xyvcard-wechat-auth 0.0.15 → 0.0.17

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.
@@ -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: {
@@ -77,13 +85,13 @@ Component({
77
85
  });
78
86
  return;
79
87
  }
80
- if (this.data.tabbar) {
88
+ if (this.properties.tabbar) {
81
89
  wx.switchTab({
82
- url: this.data.backurl
90
+ url: this.properties.backurl
83
91
  });
84
92
  } else {
85
93
  wx.navigateTo({
86
- url: this.data.backurl
94
+ url: this.properties.backurl
87
95
  });
88
96
  }
89
97
  });
@@ -99,15 +107,7 @@ Component({
99
107
  goInfo(e) {
100
108
  var _a;
101
109
  const id = (_a = e.currentTarget) == null ? void 0 : _a.id;
102
- if (id == "0") {
103
- wx.navigateTo({
104
- url: "/pages/cms/agreement/index"
105
- });
106
- } else if (id == "1") {
107
- wx.navigateTo({
108
- url: "/pages/cms/policy/index"
109
- });
110
- }
110
+ this.triggerEvent("policy", id);
111
111
  }
112
112
  }
113
113
  });
@@ -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.15",
3
+ "version": "0.0.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",