1
xuxueyang
2024-08-03 a07cf599fb48b2ee233f42d0d7772684a8c3c790
pages/login/supplier-reg.vue
@@ -74,8 +74,7 @@
                  <!-- #endif -->
                  <!-- #ifdef PUB_CUSTOMER -->
                  <!--            open-type="getUserInfo"-->
                  <button @tap="wxreg('')"
                     class="bottom-button">注 册</button>
                  <button @tap="wxreg('')" class="bottom-button">注 册</button>
                  <!-- #endif -->
@@ -143,10 +142,21 @@
      },
      onLoad(options) {
         this.source = options.source || ''
         // #ifdef PUB_CUSTOMER
         var tjson = this.$storage.getItem('cache_customer_info')
         if (tjson) {
            var dto = JSON.parse(tjson)
            if (dto.partnerUserId) {
               this.partnerId = dto.partnerUserId || ''
               this.partnerName = dto.partnerUserName || '佚名'
            }
         }
         // #endif
      },
      methods: {
         async scanPartnerCode() {
            await this.$message.confirm('确定要绑定合伙人吗?')
            // await this.$message.confirm('确定要绑定合伙人吗?')
            //扫二维码确认
            let that = this
            uni.scanCode({
@@ -154,7 +164,25 @@
                  console.log('条码内容:' + res.result);
                  var dto = undefined
                  try {
                     dto = JSON.parse(res.result)
                     if (res.result && (res.result.startsWith('http://') || res.result.startsWith(
                           'https://')) && res.result.indexOf(
                           'partnerUserId') >= 0) {
                        var arr = res.result.split("?")[1].split("&")
                        dto = {}
                        for (var item of arr) {
                           var tarr = item.split("=")
                           if (tarr[1]) {
                              dto[tarr[0]] = tarr[1]
                           }
                        }
                        dto['name'] = dto['partnerUserName'] || ''
                        dto['userId'] = dto['partnerUserId'] || ''
                     } else {
                        dto = JSON.parse(res.result)
                     }
                     if (!!dto['userId']) {
                        that.partnerName = dto['name'] || ''
                        that.partnerId = dto['userId'] || ''
@@ -347,7 +375,7 @@
               }
               var dto = JSON.parse(tjson)
               // dto.partnerId = this.partnerId || undefined
               dto.userId  = this.partnerId || undefined
               dto.partnerUserId = this.partnerId || undefined
               post.dto = dto
            }
            post.wxcode = wxcode