forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-09 2e4d56e2ed95cb0f336522216fedc37167fb446d
gz-wxparty/pages/realNameAuthentication/index.js
@@ -3,7 +3,12 @@
// 实名认证
function realNameAuthenticationApi(submitData) {
   return $$.request({ url: 'paUser/realAuth', type: 'post', submitData, service: 'cust' });
  return $$.request({
    url: 'paUser/realAuth',
    type: 'post',
    submitData,
    service: 'cust'
  });
}
Page({
@@ -37,17 +42,23 @@
   // 展示弹出层
   handleShowPopup(e) {
      this.setData({ popup: e.detail });
    this.setData({
      popup: e.detail
    });
   },
   // 关闭弹出层
   handleClosePopup() {
      this.data.popup.visible = false;
      this.setData({ popup: this.data.popup });
    this.setData({
      popup: this.data.popup
    });
   },
   // 下拉框确认选择
   handleConfirmPicker({ detail }) {
  handleConfirmPicker({
    detail
  }) {
      let type = this.data.popup.type;
      let value = detail.detail.value;
      let arr = [];
@@ -74,21 +85,34 @@
            this.data.submitData[x] = value[t === 0 ? 'value' : 'label'];
         });
      }
      this.setData({ popup: this.data.popup, submitData: this.data.submitData });
    this.setData({
      popup: this.data.popup,
      submitData: this.data.submitData
    });
   },
   // form的change
   handleChange(e) {
      const { key, value } = e.detail;
    const {
      key,
      value
    } = e.detail;
      this.data.submitData[key] = value;
      this.setData({ submitData: this.data.submitData });
    this.setData({
      submitData: this.data.submitData
    });
   },
   // 修改picker的列时触发
   handleChangeColumns(e) {
      if (this.data.popup.type === 'location') {
         let selectData = $$.changeLocation(e, this.selectComponent('#personal-data-dom').location, this.data.popup.selectData);
         this.setData({ popup: { ...this.data.popup, selectData } });
      this.setData({
        popup: {
          ...this.data.popup,
          selectData
        }
      });
      }
   },
@@ -106,7 +130,9 @@
         msg = '请勾选确认信息';
      }
      if (msg) {
         $$.showToast({ title: msg });
      $$.showToast({
        title: msg
      });
         return false;
      }
      let that = this;
@@ -120,12 +146,16 @@
                  that.realNameAuthentication();
               },
               fail() {
                  $$.showToast({ title: '抱歉!识别失败,请稍后重试' });
            $$.showToast({
              title: '抱歉!识别失败,请稍后重试'
            });
               },
            });
         },
         fail(res) {
            $$.showToast({ title: '抱歉!请求失败,稍后重试' });
        $$.showToast({
          title: '抱歉!请求失败,稍后重试'
        });
         },
      });
   },
@@ -139,11 +169,21 @@
         wx.getStorage({
            key: 'userInfo',
            success(res2) {
               res2.data.realStatus = '1';
               wx.setStorage({ key: 'userInfo', data: res2.data });
          console.log('res2', res2);
          let nowData = {
            ...res2.data,
            realStatus: 1,
          }
          wx.setStorage({
            key: 'userInfo',
            data: nowData
          });
            },
         });
            $$.showToast({ icon: 'success', title: '实名认证成功' });
      $$.showToast({
        icon: 'success',
        title: '实名认证成功'
      });
            wx.removeStorage({
                key: 'access_token'
            });
@@ -163,14 +203,18 @@
            this.data.submitData[x] = data[x];
         }
      });
      this.setData({ submitData: this.data.submitData });
    this.setData({
      submitData: this.data.submitData
    });
   },
   // 获取手机号码
   async handleGetPhoneNumber(e) {
      let phone = await this.selectComponent('#common-page').handleGetPhoneNumber(e.detail);
      this.data.submitData.mobile = phone;
      this.setData({ submitData: this.data.submitData });
    this.setData({
      submitData: this.data.submitData
    });
   },
   /**