weapps-plugin-jingtong-verify 1.3.9 → 1.4.1

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 (47) hide show
  1. package/package.json +1 -1
  2. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.js +47 -0
  3. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.json +4 -0
  4. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxml +13 -0
  5. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxss +1 -0
  6. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.js +30 -0
  7. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.json +7 -0
  8. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxml +42 -0
  9. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxss +1 -0
  10. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.js +4 -0
  11. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.wxml +1 -1
  12. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.js +1 -0
  13. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.wxml +1 -0
  14. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.js +4 -0
  15. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.wxml +1 -1
  16. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.js +4 -0
  17. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.wxml +1 -1
  18. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.js +21 -0
  19. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.json +7 -0
  20. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxml +16 -0
  21. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxss +1 -0
  22. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-badge.wxss +41 -0
  23. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-cell.wxss +220 -0
  24. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-item.wxss +7 -0
  25. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-switch.wxss +176 -0
  26. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.js +1 -1
  27. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxss +1 -0
  28. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.js +4 -0
  29. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxml +2 -2
  30. package/weapps-plugin-jingtong-verify/i18n/rules.js +21 -8
  31. package/weapps-plugin-jingtong-verify/images/close-circle.png +0 -0
  32. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxml +4 -1
  33. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxss +15 -2
  34. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.js +156 -60
  35. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +2 -1
  36. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +99 -15
  37. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +40 -0
  38. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.js +1 -0
  39. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.js +21 -8
  40. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.js +178 -31
  41. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.json +2 -1
  42. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxml +132 -51
  43. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxss +46 -0
  44. package/weapps-plugin-jingtong-verify/utils/country.js +7 -1
  45. package/weapps-plugin-jingtong-verify/utils/request.js +89 -24
  46. package/weapps-plugin-jingtong-verify/utils/rules.js +101 -5
  47. package/weapps-plugin-jingtong-verify/utils/validate.js +26 -8
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "weapps-plugin-jingtong-verify",
3
3
  "pluginName": "weapps-plugin-jingtong-verify",
4
4
  "pluginType": "mp",
5
- "version": "1.3.9",
5
+ "version": "1.4.1",
6
6
  "description": "",
7
7
  "main": "sdk.js",
8
8
  "author": "tongyirenzheng",
