MrShi
3 天以前 d54dc04ae25b73ee0c7c588c6523d94624f052e3
small-program/shop/pages/mine/mine.vue
@@ -16,13 +16,13 @@
         <view class="profile-section">
            <view class="profile-main">
               <view class="profile-left">
                  <image class="store-avatar" :src="storeAvatar" mode="aspectFill"></image>
                  <image class="store-avatar" @click="previewImage([info.shopAvatar],0)"  :src="(info.shopAvatar)?info.shopAvatar:'/static/image/tx@2x.png'"  mode="aspectFill"></image>
                  <view class="profile-info">
                     <text class="store-name">{{ shopDisplayName }}</text>
                     <text class="store-name">{{info.name||''}}</text>
                     <view class="profile-meta-row">
                        <text class="manager-name">{{ managerName }}</text>
                        <view class="identity-tag enterprise-tag">企业</view>
                        <view class="identity-tag personal-tag">个人</view>
                        <text class="manager-name">{{info.linkName || ''}}</text>
                        <view class="identity-tag enterprise-tag" v-if="info.companyType === 1">企业</view>
                        <view class="identity-tag personal-tag" v-if="info.companyType === 0">个人</view>
                     </view>
                  </view>
               </view>
@@ -59,10 +59,27 @@
         <view class="card menu-card">
            <view class="menu-item" v-for="item in menuList" :key="item.title" @click="handleMenuClick(item)">
               <text class="menu-title">{{ item.title }}</text>
               <image src="/static/icon/ar_map@2x.png" mode="widthFix" class="menu-arrow"></image>
               <view class="menu-arrow">
                  <button  v-if="item.title === '在线客服'" open-type="contact" type="default"> </button>
                  <image src="/static/icon/ar_map@2x.png" mode="widthFix"></image>
               </view>
            </view>
         </view>
      </view>
      <u-popup :show="showPhone" round="15" mode="bottom" :safeAreaInsetBottom="true" @close="showPhone = false" :closeable="true" :closeOnClickOverlay="true">
         <view class="phone">
            <view class="phone-head">
               <view></view>
               <text>联系平台</text>
            </view>
             <view style="flex-direction: row;margin-bottom: 30rpx;" class="phone-item" v-for="(phone, index) in serverPhoneList" :key="index" @click="contactPhoneDo(phone)">
                  <image src="/static/icon/ic_call@2x.png" mode="widthFix"></image>
                  <text>{{ phone }}</text>
             </view>
             <!-- <view style="width: 100%; height: 30rpx;"></view> -->
         </view>
      </u-popup>
      <custom-tabbar></custom-tabbar>
   </view>
