|
@@ -1,7 +1,12 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <zj-page-layout :isScroll="true" :isWxCustomPage="true" :isLoading="isLoading"
|
|
|
- :refresherTriggered="refresherTriggered" @refresherrefresh="refresherrefresh">
|
|
|
+ <zj-page-layout
|
|
|
+ :isScroll="true"
|
|
|
+ :isWxCustomPage="true"
|
|
|
+ :isLoading="isLoading"
|
|
|
+ :refresherTriggered="refresherTriggered"
|
|
|
+ @refresherrefresh="refresherrefresh"
|
|
|
+ >
|
|
|
<!-- <template slot="header">
|
|
|
<view class="header-container" :style="cuStyle">我的</view>
|
|
|
</template> -->
|
|
@@ -39,8 +44,12 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="stats">
|
|
|
- <view class="item" v-for="(item, index) in statsList.filter(o => o.show)" :key="index"
|
|
|
- @tap="navToPage(item.link)">
|
|
|
+ <view
|
|
|
+ class="item"
|
|
|
+ v-for="(item, index) in statsList.filter(o => o.show)"
|
|
|
+ :key="index"
|
|
|
+ @tap="navToPage(item.link)"
|
|
|
+ >
|
|
|
<view class="value">{{ item.num }}</view>
|
|
|
<view class="label">{{ item.name }}</view>
|
|
|
</view>
|
|
@@ -57,8 +66,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list">
|
|
|
- <view class="item" v-for="(item, index) in shareProfitList" :key="index"
|
|
|
- @tap="navToPage('/packageMine/pages/profit/list', 1)">
|
|
|
+ <view
|
|
|
+ class="item"
|
|
|
+ v-for="(item, index) in shareProfitList"
|
|
|
+ :key="index"
|
|
|
+ @tap="navToPage('/packageMine/pages/profit/list', 1)"
|
|
|
+ >
|
|
|
<view class="num">{{ item.num | priceFilter }}</view>
|
|
|
<view class="title">{{ item.title }}</view>
|
|
|
</view>
|
|
@@ -74,8 +87,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list">
|
|
|
- <view class="item" v-for="(item, index) in salesProfitList" :key="index"
|
|
|
- @tap="navToPage('/packageMine/pages/salesProfit/index', 1)">
|
|
|
+ <view
|
|
|
+ class="item"
|
|
|
+ v-for="(item, index) in salesProfitList"
|
|
|
+ :key="index"
|
|
|
+ @tap="navToPage('/packageMine/pages/salesProfit/index', 1)"
|
|
|
+ >
|
|
|
<view class="num">{{ item.num | priceFilter }}</view>
|
|
|
<view class="title">{{ item.title }}</view>
|
|
|
</view>
|
|
@@ -91,8 +108,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list">
|
|
|
- <view class="item" v-for="(item, index) in orderList" :key="index"
|
|
|
- @tap="navToPage(`/packageMine/pages/order/list?tab=${item.key}`, 1)">
|
|
|
+ <view
|
|
|
+ class="item"
|
|
|
+ v-for="(item, index) in orderList"
|
|
|
+ :key="index"
|
|
|
+ @tap="navToPage(`/packageMine/pages/order/list?tab=${item.key}`, 1)"
|
|
|
+ >
|
|
|
<view class="icon">
|
|
|
<text class="iconfont" :class="item.icon"></text>
|
|
|
<u-badge max="99" :value="item.num" :absolute="true" :offset="[-4, -4]"></u-badge>
|
|
@@ -108,8 +129,12 @@
|
|
|
</view>
|
|
|
<view class="list">
|
|
|
<block v-for="(item, index) in menuList.filter(o => o.show)" :key="index">
|
|
|
- <button v-if="item.fn == 'phone'" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
|
|
|
- class="item">
|
|
|
+ <button
|
|
|
+ v-if="item.fn == 'phone'"
|
|
|
+ open-type="getPhoneNumber"
|
|
|
+ @getphonenumber="getPhoneNumber"
|
|
|
+ class="item"
|
|
|
+ >
|
|
|
<view class="icon"><text class="iconfont" :class="item.icon"></text></view>
|
|
|
<view class="title">{{ item.name }}</view>
|
|
|
<view class="right"><text class="iconfont icon-jinru"></text></view>
|
|
@@ -119,11 +144,15 @@
|
|
|
<view class="title">{{ item.name }}</view>
|
|
|
<view class="right"><text class="iconfont icon-jinru"></text></view>
|
|
|
</button>
|
|
|
- <view v-else-if="item.icon == 'coupon'" class="item" @tap="item.link ? navToPage(item.link, 1) : actionFn(item.fn)">
|
|
|
- <view class="icon"><u-icon size="20" :name="item.icon"></u-icon></view>
|
|
|
- <view class="title">{{ item.name }}</view>
|
|
|
- <view class="right"><text class="iconfont icon-jinru"></text></view>
|
|
|
- </view>
|
|
|
+ <view
|
|
|
+ v-else-if="item.icon == 'coupon'"
|
|
|
+ class="item"
|
|
|
+ @tap="item.link ? navToPage(item.link, 1) : actionFn(item.fn)"
|
|
|
+ >
|
|
|
+ <view class="icon"><u-icon size="20" :name="item.icon"></u-icon></view>
|
|
|
+ <view class="title">{{ item.name }}</view>
|
|
|
+ <view class="right"><text class="iconfont icon-jinru"></text></view>
|
|
|
+ </view>
|
|
|
<view v-else class="item" @tap="item.link ? navToPage(item.link, 1) : actionFn(item.fn)">
|
|
|
<view class="icon"><text class="iconfont" :class="item.icon"></text></view>
|
|
|
<view class="title">{{ item.name }}</view>
|
|
@@ -142,8 +171,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getNoticeNum, getOrderNum, selectionChange } from '@/common/utils/util.js';
|
|
|
-import { getStorage } from "@/common/utils/storage.js"
|
|
|
+import { getNoticeNum, getOrderNum, selectionChange } from '@/common/utils/util.js'
|
|
|
+import { getStorage } from '@/common/utils/storage.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -157,7 +186,7 @@ export default {
|
|
|
{ title: '累计分销收益', num: 0 }
|
|
|
],
|
|
|
salesProfitList: [
|
|
|
- { title: '可提现金额', num: 0 },
|
|
|
+ { title: '已结算金额', num: 0 },
|
|
|
{ title: '待结算金额', num: 0 }
|
|
|
],
|
|
|
orderList: [
|
|
@@ -169,7 +198,7 @@ export default {
|
|
|
statsList: [],
|
|
|
menuList: [],
|
|
|
noticeNum: 0,
|
|
|
- qrcode2: ""
|
|
|
+ qrcode2: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -197,13 +226,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
async onShow() {
|
|
|
- selectionChange();
|
|
|
+ selectionChange()
|
|
|
|
|
|
this.configInfo = await this.$getConfigInfo()
|
|
|
|
|
|
// if(this.isLogin) {
|
|
|
this.userInfo = await this.$getUserInfo()
|
|
|
- await this.getCouponList();
|
|
|
+ await this.getCouponList()
|
|
|
this.initList()
|
|
|
await this.getCount()
|
|
|
await this.getShareProfitCount()
|
|
@@ -226,7 +255,7 @@ export default {
|
|
|
this.configInfo = await this.$getConfigInfo()
|
|
|
// if(this.isLogin) {
|
|
|
this.userInfo = await this.$getUserInfo()
|
|
|
- await this.getCouponList();
|
|
|
+ await this.getCouponList()
|
|
|
this.initList()
|
|
|
await this.getCount()
|
|
|
await this.getShareProfitCount()
|
|
@@ -321,7 +350,7 @@ export default {
|
|
|
icon: 'icon-kehu',
|
|
|
link: '/packageMine/pages/mySecurityFee',
|
|
|
show: this.isWorkerUser
|
|
|
- },
|
|
|
+ }
|
|
|
]
|
|
|
},
|
|
|
|
|
@@ -333,25 +362,27 @@ export default {
|
|
|
// 授权手机号
|
|
|
getPhoneNumber(e) {
|
|
|
if (!e.detail.iv) {
|
|
|
- return this.$toast('获取手机号失败');
|
|
|
+ return this.$toast('获取手机号失败')
|
|
|
}
|
|
|
uni.login({
|
|
|
provider: 'weixin',
|
|
|
- success: (loginRes) => {
|
|
|
- this.$api.post('/user/auth', {
|
|
|
- code: loginRes.code,
|
|
|
- phoneCode: e.detail.code,
|
|
|
- }).then(async res => {
|
|
|
- this.$store.commit("user/set_token", res.data.token)
|
|
|
- this.$store.commit("user/set_openId", res.data.openId)
|
|
|
- this.$store.commit("user/set_name", res.data.nickName)
|
|
|
- this.$store.commit("user/set_avatar", res.data.avatar)
|
|
|
- this.$store.commit("user/set_userId", res.data.userId)
|
|
|
- this.$store.commit("user/set_mobile", res.data.mobile)
|
|
|
- this.$successToast('授权成功');
|
|
|
- })
|
|
|
+ success: loginRes => {
|
|
|
+ this.$api
|
|
|
+ .post('/user/auth', {
|
|
|
+ code: loginRes.code,
|
|
|
+ phoneCode: e.detail.code
|
|
|
+ })
|
|
|
+ .then(async res => {
|
|
|
+ this.$store.commit('user/set_token', res.data.token)
|
|
|
+ this.$store.commit('user/set_openId', res.data.openId)
|
|
|
+ this.$store.commit('user/set_name', res.data.nickName)
|
|
|
+ this.$store.commit('user/set_avatar', res.data.avatar)
|
|
|
+ this.$store.commit('user/set_userId', res.data.userId)
|
|
|
+ this.$store.commit('user/set_mobile', res.data.mobile)
|
|
|
+ this.$successToast('授权成功')
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 获取订单数量
|
|
@@ -417,7 +448,8 @@ export default {
|
|
|
// 获取销售收益统计
|
|
|
async getSalesProfitCount() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$api.post('/withdrawal/amount/count')
|
|
|
+ this.$api
|
|
|
+ .post('/withdrawal/amount/count')
|
|
|
.then(res => {
|
|
|
const data = res.data || {}
|
|
|
this.salesProfitList[0].num = data.ktx
|
|
@@ -433,31 +465,37 @@ export default {
|
|
|
// 获取可领优惠券列表
|
|
|
async getCouponList() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$api.get('/coupon/list/all', {
|
|
|
- userId: this.$store.state.user.userId
|
|
|
- }).finally(res => {
|
|
|
- resolve(1)
|
|
|
- })
|
|
|
- })
|
|
|
+ this.$api
|
|
|
+ .get('/coupon/list/all', {
|
|
|
+ userId: this.$store.state.user.userId
|
|
|
+ })
|
|
|
+ .finally(res => {
|
|
|
+ resolve(1)
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
getweixinpeizhi() {
|
|
|
- this.$api.get('/common/wechat/detail')
|
|
|
- .then(res => {
|
|
|
- this.qrcode2 = res.data.qrcode2
|
|
|
- })
|
|
|
+ this.$api.get('/common/wechat/detail').then(res => {
|
|
|
+ this.qrcode2 = res.data.qrcode2
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
openCode() {
|
|
|
- this.$api.post('/common/get/mp/qrcode', {
|
|
|
- companyWechatId: getStorage("user").companyWechatId || "",
|
|
|
- userId: this.$store.state.user.userId
|
|
|
- })
|
|
|
+ this.$api
|
|
|
+ .post('/common/get/mp/qrcode', {
|
|
|
+ companyWechatId: getStorage('user').companyWechatId || '',
|
|
|
+ userId: this.$store.state.user.userId
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
uni.previewImage({
|
|
|
- current: res.data.ticket ? `https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${res.data.ticket}` : this.qrcode2,
|
|
|
- urls: [res.data.ticket ? `https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${res.data.ticket}` : this.qrcode2],
|
|
|
- });
|
|
|
+ current: res.data.ticket
|
|
|
+ ? `https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${res.data.ticket}`
|
|
|
+ : this.qrcode2,
|
|
|
+ urls: [
|
|
|
+ res.data.ticket ? `https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${res.data.ticket}` : this.qrcode2
|
|
|
+ ]
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -492,7 +530,7 @@ export default {
|
|
|
item.num = 0
|
|
|
})
|
|
|
})
|
|
|
- .catch(() => { })
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
|
}
|
|
|
}
|