@@ -0,0 +1,47 @@
1
+ // pages/g-badge/index.js
2
+ const badgePosition = 'none';
3
+ Component({
4
+ externalClasses: ['component-class'],
5
+ properties: {
6
+ count: {
7
+ type: [Number, String],
8
+ observer(newVal) {
9
+ this.isShowOverflowCount(newVal);
10
+ }
11
+ },
12
+ dot: {
13
+ type: Boolean,
14
+ value: false
15
+ },
16
+ overflowCount: {
17
+ type: Number,
18
+ value: 99
19
+ },
20
+ position: {
21
+ type: String,
22
+ value: badgePosition
23
+ }
24
+ },
25
+ data: {
26
+ showOverflowCount: false
27
+ },
28
+ methods: {
29
+ /**
30
+ * 如果是整型的话,判断是否达到最大值
31
+ *
32
+ * @param {(number | string)} value
33
+ */
34
+ isShowOverflowCount(value) {
35
+ if (typeof value === 'number' && value >= this.properties.overflowCount) {
36
+ this.setData({
37
+ showOverflowCount: true
38
+ });
39
+ }
40
+ else {
41
+ this.setData({
42
+ showOverflowCount: false
43
+ });
44
+ }
45
+ }
46
+ }
47
+ });
@@ -0,0 +1,4 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
+ }
@@ -0,0 +1,13 @@
1
+ <!--pages/g-badge/index.wxml-->
2
+ <view class="badge component-class badge--{{ dot?'dot':'normal' }} badge__position--{{ position }}">
3
+ <view wx:if="{{ dot }}">
4
+ </view>
5
+ <view wx:else>
6
+ <view wx:if="{{ showOverflowCount }}">
7
+ {{ overflowCount }}+
8
+ </view>
9
+ <view wx:else>
10
+ {{ count }}
11
+ </view>
12
+ </view>
13
+ </view>
@@ -0,0 +1 @@
1
+ @import '../static/style/components/g-badge';
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // pages/g-cell/index.js
4
+ const navigatorBehavior = require("../behaviors/navigator");
5
+ const iconBehavior = require("../behaviors/icon");
6
+ Component({
7
+ behaviors: [navigatorBehavior, iconBehavior],
8
+ externalClasses: ['component-class', 'prepend-class'],
9
+ options: {
10
+ multipleSlots: true
11
+ },
12
+ properties: {
13
+ label: String,
14
+ desc: String,
15
+ access: Boolean,
16
+ disabled: {
17
+ type: Boolean,
18
+ value: false
19
+ }
20
+ },
21
+ data: {},
22
+ methods: {
23
+ handleTap(e) {
24
+ if (!this.properties.disabled) {
25
+ this.navigator();
26
+ this.triggerEvent('tap', e.detail);
27
+ }
28
+ }
29
+ }
30
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "g-badge": "../g-badge/index",
5
+ "g-icon": "../g-icon/index"
6
+ }
7
+ }
@@ -0,0 +1,42 @@
1
+ <!-- pages/g-cell/index.wxml -->
2
+ <view class="cell component-class" aria-role="{{access || to ? 'button' : ''}}"
3
+ catch:tap="handleTap"
4
+ hover-class="{{ !disabled && (to || access) ? 'cell--active' : 'none' }}"
5
+ aria-label="{{label + (desc ? ' ' + desc : '') + (disabled ? '已禁用' : '')}}"
6
+ >
7
+ <view class="cell__wrap">
8
+ <view class="cell__content {{ disabled?'cell--disabled':'' }}">
9
+ <view class="cell__content__header">
10
+ <view class="cell__content__prepend prepend-class">
11
+ <slot name="prepend"></slot>
12
+ </view>
13
+ <view class="cell__content__icon" wx:if="{{iconType}}">
14
+ <g-icon type="{{iconType}}" size="{{iconSize}}" color="{{iconColor}}"/>
15
+ </view>
16
+ <view class="cell__content__wrap">
17
+ <!-- 固定格式的 cell -->
18
+ <view class="cell__content__label" aria-label="{{label}}">
19
+ {{ label }}
20
+ </view>
21
+ <view wx:if="{{ desc }}" aria-label="{{desc}}" class="cell__desc {{label ? '' : 'cell__desc--nolabel'}}">
22
+ <text>{{ desc }}</text>
23
+ </view>
24
+
25
+ <!-- 自由编写的 slot -->
26
+ <view>
27
+ <slot/>
28
+ <slot name="content" />
29
+ </view>
30
+ </view>
31
+ </view>
32
+ <view class="cell__content__footer {{ access || to ? '' : 'cell--no-access' }}">
33
+ <view class="cell__content__append {{ access || to ? '' : 'cell--no-access' }}">
34
+ <slot name="append"></slot>
35
+ </view>
36
+ </view>
37
+ </view>
38
+
39
+ <!-- 主要内容 -->
40
+ <view wx:if="{{ access || to }}" class="cell__access"></view>
41
+ </view>
42
+ </view>
@@ -0,0 +1 @@
1
+ @import '../static/style/components/g-cell';
@@ -23,6 +23,10 @@ Component({
23
23
  }
24
24
  },
25
25
  label: String,
26
+ _required: {
27
+ type: Boolean,
28
+ value: true
29
+ },
26
30
  actionText: {
27
31
  type: String,
28
32
  value: 'select'
@@ -1,4 +1,4 @@
1
- <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}">
1
+ <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" required="{{ _required }}">
2
2
  <view class="picker" bind:tap="open">
