陶杰
2025-01-13 efa9bfe98ba906e4c9b8f49c89f5da162a46bb0f
pages/home/supplier-home.vue
@@ -37,10 +37,13 @@
            <image class="user-icon" v-if="currentInfo.picture" :src="currentInfo.picture" mode="aspectFit"></image> -->
            <view class="name">
               <view class="t1 flex" style="align-items: center; justify-content: space-between;">
               <view class="t1 flex" style="align-items: center; justify-content: start;">
                  <!-- {{ (!!currentInfo.supplierDTO?(currentInfo.supplierDTO.name):"") || currentInfo.nickName || currentInfo.loginName || '-'}} -->
                  <span v-if="currentInfo.partnerDTO && currentInfo.partnerDTO.name">
                     {{ currentInfo.partnerDTO.name }}
                  </span>
                  <span v-else-if="currentInfo.supplierSub && currentInfo.supplierSub.name">
                     {{ currentInfo.supplierSub.name }}
                  </span>
                  <span v-else-if="currentInfo.supplierDTO && currentInfo.supplierDTO.name">
                     {{ currentInfo.supplierDTO.name }}
@@ -61,14 +64,22 @@
                  <span v-if="currentInfo.partnerDTO && currentInfo.partnerDTO.status !== 'P'">
                     ({{ currentInfo.partnerDTO ? currentInfo.partnerDTO.statusStr : '' }})</span>
                  <span v-if="!currentInfo.partnerDTO && currentInfo.type === 'partner'">(信息待完善)</span>
                  <u--image v-if="selftype === 'supplier' && currentInfo.switchFlag "
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/fa/fa6585cd52d54156b5d64fa59af58180switch.png"
                     width="10px" height="10px" style="margin-left: 10px; margin-right: 10px;"
                     @click="switchSubAccount"></u--image>
                  <u--text v-if="selftype === 'supplier' && currentInfo.switchFlag " style="color: black;" text="切换账号" @click="switchSubAccount"></u--text>
                  <view v-if="selftype === 'supplier' && currentInfo.switchFlag " style="margin-left: 10px; display: flex; justify-content: start; align-items: center;">
                     <u--image v-if="selftype === 'supplier' && currentInfo.switchFlag "
                        src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/96/96f6ea502bac4360bf35399e86e463efswitch2.png"
                        width="10px" height="10px" style="margin-left: 20px; margin-right: 20px;"
                        @click="switchSubAccount"></u--image>
                     <!-- <u--text v-if="selftype === 'supplier' && currentInfo.switchFlag " style="color: black;" text="切换账号" @click="switchSubAccount"></u--text> -->
                     <view  v-if="selftype === 'supplier' && currentInfo.switchFlag "  @click="switchSubAccount" style="font-size: 10px; ">切换账号</view>
                  </view>
               </view>
               <view class="t2">{{ currentInfo.tel || '暂无电话' }}</view>
               <view class="t2 flex " style="align-items: center; justify-content: start;" >
                  <view>{{ currentInfo.supplierSub.phone || currentInfo.tel || '暂无电话' }}</view>
                  <!-- <view v-if="selftype === 'supplier' && $hasPermission('supplier:workbench:common:functions:sub:account')  ">
                     <view v-if="currentInfo.isSubSupplier" class="account_sub  m-l-a m-r-0"  >子账号</view>
                     <view v-else class="account_sub  m-l-a m-r-0"  >主账号</view>
                  </view> -->
               </view>
               <view class="t2" v-if="currentInfo.partnerDTO && currentInfo.partnerDTO.id">
                  ID: {{ currentInfo.partnerDTO.id }}
               </view>
@@ -270,7 +281,7 @@
            </view>
            <view class="nav row margin-tb function-item "
            <!-- <view class="nav row margin-tb function-item "
               v-if="(selftype === 'supplier' && $hasPermission('supplier:workbench:common:functions:sub:account'))"
               @click="goto('/sub_pages/supplier/sub-account/sub-account-list', true)">
               <view class="img-c">
@@ -279,7 +290,7 @@
                     mode="scaleToFill" />
               </view>
               <view class="order-desc syst">子账号</view>
            </view>
            </view> -->
            <!-- <view class="nav row margin-tb function-item "></view> -->
         </view>
      </view>
@@ -337,15 +348,32 @@
      }
   },
   async onPullDownRefresh() {
      // 需要判断当前是否是子账号,如果是子账号则需要刷新账号切换的信息
      // const currentInfo = this.$store.state.currentInfo
      // if(currentInfo&&currentInfo.supplierSub&&currentInfo.supplierSub.id){
      //    await this.$store.dispatch('getSwitchSubAccount',currentInfo.supplierSub)
      // }else{
      //    await this.$store.dispatch('getCurrentInfo')
      // }
      await this.$store.dispatch('getCurrentInfo')
      await this.getTj(true)
      uni.stopPullDownRefresh()
   },
   onLoad(options) {
      const url = options.q ? decodeURIComponent(options.q) : '';
      const urlcode = options.url && decodeURIComponent(options.url) || ''
   },
   onShow() {
   async onShow() {
      if(this.selftype==='supplier'){
         // 刷新供应商菜单
         await this.$store.dispatch('getAppMenuSupplier')
      }else if(this.selftype==='partner'){
         // 刷新合伙人菜单
         await this.$store.dispatch('getAppMenuPartner')
      }
      this.getTj(true)
   },
   created() {
@@ -413,6 +441,7 @@
         var that = this;
         wx.getBluetoothAdapterState({
            success: (result) => {
               // debugger;
               console.log('b s', result)
               console.log("蓝牙状态:\n" + result.errMsg)
               if (result.adapterState.available) {
@@ -629,4 +658,16 @@
  box-sizing: border-box;
  margin-bottom: 10px; 
}
.account_sub {
    width: 80rpx;
    height: 24rpx;
    border-radius: 30rpx;
    border: 2rpx solid #23A9F2;
    font-size: 18rpx;
    color: white;
    line-height: 20rpx;
    text-align: center;
    background-color: #23A9F2;
    margin-left: 10px !important;
}
</style>