xyvcard-wechat-auth 0.0.1 → 0.0.3

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.
Files changed (72) hide show
  1. package/README.md +1 -1
  2. package/dist/api/auth/index.js +159 -1
  3. package/dist/api/auth/types.js +1 -1
  4. package/dist/api/dict/index.js +36 -1
  5. package/dist/api/dict/types.js +1 -1
  6. package/dist/api/dicts.js +53 -1
  7. package/dist/api/files/index.js +135 -1
  8. package/dist/api/files/types.js +1 -1
  9. package/dist/api/index.js +12 -1
  10. package/dist/api/myorgan/index.js +1 -1
  11. package/dist/api/myorgan/types.js +1 -1
  12. package/dist/api/types.d.ts +47 -0
  13. package/dist/api/types.js +9 -1
  14. package/dist/components/common/btn/footer-btn/index.js +34 -1
  15. package/dist/components/common/btn/footer-btn/index.wxml +1 -1
  16. package/dist/components/common/btn/footer-double-btn/index.js +67 -1
  17. package/dist/components/common/btn/footer-double-btn/index.wxml +4 -2
  18. package/dist/components/common/btn/footer-double-btn/index.wxss +1 -0
  19. package/dist/components/common/choose-avatar/index.js +82 -1
  20. package/dist/components/common/choose-avatar/index.wxss +1 -1
  21. package/dist/components/common/none-data/index.js +53 -1
  22. package/dist/components/common/none-data/index.wxml +2 -2
  23. package/dist/components/common/none-data/index.wxss +1 -1
  24. package/dist/components/common/popup/index.js +50 -1
  25. package/dist/components/common/popup/index.wxml +1 -1
  26. package/dist/components/common/popup/index.wxss +1 -1
  27. package/dist/components/common/search/index.d.ts +1 -0
  28. package/dist/components/common/search/index.js +55 -0
  29. package/dist/components/common/search/index.json +4 -0
  30. package/dist/components/common/search/index.wxml +7 -0
  31. package/dist/components/common/search/index.wxss +1 -0
  32. package/dist/components/common/top-navigation/index.d.ts +1 -0
  33. package/dist/components/common/top-navigation/index.js +49 -0
  34. package/dist/components/common/top-navigation/index.json +4 -0
  35. package/dist/components/common/top-navigation/index.wxml +6 -0
  36. package/dist/components/common/top-navigation/index.wxss +1 -0
  37. package/dist/components/jmash-half-login/index.d.ts +1 -0
  38. package/dist/components/jmash-half-login/index.js +105 -0
  39. package/dist/components/jmash-half-login/index.json +8 -0
  40. package/dist/components/jmash-half-login/index.wxml +46 -0
  41. package/dist/components/jmash-half-login/index.wxss +1 -0
  42. package/dist/components/jmash-login/index.d.ts +1 -0
  43. package/dist/components/jmash-login/index.js +99 -0
  44. package/dist/components/jmash-login/index.json +4 -0
  45. package/dist/components/jmash-login/index.wxml +16 -0
  46. package/dist/components/jmash-login/index.wxss +1 -0
  47. package/dist/constant.js +15 -1
  48. package/dist/index.d.ts +11 -2
  49. package/dist/index.js +25 -1
  50. package/dist/styles/{global.scss → index.scss} +11 -1
  51. package/dist/utils/auth.d.ts +3 -2
  52. package/dist/utils/auth.js +199 -1
  53. package/dist/utils/common.d.ts +16 -0
  54. package/dist/utils/common.js +112 -1
  55. package/dist/utils/config.d.ts +3 -1
  56. package/dist/utils/config.js +27 -1
  57. package/dist/utils/db.js +188 -1
  58. package/dist/utils/request.js +86 -1
  59. package/dist/utils/util.d.ts +9 -0
  60. package/dist/utils/util.js +88 -1
  61. package/package.json +4 -3
  62. package/xyvcard-wechat-auth-0.0.1.tgz +0 -0
  63. package/dist/app.d.ts +0 -0
  64. package/dist/app.js +0 -1
  65. package/dist/app.json +0 -24
  66. package/dist/app.wxss +0 -0
  67. package/dist/pages/index/index.d.ts +0 -0
  68. package/dist/pages/index/index.js +0 -1
  69. package/dist/pages/index/index.json +0 -7
  70. package/dist/pages/index/index.wxml +0 -4
  71. package/dist/pages/index/index.wxss +0 -0
  72. package/dist/sitemap.json +0 -7
