فهرست منبع

Merge remote-tracking branch 'origin/dev2.0' into dev2.0

xuyunhui 3 ماه پیش
والد
کامیت
7ed0d96bd4
4فایلهای تغییر یافته به همراه94 افزوده شده و 63 حذف شده
  1. 35 61
      App.vue
  2. 9 0
      common/js/api.js
  3. 44 0
      myPages/serviceObjectAllInfo/index.vue
  4. 6 2
      pages/index/index.vue

+ 35 - 61
App.vue

@@ -37,71 +37,45 @@
                         let expandParam = uni.getStorageSync('expandParam')
                         if (expandParam) {
 
-
+                          if (expandParam.isUse != 1){
                             console.log('获取到的拓客端参数',expandParam)
                             if (new Date().getTime() <= expandParam.timestamp){
-                                if (isNew){
-                                  //登录成功,且是新用户,触发首页的自定义事件
-                                  uni.$emit("loginSuccess")
-                                    //用户扫码拓客端进入小程序
-                                    // that.$api.userBindMember(
-                                    //     {
-                                    //         ...expandParam,
-                                    //         memberId: res.data.data.userInfo.id
-                                    //     }
-                                    // ).then(res1 => {
-                                    //     console.log('拓客端推广用户绑定成功!')
-                                    //
-                                    //     that.$api.addRecordForAttach({
-                                    //         ...expandParam,
-                                    //         isNew:1,
-                                    //         isBindSuccess:1,
-                                    //     }).then(res=>{
-                                    //         console.log('+++++++++新用户,扫码推广成功记录!++++++++++++++++')
-                                    //     })
-                                    //
-                                    //     uni.removeStorageSync('expandParam');
-                                    // }).catch(err=>{
-                                    //
-                                    //     that.$api.addRecordForAttach({
-                                    //         ...expandParam,
-                                    //         isNew:1,
-                                    //         isBindSuccess:0,
-                                    //     }).then(res=>{
-                                    //         console.log('+++++++++新用户,扫码推广失败记录!++++++++++++++++')
-                                    //     })
-                                    //
-                                    //     uni.removeStorageSync('expandParam');
-                                    // })
-                                }else {
-
-                                    that.$api.addRecordForAttach({
-                                        ...expandParam,
-                                        isNew:0,
-                                        isBindSuccess:0,
-                                    }).then(res=>{
-                                        console.log('+++++++++老用户,扫码推广失败记录!++++++++++++++++')
-                                    })
-
-                                    uni.removeStorageSync('expandParam');
+                              if (isNew){
+                                //登录成功,且是新用户,触发首页的自定义事件
+                                uni.$emit("loginSuccess")
+                              }else {
+
+                                that.$api.addRecordForAttach({
+                                  ...expandParam,
+                                  isNew:0,
+                                  isBindSuccess:0,
+                                }).then(res=>{
+                                  expandParam.isUse = 1
+                                  uni.setStorageSync('expandParam', expandParam)
+                                  console.log('+++++++++老用户,扫码推广失败记录!++++++++++++++++')
+                                })
+
+                                // uni.removeStorageSync('expandParam');
+                              }
+
+                            }else {
+                              uni.showModal({
+                                title: '温馨提示',
+                                content: ' 当前二维码已过期,请重新扫码',
+                                showCancel:false,
+                                success: function (res) {
+                                  if (res.confirm) {
+                                    console.log('用户点击确定');
+                                  } else if (res.cancel) {
+                                    console.log('用户点击取消');
+                                  }
                                 }
-
-                             }else {
-                                uni.showModal({
-                                    title: '温馨提示',
-                                    content: ' 当前二维码已过期,请重新扫码',
-                                    showCancel:false,
-                                    success: function (res) {
-                                        if (res.confirm) {
-                                            console.log('用户点击确定');
-                                        } else if (res.cancel) {
-                                            console.log('用户点击取消');
-                                        }
-                                    }
-                                });
-                                uni.removeStorageSync('expandParam');
+                              });
+                              expandParam.isUse = 1
+                              uni.setStorageSync('expandParam', expandParam)
+                              // uni.removeStorageSync('expandParam');
                             }
-
+                          }
                         }
 
                         //用户扫码技师端进入小程序,携带的参数。 暂无操作

+ 9 - 0
common/js/api.js

@@ -1091,4 +1091,13 @@ export default {
         })
     },
 
+    // 解绑服务对象
+    unbindServiceObject(data) {
+        return request({
+            url: '/member/wechat/unbindServiceObject',
+            method: 'post',
+            data: data
+        })
+    },
+
 }

+ 44 - 0
myPages/serviceObjectAllInfo/index.vue

@@ -212,6 +212,10 @@
       <view class="btn">保存</view>
     </view>
 
+    <view @click="unbindServiceObject" class="sure-btn">
+      <view class="btn1">解绑</view>
+    </view>
+
     <!-- 性别选择 -->
     <u-picker :show="genderShow" keyName="gender" @confirm="sureChooseGender" :columns="genderList"></u-picker>
       <cropper selWidth="660rpx" selHeight="660rpx" ref="cropper" quality="0.5" @uploadImg="uploadCropImg"  @upload="userInfo.facePhotoUrl" />
@@ -302,6 +306,34 @@ export default {
   },
   methods: {
 
+    unbindServiceObject(){
+      let that = this
+
+      uni.showModal({
+        title: '温馨提示',
+        content: '解绑后您将无法看到该服务对象的信息!确定解绑?',
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定');
+
+            that.$api.unbindServiceObject({
+              id:that.userInfo.id
+            }).then(res=>{
+              uni.showToast({
+                icon: 'none',
+                title: '解绑成功!'
+              })
+            })
+
+          } else if (res.cancel) {
+            console.log('用户点击取消');
+          }
+        }
+      })
+
+
+    },
+
     uploadCropImg(e){
       uni.compressImage({
         src: e,
@@ -666,6 +698,18 @@ export default {
       margin-top: 12px;
       font-size: 14px;
     }
+
+    .btn1 {
+      text-align: center;
+      height: 42px;
+      background: red;
+      border-radius: 27px;
+      color: #ffffff;
+      line-height: 42px;
+      margin-top: 12px;
+      font-size: 14px;
+    }
+
   }
 }
 

+ 6 - 2
pages/index/index.vue

@@ -596,9 +596,11 @@ export default {
         isNew: 1,
         isBindSuccess: 0,
       }).then(res => {
+        expandParam.isUse = 1
+        uni.setStorageSync('expandParam', expandParam)
         console.log('+++++++++新用户,扫码推广失败记录!++++++++++++++++')
       })
-      uni.removeStorageSync('expandParam');
+      // uni.removeStorageSync('expandParam');
     },
 
     userBindMember() {
@@ -655,7 +657,9 @@ export default {
           }).then(res => {
             console.log('+++++++++新用户,扫码推广成功记录!++++++++++++++++')
           })
-          uni.removeStorageSync('expandParam');
+          expandParam.isUse = 1
+          uni.setStorageSync('expandParam', expandParam)
+          // uni.removeStorageSync('expandParam');
         })
 
       }).catch(errors => {