zhaoxiaohai 3 سال پیش
والد
کامیت
a463a7b3d7
2فایلهای تغییر یافته به همراه13 افزوده شده و 3 حذف شده
  1. 11 2
      pages/login/phone.js
  2. 2 1
      pages/login/phone.wxml

+ 11 - 2
pages/login/phone.js

@@ -25,6 +25,16 @@ Page({
         this.setData({
             ...wx.getStorageSync('loginMsg')
         })
+        wx.getUserProfile({
+            desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+            success: (res) => {
+                console.log("用户信息",res)
+                /* this.setData({
+                    userInfo: res.userInfo,
+                    hasUserInfo: true
+                }) */
+            }
+        })
         this.allowOrNot()
     },
     /* 微信登录 */
@@ -86,8 +96,7 @@ Page({
     /* 改变密码输入框类型 */
     changePasswordType() {
         this.setData({
-            inputType: this.data.inputType == "text" ? 'password' : 'text',
-            focus: true
+            inputType: this.data.inputType == "text" ? 'password' : 'text'
         })
     },
     /* 授权 */

+ 2 - 1
pages/login/phone.wxml

@@ -5,7 +5,8 @@
 </van-cell>
 <van-cell>
     <text slot='icon' class="iconfont icon-a-wodemima" />
-    <input class="input" type="{{inputType}}" focus='{{focus}}' bindinput="inputPassword" value="{{password}}" placeholder="请输入密码" />
+    <input class="input" wx:if="{{inputType=='text'}}" focus='{{focus}}' bindinput="inputPassword" value="{{password}}" placeholder="请输入密码" />
+    <input class="input" wx:else type="password" focus='{{focus}}' bindinput="inputPassword" value="{{password}}" placeholder="请输入密码" />
     <view slot='right-icon' style="width: 90rpx;height: 22.4px; display: flex; justify-content: flex-end;" catchtap="changePasswordType">
         <image class="image" src="{{inputType=='password'?'/static/image/dp-none.svg':'/static/image/dp-show.svg'}}" />
     </view>