From 6b96f204e4083d32996c2943a25e36c15d668bd1 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 17 七月 2025 15:33:20 +0800
Subject: [PATCH] 前端
---
small-program/pages/mine/mine.vue | 124 +++++++++++++++++++++++++++++++++++------
1 files changed, 105 insertions(+), 19 deletions(-)
diff --git a/small-program/pages/mine/mine.vue b/small-program/pages/mine/mine.vue
index e243b6b..d420adf 100644
--- a/small-program/pages/mine/mine.vue
+++ b/small-program/pages/mine/mine.vue
@@ -7,19 +7,19 @@
</view>
<view class="info">
<view class="info-box">
- <view class="info-box-head" @click="jump(isLogin?1:0)">
- <view class="info-box-head-image">
+ <view class="info-box-head" >
+ <view class="info-box-head-image" @click="jump(isLogin?1:5)">
<image v-if="userInfo.fullCoverImage&&userInfo.fullCoverImage !=''" :src="userInfo.fullCoverImage" mode="widthFix"></image>
<image v-else src="/static/logo.png" mode="widthFix"></image>
</view>
<view class="info-box-head-info" v-if="isLogin">
- <view class="info-box-head-info-name">{{userInfo.nickName||'鍖垮悕'}}</view>
+ <view class="info-box-head-info-name" @click="jump(1)">{{userInfo.nickName||'鍖垮悕'}}</view>
<view class="info-box-head-info-type">
- <view class="info-box-head-info-type-val">鐢ㄥ伐鍙戝竷鏂�</view>
- <view class="info-box-head-info-type-wz">鍒囨崲</view>
+ <view class="info-box-head-info-type-val">{{userInfo.useIdentity==1?'鐢ㄥ伐鎺ュ崟鏂�':'鐢ㄥ伐鍙戝竷鏂�'}}</view>
+ <view class="info-box-head-info-type-wz" @click="editUseIdentity">鍒囨崲</view>
</view>
</view>
- <view class="info-box-head-info" v-else>
+ <view class="info-box-head-info" v-else @click="jump(5)">
<view class="info-box-head-info-name">鐐瑰嚮鐧诲綍</view>
<view class="info-box-head-info-type">
<view class="info-box-head-info-type-wz">寰俊鎺堟潈鐧诲綍</view>
@@ -29,7 +29,7 @@
<view class="info-box-label">璐︽埛浣欓</view>
<view class="info-box-price">
<text>锟{isLogin?(userInfo.amount || 0) :0.00}}</text>
- <view class="info-box-price-btn" @click="jumpTX">鍘绘彁鐜�</view>
+ <view class="info-box-price-btn" @click="jump(6)">鍘绘彁鐜�</view>
</view>
</view>
</view>
@@ -41,7 +41,7 @@
</view>
<view class="statistics-x"></view>
<view class="statistics-item">
- <text>{{isLogin?(userInfo.userCenterVO.waitReceiveTotal||0):'-'}}</text>
+ <text class="redtxt">{{isLogin?(userInfo.userCenterVO.waitReceiveTotal||0):'-'}}</text>
<text>寰呮帴鍗�</text>
</view>
<view class="statistics-item">
@@ -72,24 +72,25 @@
<view class="guanggao">
<view class="guanggao-image">
<image src="/static/image/share@2x.png" mode="widthFix"></image>
+ <button mode="widthFix"class='sharebtn' open-type="share"></button>
</view>
</view>
- <view class="paidan">
+ <view class="paidan" v-if="isLogin && userInfo.useIdentity ==1">
<view class="paidan-box">
<view class="paidan-label">鎺ュ彈绯荤粺鑷姩娲惧崟</view>
<view class="paidan-right">
<text>鍏抽棴</text>
- <u-switch activeColor="#00BC12" v-model="value"></u-switch>
+ <u-switch activeColor="#00BC12" v-model="autoReceiveStatus"></u-switch>
</view>
</view>
</view>
<view class="list">
<view class="list-hz">
- <view class="list-hz-item">
+ <view class="list-hz-item"@click="jumpService(1)">
<text>鏈嶅姟浠嬬粛</text>
- <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
+ <u-icon name="arrow-right" color="#111111" size="18"></u-icon>
</view>
- <view class="list-hz-item">
+ <view class="list-hz-item" @click="jumpService(2)">
<text>鏀惰垂鏍囧噯</text>
<u-icon name="arrow-right" color="#111111" size="18"></u-icon>
</view>
@@ -114,11 +115,13 @@
<u-icon name="arrow-right" color="#111111" size="18"></u-icon>
</view>
</view>
- <view class="list-hz-item">
+ <view class="list-hz-item" @click="jumpService(3)">
<text>鍏充簬鎴戜滑</text>
<u-icon name="arrow-right" color="#111111" size="18"></u-icon>
</view>
</view>
+ <view class="setup-sub" v-if="isLogin" @click="logOffDo">閫�鍑虹櫥褰�</view>
+ <view class="setup-sub" v-if="!isLogin" @click="jump(5)">鍘荤櫥褰�</view>
</view>
</view>
</view>
@@ -132,22 +135,29 @@
},
data() {
return {
- value: false,
- isLogin:false
+ changing:false,
+ changing1:false,
+ autoReceiveStatus: false,
+ isLogin:false,
+ useIdentity:0
}
},
onShow(options){
this.isLogin=false
+ this.autoReceiveStatus=false;
+ this.useIdentity =0
if(this.token &&this.token!='' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){
this.isLogin=true
this.getUserInfo()
+ this.autoReceiveStatus = this.userInfo.autoReceiveStatus === 1
+ this.useIdentity = this.userInfo.useIdentity
}
},
methods: {
getUserInfo() {
var that = this;
this.$u.api.getMemberInfo({}).then(res =>{
- if (res.code ===200) {
+ if (res&&res.code ===200) {
that.$store.commit('setUserInfo', res.data)
that.$isResolve()
}else{
@@ -157,7 +167,7 @@
}
})
},
- jumpTX() {
+ jumpService(flag) {
uni.navigateTo({
url: '/pages/withdrawal/withdrawal'
})
@@ -190,8 +200,54 @@
url: '/pages/login/login'
})
break;
+
+ case 6:
+ uni.navigateTo({
+ url: '/pages/withdrawal/withdrawal'
+ })
+ break;
}
- }
+ },
+ logOffDo() {
+ var that = this
+ this.$u.api.logOff({}).then(res =>{
+ //閫�鍑虹櫥褰曟垚鍔�
+ that.isLogin =false
+ that.$store.commit("empty")
+ })
+ } ,
+ editUseIdentity() {
+ if(this.changing1){
+ return
+ }
+ this.changing1 = true
+ var that = this
+ var param ={useIdentity:this.userInfo.useIdentity==1?0:1}
+ that.$u.api.editUseIdentity(param)
+ .then(res =>{
+ console.log(222,res)
+ if(res.code ===200){
+ that.userInfo.useIdentity = param.useIdentity
+ }
+ }).finally(() => {
+ that.changing1 = false
+ })
+ } ,
+ updateMemberInfo() {
+ if(this.changing){
+ return
+ }
+ this.changing = true
+ var that = this
+ var param ={ autoReceiveStatus:that.autoReceiveStatus?1:0}
+ this.$u.api.editMemberInfo(param).then(res =>{
+ if(res.code ===200){
+ that.userInfo.autoReceiveStatus = param.autoReceiveStatus
+ }
+ }).finally(() => {
+ that.changing = false
+ })
+ }
}
}
</script>
@@ -283,6 +339,20 @@
image {
width: 100%;
height: 100%;
+ z-index: 999;
+ }
+ .sharebtn{
+ position: relative;
+ top: -150rpx;
+ left: 0;
+ outline:none;
+ padding:0px;
+ cursor: pointer;
+ border: none;
+ opacity: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1000;
}
}
}
@@ -450,4 +520,20 @@
}
}
}
+ .setup-sub {
+ width: 100%;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ box-shadow: 0rpx 8rpx 12rpx 0rpx rgba(91,190,56,0.16);
+ border-radius: 44rpx;
+ font-weight: 500;
+ font-size: 32rpx;
+ color: #5BBE38;
+ margin-top: 80rpx;
+ border: 1rpx solid #15CF52;
+ }
+ .redtxt{
+ color:#FF0000 !important ;
+ }
</style>
--
Gitblit v1.9.3