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.
@@ -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
- // LOGO地址
9
- logoUrl: {
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: config.resourceUrl + "/images/logo.png"
19
+ value: "#0551ff"
12
20
  },
13
- //背景地址
14
- loginBgUrl: {
21
+ // 协议样式
22
+ agreementStyle: {
15
23
  type: String,
16
- value: config.resourceUrl + "/images/login_bg.png"
24
+ value: "color: #0551ff"
17
25
  },
18
26
  //登录后跳转页面
19
27
  backurl: {
@@ -1,4 +1,6 @@
1
1
  {
2
2
  "component": true,
3
- "usingComponents": {}
3
+ "usingComponents": {
4
+ "auth-single-btn": "../common/auth-btn/single-btn/index"
5
+ }
4
6
  }
@@ -1,16 +1,12 @@
1
- <image mode="widthFix" src="{{ loginBgUrl }}" class="index_bj">
2
- </image>
3
- <view class="login_container">
4
- <image mode="widthFix" src="{{ logoUrl }}" class="login_logo"></image>
5
- <view class="login_box">
6
- <button class="login_btn" open-type="getPhoneNumber" bindgetphonenumber="wxPhoneLogin" wx:if="{{ agreeStatus }}">手机号授权登录</button>
7
- <button class="login_btn" bindtap="wxPhoneLogin" wx:else>手机号授权登录</button>
8
- <radio-group bindchange="agreeChange" class="protocol_agree">
9
- <label>
10
- <radio value="{{ agreeStatus }}" checked="{{ agreeStatus }}" color="#1669FE" />
11
- 已阅读<text id="0" catch:tap="goInfo">《用户使用协议》</text> <text id="1" catch:tap="goInfo">《隐私权政策》</text>
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
- .login_container{position:relative;margin-top:-35%;display:flex;flex-direction:column;align-items:center}.login_logo{width:250px}.login_box{border-top-left-radius:20px;border-top-right-radius:20px;background-color:#fff;padding:13% 3% 4%;margin-top:40px;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}.login_box .tips_box{color:#2563eb;font-size:12px;margin-top:40%}
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xyvcard-wechat-auth",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",