Kaynağa Gözat

to: modify permission wx:if condition

wangyuan 2 yıl önce
ebeveyn
işleme
3141c5754a

+ 16 - 2
pages/permisission/permission.js

@@ -6,7 +6,7 @@ Page({
    */
   data: {
     phoneLoading: false,
-    showCreateForm: false,
+    showCreateForm: true,
     createForm: null,
     date: '',
     sexList: [
@@ -69,9 +69,23 @@ Page({
     })
   },
   handleSex (e) {
-    console.log(e.currentTarget.dataset.index)
     this.setData({
       sexActive: e.currentTarget.dataset.index
     })
+  },
+  handleConfirmBind () {
+    wx.showLoading({
+      title: '绑定中...',
+      mask: true
+    })
+    setTimeout(() => {
+      wx.hideLoading({
+        success: (res) => {
+          wx.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+    }, 1000);
   }
 })

+ 2 - 2
pages/permisission/permission.wxml

@@ -1,5 +1,5 @@
 <view class="entery-container">
-  <block wx:if="{{showCreateForm}}">
+  <block wx:if="{{!showCreateForm}}">
     <button class="permission-btn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">获取手机号</button>
     <button class="permission-btn" bindtap="getUser">获取用户信息</button>
     <button class="permission-btn" bindtap="fillInfo">填写信息</button>
@@ -36,7 +36,7 @@
             </block>
           </view>
         </view>
-        <view class="submit-btn">确认绑定</view>
+        <view class="submit-btn" bindtap="handleConfirmBind">确认绑定</view>
       </view>
     </view>
   </block>