Browse Source

添加新页面

master
mike 4 years ago
parent
commit
277355ac22
  1. 2
      config/index.js
  2. 127
      packages/agent/agent.vue
  3. 6
      pages.json
  4. 1
      pages/index/index.vue
  5. 5
      pages/settings/settings.vue
  6. 8
      service/agreementArticle.js

2
config/index.js

@ -11,7 +11,7 @@ module.exports = (() => {
config.Timeout = 10000 // 请求超时时间,单位 ms
// 基础服务器地址
config.BASE_URL = 'http://qxk.leadfyy.com' // 开发环境
config.BASE_URL = 'http://127.0.0.1:8000' // 开发环境
// config.BASE_URL = '' // 生产环境

127
packages/agent/agent.vue

@ -0,0 +1,127 @@
<template>
<view class="flex-col group_4">
<view class="flex-col">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497759710376128.png"
class="image_6"
/>
<view class="flex-col section_2">
<view class="flex-col items-center section_3">
<text class="text_2">783489248292</text>
<text class="text_3">有效期2022-05-17至2022-05-31</text>
</view>
<text class="text_4">重新生成后没使用的优惠码将失效</text>
<view class="flex-col group_6">
<view class="flex-col items-center button" @click="copy()"><text class="text_5">复制分销优惠码</text></view>
<view class="flex-col items-center button_1"><text class="text_6">重新生成优惠码</text></view>
</view>
</view>
</view>
<view class="section_4"><!--*--></view>
</view>
</template>
<script>
export default {
onLoad() {
},
methods: {
copy(){
let userInfo = uni.getStorageSync('userInfo');
console.log(11111);
uni.setClipboardData({
data:userInfo.agent_code,
showToast:true,
success() {
uni.showToast({
title:"已复制优惠码"
})
}
})
},
}
}
</script>
<style>
.group_4 {
padding-bottom: 0.5rem;
flex: 1 1 auto;
overflow-y: auto;
}
.section_4 {
margin-top: 22.63rem;
align-self: center;
background-color: #000000;
border-radius: 0.13rem;
width: 6.13rem;
height: 0.25rem;
}
.image_6 {
width: 100vw;
height: 0.8vw;
}
.section_2 {
padding: 1.25rem 1rem;
background-color: #ffffff;
}
.section_3 {
padding: 1.25rem 0;
background-color: #f6f6f6;
border-radius: 0.31rem;
}
.text_4 {
margin-top: 0.94rem;
align-self: center;
color: #999999;
font-size: 0.88rem;
font-family: 'PingFangSC-Medium';
font-weight: 500;
line-height: 1.25rem;
}
.group_6 {
margin-top: 3.75rem;
}
.text_2 {
color: #e7a23f;
font-size: 1.5rem;
font-family: 'PingFangSC-Semibold';
font-weight: 600;
line-height: 2.06rem;
}
.text_3 {
margin-top: 0.63rem;
color: #777777;
font-size: 0.88rem;
font-family: 'PingFangSC-Medium';
font-weight: 500;
line-height: 1.25rem;
}
.button {
padding: 0.81rem 0;
background-color: #e7a23f;
border-radius: 0.31rem;
}
.button_1 {
margin-top: 0.88rem;
padding: 0.75rem 0;
border-radius: 0.31rem;
border: solid 0.063rem #e7a23f;
}
.text_5 {
color: #ffffff;
font-size: 1rem;
font-family: 'PingFangSC-Semibold';
font-weight: 600;
line-height: 1.38rem;
}
.text_6 {
color: #e7a23f;
font-size: 1rem;
font-family: 'PingFangSC-Semibold';
font-weight: 600;
line-height: 1.38rem;
}
</style>

6
pages.json

@ -117,6 +117,12 @@
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},{
"path": "agent/agent",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}]
}],
"globalStyle": {

1
pages/index/index.vue

@ -185,6 +185,7 @@
async getUserCenterDetail(){
let res = await my();
uni.setStorageSync('userInfo', res.data.datas.user);
this.user = res.data.datas.user;
this.dots = res.data.datas.dots;
let evaluated_order = res.data.datas.evaluated_order;

5
pages/settings/settings.vue

@ -10,6 +10,8 @@
<u-cell title="系统消息" :isLink="true" :border="false" @click="$msg('敬请期待')">
<!-- <u-badge class="badge" slot="value" numberType="overflow" max="99" :value="99"></u-badge> -->
</u-cell>
<u-cell title="我的分销优惠码" :isLink="true" :border="false" url="/packages/agent/agent" v-if="isAgent()"></u-cell>
</u-cell-group>
<view class="fixed-tips">{{ version ? 'v'+ version : '' }}</view>
</view>
@ -36,6 +38,9 @@
uni.previewImage({
urls: [this.userInfo.avatar]
})
},
isAgent(){
return this.userInfo.is_agent
}
}
}

8
service/agreementArticle.js

@ -38,4 +38,12 @@ export async function ratingStandard() {
url: '/api/v1/content/rating_standard',
method: 'post'
})
}
//更新优惠券
export async function couponUpdate() {
return await request({
url: '/api/v1/coupon_update',
method: 'post'
})
}
Loading…
Cancel
Save