|
|
@ -29,7 +29,10 @@ |
|
|
|
<!-- 用户信息卡片 --> |
|
|
|
<view class="user-card" v-if="login_status"> |
|
|
|
<view class="user-info"> |
|
|
|
<image class="avatar" :src="userInfo.headImage" mode="aspectFill"></image> |
|
|
|
<view class="avatar-badge-box"> |
|
|
|
<image class="avatar" :src="userInfo.headImage" mode="aspectFill"></image> |
|
|
|
<view class="avatar-badge">{{ userTypeText }}</view> |
|
|
|
</view> |
|
|
|
<view class="info"> |
|
|
|
<text class="name">{{userInfo.nickName}}</text> |
|
|
|
<text class="id">ID: {{userInfo.intentioCode}}</text> |
|
|
@ -327,6 +330,7 @@ export default { |
|
|
|
this.$api("getUserByToken",{},(res)=>{ |
|
|
|
if(res.code == 200){ |
|
|
|
this.userInfo = res.result |
|
|
|
// isTuiType 为0用户,1推广达人,2推广大使 |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
@ -348,11 +352,10 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getTotalOrders(){ |
|
|
|
this.$api && this.$api('getOrderListPage', {}, res => { |
|
|
|
if (res && res.code === 200 && res.result && Array.isArray(res.result.records)) { |
|
|
|
// 更新累计回收单数 |
|
|
|
this.totalOrders = res.result.total || 0 |
|
|
|
getCumulativeRecoveryCount(){ |
|
|
|
this.$api && this.$api('getCumulativeRecoveryCount', {}, res => { |
|
|
|
if (res && res.code === 200 && res.result) { |
|
|
|
this.totalOrders = res.result |
|
|
|
} else { |
|
|
|
this.totalOrders = 0 |
|
|
|
} |
|
|
@ -372,6 +375,12 @@ export default { |
|
|
|
myBannerImage() { |
|
|
|
const banner = (getApp().globalData.bannerList || []).find(item => item.title === '我的-轮播图'); |
|
|
|
return banner ? banner.image : ''; |
|
|
|
}, |
|
|
|
userTypeText() { |
|
|
|
// 0 普通用户, 1 推广达人, 2 推广大使 |
|
|
|
if (this.userInfo.isTuiType === 1) return '推广达人' |
|
|
|
if (this.userInfo.isTuiType === 2) return '推广大使' |
|
|
|
return '普通用户' |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
@ -382,7 +391,7 @@ export default { |
|
|
|
}) |
|
|
|
this.fetchUserInfo() |
|
|
|
this.fetchOrderList() |
|
|
|
this.getTotalOrders() |
|
|
|
this.getCumulativeRecoveryCount() |
|
|
|
uni.$on('bannerListUpdated', () => { |
|
|
|
this.$forceUpdate && this.$forceUpdate() |
|
|
|
}) |
|
|
@ -392,11 +401,11 @@ export default { |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.fetchUserInfo() |
|
|
|
this.getTotalOrders() |
|
|
|
this.getCumulativeRecoveryCount() |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
this.fetchUserInfo() |
|
|
|
this.getTotalOrders() |
|
|
|
this.getCumulativeRecoveryCount() |
|
|
|
setTimeout(() => { |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
uni.showToast({ |
|
|
@ -461,11 +470,43 @@ export default { |
|
|
|
align-items: center; |
|
|
|
margin-bottom: 40rpx; |
|
|
|
|
|
|
|
.avatar { |
|
|
|
.avatar-badge-box { |
|
|
|
position: relative; |
|
|
|
width: 110rpx; |
|
|
|
height: 110rpx; |
|
|
|
border-radius: 12rpx; |
|
|
|
overflow: hidden; |
|
|
|
background: #fff; |
|
|
|
flex-shrink: 0; |
|
|
|
margin-right: 24rpx; |
|
|
|
display: flex; |
|
|
|
align-items: flex-end; |
|
|
|
justify-content: center; |
|
|
|
} |
|
|
|
|
|
|
|
.avatar { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
border-radius: 12rpx; |
|
|
|
display: block; |
|
|
|
} |
|
|
|
|
|
|
|
.avatar-badge { |
|
|
|
position: absolute; |
|
|
|
left: 0; |
|
|
|
bottom: 0; |
|
|
|
width: 100%; |
|
|
|
height: 32rpx; |
|
|
|
line-height: 32rpx; |
|
|
|
background: rgba(238,238,238,0.95); |
|
|
|
color: #999; |
|
|
|
font-size: 24rpx; |
|
|
|
text-align: center; |
|
|
|
border-bottom-left-radius: 12rpx; |
|
|
|
border-bottom-right-radius: 12rpx; |
|
|
|
font-weight: 400; |
|
|
|
letter-spacing: 2rpx; |
|
|
|
z-index: 2; |
|
|
|
} |
|
|
|
|
|
|
|
.info { |
|
|
|