From 3f9032e92fdd383bfefc87a0bec9b242e1223851 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 09 六月 2026 17:08:44 +0800
Subject: [PATCH] 改bug
---
app/pages/mine/mine.vue | 283 +++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 237 insertions(+), 46 deletions(-)
diff --git a/app/pages/mine/mine.vue b/app/pages/mine/mine.vue
index fdb3a46..37f55de 100644
--- a/app/pages/mine/mine.vue
+++ b/app/pages/mine/mine.vue
@@ -6,20 +6,19 @@
</view>
</view>
- <scroll-view class="mine-page__body" scroll-y :style="bodyStyle">
+ <view class="mine-page__body" :style="bodyStyle">
<view class="mine-page__content">
<view class="mine-page__profile">
- <image class="mine-page__avatar" src="/static/image/ic_pic@2x.png" mode="aspectFill"></image>
+ <image class="mine-page__avatar" :src="userInfo.imgurl || '/static/image/ic_pic@2x.png'" mode="aspectFill"></image>
<view class="mine-page__profile-info">
<view class="mine-page__name-row">
- <text class="mine-page__name">{{ currentProfile.name }}</text>
- <view v-if="currentProfile.levelTag" class="mine-page__level-tag">
- <!-- <text class="mine-page__level-dot"></text> -->
+ <text class="mine-page__name">{{ userInfo.name }}</text>
+ <view v-if="userInfo.driverLevel" class="mine-page__level-tag">
<image src="/static/image/ic_jiangpai@2x.png" mode="widthFix" class="mine-page__level-dot"></image>
- <text class="mine-page__level-text">{{ currentProfile.levelTag }}</text>
+ <text class="mine-page__level-text">{{ getDriverLevelText(userInfo.driverLevel) }}</text>
</view>
</view>
- <text class="mine-page__phone">{{ currentProfile.phone }}</text>
+ <text class="mine-page__phone">{{ userInfo.telephone || '' }} 锛坽{ userInfo.carCode || '' }} 锛�</text>
</view>
</view>
@@ -41,21 +40,22 @@
</view>
<view class="menu-panel">
- <view v-for="item in menuList" :key="item.title" class="menu-panel__item" @click="jump(item)">
+ <view v-for="item in menuList" :key="item.title" class="menu-panel__item" @click="jump(item)" v-show="item.key !== 'reward' || userInfo.auditStatus === 3">
<text class="menu-panel__title">{{ item.title }}</text>
<view class="menu-panel__right">
<template v-if="item.key === 'wallet'">
<text class="menu-panel__sub menu-panel__sub--muted">浣欓锛歿{ currentProfile.walletBalance }}</text>
</template>
- <template v-else-if="item.key === 'driver' && !currentProfile.verified">
- <text class="menu-panel__sub menu-panel__sub--danger">瀹屾垚璁よ瘉鍚庡嵆鍙帴鍗�</text>
- </template>
- <template v-else-if="item.key === 'driver' && currentProfile.verified">
- <text class="menu-panel__sub menu-panel__sub--warning">瀹℃牳涓�</text>
- <text class="menu-panel__sub menu-panel__sub--primary">宸茶璇�</text>
+ <template v-if="item.key === 'driver'">
+ <text v-if="userInfo.auditStatus === 99" class="menu-panel__sub menu-panel__sub--danger">瀹屾垚璁よ瘉鍚庡嵆鍙帴鍗�</text>
+ <text v-else-if="!userInfo.hasApprovedOfficial && userInfo.auditStatus === 0" class="menu-panel__sub menu-panel__sub--danger">瀹℃牳涓�</text>
+ <text v-else-if="userInfo.hasApprovedOfficial && userInfo.auditStatus === 0" class="menu-panel__sub menu-panel__sub--danger">鍙樻洿涓�</text>
+ <text v-if="!userInfo.hasApprovedOfficial && userInfo.auditStatus === 2" class="menu-panel__sub menu-panel__sub--danger">宸查┏鍥�</text>
+ <text v-if="userInfo.hasApprovedOfficial && userInfo.auditStatus === 2" class="menu-panel__sub menu-panel__sub--danger">鍙樻洿宸查┏鍥�</text>
+ <text v-else-if="userInfo.auditStatus === 3" class="menu-panel__sub menu-panel__sub--primary">宸茶璇�</text>
</template>
<template v-else-if="item.key === 'setting'">
- <text class="menu-panel__sub menu-panel__sub--muted">褰撳墠鐗堟湰V1.0.0</text>
+ <text class="menu-panel__sub menu-panel__sub--muted">褰撳墠鐗堟湰{{ appVersion }}</text>
</template>
<view class="menu-panel__arrow">
<image src="/static/image/mine_ar2@2x.png" mode="widthFix"></image>
@@ -63,27 +63,59 @@
</view>
</view>
</view>
+ <view style="width: 100%; height: 5rpx;"></view>
</view>
- </scroll-view>
+ </view>
<view class="mine-page__footer">
- <button class="mine-page__logout" hover-class="mine-page__logout--hover">閫�鍑虹櫥褰�</button>
+ <button class="mine-page__logout" hover-class="mine-page__logout--hover" @click.stop="handleLogout">閫�鍑虹櫥褰�</button>
</view>
+
+ <u-popup :show="showPlatformPopup" mode="bottom" round="24" :closeable="true" @close="showPlatformPopup = false">
+ <view class="platform-popup">
+ <view class="platform-popup__title">鑱旂郴骞冲彴</view>
+ <view
+ v-for="(phone, index) in serverPhoneList"
+ :key="index"
+ class="platform-popup__item"
+ @click="handlePlatformCall(phone)"
+ >
+ <image class="platform-popup__icon" src="/static/image/ic_call@2x.png" mode="aspectFit"></image>
+ <text class="platform-popup__text">{{ phone }}</text>
+ </view>
+ <view v-if="!platformPhoneList.length" class="platform-popup__empty">鏆傛棤骞冲彴鑱旂郴鐢佃瘽</view>
+ </view>
+ </u-popup>
</view>
</template>
<script>
+ import { mapState } from 'vuex'
export default {
data() {
return {
statusBarHeight: 0,
navHeight: 0,
useVerifiedState: true,
+ serverPhone: '',
+ serverPhone1: '',
+ showPlatformPopup: false,
+ platformPhoneList: [],
+ appVersion: 'V1.0.0',
menuList: [
{ key: 'wallet', title: '鎴戠殑閽卞寘' },
{ key: 'driver', title: '鍙告満璁よ瘉' },
- { key: 'guide', title: '瑙勮寖椤荤煡' },
- { key: 'help', title: '甯姪涓庡鏈�' },
+ { key: 'reward', title: '濂栧姳澶у巺' },
+ { key: 'revenue', title: '钀ユ敹鍒嗘瀽' },
+ { key: 'agreementPrivacy', title: '鍙告満闅愮鏀跨瓥', type: 'driverPrivacyPolicy' },
+ { key: 'agreementErrandLuggage', title: '璺戣吙杈句汉琛屾潕瀵勫瓨椤荤煡', type: 'errandLuggageStorageNotice' },
+ { key: 'agreementErrandService', title: '璺戣吙杈句汉鏈嶅姟鍗忚', type: 'errandServiceAgreement' },
+ { key: 'agreementErrandRisk', title: '璺戣吙杈句汉椋庨櫓鎵胯', type: 'errandRiskCommitment' },
+ { key: 'agreementOwnerLuggage', title: '骞冲彴杞︿富琛屾潕瀵勫瓨椤荤煡', type: 'ownerLuggageStorageNotice' },
+ { key: 'agreementOwnerService', title: '骞冲彴杞︿富鏈嶅姟鍗忚', type: 'ownerServiceAgreement' },
+ { key: 'agreementOwnerRisk', title: '骞冲彴杞︿富椋庨櫓鎵胯', type: 'ownerRiskCommitment' },
+ { key: 'platform', title: '鑱旂郴骞冲彴' },
+ { key: 'help', title: '鑱旂郴瀹㈡湇' },
{ key: 'setting', title: '璁剧疆' }
],
profileStates: {
@@ -101,44 +133,168 @@
name: '姹ゅ瓙鏂�',
phone: '18166565677锛堢殩BD23189锛�',
levelTag: 'S绾�',
- totalIncome: '8,314.90',
- pendingIncome: '2000.00',
- orderCount: '329',
- walletBalance: '楼1500.00',
+ totalIncome: '-',
+ pendingIncome: '-',
+ orderCount: '-',
+ walletBalance: '楼0',
verified: true
}
}
}
},
computed: {
+ ...mapState(['userInfo']),
currentProfile() {
return this.useVerifiedState ? this.profileStates.verified : this.profileStates.guest
},
bodyStyle() {
- const footerHeight = uni.upx2px(124)
return {
- marginTop: this.navHeight + 'px',
- height: `calc(100vh - ${this.navHeight + footerHeight}px)`
+ marginTop: this.navHeight + 'px'
}
+ },
+ serverPhoneList() {
+ if (!this.serverPhone) return []
+ return this.serverPhone.split(',')
}
},
onLoad() {
const systemInfo = uni.getSystemInfoSync()
this.statusBarHeight = systemInfo.statusBarHeight || 0
this.navHeight = this.statusBarHeight + uni.upx2px(88)
+ if (plus.runtime && plus.runtime.version) {
+ this.appVersion = 'V' + plus.runtime.version
+ }
+ this.getContactInfo()
+ },
+ onShow() {
+ this.getStats()
+ this.getUserInfo()
+ this.getServerPhone()
},
methods: {
+ async getContactInfo() {
+ const res = await this.$u.api.getPlatformAboutUs({})
+ console.log(res,"====================")
+ if (res.code === 200) {
+ this.serverPhone1 = res.data.serverPhone || ''
+ }
+ },
+ formatPhoneList(phoneText) {
+ if (!phoneText) {
+ return []
+ }
+ return Array.from(new Set(
+ String(phoneText)
+ .split(/[\n,锛屻��;锛沑s]+/)
+ .map(item => item.trim())
+ .filter(item => item && /\d/.test(item))
+ ))
+ },
+ getServerPhone() {
+ this.$u.api.getPlatformAboutUs().then(res => {
+ if (res.code === 200 && res.data) {
+ this.serverPhone = res.data.serverPhone || ''
+ this.platformPhoneList = this.formatPhoneList(this.serverPhone)
+ }
+ })
+ },
+ getUserInfo() {
+ this.$u.api.verifyDetail().then(user => {
+ if (user.code === 200) {
+ this.$store.commit('setUserInfo', user.data);
+ }
+ })
+ },
+ getStats() {
+ this.$u.api.stats().then(res => {
+ if (res.code === 200 && res.data) {
+ this.profileStates.verified.totalIncome = (res.data.totalCommission / 100).toFixed(2)
+ this.profileStates.verified.pendingIncome = (res.data.pendingCommission / 100).toFixed(2)
+ this.profileStates.verified.orderCount = res.data.totalOrderCount || 0
+ this.profileStates.verified.walletBalance = '楼' + (res.data.balance / 100).toFixed(2)
+ }
+ })
+ },
+ getDriverLevelText(level) {
+ const map = { 5: 'S', 4: 'A', 3: 'B', 2: 'C', 1: 'D' }
+ return map[level] ? map[level] + '绾�' : ''
+ },
jump(item) {
console.log(item)
if (item.key === 'setting') {
uni.navigateTo({
url: '/pages/settings/settings'
})
- } else if (item.key === 'driver') {
+ } else if (item.key === 'reward') {
+ if (this.userInfo.auditStatus === 3) {
+ uni.navigateTo({
+ url: '/pages/reward-hall/reward-hall'
+ })
+ } else {
+ uni.showToast({
+ title: '璁よ瘉閫氳繃鍚庢墠鍙繘鍏ュ鍔卞ぇ鍘�',
+ icon: 'none'
+ })
+ }
+ } else if (item.key === 'revenue') {
uni.navigateTo({
- url: '/pages/certification-details/certification-details'
+ url: '/pages/revenue-analysis/revenue-analysis'
})
+ } else if (item.key === 'driver') {
+ if (this.userInfo.auditStatus === 99) {
+ uni.navigateTo({
+ url: '/pages/driver-certification/driver-certification'
+ })
+ } else {
+ uni.navigateTo({
+ url: '/pages/certification-details/certification-details'
+ })
+ }
+ } else if (item.key === 'wallet') {
+ uni.navigateTo({
+ url: '/pages/wallet/wallet'
+ })
+ } else if (item.key && item.key.startsWith('agreement')) {
+ uni.navigateTo({
+ url: `/pages/agreement/agreement?type=${item.type}&title=${encodeURIComponent(item.title)}`
+ })
+ } else if (item.key === 'platform') {
+ if (this.platformPhoneList.length) {
+ this.showPlatformPopup = true
+ } else {
+ uni.showToast({ title: '骞冲彴鑱旂郴鐢佃瘽鑾峰彇澶辫触', icon: 'none' })
+ }
+ } else if (item.key === 'help') {
+ if (this.serverPhone) {
+ uni.makePhoneCall({
+ phoneNumber: this.serverPhone
+ })
+ } else {
+ uni.showToast({ title: '瀹㈡湇鐢佃瘽鑾峰彇澶辫触', icon: 'none' })
+ }
}
+ },
+ handlePlatformCall(phone) {
+ if (!phone) {
+ return
+ }
+ uni.makePhoneCall({
+ phoneNumber: phone
+ })
+ },
+ handleLogout() {
+ uni.showToast({ title: '閫�鍑轰腑...', icon: 'loading' })
+ this.$u.api.logOutDriver().then(res => {
+ console.log('logout res', res)
+ if (res.code === 200) {
+ this.$store.commit('clearAll')
+ uni.reLaunch({
+ url: '/pages/login/login'
+ })
+ }
+ }).catch(err => {
+ console.log('logout err', err)
+ })
}
}
}
@@ -146,9 +302,7 @@
<style lang="scss" scoped>
.mine-page {
- height: 100vh;
background: #f6f8fc;
- overflow: hidden;
&__nav {
position: fixed;
@@ -174,10 +328,11 @@
&__body {
box-sizing: border-box;
+ // overflow: hidden;
}
&__content {
- padding: 28rpx 20rpx 20rpx;
+ padding: 28rpx 20rpx 0;
}
&__profile {
@@ -240,26 +395,22 @@
}
&__footer {
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- padding: 16rpx 0 calc(env(safe-area-inset-bottom) + 20rpx);
- background: #f6f8fc;
+ // padding: 16rpx 0 calc(env(safe-area-inset-bottom) + 20rpx);
+ padding-bottom: 30rpx;
display: flex;
justify-content: center;
}
&__logout {
- width: 186rpx;
- height: 70rpx;
- line-height: 70rpx;
- border-radius: 999rpx;
+ width: 200rpx;
+ height: 72rpx;
+ line-height: 72rpx;
+ border-radius: 36rpx;
background: #ffffff;
- border: 1rpx solid #d8dde5;
+ border: 1rpx solid #999999;
+ font-weight: 400;
font-size: 28rpx;
- font-weight: 500;
- color: #7e8794;
+ color: #333333;
padding: 0;
&::after {
@@ -328,6 +479,7 @@
.menu-panel {
margin-top: 20rpx;
+ margin-bottom: 30rpx;
border-radius: 22rpx;
background: #ffffff;
overflow: hidden;
@@ -367,7 +519,7 @@
}
&--danger {
- color: #ff5a4f;
+ color: #FA1010;
}
&--warning {
@@ -375,7 +527,7 @@
}
&--primary {
- color: #2b7cff;
+ color: #106EFA;
}
}
@@ -387,4 +539,43 @@
}
}
}
+
+ .platform-popup {
+ padding: 44rpx 32rpx calc(env(safe-area-inset-bottom) + 36rpx);
+
+ &__title {
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #2b3139;
+ text-align: center;
+ margin-bottom: 32rpx;
+ }
+
+ &__item {
+ display: flex;
+ align-items: center;
+ padding: 24rpx 0;
+ border-bottom: 1rpx solid #eef1f5;
+ }
+
+ &__icon {
+ width: 36rpx;
+ height: 36rpx;
+ margin-right: 20rpx;
+ flex-shrink: 0;
+ }
+
+ &__text {
+ font-size: 30rpx;
+ color: #2b3139;
+ line-height: 42rpx;
+ }
+
+ &__empty {
+ padding: 24rpx 0;
+ font-size: 28rpx;
+ color: #8f96a3;
+ text-align: center;
+ }
+ }
</style>
--
Gitblit v1.9.3