xuxueyang
2024-08-01 c0c8ba4ea76109e21fde94ace1ea41a402aabf72
pages/user/supplier-user.vue
@@ -17,12 +17,15 @@
         <view class="flex user-info">
            <!-- 头像 -->
            <image class="user-icon" v-if="currentInfo.picture
               ||currentInfo.customerDTO&&currentInfo.customerDTO.cover
            <image class="user-icon" v-if="
               currentInfo.customerDTO&&currentInfo.customerDTO.cover
               ||currentInfo.supplierDTO&&currentInfo.supplierDTO.cover
               " :src="currentInfo.picture
               ||currentInfo.customerDTO&&currentInfo.customerDTO.cover
               ||currentInfo.supplierDTO&&currentInfo.supplierDTO.cover" mode="scaleToFill"></image>
               || currentInfo.picture
               " :src="
               currentInfo.customerDTO&&currentInfo.customerDTO.cover
               ||currentInfo.supplierDTO&&currentInfo.supplierDTO.cover
               || currentInfo.picture
               " mode="scaleToFill"></image>
            <image class="user-icon" v-else
               src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png'
               mode="scaleToFill"></image>
@@ -42,7 +45,7 @@
            <view class="name" v-if="!currentInfo.id" open-type="getUserInfo" @click.stop="toCustomerLogin"
               style="font-size: 48rpx;margin-top: 16rpx;">
               <!-- getUserProfile -->
               {{ '点击登陆' }}
               {{ '点击登陆/注册' }}
            </view>
            <image class="icon-setting" @click="toInfo" src="../../static/common/icon-setting.png" mode="aspectFit">
            </image>
@@ -80,10 +83,11 @@
               </view>
            </view>
            <view class="flex order-icons-container">
               <view class="order-icons" style="position: relative;" @click="goto('/pages/order/order?status=PENDING',true)">
               <view class="order-icons" style="position: relative;"
                  @click="goto('/pages/order/order?status=PENDING',true)">
                  <image src="../../static/images/customer/order/order-type-1.png" class="order-icon dfk"
                     style="position: relative;">
                     <view class="image-shop-number">{{order_pendding_num||''}}</view>
                     style="position: relative;">
                     <view class="image-shop-number" v-if="order_pendding_num">{{order_pendding_num||''}}</view>
                  </image>
                  <view>待付款</view>
               </view>
@@ -177,6 +181,17 @@
            </view>
         </view>
         <!-- #endif -->
         <!-- #ifdef PUB_CUSTOMER -->
         <view class="user-util m-t-12 flex"
            v-if="(selftype==='customer'||!selftype)&&currentInfo.id&&currentInfo.customerDTO&&!currentInfo.customerDTO.partnerId"
            @click="scanPartnerCode">
            <view class="title">扫码绑定合伙人</view>
            <view class="right-icon">
               <uni-icons type="right"></uni-icons>
            </view>
         </view>
         <!-- #endif -->
         <view class="user-util m-t-12 flex" v-if="selftype==='supplier'"
            @click="goto('/sub_pages/supplier/supplier-info/supplier-info',true)">
            <view class="title">店铺信息</view>
@@ -184,11 +199,19 @@
               <uni-icons type="right"></uni-icons>
            </view>
         </view>
         <view class="user-util m-t-12 flex" @click="goto('/pages/user/user-pwd/user-pwd',true)">
            <view class="title">修改密码</view>
            <view class="right-icon">
               <uni-icons type="right"></uni-icons>
            </view>
         </view>
         <view class="user-util m-t-12 flex" v-if="currentInfo&&currentInfo.id"
            @click="goto('/pages/user/user-bind-wx/user-bind-wx',true)">
            <view class="title">绑定当前微信</view>
            <view class="right-icon">
               <uni-icons type="right"></uni-icons>
            </view>
         </view>
         <view class="user-util m-t-12 flex" v-if="selftype==='customer'" @click="clearlogout">
            <view class="title">退出登录</view>
@@ -199,14 +222,20 @@
         <view class="user-util m-t-12 " v-if="selftype==='supplier'||selftype==='customer' || !selftype">
            <view class="title">我的客服</view>
            <view class="flex">
               <image class="icon-clock m-r-6 m-t-2" src="../../static/common/icon-call.png"></image>
               <view class="name" @click="callTel">
                  客服电话 : &nbsp;&nbsp; <span class="topic-gray">{{ tel }}</span>
               </view>
               <view class="right-icon" open-type="contact">
                  <uni-icons type="right"></uni-icons>
               </view>
            <view class="flex flex-wrap-normal" >
               <image class="icon-clock m-r-6 m-t-2" src="../../static/common/icon-call.png"></image>
                <!-- @click="callTel" -->
                <button open-type="contact"
                class="component-button-contact"
                 @handleContact="handleContact">
                   <view class="name">
                      客服电话 : &nbsp;&nbsp; <span class="topic-gray">{{ tel }}</span>
                   </view>
                   <view class="right-icon" >
                      <uni-icons type="right"></uni-icons>
                   </view>
                </button>
            </view>
         </view>
         <!--          <view class="user-util m-t-12 " @click="callTel" v-if="selftype==='partner'">
@@ -321,6 +350,48 @@
         uni.stopPullDownRefresh()
      },
      methods: {
         async scanPartnerCode() {
            await this.$message.confirm('确定要绑定合伙人吗?')
            //扫二维码确认
            let that = this
            uni.scanCode({
               success: async function(res) {
                  console.log('条码内容:' + res.result);
                  var dto = undefined
                  try {
                     dto = JSON.parse(res.result)
                     if (!!dto['userId']) {
                        var partnerName = dto['name'] || ''
                        var partnerId = dto['userId'] || ''
                        //调用接口绑定
                        that.$message.showLoading()
                        const {
                           code,
                           data
                        } = await that.$http.request('post', '/api/customer/bind/partner', {
                           data: {
                              partnerId: partnerId
                           }
                        })
                        that.$message.hideLoading()
                        if (code == 0) {
                           that.$message.showToast(`绑定合伙人${partnerName}成功`)
                           await this.$store.dispatch('getCurrentInfo')
                        }
                     } else {
                        that.$message.showToast('二维码格式不正确扫码失败')
                     }
                  } catch (e) {
                     that.$message.showToast('二维码格式不正确扫码失败')
                  }
               },
               fail() {
                  that.$message.showToast('扫码失败')
               }
            });
         },
         toInfo() {
            var url = ''
            if (this.currentInfo.id) {
@@ -355,8 +426,7 @@
                  })
                  //获取待支付数目
                  this.$http.request('get', '/api/customer/order/count/pending', {
                     params: {
                     }
                     params: {}
                  }).then(res => {
                     if (res.code === 0) {
                        that.order_pendding_num = res.data || 0