rk
2026-04-23 3696830fbaf2fd97d98020087abf20917e491bdc
small-program/pages/mine/mine.vue
@@ -7,8 +7,7 @@
      </view>
      <view class="page-scroll">
         <view class="page-content">
            <view class="profile-card">
               <button open-type="getPhoneNumber" @getphonenumber="getphonenumber">授权手机号</button>
            <view class="profile-card" @click="handleProfileClick">
               <image class="avatar" :src="userInfo.fullCoverImage ? userInfo.fullCoverImage : '/static/image/tx@2x.png'" mode="widthFix"></image>
               <view class="profile-copy">
                  <text class="login-text">{{ userInfo.nickName || '点击登录' }}</text>
@@ -49,8 +48,8 @@
               <view v-for="item in menuList" :key="item.label" class="menu-row" @click="handleMenuClick(item)">
                  <text class="menu-label">{{ item.label }}</text>
                  <view class="right-icon">
                     <text v-if="item.label === '门店入驻'" :class="{ 'status-red': userInfo.shopAuditStatus === 1 || userInfo.shopAuditStatus === 2 }">
                        {{ userInfo.shopAuditStatus === 0 ? '审核中' : userInfo.shopAuditStatus === 1 ? '审核通过,请支付押金' : userInfo.shopAuditStatus === 2 ? '审核未通过' : '申请入驻' }}
                     <text v-if="['门店入驻','门店信息'].includes(item.label)" :class="{ 'status-red': userInfo.shopAuditStatus === 1 || userInfo.shopAuditStatus === 2 }">
                        {{ userInfo.shopAuditStatus === 0 ? '审核中' : userInfo.shopAuditStatus === 1 ? '审核通过,请支付押金' : userInfo.shopAuditStatus === 2 ? '审核未通过' : userInfo.shopAuditStatus === 3 ? '门店已入驻' : '' }}
                     </text>
                     <u-icon name="arrow-right" size="18" color="#B5BBC5"></u-icon>
                  </view>
@@ -58,18 +57,30 @@
            </view>
         </view>
      </view>
      <auth-login
         :show="showAuthLogin"
         :checked.sync="agreeChecked"
         @close="showAuthLogin = false" />
      <custom-tabbar></custom-tabbar>
   </view>
</template>
<script>
import { mapState } from 'vuex'
   import { mapState } from 'vuex'
   import CustomTabbar from '@/components/custom-tabbar/custom-tabbar.vue'
export default {
   computed: {
      ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo'])
   export default {
      components: {
         CustomTabbar
      },
      computed: {
      ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo', 'token'])
   },
   data() {
      return {
         showAuthLogin: false,
         agreeChecked: true,
         userName: '',
         orderMenus: [
            { label: '待支付', url: '/static/icon/mine_ic_daifukuan@2x.png', badge: 0 },
@@ -86,12 +97,29 @@
      }
   },
   async onShow() {
      await this.$onLaunched
      if (this.userInfo) {
      await this.$onLaunched;
      if (this.token) {
         this.getOrderNum()
      }
      if (this.userInfo) {
         if (this.userInfo.shopAuditStatus === 3) {
            this.menuList[0].label = '门店信息'
         }
      } else {
         this.orderMenus = [
            { label: '待支付', url: '/static/icon/mine_ic_daifukuan@2x.png', badge: 0 },
            { label: '待收货', url: '/static/icon/mine_ic_daishouhuo@2x.png', badge: 0 },
            { label: '退款/售后', url: '/static/icon/mine_ic_tuikuan@2x.png', badge: 0 }
         ]
      }
   },
   methods: {
      handleProfileClick() {
         if (this.token) {
            return
         }
         this.showAuthLogin = true
      },
      toAllOrders() {
         uni.navigateTo({
            url: '/pages/orders/orders'
@@ -100,11 +128,11 @@
      handleMenuClick(item) {
         const urlMap = {
            '门店入驻': '/pages/store-apply/store-apply',
            '我的门店': '/pages/store-home/store-home',
            '我的门店': '/shop/pages/login/login',
            '规范须知': '/pages/rich-text/rich-text?type=serverIntroduce',
            '关于我们': '/pages/rich-text/rich-text?type=about'
         }
         if (item.label === '门店入驻' && [0,1,2].includes(this.userInfo.shopAuditStatus)) {
         if (['门店入驻','门店信息'].includes(item.label) && [0,1,2,3].includes(this.userInfo.shopAuditStatus)) {
            uni.navigateTo({
               url: '/pages/details-entry/details-entry'
            })
@@ -126,6 +154,16 @@
            url: '/pages/settings/settings'
         })
      },
      goService() {
         uni.navigateTo({
            url: '/pages/rich-text/rich-text?type=userAgreement'
         })
      },
      goPrivacy() {
         uni.navigateTo({
            url: '/pages/rich-text/rich-text?type=privacyPolicy'
         })
      },
      getOrderNum() {
         this.$u.api.getMemberInfo({}).then(res => {
            if (res.code === 200) {
@@ -141,30 +179,6 @@
               })
            }
         })
      },
      // 授权手机号
      getphonenumber(e) {
         var that = this;
         if (e.detail.errMsg === 'getPhoneNumber:ok') {
            uni.login({
               provider: 'weixin',
               success: async function (loginRes) {
                  let { code } = loginRes;
                  let res = await that.$u.api.wxLogin({ code })
                  if (res.code === 200) {
                     that.$u.api.wxAuthPhone({
                        code: e.detail.code,
                        openid: res.data.openid
                     }).then(res => {
                        if (res.code === 200) {
                           that.$store.commit('setUserInfo', res.data.member)
                           that.$store.commit('setToken', res.data.token)
                        }
                     })
                  }
               }
            });
         }
      }
   }
}