From 609a1931953b2298016bd2b0d6b410666b5ad7b9 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 02 七月 2026 09:19:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/3.0.1' into 3.0.1
---
bicycle/pages/personalCenter/personalCenter.vue | 242 ++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 210 insertions(+), 32 deletions(-)
diff --git a/bicycle/pages/personalCenter/personalCenter.vue b/bicycle/pages/personalCenter/personalCenter.vue
index 644b171..f3da54f 100644
--- a/bicycle/pages/personalCenter/personalCenter.vue
+++ b/bicycle/pages/personalCenter/personalCenter.vue
@@ -3,8 +3,9 @@
<view class="profile-header">
<image class="avatar" src="/static/images/ic_pic@2x.png" mode="aspectFill"></image>
<view class="profile-info">
- <view class="profile-name">{{ displayName }}</view>
- <view class="profile-mobile">{{ displayMobile }}</view>
+ <view class="profile-name">{{ displayMobile }}</view>
+ <button open-type="getPhoneNumber" @getphonenumber="getPhone" v-if="displayMobile === '缁戝畾鎵嬫満鍙�'"></button>
+ <!-- <view class="profile-mobile">{{ displayName }}</view> -->
</view>
</view>
@@ -12,10 +13,30 @@
<view class="menu-item" v-for="item in menuList" :key="item.id" @click="handleMenu(item)">
<view class="menu-text">{{ item.name }}</view>
<image class="menu-arrow" src="/static/icon/ar_detail@2x.png" mode="aspectFit"></image>
+ <!-- #ifdef MP-WEIXIN -->
+ <button v-if="item.id === 5" class="contact-trigger" open-type="contact" @click.stop></button>
+ <!-- #endif -->
</view>
</view>
- <view class="logout-btn" @click="logout">閫�鍑虹櫥褰�</view>
+ <view class="logout-btn" @click="logout" v-if="userInfo && userInfo.mobile">閫�鍑虹櫥褰�</view>
+
+ <!-- 鑷杞�-纭缁撶畻 -->
+ <u-popup :show="show3" :closeOnClickOverlay="true" mode="bottom" bgColor="#fff" :round="10" @close="show3 = false">
+ <template>
+ <view class="deposit1">
+ <view class="deposit_text">
+ <text>娓╅Θ鎻愮ず</text>
+ <text class="red">缁撶畻鍚庯紝濡傛灉缁х画楠戣浼氶噸鏂板紑濮嬭璐�</text>
+ <text class="red">纭缁撶畻涔堬紵</text>
+ </view>
+ <view class="deposit_footer">
+ <view class="deposit_footer_item" @click="show3 = false">鍐嶇瓑绛�</view>
+ <view class="deposit_footer_item c" @click="settlement1">绔嬪嵆缁撶畻</view>
+ </view>
+ </view>
+ </template>
+ </u-popup>
</view>
</template>
@@ -25,19 +46,21 @@
export default {
computed: {
...mapState(['userInfo']),
- displayName() {
- return this.userInfo.nickName || this.userInfo.nickname || this.userInfo.name || '鏈櫥褰曠敤鎴�'
- },
+ // displayName() {
+ // return this.userInfo.nickName || this.userInfo.nickname || this.userInfo.name || '鏈櫥褰曠敤鎴�'
+ // },
displayMobile() {
const mobile = this.userInfo.mobile || ''
if (!mobile) {
- return '璇峰厛缁戝畾鎵嬫満鍙�'
+ return '缁戝畾鎵嬫満鍙�'
}
return mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
}
},
data() {
return {
+ show3: false,
+ isDisabled: true,
menuList: [
{ id: 1, name: '缁撶畻閫�鎶奸噾' },
{ id: 2, name: '娑堣垂鏄庣粏', url: '/pages/consumptionDetails/consumptionDetails' },
@@ -49,6 +72,48 @@
}
},
methods: {
+ // 鑾峰彇鎵嬫満鍙�
+ getPhone(e) {
+ var that = this;
+ if (e.detail.errMsg === 'getPhoneNumber:ok') {
+ uni.login({
+ provider: 'weixin',
+ success: function(loginRes) {
+ let {
+ code
+ } = loginRes;
+ that.$u.api.wxLogin({
+ code
+ }).then(res => {
+ that.$store.commit('setToken', res.data.token)
+ that.$u.api.wxPhone({
+ encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv,
+ sessionKey: res.data.sessionKey
+ }).then(result => {
+ if (result.code === 200) {
+ that.$store.commit('setUserInfo', result.data.userResponse)
+ }
+ })
+ })
+ }
+ });
+ }
+ },
+ // 缁撶畻
+ settlement1() {
+ if (this.isDisabled) {
+ this.isDisabled = false
+ this.$u.api.goodsOrderSettlement({}).then(res => {
+ if (res.code === 200) {
+ uni.showToast({ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒', icon: 'none', duration: 2000 });
+ }
+ }).finally(() => {
+ this.show3 = false
+ this.isDisabled = true
+ })
+ }
+ },
handleMenu(item) {
if (item.url) {
uni.navigateTo({
@@ -56,56 +121,59 @@
})
return
}
-
+ // 缁撶畻閫�鎶奸噾
if (item.id === 1) {
- uni.showToast({
- title: '璇峰湪棣栭〉鍙戣捣閫�鎶奸噾',
- icon: 'none'
- })
+ if (!this.userInfo.mobile) return
+ this.$u.api.home()
+ .then(res => {
+ if (res.code === 200) {
+ let info = res.data
+
+ if (info.rideStatus === 1) {
+ uni.showToast({ title: '楠戣涓笉鑳界粨绠楁娂閲�', icon: 'none', duration: 2000 })
+ return
+ }
+ if (info.depositStatus === 1) {
+ this.show3 = true
+ } else if (info.depositStatus === 2) {
+ uni.showToast({ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒', icon: 'none', duration: 2000 });
+ } else {
+ uni.showToast({ title: '鎮ㄦ殏鏃犳娂閲戯紝鏃犻渶缁撶畻锛�', icon: 'none', duration: 2000 });
+ }
+
+ }
+ })
return
}
if (item.id === 4) {
- uni.showToast({
- title: '鍏戞崲璇存槑鏆傛湭閰嶇疆',
- icon: 'none'
+ uni.navigateTo({
+ url: '/pages/explanation/explanation'
})
return
}
if (item.id === 5) {
- uni.showToast({
- title: '鏆傛湭閰嶇疆瀹㈡湇鐢佃瘽',
- icon: 'none'
- })
return
}
if (item.id === 6) {
uni.navigateTo({
- url: this.userInfo.sysuser ? '/pages/operationsCenter/operationsCenter' : '/pages/operationLogin/operationLogin'
+ url: this.userInfo.sysuser ? '/pagesA/pages/operation/operation' : '/pages/operationLogin/operationLogin'
})
}
},
logout() {
- uni.showLoading({ title: '鍔犺浇涓�' })
- this.$u.api.logout()
+ this.$u.api.accountLogout()
.then(res => {
- uni.hideLoading()
if (res.code === 200) {
- this.$store.commit('setUserInfo', res.data)
- this.$store.commit('setToken', '')
+ let user = JSON.parse(JSON.stringify(this.userInfo))
+ user.mobile = ''
+ this.$store.commit('setUserInfo', user)
uni.reLaunch({
url: '/pages/index/index'
})
}
- })
- .catch(() => {
- uni.hideLoading()
- uni.showToast({
- title: '閫�鍑哄け璐ワ紝璇风◢鍚庨噸璇�',
- icon: 'none'
- })
})
}
}
@@ -113,6 +181,86 @@
</script>
<style lang="scss" scoped>
+ .deposit1 {
+ width: 100%;
+ min-height: 470rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding: 40rpx 20rpx;
+ box-sizing: border-box;
+ background: linear-gradient(360deg, #FFFFFF 0%, #FFFFFF 58%, #D0FFFD 100%);
+ box-shadow: 0rpx -6rpx 16rpx 0rpx rgba(0, 0, 0, 0.1);
+ border-radius: 32rpx 32rpx 0rpx 0rpx;
+
+ .deposit_text {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+
+ .red {
+ color: #FC2525 !important;
+ font-size: 30rpx !important;
+ }
+
+ text {
+ &:nth-child(1) {
+ font-size: 32rpx;
+ font-family: PingFangSC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #222222;
+ }
+
+ &:nth-child(2) {
+ font-size: 30rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ margin-top: 40rpx;
+ }
+
+ &:nth-child(3) {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #01B6AD;
+ margin-top: 20rpx;
+ }
+ }
+ }
+
+ .deposit_footer {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 30rpx;
+
+ .c {
+ background-color: #01B6AD !important;
+ color: #ffffff !important;
+ }
+
+ .deposit_footer_item {
+ flex: 1;
+ height: 96rpx;
+ line-height: 96rpx;
+ text-align: center;
+ border-radius: 46rpx;
+ border: 1rpx solid #01B6AD;
+ font-size: 32rpx;
+ font-family: PingFangSC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #01B6AD;
+
+ &:first-child {
+ margin-right: 22rpx;
+ }
+ }
+ }
+ }
+
.profile-page {
width: 100%;
min-height: 100vh;
@@ -137,6 +285,17 @@
.profile-info {
margin-left: 20rpx;
min-width: 0;
+ position: relative;
+ }
+
+ .profile-info button {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 999;
+ opacity: 0;
}
.profile-name {
@@ -167,12 +326,31 @@
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #E5E5E5;
+ position: relative;
&:last-child {
border-bottom: 0;
}
}
+ .contact-trigger {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ opacity: 0;
+ border: 0;
+ background: transparent;
+ z-index: 2;
+ }
+
+ .contact-trigger::after {
+ border: 0;
+ }
+
.menu-text {
font-weight: 500;
font-size: 30rpx;
--
Gitblit v1.9.3