From 44daeb43fecda93c1a6a1f0e37ad420291f29b0d Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期四, 17 七月 2025 12:06:59 +0800 Subject: [PATCH] 前端 --- small-program/pages/mine/mine.vue | 75 +++++++++++++++++++++++++++++++------ 1 files changed, 62 insertions(+), 13 deletions(-) diff --git a/small-program/pages/mine/mine.vue b/small-program/pages/mine/mine.vue index 7bc9062..e243b6b 100644 --- a/small-program/pages/mine/mine.vue +++ b/small-program/pages/mine/mine.vue @@ -7,44 +7,66 @@ </view> <view class="info"> <view class="info-box"> - <view class="info-box-head" @click="jump(1)"> + <view class="info-box-head" @click="jump(isLogin?1:0)"> <view class="info-box-head-image"> - <image src="/static/logo.png" mode="widthFix"></image> + <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"> - <view class="info-box-head-info-name">鏉ㄥ┓鐟�</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-type"> <view class="info-box-head-info-type-val">鐢ㄥ伐鍙戝竷鏂�</view> <view class="info-box-head-info-type-wz">鍒囨崲</view> + </view> + </view> + <view class="info-box-head-info" v-else> + <view class="info-box-head-info-name">鐐瑰嚮鐧诲綍</view> + <view class="info-box-head-info-type"> + <view class="info-box-head-info-type-wz">寰俊鎺堟潈鐧诲綍</view> </view> </view> </view> <view class="info-box-label">璐︽埛浣欓</view> <view class="info-box-price"> - <text>楼1000.00</text> + <text>锟{isLogin?(userInfo.amount || 0) :0.00}}</text> <view class="info-box-price-btn" @click="jumpTX">鍘绘彁鐜�</view> </view> </view> </view> <view class="statistics"> - <view class="statistics-box"> - <view class="statistics-item"> - <text>248</text> + <view class="statistics-box" v-if="!isLogin || userInfo.useIdentity !=1"> + <view class="statistics-item" > + <text>{{isLogin?(userInfo.userCenterVO.releaseTaskTotal||0):'-'}}</text> <text>鎬诲彂鍗曟暟</text> </view> <view class="statistics-x"></view> <view class="statistics-item"> - <text>1</text> + <text>{{isLogin?(userInfo.userCenterVO.waitReceiveTotal||0):'-'}}</text> <text>寰呮帴鍗�</text> </view> <view class="statistics-item"> - <text>2</text> + <text>{{isLogin?(userInfo.userCenterVO.doingTotal||0):'-'}}</text> <text>杩涜涓�</text> </view> <view class="statistics-item"> - <text>2</text> + <text>{{isLogin?(userInfo.userCenterVO.waitCommentTotal||0):'-'}}</text> <text>寰呰瘎浠�</text> </view> + </view> + <view class="statistics-box" v-else> + <view class="statistics-item" > + <text>{{isLogin?(userInfo.userCenterVO.receiveTotal||0):'-'}}</text> + <text>宸叉帴鍗�</text> + </view> + <view class="statistics-x"></view> + <view class="statistics-item"> + <text>{{isLogin?(userInfo.userCenterVO.taskingTotal||0):'-'}}</text> + <text>杩涜涓�</text> + </view> + <view class="statistics-item"> + <text>{{isLogin?(userInfo.userCenterVO.doneTotal||0):'-'}}</text> + <text>宸插畬鎴�</text> + </view> </view> </view> <view class="guanggao"> @@ -106,14 +128,35 @@ import { mapState } from 'vuex' export default { computed: { - ...mapState(['navHeight', 'statusbarHeight']) + ...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid']) }, data() { return { - value: false + value: false, + isLogin:false + } + }, + onShow(options){ + this.isLogin=false + if(this.token &&this.token!='' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){ + this.isLogin=true + this.getUserInfo() } }, methods: { + getUserInfo() { + var that = this; + this.$u.api.getMemberInfo({}).then(res =>{ + if (res.code ===200) { + that.$store.commit('setUserInfo', res.data) + that.$isResolve() + }else{ + that.$store.commit('setToken','') + that.$store.commit('setUserInfo',{}) + that.$isResolve() + } + }) + }, jumpTX() { uni.navigateTo({ url: '/pages/withdrawal/withdrawal' @@ -140,6 +183,12 @@ uni.navigateTo({ url: '/pages/catering-certification/catering-certification' }) + + break; + case 5: + uni.navigateTo({ + url: '/pages/login/login' + }) break; } } -- Gitblit v1.9.3