@@ -71,49 +88,87 @@
<script>
   import { mapState } from 'vuex'
   import CustomTabbar from '@/components/custom-tabbar/custom-tabbar.vue'
   export default {
      components: {
         CustomTabbar
      },
      computed: {
         ...mapState(['navHeight', 'statusbarHeight','shopInfo','shopToken']),
         shopDisplayName() {
            return this.shopInfo.shopName || ''
         },
         managerName() {
            return this.shopInfo.contactName || this.shopInfo.managerName || ''
         },
         serverPhoneList() {
            if (!this.serverPhone) return []
            return this.serverPhone.split(',')
         }
      },
      data() {
         return {
            navActionIcon: '',
            settingIcon: '',
            showPhone: false,
            serverPhone: '',
            info:{},
            storeAvatar: '',
            bannerImage: '',
            orderMenus: [
            /* orderMenus: [
               { title: '待核验', badge: 12, icon: '/static/icon/mine_ic_daifukuan@2x.png', url: '/shop/pages/write-off/write-off' },
               { title: '待收货', badge: 2, icon: '/static/icon/mine_ic_daishouhuo@2x.png', url: '' },
               { title: '退款/售后', badge: '', icon: '/static/icon/mine_ic_tuikuan@2x.png', url: '' }
            ],
            ], */
            menuList: [
               { title: '规范须知', url: '' },
               { title: '在线客服', url: '' },
               { title: '关于我们', url: '' }
               { title: '门店合作协议', url: '/pages/rich-text/rich-text',type:2 },
               { title: '门店隐私政策', url: '/pages/rich-text/rich-text',type:3 },
               { title: '风险承诺', url: '/pages/rich-text/rich-text',type:6 },
               { title: '行李寄存须知', url: '/pages/rich-text/rich-text',type:7 },
               { title: '代理点合作协议', url: '/pages/rich-text/rich-text',type:8 },
               { title: '门店资质', url: '/shop/pages/qualification/qualification' },
               { title: '在线客服', url: null, type: -1 },
               { title: '联系平台', url: null, type: 'contact' },
               { title: '关于我们', url: '/pages/rich-text/rich-text' ,type:5},
            ]
         }
      },
      computed: {
         ...mapState(['navHeight', 'statusbarHeight', 'shopInfo']),
         shopDisplayName() {
            return this.shopInfo.shopName || '中铁快运南站旗舰店'
         },
         managerName() {
            return this.shopInfo.contactName || this.shopInfo.managerName || '蔡子瑶'
         }
      },
       onShow() {
         this.info  ={}
         this.getMyShop()
       },
       onLoad(options) {
       },
      methods: {
         previewImage(images,index = 0) {
            uni.previewImage({
               current: index,
               urls: images
            });
         },
         async  getMyShop(index){
               var that =this
               let res = await that.$u.api.getShopInfoDetail()
               if (res.code === 200) {
                  this.info = res.data
                  console.log(this.info.laborContractImgUrls,this.info.laborContractImgUrls.length,"====================")
                   console.log(this.info,"====================")
               }
         },
         junp() {
            uni.navigateTo({
               url: '/shop/pages/settings/settings'
            })
         },
         handleLogout() {
            uni.showToast({
               title: '请接入登出逻辑',
               icon: 'none'
            })
         async handleLogout() {
            var that =this
            let res = await that.$u.api.logOutShop()
            if (res.code === 200) {
               uni.clearStorageSync("shopInfo")
               uni.clearStorageSync("shopToken")
               uni.navigateTo({
                  url:'/shop/pages/login/login'
               })
            }
         },
         goAllOrders() {
            uni.showToast({
@@ -123,10 +178,10 @@
         },
         handleOrderClick(item) {
            if (!item.url) {
               uni.showToast({
               /* uni.showToast({
                  title: '请补充跳转链接',
                  icon: 'none'
               })
               }) */
               return
            }
@@ -135,16 +190,36 @@
            })
         },
         handleMenuClick(item) {
            if (item.type === 'contact') {
               this.getContactInfo()
               return
            }
            if (!item.url) {
               uni.showToast({
                  title: '请补充页面链接',
                  icon: 'none'
               })
               return
            }
            uni.navigateTo({
               url: item.url
            if(item.type > 0){
               uni.navigateTo({
                  url: '/pages/rich-text/rich-text?type='+item.type
               })
            }else{
               uni.navigateTo({
                  url: item.url
               })
            }
         },
         async getContactInfo() {
            const res = await this.$u.api.getPlatformAboutUs({})
            console.log(res,"====================")
            if (res.code === 200) {
               this.serverPhone = res.data.serverPhone || ''
               this.showPhone = true
            }
         },
         contactPhoneDo(phone) {
            uni.makePhoneCall({
               phoneNumber: phone
            })
         }
      }
@@ -285,7 +360,7 @@
   }
   .page-body {
      padding: 0 30rpx calc(180rpx + env(safe-area-inset-bottom));
      padding: 0 30rpx env(safe-area-inset-bottom);
      margin-top: -6rpx;
   }
@@ -416,7 +491,56 @@
   }
   .menu-arrow {
      width: 16rpx;
      height: 26rpx;
      display: inline-flex;
      button {
         position: relative;
         top: 0;
         float:right;
         right: 0;
         width: 200rpx;
         height: 26rpx;
         opacity: 0;
         z-index: 9999;
      }
      image{
         width: 16rpx;
         height: 26rpx;
      }
   }
   .phone {
      padding: 30rpx;
      .phone-head {
         display: flex;
         justify-content: center;
         margin-bottom: 40rpx;
         position: relative;
         text {
            font-size: 32rpx;
            font-weight: 500;
            color: #333333;
         }
      }
      .phone-item {
         display: flex;
         align-items: center;
         // padding: 24rpx;
         border-radius: 16rpx;
         margin-bottom: 20rpx;
         image {
            width: 40rpx;
            height: 40rpx;
            margin-right: 20rpx;
         }
         text {
            font-size: 28rpx;
            color: #333333;
         }
      }
   }
</style>