Просмотр исходного кода

feat:绑定手机号时 展示会员编号并进行确认

xyh8905170 2 лет назад
Родитель
Сommit
6acef8ba02
3 измененных файлов с 137 добавлено и 31 удалено
  1. 9 1
      common/js/api.js
  2. 101 14
      myPages/setting/setting-telphone.vue
  3. 27 16
      myPages/systemSwitch/index.vue

+ 9 - 1
common/js/api.js

@@ -512,12 +512,20 @@ export default {
     // get请求,获取手机验证码
     // get请求,获取手机验证码
     getSmsCode(data) {
     getSmsCode(data) {
         return request({
         return request({
-            url: '/resource/sms/code',
+            url: '/resource/sms/codeByType',
             method: 'GET',
             method: 'GET',
             data: data
             data: data
         })
         })
     },
     },
 
 
+    //get请求,获取手机验证码 新模板
+    getSmsCodeByType(data) {
+        return request({
+            url: '/resource/sms/codeByType',
+            method: 'GET',
+            data: data
+        })
+    },
     // post请求,验证手机验证码
     // post请求,验证手机验证码
     validateSmsCode(data) {
     validateSmsCode(data) {
         return request({
         return request({

+ 101 - 14
myPages/setting/setting-telphone.vue

@@ -54,14 +54,14 @@
             </template>
             </template>
 
 
           </u-form-item>
           </u-form-item>
-<!--          <view style="font-size: 26rpx">-->
-<!--            请输入您在娇骄儿的会员手机号,如需要找回账号请点击-->
-<!--            <navigator url="/loginPages/login/retrieve-account">-->
-<!--              <text style="color: #007aff">找回账号</text>-->
-<!--              。-->
-<!--            </navigator>-->
+          <!--          <view style="font-size: 26rpx">-->
+          <!--            请输入您在娇骄儿的会员手机号,如需要找回账号请点击-->
+          <!--            <navigator url="/loginPages/login/retrieve-account">-->
+          <!--              <text style="color: #007aff">找回账号</text>-->
+          <!--              。-->
+          <!--            </navigator>-->
 
 
-<!--          </view>-->
+          <!--          </view>-->
 
 
         </u--form>
         </u--form>
       </view>
       </view>
@@ -76,7 +76,23 @@
         <text>确定</text>
         <text>确定</text>
       </view>
       </view>
     </view>
     </view>
-
+    <!--    确认绑定弹框-->
+    <uni-popup ref="popupMigrate" :isMaskClick="false">
+      <view class="popup-content">
+        <view style="text-align: center">
+          <view class="text">当前会员编号为{{ storageUserInfo.no }}</view>
+          <text class="text">是否确认与该会员绑定并获取验证码?</text>
+        </view>
+        <view style="height:10px"></view>
+        <view class="button-popup">
+          <button class="h-btn" style="background-color: #EEEEEE;" @click="popupClose()">取消</button>
+          <view class="h-btn" style="background-color: #FFE05C;" @click="getPhoneCode()"
+                :disabled="currentStep === steps.length - 1">
+            <text>确定</text>
+          </view>
+        </view>
+      </view>
+    </uni-popup>
 
 
   </view>
   </view>
 </template>
 </template>
@@ -99,6 +115,7 @@ export default {
         type: '' // 实名认证创建新账号
         type: '' // 实名认证创建新账号
       },
       },
       tips2: '',
       tips2: '',
+      storageUserInfo:{},
       rules: {
       rules: {
         phonenumber: [
         phonenumber: [
           {
           {
@@ -129,12 +146,15 @@ export default {
     }
     }
   },
   },
   onLoad(option) {
   onLoad(option) {
+    this.storageUserInfo = uni.getStorageSync('userInfo')
   },
   },
   onReady() {
   onReady() {
     this.$refs.form1.setRules(this.rules)
     this.$refs.form1.setRules(this.rules)
   },
   },
   methods: {
   methods: {
-
+    popupClose(){
+      this.$refs.popupMigrate.close()
+    },
     getUserInfo() {
     getUserInfo() {
       this.$api.getUserInfo().then(res => {
       this.$api.getUserInfo().then(res => {
         uni.setStorageSync('userInfo', res.data.data)
         uni.setStorageSync('userInfo', res.data.data)
@@ -180,16 +200,18 @@ export default {
     },
     },
     // 获取手机验证码
     // 获取手机验证码
     getSmsCode() {
     getSmsCode() {
-      console.log('cacacacacacaca',this.userInfo)
+      console.log('cacacacacacaca', this.userInfo)
       let that = this;
       let that = this;
       if (!this.userInfo.phonenumber) {
       if (!this.userInfo.phonenumber) {
         uni.$u.toast('请认真填写手机号');
         uni.$u.toast('请认真填写手机号');
         return;
         return;
       }
       }
 
 
+
       // 验证电话号码是否存在
       // 验证电话号码是否存在
       this.$api.phoneIsExist(this.userInfo).then((res) => {
       this.$api.phoneIsExist(this.userInfo).then((res) => {
-        if (res.phoneIsExist) { // 存在
+        console.log(res.data.data.phoneIsExist)
+        if (res.data.data.phoneIsExist) { // 存在
           that.errTipShow = true;
           that.errTipShow = true;
           setTimeout(() => {
           setTimeout(() => {
             that.errTipShow = false;
             that.errTipShow = false;
@@ -197,7 +219,8 @@ export default {
             that.userInfo.phonenumber = null;
             that.userInfo.phonenumber = null;
           }, 3000);
           }, 3000);
         } else {
         } else {
-          that.getPhoneCode();
+          this.$refs.popupMigrate.open()
+          // that.getPhoneCode();
         }
         }
       }).catch(() => {
       }).catch(() => {
         uni.showToast({
         uni.showToast({
@@ -205,17 +228,18 @@ export default {
           duration: 3000
           duration: 3000
         })
         })
       });
       });
+    },
 
 
 
 
-    },
     // 获取验证码
     // 获取验证码
     getPhoneCode() {
     getPhoneCode() {
       let that = this;
       let that = this;
+      that.$refs.popupMigrate.close()
       // 模拟向后端请求验证码
       // 模拟向后端请求验证码
       uni.showLoading({
       uni.showLoading({
         title: '正在获取验证码'
         title: '正在获取验证码'
       })
       })
-      this.$api.getSmsCode({phonenumber: this.userInfo.phonenumber, auth: true}).then((res) => {
+      this.$api.getSmsCodeByType({phonenumber: this.userInfo.phonenumber, auth: true, type: 0}).then((res) => {
         uni.hideLoading();
         uni.hideLoading();
         // 这里此提示会被this.start()方法中的提示覆盖
         // 这里此提示会被this.start()方法中的提示覆盖
         uni.$u.toast('验证码已发送');
         uni.$u.toast('验证码已发送');
@@ -231,6 +255,7 @@ export default {
 }
 }
 </script>
 </script>
 <style lang="scss">
 <style lang="scss">
+
 page, body {
 page, body {
   background: #fff;
   background: #fff;
 }
 }
@@ -331,4 +356,66 @@ page, body {
     }
     }
   }
   }
 }
 }
+
+.popup-content {
+  width: 622rpx;
+  background-color: #FFFFFF;
+  border-radius: 20rpx;
+  padding: 24rpx;
+
+  .popupItem {
+    width: 558rpx;
+    height: 100rpx;
+    background-color: #FAFAFA;
+    border-radius: 16rpx;
+    margin:24rpx ;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+  }
+  .popupItemSelect {
+    width: 558rpx;
+    height: 100rpx;
+    background-color: #FAFAFA;
+    border-radius: 16rpx;
+    border: 4rpx solid #FFE05C;
+    margin:24rpx ;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    box-sizing: border-box;
+  }
+  .popupItemSelect::after {
+    content: '√';
+    color: #fff;
+    z-index: 1000;
+    display: inline-block;
+    width: 32rpx;
+    height: 32rpx;
+    transform: rotate(20deg);
+    position: absolute;
+    top: 0;
+    right: 0;
+  }
+
+}
+
+.button-popup {
+  height: 60px;
+  display: flex;
+  justify-content: space-between;
+  background: #fff;
+
+  .h-btn {
+    margin: 0 auto;
+    margin-top: 8px;
+    width: 240rpx;
+    height: 84rpx;
+    border-radius: 27px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-size: 14px;
+  }
+}
 </style>
 </style>

+ 27 - 16
myPages/systemSwitch/index.vue

@@ -186,7 +186,7 @@
       <uni-popup ref="popup" :isMaskClick="false">
       <uni-popup ref="popup" :isMaskClick="false">
         <view class="popup-content">
         <view class="popup-content">
           <view style="text-align: center">
           <view style="text-align: center">
-            <text class="text" >选择会员编号</text>
+            <text class="text">选择会员编号</text>
           </view>
           </view>
           <view v-for="item in numberList">
           <view v-for="item in numberList">
             <view class="popupItem" :class="{'popupItemSelect':item.isSelect == true }" @click="SelectItem(item)"
             <view class="popupItem" :class="{'popupItemSelect':item.isSelect == true }" @click="SelectItem(item)"
@@ -209,15 +209,17 @@
         </view>
         </view>
       </uni-popup>
       </uni-popup>
     </view>
     </view>
-<!--   确认迁移弹框 -->
+
+    <!--   确认迁移弹框 -->
     <uni-popup ref="popupMigrate" :isMaskClick="false">
     <uni-popup ref="popupMigrate" :isMaskClick="false">
       <view class="popup-content">
       <view class="popup-content">
         <view style="text-align: center">
         <view style="text-align: center">
-          <text class="text" >您确定要迁移资产?</text>
+          <view class="text">当前会员编号为{{ storageUserInfo.no }}</view>
+          <text class="text">是否确认找回到该账号下?</text>
         </view>
         </view>
-        <view style="height:40px" ></view>
+        <view style="height:10px"></view>
         <view class="button-popup">
         <view class="button-popup">
-          <button class="h-btn" style="background-color: #EEEEEE;" @click="this.$refs.popupMigrate.close()">取消</button>
+          <button class="h-btn" style="background-color: #EEEEEE;" @click="popupClose()">取消</button>
           <view class="h-btn" style="background-color: #FFE05C;" @click="nextStep(4)"
           <view class="h-btn" style="background-color: #FFE05C;" @click="nextStep(4)"
                 :disabled="currentStep === steps.length - 1">
                 :disabled="currentStep === steps.length - 1">
             <text>确定</text>
             <text>确定</text>
@@ -230,6 +232,7 @@
 
 
 <script>
 <script>
 import signature from '../components/sign/sign';
 import signature from '../components/sign/sign';
+
 export default {
 export default {
   components: {
   components: {
     signature
     signature
@@ -239,7 +242,7 @@ export default {
       isCommit: 0,
       isCommit: 0,
       isSelect: false,
       isSelect: false,
       isShow: true,
       isShow: true,
-      isMigrateClick:false,
+      isMigrateClick: false,
       showCanvas: false,
       showCanvas: false,
       numberList: [],
       numberList: [],
       currentStep: 0,
       currentStep: 0,
@@ -311,6 +314,7 @@ export default {
       signType: '',
       signType: '',
       signImg1: '',
       signImg1: '',
       tips2: '',
       tips2: '',
+      storageUserInfo:{},
       rules: {
       rules: {
         phone: [
         phone: [
           {
           {
@@ -380,8 +384,11 @@ export default {
   },
   },
 
 
   onLoad() {
   onLoad() {
+    // 用户信息
+    this.storageUserInfo = uni.getStorageSync('userInfo')
     // 获取服务条款数据
     // 获取服务条款数据
     // this.getTermOfServiceByType();
     // this.getTermOfServiceByType();
+    // this.$refs.popupMigrate.open()
   },
   },
 
 
   onUnload() {
   onUnload() {
@@ -396,10 +403,14 @@ export default {
   },
   },
 
 
   methods: {
   methods: {
+    popupClose(){
+      this.$refs.popupMigrate.close()
+    },
+
     SelectItem(data) {
     SelectItem(data) {
       this.isSelect = true
       this.isSelect = true
       this.userMemberInfo = data
       this.userMemberInfo = data
-      console.log(this.userMemberInfo,'33333333')
+      console.log(this.userMemberInfo, '33333333')
       this.isCommit = this.userMemberInfo.isCommit
       this.isCommit = this.userMemberInfo.isCommit
       this.numberList.forEach(e => {
       this.numberList.forEach(e => {
         e.isSelect = false
         e.isSelect = false
@@ -450,7 +461,7 @@ export default {
       uni.showLoading({
       uni.showLoading({
         title: '正在获取验证码'
         title: '正在获取验证码'
       })
       })
-      this.$api.getSmsCode({phonenumber: this.userInfo.phone, auth: true}).then((res) => {
+      this.$api.getSmsCodeByType({phonenumber: this.userInfo.phone, auth: true, type: 1}).then((res) => {
         uni.hideLoading();
         uni.hideLoading();
         // 这里此提示会被this.start()方法中的提示覆盖
         // 这里此提示会被this.start()方法中的提示覆盖
         uni.$u.toast('验证码已发送');
         uni.$u.toast('验证码已发送');
@@ -481,7 +492,7 @@ export default {
             console.log(this.numberList, '1111111')
             console.log(this.numberList, '1111111')
             this.userMemberInfo = res.data.data[0]
             this.userMemberInfo = res.data.data[0]
             this.isCommit = res.data.data[0].isCommit
             this.isCommit = res.data.data[0].isCommit
-            console.log(this.isCommit,'9999999999')
+            console.log(this.isCommit, '9999999999')
             if (this.currentStep < this.steps.length - 1) {
             if (this.currentStep < this.steps.length - 1) {
               this.currentStep++;
               this.currentStep++;
               this.getOrderRechargeOldList()
               this.getOrderRechargeOldList()
@@ -559,9 +570,9 @@ export default {
         if (this.isSelect === true) {
         if (this.isSelect === true) {
           this.$refs.popup.close()
           this.$refs.popup.close()
           // this.getOldMember();
           // this.getOldMember();
-          if (this.currentServiceTab == 'orderTab1'){
+          if (this.currentServiceTab == 'orderTab1') {
             this.getOrderRechargeOldList()
             this.getOrderRechargeOldList()
-          }else {
+          } else {
             this.getOrderConsumeLogOld();
             this.getOrderConsumeLogOld();
           }
           }
           if (this.currentStep < this.steps.length - 1) {
           if (this.currentStep < this.steps.length - 1) {
@@ -579,12 +590,12 @@ export default {
       if (idx == 1) { // 点击查询数据
       if (idx == 1) { // 点击查询数据
         const userInfo = uni.getStorageSync('userInfo')
         const userInfo = uni.getStorageSync('userInfo')
         // console.log(userInfo,'绑定手机号')
         // console.log(userInfo,'绑定手机号')
-        if (!userInfo.phone){
+        if (!userInfo.phone) {
           uni.showModal({
           uni.showModal({
-            title:'温馨提示',
-            content:'资产找回涉及资金安全,需绑定手机号才能进行查询,是否确认绑定手机号',
-            success:res=>{
-              if (res.confirm){
+            title: '温馨提示',
+            content: '资产找回涉及资金安全,需绑定手机号才能进行查询,是否确认绑定手机号',
+            success: res => {
+              if (res.confirm) {
                 uni.navigateTo({
                 uni.navigateTo({
                   url: '/myPages/setting/setting-telphone',
                   url: '/myPages/setting/setting-telphone',
                 })
                 })