3
3
  <view class="picker__value {{_isEmpty ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">{{_displayName}}</view>
4
4
  <view class="picker__action">{{actionText}}</view>
@@ -7,6 +7,7 @@ Component({
7
7
  showQuestion: Boolean,
8
8
  label: String,
9
9
  disabled: Boolean,
10
+ required: Boolean,
10
11
  status: {
11
12
  type: String,
12
13
  observer(_status) {
@@ -3,6 +3,7 @@
3
3
  <view class="form-item__wrap {{disabled ? 'form-item__wrap--disabled' : ''}}">
4
4
  <view class="flex-row-start form-item__label" wx:if="{{label}}" aria-label="{{label}}">
5
5
  <text>{{label}}</text>
6
+ <text class="star" wx:if="{{ required }}">*</text>
6
7
  <image src="../../../images/question.png" mode="widthFix" catch:tap="showTip" class="question-icon" wx:if="{{ showQuestion }}" />
7
8
  </view>
8
9
  <slot />
@@ -28,6 +28,10 @@ Component({
28
28
  type: Boolean,
29
29
  value: false
30
30
  },
31
+ _required: {
32
+ type: Boolean,
33
+ value: true
34
+ },
31
35
  value: {
32
36
  type: String,
33
37
  value: '',
@@ -1,5 +1,5 @@
1
1
  <!--pages/g-input/index.wxml-->
2
- <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" static-item-class="{{icon === 'info'?'static-item':''}}" showQuestion="{{showQuestion}}" bind:showQuestionTip="showQuestionTip">
2
+ <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" static-item-class="{{icon === 'info'?'static-item':''}}" showQuestion="{{showQuestion}}" required="{{ _required }}" bind:showQuestionTip="showQuestionTip">
3
3
  <view class="{{icon === 'info'?'input__containerIcon':'input__container'}}">
4
4
  <view class="input__prepend" wx:if="{{prepend}}">
5
5
  <slot name="prepend" class="slot"/>
@@ -20,6 +20,10 @@ Component({
20
20
  type: String,
21
21
  value: '选择'
22
22
  },
23
+ _required: {
24
+ type: Boolean,
25
+ value: true
26
+ },
23
27
  range: {
24
28
  type: Array,
25
29
  value: [],
@@ -9,7 +9,7 @@
9
9
  bindcolumnchange="triggerColumnchange"
10
10
  >
11
11
  <view wx:if="{{type === 'formItem'}}">
12
- <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}">
12
+ <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" required="{{ _required }}">
13
13
  <view class="picker">
14
14
  <view class="picker__value {{_isEmpty ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">{{_displayName}}</view>
15
15
  <view class="picker__action" bind:tap="handleActionTap">{{actionText}}</view>
@@ -0,0 +1,21 @@
1
+ // pages/g-switch/index.js
2
+ Component({
3
+ properties: {
4
+ value: Boolean,
5
+ label: String,
6
+ desc: String,
7
+ disabled: Boolean,
8
+ showTip: Boolean
9
+ },
10
+ data: {},
11
+ methods: {
12
+ handleChange() {
13
+ if (!this.properties.disabled) {
14
+ wx.vibrateShort();
15
+ this.triggerEvent('change', {
16
+ value: !this.properties.value
17
+ });
18
+ }
19
+ }
20
+ }
21
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "g-form-item": "../g-form-item/index",
5
+ "g-cell": "../g-cell/index"
6
+ }
7
+ }
@@ -0,0 +1,16 @@
1
+ <!--pages/g-switch/index.wxml-->
2
+ <g-form-item disabled="{{disabled}}" component-class="form-item">
3
+ <view class="switch">
4
+ <view class="switch__header__label">{{label}}</view>
5
+ <view class="switch__widget" aria-role="button" catch:tap="handleChange"
6
+ aria-label="{{label + (value ? ' 开' : ' 关') + (disabled ? ' 已禁用' : '')}}">
7
+ <view class="switch__widget__container {{value ? 'switch__widget__container--checked': ''}}">
8
+ <view wx:if="{{ showTip }}">
9
+ <view class="switch-desc open-desc" wx:if="{{ value }}">填写</view>
10
+ <view class="switch-desc close-desc" wx:else>选填</view>
11
+ </view>
12
+ </view>
13
+ </view>
14
+ </view>
15
+ <view class="switch__header__desc" wx:if="{{desc}}">{{desc}}</view>
16
+ </g-form-item>
@@ -0,0 +1 @@
1
+ @import '../static/style/components/g-switch';
@@ -0,0 +1,41 @@
1
+ .badge {
2
+ background-color: #f13939;
3
+ box-sizing: border-box;
4
+ display: inline-block;
5
+ color: #fff;
6
+ white-space: nowrap;
7
+ text-align: center;
8
+ border: 2rpx solid transparent;
9
+ }
10
+
11
+ .badge--normal {
12
+ font-size: 30rpx;
13
+ line-height: 40rpx;
14
+ height: 48rpx;
15
+ min-width: 48rpx;
16
+ line-height: 48rpx;
17
+ padding-left: 12rpx;
18
+ padding-right: 12rpx;
19
+ border-radius: 24rpx;
20
+ }
21
+
22
+ .badge--dot {
23
+ width: 22rpx;
24
+ height: 22rpx;
25
+ border-radius: 50%;
26
+ }
27
+
28
+ .badge__position--left, .badge__position--right {
29
+ position: absolute;
30
+ top: 0;
31
+ }
32
+
33
+ .badge__position--left {
34
+ left: 0;
35
+ transform: translate(-50%, -50%);
36
+ }
37
+
38
+ .badge__position--right {
39
+ right: 0;
40
+ transform: translate(50%, -50%);
41
+ }
@@ -0,0 +1,220 @@
1
+ .table {
2
+ display: table;
3
+ table-layout: fixed;
4
+ width: 100%;
5
+ }
6
+
7
+ .colgroup {
8
+ display: table-column-group;
9
+ }
10
+
11
+ .col {
12
+ display: table-column;
13
+ }
14
+
15
+ .thead {
16
+ display: table-header-group;
17
+ }
18
+
19
+ .tbody {
20
+ display: table-row-group;
21
+ }
22
+
23
+ .tr {
24
+ display: table-row;
25
+ }
26
+
27
+ .th {
28
+ display: table-cell;
29
+ text-align: center;
30
+ word-break: break-all;
31
+ }
32
+
33
+ .td {
34
+ display: table-cell;
35
+ text-align: center;
36
+ word-break: break-all;
37
+ }
38
+
39
+ .border--top {
40
+ position: relative;
41
+ }
42
+
43
+ .border--top::after {
44
+ height: 1px;
45
+ width: 100%;
46
+ transform: scaleY(0.5);
47
+ left: 0;
48
+ right: 0;
49
+ content: '';
50
+ position: absolute;
51
+ background-color: #ebebeb;
52
+ top: 0;
53
+ }
54
+
55
+ .border--bottom {
56
+ position: relative;
57
+ }
58
+
59
+ .border--bottom::after {
60
+ height: 1px;
61
+ width: 100%;
62
+ transform: scaleY(0.5);
63
+ left: 0;
64
+ right: 0;
65
+ content: '';
66
+ position: absolute;
67
+ background-color: #ebebeb;
68
+ bottom: 0;
69
+ }
70
+
71
+ .border--left {
72
+ position: relative;
73
+ }
74
+
75
+ .border--left::after {
76
+ width: 100%;
77
+ width: 1px;
78
+ transform: scaleX(0.5);
79
+ top: 0;
80
+ bottom: 0;
81
+ content: '';
82
+ position: absolute;
83
+ background-color: #ebebeb;
84
+ left: 0;
85
+ }
86
+
87
+ .border--left {
88
+ position: relative;
89
+ }
90
+
91
+ .border--left::after {
92
+ width: 100%;
93
+ width: 1px;
94
+ transform: scaleX(0.5);
95
+ top: 0;
96
+ bottom: 0;
97
+ content: '';
98
+ position: absolute;
99
+ background-color: #ebebeb;
100
+ right: 0;
101
+ }
102
+
103
+ .cell__wrap {
104
+ margin-left: 40rpx;
105
+ margin-right: 40rpx;
106
+ padding-top: 36rpx;
107
+ padding-bottom: 36rpx;
108
+ position: relative;
109
+ }
110
+
111
+ .cell__content {
112
+ display: flex;
113
+ flex-direction: row;
114
+ justify-content: space-between;
115
+ align-items: center;
116
+ position: relative;
117
+ }
118
+
119
+ .cell__wrap::after {
120
+ height: 1px;
121
+ width: 100%;
122
+ transform: scaleY(0.5);
123
+ left: 0;
124
+ right: 0;
125
+ content: '';
126
+ position: absolute;
127
+ background-color: #ebebeb;
128
+ bottom: 0;
129
+ }
130
+
131
+ .cell__content__header {
132
+ display: flex;
133
+ flex-direction: row;
134
+ justify-content: flex-start;
135
+ align-items: center;
136
+ flex: 1;
137
+ }
138
+
139
+ .cell__content__wrap {
140
+ flex: 1;
141
+ }
142
+
143
+ .cell__content__prepend {
144
+ display: flex;
145
+ flex-direction: column;
146
+ justify-content: center;
147
+ align-items: center;
148
+ height: 48rpx;
149
+ }
150
+
151
+ .cell__content__label {
152
+ font-size: 36rpx;
153
+ line-height: 48rpx;
154
+ }
155
+
156
+ .cell__content__icon {
157
+ margin-right: 20rpx;
158
+ }
159
+
160
+ .cell__desc {
161
+ font-size: 26rpx;
162
+ line-height: 36rpx;
163
+ color: #999;
164
+ margin-top: 6rpx;
165
+ padding-right: 40rpx;
166
+ }
167
+
168
+ .cell__desc--nolabel {
169
+ margin-top: 0;
170
+ }
171
+
172
+ .cell__content__footer {
173
+ display: flex;
174
+ flex-direction: row;
175
+ justify-content: flex-start;
176
+ align-items: center;
177
+ position: relative;
178
+ padding-right: 18rpx;
179
+ }
180
+
181
+ .cell__content__append {
182
+ display: flex;
183
+ flex-direction: column;
184
+ justify-content: center;
185
+ align-items: center;
186
+ padding-right: 30rpx;
187
+ height: 48rpx;
188
+ }
189
+
190
+ .cell__access {
191
+ color: inherit;
192
+ }
193
+
194
+ .cell__access::after {
195
+ content: " ";
196
+ display: inline-block;
197
+ box-sizing: border-box;
198
+ height: 18rpx;
199
+ width: 18rpx;
200
+ border-width: 4rpx 4rpx 0 0;
201
+ border-color: #C7C7CC;
202
+ border-style: solid;
203
+ position: absolute;
204
+ top: 50%;
205
+ transform: translateY(-50%) matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
206
+ right: 0;
207
+ right: 6rpx;
208
+ }
209
+
210
+ .cell--no-access {
211
+ padding-right: 0;
212
+ }
213
+
214
+ .cell--disabled {
215
+ opacity: 0.3;
216
+ }
217
+
218
+ .cell--active {
219
+ background: #c4c4c4;
220
+ }
@@ -165,3 +165,10 @@
165
165
  .form-item__status-message--warn {
166
166
  color: #f13939;
167
167
  }
168
+
169
+ .star {
170
+ color: #f13939;
171
+ margin-left: 2rpx;
172
+ font-size: 30rpx;
173
+ font-weight: bold;
174
+ }