@@ -1 +1,82 @@
1
- "use strict";const e=require("../../../utils/config.js"),t=require("../../../utils/auth.js"),a=require("../../../api/files/index.js");Component({properties:{value:{type:String,value:"",observer(){this.setData({avatar:this.properties.value?a.fileApi.imageUrl(this.properties.value,320,320,"trans"):this.data.avatar})}},logoImg:{type:String,value:"",observer(){this.setData({avatar:this.properties.logoImg?this.properties.logoImg:this.data.avatar})}},logo:{type:Boolean,value:!1,observer(){this.setData({avatar:this.properties.logo?this.data.defaultlogo:this.data.avatar})}},pathType:{type:Boolean,value:!1}},data:{resourceUrl:e.config.resourceUrl+"/images",avatar:e.config.resourceUrl+"/images/components/gray_head2x.png",defaultlogo:e.config.resourceUrl+"/images/components/gray_logo.png"},lifetimes:{attached(){""!=this.properties.value&&(this.data.avatar=this.properties.pathType?this.properties.value:a.fileApi.imageUrl(this.properties.value,320,320,"trans"),this.setData({avatar:this.data.avatar}))}},methods:{onChooseAvatar(e){const{avatarUrl:r}=e.detail;t.auth.checkLogin()?a.fileApi.uploadFile(r).then(e=>{this.triggerEvent("change",e,{}),this.setData({avatar:a.fileApi.imageUrl(e.data.fileSrc,320,320,"trans")})}):wx.showToast({title:"请先获取手机号!",duration:2e3})}}}),"object"==typeof exports&&"undefined"!=typeof module&&Object.keys(module.exports).forEach(function(e){exports[e]=module.exports[e]});
1
+ import { config } from "../../../utils/config.js";
2
+ import { fileApi } from "../../../api/files/index.js";
3
+ Component({
4
+ /**
5
+ * 组件的属性列表
6
+ */
7
+ properties: {
8
+ // 头像路径 form绑定的这个属性
9
+ value: {
10
+ type: String,
11
+ value: "",
12
+ observer() {
13
+ this.setData({
14
+ avatar: this.properties.value ? fileApi.imageUrl(this.properties.value, 320, 320, "trans") : this.data.avatar
15
+ });
16
+ }
17
+ },
18
+ // logo图片路径-全路径 编辑回显使用
19
+ logoImg: {
20
+ type: String,
21
+ value: "",
22
+ observer() {
23
+ this.setData({
24
+ avatar: this.properties.logoImg ? this.properties.logoImg : this.data.avatar
25
+ });
26
+ }
27
+ },
28
+ // 是否显示默认logo
29
+ logo: {
30
+ type: Boolean,
31
+ value: false,
32
+ observer() {
33
+ this.setData({
34
+ avatar: this.properties.logo ? this.data.defaultlogo : this.data.avatar
35
+ });
36
+ }
37
+ },
38
+ // 路径的类型,全路径状态为true,相对路径状态为false
39
+ pathType: {
40
+ type: Boolean,
41
+ value: false
42
+ }
43
+ },
44
+ /**
45
+ * 组件的初始数据
46
+ */
47
+ data: {
48
+ resourceUrl: config.resourceUrl + "/images",
49
+ // 默认头像图片
50
+ avatar: config.resourceUrl + "/images/components/gray_head2x.png",
51
+ // 默认logo图片
52
+ defaultlogo: config.resourceUrl + "/images/components/gray_logo.png"
53
+ },
54
+ /**
55
+ * 组件的生命周期
56
+ */
57
+ lifetimes: {
58
+ attached() {
59
+ if (this.properties.value != "") {
60
+ this.data.avatar = this.properties.pathType ? this.properties.value : fileApi.imageUrl(this.properties.value, 320, 320, "trans");
61
+ this.setData({
62
+ avatar: this.data.avatar
63
+ });
64
+ }
65
+ }
66
+ },
67
+ /**
68
+ * 组件的方法列表
69
+ */
70
+ methods: {
71
+ // 选择头像
72
+ onChooseAvatar(e) {
73
+ const { avatarUrl } = e.detail;
74
+ fileApi.uploadFile(avatarUrl).then((res) => {
75
+ this.triggerEvent("change", res, {});
76
+ this.setData({
77
+ avatar: fileApi.imageUrl(res.data.fileSrc, 320, 320, "trans")
78
+ });
79
+ });
80
+ }
81
+ }
82
+ });
@@ -1 +1 @@
1
- .image-box-bgc{position:relative;display:flex;align-items:center;justify-content:center;width:80px !important;height:80px;border:none !important;border-radius:10px;padding:0}.image-box-bgc .image-box-show{width:80px;height:80px}.image-box-bgc .select-image{position:absolute;width:24px;height:24px;bottom:0;right:0}
1
+ .image-box-bgc{position:relative;display:flex;align-items:center;justify-content:center;width:80px !important;height:80px;border:none;border-radius:10px;padding:0}.image-box-bgc .image-box-show{width:80px;height:80px}.image-box-bgc .select-image{position:absolute;width:24px;height:24px;bottom:0;right:0}.image-box-bgc[plain]{border:1px solid #e0e0e0}
@@ -1 +1,53 @@
1
- "use strict";const e=require("../../../utils/config.js");Component({properties:{marginTop:{type:Number,value:300},paddingTop:{type:Number,value:0},content:{type:String,value:"暂无数据"}},data:{resourceUrl:e.config.resourceUrl+"/images"},methods:{}}),"object"==typeof exports&&"undefined"!=typeof module&&Object.keys(module.exports).forEach(function(e){exports[e]=module.exports[e]});
1
+ import { config } from "../../../utils/config.js";
2
+ Component({
3
+ /**
4
+ * 组件的属性列表
5
+ */
6
+ properties: {
7
+ // 上外边距
8
+ marginTop: {
9
+ type: Number,
10
+ value: 300
11
+ },
12
+ // 上内边距
13
+ paddingTop: {
14
+ type: Number,
15
+ value: 0
16
+ },
17
+ // 文本内容
18
+ content: {
19
+ type: String,
20
+ value: "暂无数据"
21
+ },
22
+ // 图片的宽
23
+ imgWidth: {
24
+ type: String,
25
+ value: "auto"
26
+ },
27
+ // 图片的高
28
+ imgHeight: {
29
+ type: String,
30
+ value: "125px"
31
+ },
32
+ // 图片的路径
33
+ imgUrl: {
34
+ type: String,
35
+ value: "/components/contacts_nomore2x.png"
36
+ },
37
+ contentColor: {
38
+ type: String,
39
+ value: "#b6b6b6"
40
+ }
41
+ },
42
+ /**
43
+ * 组件的初始数据
44
+ */
45
+ data: {
46
+ // 图片资源路径/v1/file/path/wxapp/
47
+ resourceUrl: config.resourceUrl + "/images"
48
+ },
49
+ /**
50
+ * 组件的方法列表
51
+ */
52
+ methods: {}
53
+ });
@@ -1,4 +1,4 @@
1
1
  <view class="none-data" style="margin-top: {{ marginTop }}rpx; padding-top: {{ paddingTop }}rpx;">
2
- <image class="holder-image" src="{{ resourceUrl + '/components/contacts_nomore2x.png' }}" mode="heightFix" />
3
- <view class="holder-text">{{ content }}</view>
2
+ <image class="holder-image" src="{{ resourceUrl + imgUrl }}" mode="heightFix" style="width: {{ imgWidth }};height: {{ imgHeight }};" />
3
+ <view class="holder-text" style="color: {{ contentColor }};">{{ content }}</view>
4
4
  </view>
@@ -1 +1 @@
1
- .none-data{display:flex;align-items:center;justify-content:center;flex-direction:column}.none-data .holder-image{width:auto;height:250rpx}.none-data .holder-text{font-size:30rpx;color:#b6b6b6;position:relative;top:-30rpx}
1
+ .none-data{display:flex;align-items:center;justify-content:center;flex-direction:column}.none-data .holder-text{font-size:14px}
@@ -1 +1,50 @@
1
- "use strict";const e=require("../../../utils/config.js");Component({properties:{show:{type:Boolean,value:!1},title:{type:String,value:""},titleShow:{type:Boolean,value:!1},height:{type:String,value:"300px"}},data:{resourceUrl:e.config.resourceUrl+"/images",closeModel:!1,titleShow:!0},methods:{closePopup(){this.triggerEvent("close",null,{})}}}),"object"==typeof exports&&"undefined"!=typeof module&&Object.keys(module.exports).forEach(function(e){exports[e]=module.exports[e]});
1
+ import { config } from "../../../utils/config.js";
2
+ Component({
3
+ /**
4
+ * 组件的属性列表
5
+ */
6
+ properties: {
7
+ // 是否显示
8
+ show: {
9
+ type: Boolean,
10
+ value: false
11
+ },
12
+ // 标题
13
+ title: {
14
+ type: String,
15
+ value: ""
16
+ },
17
+ // 是否显示标题
18
+ titleShow: {
19
+ type: Boolean,
20
+ value: false
21
+ },
22
+ // 高
23
+ height: {
24
+ type: String,
25
+ value: "300px"
26
+ },
27
+ // 背景色
28
+ backColor: {
29
+ type: String,
30
+ value: "#fff"
31
+ }
32
+ },
33
+ /**
34
+ * 组件的初始数据
35
+ */
36
+ data: {
37
+ resourceUrl: config.resourceUrl + "/images",
38
+ // 是否显示
39
+ closeModel: false,
40
+ titleShow: true
41
+ },
42
+ /**
43
+ * 组件的方法列表
44
+ */
45
+ methods: {
46
+ closePopup() {
47
+ this.triggerEvent("close", null, {});
48
+ }
49
+ }
50
+ });
@@ -1,5 +1,5 @@
1
1
  <view class="mask-box" wx:if="{{ show }}"></view>
2
- <view class="mask-popup" wx:if="{{ show }}" style="height: {{ height }}">
2
+ <view class="mask-popup" wx:if="{{ show }}" style="height: {{ height }}; background-color: {{ backColor }};">
3
3
  <view class="popup-title" titleShow="{{ titleShow }}">
4
4
  {{ title }}
5
5
  <image mode="widthFix" src="{{ resourceUrl + '/icon_image/close_circle2x.png' }}" class="close-icon" bind:tap="closePopup"></image>
@@ -1 +1 @@
1
- .mask-box{position:fixed;left:0;top:0;bottom:0;right:0;width:100%;background-color:rgba(0,0,0,.5);z-index:99999}.mask-popup{position:fixed;bottom:0;left:0;background-color:#fff;border-top-left-radius:25px;border-top-right-radius:25px;padding:10px 4% 30px 4%;width:92%;z-index:99999}.mask-popup .popup-title{color:#333;font-size:15px;padding:10px 0;font-weight:bold;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ebebeb}.mask-popup .popup-title .close-icon{width:20px}
1
+ .mask-box{position:fixed;left:0;top:0;bottom:0;right:0;width:100%;background-color:rgba(0,0,0,.5);z-index:99999}.mask-popup{position:fixed;bottom:0;left:0;border-top-left-radius:25px;border-top-right-radius:25px;padding:10px 4% 30px 4%;width:92%;z-index:99999}.mask-popup .popup-title{color:#333;font-size:14px;padding:10px 0;font-weight:bold;display:flex;align-items:center;justify-content:space-between}.mask-popup .popup-title .close-icon{width:20px}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import { config } from "../../../utils/config.js";
2
+ Component({
3
+ /**
4
+ * 组件的属性列表
5
+ */
6
+ properties: {
7
+ placeholder: {
8
+ type: String,
9
+ value: ""
10
+ },
11
+ disabled: {
12
+ type: Boolean,
13
+ value: false
14
+ },
15
+ // 是否显示右侧内容
16
+ isSearchBtn: {
17
+ type: Boolean,
18
+ value: false
19
+ },
20
+ // value值
21
+ likeName: {
22
+ type: String,
23
+ value: ""
24
+ },
25
+ // 背景色
26
+ backColor: {
27
+ type: String,
28
+ value: ""
29
+ },
30
+ // 是否有阴影
31
+ isBoxShadow: {
32
+ type: Boolean,
33
+ value: true
34
+ }
35
+ },
36
+ /**
37
+ * 组件的初始数据
38
+ */
39
+ data: {
40
+ resourceUrl: config.resourceUrl + "/images"
41
+ },
42
+ /**
43
+ * 组件的方法列表
44
+ */
45
+ methods: {
46
+ handleInput(e) {
47
+ const { value } = e.detail;
48
+ this.triggerEvent("handleSearch", value);
49
+ },
50
+ // 一般用于点击搜索框跳转到搜索页
51
+ handleTap() {
52
+ this.triggerEvent("click");
53
+ }
54
+ }
55
+ });
@@ -0,0 +1,4 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
+ }
@@ -0,0 +1,7 @@
1
+ <view class="search-box" style="box-shadow: {{ isBoxShadow ? '0px 3px 3px 0px rgba(40, 65, 91, 0.1);' : '0px' }}">
2
+ <image src="{{ resourceUrl + '/icon_image/icon_search.png' }}" class="search-icon"></image>
3
+ <input class="search-input" style="background-color: {{ backColor }}; width: {{ isSearchBtn ? '60%' : '100%' }}; {{ isSearchBtn ? '' : 'padding-right: 20px' }}" placeholder="{{ placeholder }}" disabled="{{ disabled }}" value="{{ likeName }}" bindinput="handleInput" bind:tap="handleTap" />
4
+ <view class="search-btn" wx:if="{{ isSearchBtn }}">
5
+ <slot></slot>
6
+ </view>
7
+ </view>
@@ -0,0 +1 @@
1
+ .search-box{position:relative;width:100%;border-radius:25px;background-color:#fff;display:flex;justify-content:space-between;align-items:center;height:35px;box-sizing:border-box;overflow:hidden}.search-box .search-input{height:35px;color:#6b7280;font-size:14px;padding-left:40px}.search-box .search-icon{width:20px;height:20px;position:absolute;left:10px;transform:translate(0, -50%);top:50%}.search-box .search-btn{padding-right:3%}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,49 @@
1
+ import { config } from "../../../utils/config.js";
2
+ import { getHeight } from "../../../utils/common.js";
3
+ Component({
4
+ /**
5
+ * 组件的属性列表
6
+ */
7
+ properties: {
8
+ // 标题
9
+ title: {
10
+ type: String,
11
+ value: ""
12
+ },
13
+ // 左侧icon图标 跳转到查看消息页面
14
+ isLeftIcon: {
15
+ type: Boolean,
16
+ value: true
17
+ }
18
+ },
19
+ /**
20
+ * 组件的初始数据
21
+ */
22
+ data: {
23
+ resourceUrl: config.resourceUrl + "/images",
24
+ // 样式控制对象
25
+ style: {
26
+ // 导航栏的高度
27
+ height: getHeight().MenuButtonBottom - getHeight().MenuButtonTop,
28
+ // 标题顶部内边距
29
+ titlePaddingTop: getHeight().MenuButtonBounding / 10,
30
+ // 导航栏顶部内边距
31
+ paddingTop: getHeight().MenuButtonTop,
32
+ // 存储当前页面滚动的高度
33
+ pageScrollTop: 0,
34
+ // 胶囊球的宽度
35
+ buttonWidth: getHeight().MenuButtonWidth,
36
+ // 背景色
37
+ color: ""
38
+ }
39
+ },
40
+ /**
41
+ * 组件的方法列表
42
+ */
43
+ methods: {
44
+ // 返回
45
+ handleBack() {
46
+ this.triggerEvent("eventBackTo");
47
+ }
48
+ }
49
+ });
@@ -0,0 +1,4 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
+ }
@@ -0,0 +1,6 @@
1
+ <view style="background-color: {{ style.color }};">
2
+ <view class="top-navigation" style="padding-top: {{ style.paddingTop }}px; height: {{ style.height }}px;">
3
+ <image src="{{ resourceUrl + '/member/arrow-left.png' }}" class="back-icon" wx:if="{{ isLeftIcon }}" bind:tap="handleBack"></image>
4
+ <text class="title">{{ title }}</text>
5
+ </view>
6
+ </view>
@@ -0,0 +1 @@
1
+ .top-navigation{display:flex;align-items:center;padding:0 10px}.top-navigation .back-icon{width:13px;height:21px}.top-navigation .title{flex:1;text-align:center;font-size:14px}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,105 @@
1
+ import { auth } from "../../utils/auth.js";
2
+ import { config } from "../../utils/config.js";
3
+ Component({
4
+ /**
5
+ * 组件的属性列表
6
+ */
7
+ properties: {
8
+ show: {
9
+ type: Boolean,
10
+ value: false,
11
+ observer() {
12
+ this.setData({
13
+ isShow: this.properties.show
14
+ });
15
+ }
16
+ }
17
+ },
18
+ /**
19
+ * 组件的初始数据
20
+ */
21
+ data: {
22
+ resourceUrl: config.resourceUrl + "/images",
23
+ avatar: config.resourceUrl + "/images/components/gray_head2x.png",
24
+ isShow: false,
25
+ // 是否勾选协议
26
+ isCheckBox: false,
27
+ // 微信姓名
28
+ nameValue: "",
29
+ // 检验是否通过
30
+ isValidate: false
31
+ },
32
+ /**
33
+ * 组件的方法列表
34
+ */
35
+ methods: {
36
+ onClose: function() {
37
+ this.setData({ isShow: false });
38
+ this.triggerEvent("close", this.data.isShow);
39
+ },
40
+ // 协议勾选方法
41
+ onChange: function() {
42
+ this.data.isCheckBox = !this.data.isCheckBox;
43
+ let res = this.validate();
44
+ this.setData({ isCheckBox: this.data.isCheckBox, isValidate: res.validate });
45
+ },
46
+ onLogin: function() {
47
+ let res = this.validate();
48
+ if (!res.validate) {
49
+ wx.showToast({
50
+ icon: "error",
51
+ title: res.message,
52
+ duration: 2e3
53
+ });
54
+ return;
55
+ }
56
+ },
57
+ // 获取微信头像
58
+ onChooseAvatar: function(e) {
59
+ const { avatarUrl } = e.detail;
60
+ this.setData({ avatar: avatarUrl });
61
+ },
62
+ // 手机号授权登录
63
+ wxPhoneLogin: function(event) {
64
+ if (event.detail.errMsg === "getPhoneNumber:ok") {
65
+ auth.phoneCodeLogin(event.detail.code, this.data.nameValue).then((resp) => {
66
+ if (resp.status) {
67
+ this.triggerEvent("status", resp.status);
68
+ this.onClose();
69
+ }
70
+ });
71
+ }
72
+ },
73
+ // 输入姓名
74
+ bindKeyInput: function(e) {
75
+ var _a;
76
+ this.data.nameValue = (_a = e.detail) == null ? void 0 : _a.value;
77
+ let res = this.validate();
78
+ this.setData({ nameValue: this.data.nameValue, isValidate: res.validate });
79
+ },
80
+ // 校验
81
+ validate() {
82
+ if (!this.data.isCheckBox) {
83
+ return { validate: false, message: "是否已阅读协议" };
84
+ }
85
+ if (!this.data.nameValue) {
86
+ return { validate: false, message: "请输入姓名" };
87
+ }
88
+ return { validate: true, message: "" };
89
+ },
90
+ // 跳转隐私协议
91
+ goInfo(e) {
92
+ var _a;
93
+ const id = (_a = e.currentTarget) == null ? void 0 : _a.id;
94
+ if (id == "0") {
95
+ wx.navigateTo({
96
+ url: "/pages/my/system-agreement/index"
97
+ });
98
+ } else if (id == "1") {
99
+ wx.navigateTo({
100
+ url: "/pages/my/system-privacy/index"
101
+ });
102
+ }
103
+ }
104
+ }
105
+ });
@@ -0,0 +1,8 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "van-popup": "@vant/weapp/popup/index",
5
+ "van-checkbox": "@vant/weapp/checkbox/index",
6
+ "van-checkbox-group": "@vant/weapp/checkbox-group/index"
7
+ }
8
+ }
@@ -0,0 +1,46 @@
1
+ <!--components/jmash-half-login/index.wxml-->
2
+ <!-- 授权登录 -->
3
+ <van-popup z-index="999999" show="{{ isShow }}" close-on-click-overlay="{{ false }}" round position="bottom" custom-style="height: 830rpx;" bind:close="onClose" custom-class="vcard-login-popup">
4
+
5
+ <view class="custom-title">
6
+ <view class="title-left">
7
+ <view class="left-title">授权登录</view>
8
+ <view class="left-logo">
9
+ <image class="logo-image" src="{{ resourceUrl + '/logo/logo.png' }}" mode="" />
10
+ <view class="logo-text">{{ config.name }}·申请使用</view>
11
+ </view>
12
+ </view>
13
+ <view class="title-right" bind:tap="onClose">
14
+ <image class="title-image" src="{{ resourceUrl + '/icon_image/close_circle2x.png' }}" mode="widthFix" />
15
+ </view>
16
+ </view>
17
+
18
+ <view class="custom-main">
19
+ <view class="main-msg">
20
+ <view class="msg-itme">
21
+ <view class="item-title">头像</view>
22
+ <button plain class="item-btn" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
23
+ <image class="item-image" src="{{ avatar }}" mode="widthFix" />
24
+ </button>
25
+ </view>
26
+ <view class="msg-itme">
27
+ <view class="item-title">姓名</view>
28
+ <input bind:change="bindKeyInput" value="{{ nameValue }}" class="item-input" type="nickname" placeholder="请输入姓名" />
29
+ </view>
30
+ </view>
31
+
32
+ <view class="main-check-agreement">
33
+ <van-checkbox label-class="main-check-agreement-text" value="{{ isCheckBox }}" icon-size="14px" shape="square" bind:change="onChange">
34
+ <!-- 已阅读《用户使用协议》《隐私权政策》 -->
35
+ 已阅读
36
+ <text id="0" catch:tap="goInfo">《用户使用协议》</text> <text id="1" catch:tap="goInfo">《隐私权政策》</text>
37
+ </van-checkbox>
38
+ </view>
39
+
40
+ <!-- 未勾选用户协议 -->
41
+ <button wx:if="{{ !isValidate }}" plain class="main-login-btn" bind:tap="onLogin">授权登录</button>
42
+ <!-- 已勾选用户协议 -->
43
+ <button wx:else plain class="main-login-btn" open-type="getPhoneNumber" bind:getphonenumber="wxPhoneLogin">授权登录</button>
44
+ <view class="main-login-cencl" bind:tap="onClose">取消</view>
45
+ </view>
46
+ </van-popup>
@@ -0,0 +1 @@
1
+ .vcard-login-popup{background-color:#fff !important;max-height:100vh}.vcard-login-popup .custom-title{display:flex;align-items:center;justify-content:space-between;padding:47rpx 40rpx 0 40rpx;margin-bottom:70rpx}.vcard-login-popup .custom-title .title-left{display:flex;align-items:center;gap:20rpx}.vcard-login-popup .custom-title .title-left .left-title{font-weight:600;font-size:30rpx;color:#333}.vcard-login-popup .custom-title .title-left .left-logo{display:flex;align-items:center}.vcard-login-popup .custom-title .title-left .left-logo .logo-image{width:36rpx;height:36rpx}.vcard-login-popup .custom-title .title-left .left-logo .logo-text{display:flex;align-items:center;justify-content:center;height:100%;font-weight:400;font-size:26rpx;color:#333}.vcard-login-popup .custom-title .title-right{padding:47rpx 40rpx;position:absolute;top:0;right:0}.vcard-login-popup .custom-title .title-right .title-image{width:35rpx;height:35rpx}.vcard-login-popup .custom-main{padding:0 30rpx}.vcard-login-popup .custom-main .main-msg{display:flex;flex-direction:column;margin-bottom:86rpx}.vcard-login-popup .custom-main .main-msg .msg-itme{display:flex;justify-content:space-between;align-items:center;padding:30rpx 24rpx;height:50rpx;border-bottom:1px solid #f5f5f5;font-size:28rpx;color:#333}.vcard-login-popup .custom-main .main-msg .msg-itme .item-title{font-weight:500}.vcard-login-popup .custom-main .main-msg .msg-itme .item-input{width:150rpx}.vcard-login-popup .custom-main .main-msg .msg-itme .item-btn{margin:0;padding:0;border:none;background-color:rgba(0,0,0,0)}.vcard-login-popup .custom-main .main-msg .msg-itme .item-btn .item-image{width:70rpx;height:70rpx;border-radius:10rpx}.vcard-login-popup .custom-main .main-check-agreement{display:flex;justify-content:center;align-items:center;margin-top:50rpx;margin-bottom:40rpx}.vcard-login-popup .custom-main .main-check-agreement .main-check-agreement-text{font-weight:400;font-size:24rpx;color:#0551ff}.vcard-login-popup .custom-main .main-login-btn{display:flex;justify-content:center;align-items:center;background:#0551ff;height:90rpx;border-radius:45rpx;font-weight:600;font-size:30rpx;color:#fff;margin-bottom:30rpx;border:none}.vcard-login-popup .custom-main .main-login-cencl{display:flex;justify-content:center;align-items:center;height:90rpx;border:2rpx solid #c2c2c2;border-radius:45rpx;font-weight:600;font-size:30rpx}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,99 @@
1
+ import { config } from "../../utils/config.js";
2
+ import { auth } from "../../utils/auth.js";
3
+ Component({
4
+ /**
5
+ * 组件的属性列表
6
+ */
7
+ properties: {
8
+ // LOGO地址
9
+ logoUrl: {
10
+ type: String,
11
+ value: config.resourceUrl + "/images/logo.png"
12
+ },
13
+ //背景地址
14
+ loginBgUrl: {
15
+ type: String,
16
+ value: config.resourceUrl + "/images/login_bg.png"
17
+ },
18
+ //登录后跳转页面
19
+ backurl: {
20
+ type: String,
21
+ value: "/pages/home/index"
22
+ },
23
+ //登录后调转是否是Tabbar
24
+ tabbar: {
25
+ type: Boolean,
26
+ value: true
27
+ },
28
+ //遮罩层效果
29
+ isShowModel: {
30
+ type: Boolean,
31
+ value: false
32
+ }
33
+ },
34
+ /**
35
+ * 组件的初始数据
36
+ */
37
+ data: {
38
+ // 同意协议
39
+ agreeStatus: false
40
+ },
41
+ /**
42
+ * 组件的方法列表
43
+ */
44
+ methods: {
45
+ // 协议勾选事件
46
+ agreeChange() {
47
+ this.setData({
48
+ agreeStatus: !this.data.agreeStatus
49
+ });
50
+ },
51
+ // 手机号授权登录
52
+ wxPhoneLogin(event) {
53
+ let that = this;
54
+ if (!this.data.agreeStatus) {
55
+ wx.showModal({
56
+ title: "提示",
57
+ content: "您是否已阅读《用户使用协议》《隐私权政策》?",
58
+ success(res) {
59
+ if (res.confirm) {
60
+ that.setData({ agreeStatus: true });
61
+ } else if (res.cancel) {
62
+ return;
63
+ }
64
+ }
65
+ });
66
+ return;
67
+ }
68
+ if (event.detail.errMsg === "getPhoneNumber:ok") {
69
+ console.log(event.detail.code);
70
+ auth.phoneCodeLogin(event.detail.code).then((resp) => {
71
+ console.log(resp);
72
+ if (resp.status == false) {
73
+ wx.showToast({
74
+ title: resp.message ? resp.message : "登录失败联系管理员",
75
+ icon: "none",
76
+ duration: 2e3
77
+ });
78
+ return;
79
+ }
80
+ if (this.data.tabbar) {
81
+ wx.switchTab({
82
+ url: this.data.backurl
83
+ });
84
+ } else {
85
+ wx.navigateTo({
86
+ url: this.data.backurl
87
+ });
88
+ }
89
+ });
90
+ } else {
91
+ wx.showToast({
92
+ title: "您已取消授权",
93
+ icon: "none",
94
+ duration: 2e3
95
+ });
96
+ }
97
+ }
98
+ }
99
+ });
@@ -0,0 +1,4 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
+ }
@@ -0,0 +1,16 @@
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>《用户使用协议》《隐私权政策》</text>
12
+ </label>
13
+ </radio-group>
14
+ <view class="tips_box">温馨提示:{{config.name}}手机号授权登录。</view>
15
+ </view>
16
+ </view>