xyvcard-wechat-auth 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth-user/jmash-update-user/index.js +3 -7
- package/dist/components/jmash-login/index.js +15 -7
- package/dist/components/jmash-login/index.json +3 -1
- package/dist/components/jmash-login/index.wxml +11 -15
- package/dist/components/jmash-login/index.wxss +1 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ Component({
|
|
|
48
48
|
},
|
|
49
49
|
lifetimes: {
|
|
50
50
|
ready() {
|
|
51
|
-
if (this.data.form) {
|
|
51
|
+
if (Object.keys(this.data.form).length > 0) {
|
|
52
52
|
this.setData({
|
|
53
53
|
userInfo: {
|
|
54
54
|
...this.properties.form
|
|
@@ -57,12 +57,6 @@ Component({
|
|
|
57
57
|
} else {
|
|
58
58
|
this.getUserInfo();
|
|
59
59
|
}
|
|
60
|
-
this.setData({
|
|
61
|
-
userInfo: {
|
|
62
|
-
requestId: Math.random() * 10 + "",
|
|
63
|
-
updateMask: "nickName,avatar,realName"
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
60
|
}
|
|
67
61
|
},
|
|
68
62
|
/**
|
|
@@ -124,6 +118,8 @@ Component({
|
|
|
124
118
|
},
|
|
125
119
|
// 更新用户信息
|
|
126
120
|
updateUserInfo() {
|
|
121
|
+
this.data.userInfo.requestId = Math.random() * 10 + "";
|
|
122
|
+
this.data.userInfo.updateMask = "nickName,avatar,realName";
|
|
127
123
|
authApi.updateUserInfo(this.data.userInfo).then((res) => {
|
|
128
124
|
if (res.code == 200) {
|
|
129
125
|
db.userInfoStorage(res.data);
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { config } from "../../utils/config.js";
|
|
2
1
|
import { auth } from "../../utils/auth.js";
|
|
3
2
|
Component({
|
|
3
|
+
// 在组件定义时的选项中启用多slot支持
|
|
4
|
+
options: {
|
|
5
|
+
multipleSlots: true
|
|
6
|
+
},
|
|
4
7
|
/**
|
|
5
8
|
* 组件的属性列表
|
|
6
9
|
*/
|
|
7
10
|
properties: {
|
|
8
|
-
//
|
|
9
|
-
|
|
11
|
+
// 登录按钮样式
|
|
12
|
+
loginStyle: {
|
|
13
|
+
type: String,
|
|
14
|
+
value: "width: 100%;background-color: #2563EB;color: #fff;font-size: 15px;"
|
|
15
|
+
},
|
|
16
|
+
// 单选框选中的颜色
|
|
17
|
+
checkedColor: {
|
|
10
18
|
type: String,
|
|
11
|
-
value:
|
|
19
|
+
value: "#0551ff"
|
|
12
20
|
},
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
// 协议样式
|
|
22
|
+
agreementStyle: {
|
|
15
23
|
type: String,
|
|
16
|
-
value:
|
|
24
|
+
value: "color: #0551ff"
|
|
17
25
|
},
|
|
18
26
|
//登录后跳转页面
|
|
19
27
|
backurl: {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</label>
|
|
13
|
-
</radio-group>
|
|
14
|
-
<view class="tips_box">温馨提示:{{config.name}}手机号授权登录。</view>
|
|
15
|
-
</view>
|
|
1
|
+
<slot name="before"></slot>
|
|
2
|
+
<view class="login_box">
|
|
3
|
+
<button open-type="getPhoneNumber" style="{{ loginStyle }}" bindgetphonenumber="wxPhoneLogin" wx:if="{{ agreeStatus }}">手机号授权登录</button>
|
|
4
|
+
<button bind:tap="wxPhoneLogin" style="{{ loginStyle }}" wx:else>手机号授权登录</button>
|
|
5
|
+
<radio-group bindchange="agreeChange" class="protocol_agree">
|
|
6
|
+
<label>
|
|
7
|
+
<radio value="{{ agreeStatus }}" checked="{{ agreeStatus }}" color="{{ checkedColor }}" />
|
|
8
|
+
已阅读<text id="0" style="{{ agreementStyle }}" catch:tap="goInfo">《用户使用协议》</text> <text id="1" style="{{ agreementStyle }}" catch:tap="goInfo">《隐私权政策》</text>
|
|
9
|
+
</label>
|
|
10
|
+
</radio-group>
|
|
11
|
+
<slot name="after"></slot>
|
|
16
12
|
</view>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.login_box{padding:13% 3% 4%;display:flex;flex-direction:column;align-items:center}.login_box .login_btn{background-color:#2563eb;color:#fff;padding:16px 0;width:100%;font-size:14px}.login_box .protocol_agree{color:#999;font-size:14px;margin-top:20px}.login_box .protocol_agree text{color:#2563eb}
|