Kaynağa Gözat

1. 修复完善信息 提交按钮 禁用问题
2. 修复不同意隐私状态

cc12458 6 ay önce
ebeveyn
işleme
979225ad1d

+ 3 - 1
miniprogram/components/popup-user-auth/popup-user-auth.ts

@@ -46,7 +46,9 @@ Component({
     onAgree() {
     onAgree() {
       this.setData({ "privacyContract.agree": true });
       this.setData({ "privacyContract.agree": true });
     },
     },
-
+    onDisagree() {
+      this.setData({ "privacyContract.agree": false });
+    },
     async onSubmit(event: WechatMiniprogram.FormSubmit) {
     async onSubmit(event: WechatMiniprogram.FormSubmit) {
       if (this.data.submitting || submitting) return;
       if (this.data.submitting || submitting) return;
       submitting = true;
       submitting = true;

+ 1 - 1
miniprogram/components/popup-user-auth/popup-user-auth.wxml

@@ -20,4 +20,4 @@
     </view>
     </view>
   </view>
   </view>
 </t-popup>
 </t-popup>
-<popup-privacy show="{{privacyContract.show}}" bind:setting="onPrivacySetting" bind:agree="onAgree" />
+<popup-privacy show="{{privacyContract.show}}" bind:setting="onPrivacySetting" bind:agree="onAgree" bind:disagree="onDisagree" />

+ 3 - 0
miniprogram/lib/wx/update.ts

@@ -1,5 +1,8 @@
 const updateManager = wx.getUpdateManager();
 const updateManager = wx.getUpdateManager();
+const env = wx.getAccountInfoSync().miniProgram.envVersion;
 export function appUpdate(force = false) {
 export function appUpdate(force = false) {
+  if (env !== wx.getStorageSync('env')) wx.clearStorageSync();
+  wx.setStorageSync('env', env);
   updateManager.onUpdateReady(function () {
   updateManager.onUpdateReady(function () {
     wx.showModal({
     wx.showModal({
       title: '更新提示',
       title: '更新提示',

+ 14 - 8
miniprogram/module/user/pages/user-certification/user-certification.ts

@@ -80,11 +80,10 @@ Component({
       else this.setData({ "privacyContract.agree": agree });
       else this.setData({ "privacyContract.agree": agree });
     },
     },
     onAgree() {
     onAgree() {
-      const submitBtn = this.selectComponent("#submitBtn");
-      console.log("onAgree-->");
-
       this.setData({ "privacyContract.agree": true });
       this.setData({ "privacyContract.agree": true });
-      if (submitBtn) submitBtn.resetState();
+    },
+    onDisagree() {
+      this.setData({ "privacyContract.agree": false });
     },
     },
     async verifyCardno(event: WechatMiniprogram.InputConfirm) {
     async verifyCardno(event: WechatMiniprogram.InputConfirm) {
       const value = event.detail.value;
       const value = event.detail.value;
@@ -104,19 +103,18 @@ Component({
     },
     },
     async onSubmit(event: WechatMiniprogram.FormSubmit) {
     async onSubmit(event: WechatMiniprogram.FormSubmit) {
       if (this.data.submitting) return;
       if (this.data.submitting) return;
-      this.setData({ submitting: true });
+      this.resetSubmitState(true);
       const data = { ...this.data.model, ...event.detail.value };
       const data = { ...this.data.model, ...event.detail.value };
       data.phone = this.data.model.phone;
       data.phone = this.data.model.phone;
-      const submitBtn = this.selectComponent("#submitBtn");
       if (!data.phone) {
       if (!data.phone) {
-        if (submitBtn) submitBtn.resetState();
+        this.resetSubmitState(false);
         return getTickleContext.call(this).showWarnMessage("请获取手机号码");
         return getTickleContext.call(this).showWarnMessage("请获取手机号码");
       }
       }
       if (!data.agemust) {
       if (!data.agemust) {
         data.agemust = this.data.privacyContract.agree ? "Y" : "N";
         data.agemust = this.data.privacyContract.agree ? "Y" : "N";
       }
       }
       if (data.agemust === "N") {
       if (data.agemust === "N") {
-        if (submitBtn) submitBtn.resetState();
+        this.resetSubmitState(false);
         this.setData({ "privacyContract.show": true });
         this.setData({ "privacyContract.show": true });
         return wx.showToast({
         return wx.showToast({
           title: `请阅读并同意${this.data.privacyContract.name}`,
           title: `请阅读并同意${this.data.privacyContract.name}`,
@@ -146,5 +144,13 @@ Component({
         wx.hideLoading();
         wx.hideLoading();
       }
       }
     },
     },
+    resetSubmitState(loading: boolean) {
+      if (loading) this.setData({ submitting: true });
+      else {
+        this.setData({ submitting: false });
+        const submitBtn = this.selectComponent("#submitBtn");
+        if (submitBtn) submitBtn.resetState();
+      }
+    }
   },
   },
 });
 });

+ 2 - 2
miniprogram/module/user/pages/user-certification/user-certification.wxml

@@ -1,6 +1,6 @@
 <wxs src="../../../../core/wxs/dictionary.wxs" module="dictionary" />
 <wxs src="../../../../core/wxs/dictionary.wxs" module="dictionary" />
 <!--module/user/pages/user-certification/user-certification.wxml-->
 <!--module/user/pages/user-certification/user-certification.wxml-->
-<t-navbar title="完善信息" left-arrow />
+<t-navbar title="完善信息" left-arrow="{{!hide}}" />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
   <form bindsubmit="onSubmit">
   <form bindsubmit="onSubmit">
     <view class="open-button">
     <view class="open-button">
@@ -37,4 +37,4 @@
 </scroll-view>
 </scroll-view>
 
 
 <t-message id="{{$messageId}}" />
 <t-message id="{{$messageId}}" />
-<popup-privacy show="{{privacyContract.show}}" bind:setting="onPrivacySetting" bind:agree="onAgree"></popup-privacy>
+<popup-privacy show="{{privacyContract.show}}" bind:setting="onPrivacySetting" bind:agree="onAgree" bind:disagree="onDisagree"></popup-privacy>