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.
- package/package.json +1 -1
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.js +47 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.json +4 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxml +13 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxss +1 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.js +30 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.json +7 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxml +42 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxss +1 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.js +4 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.wxml +1 -1
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.js +1 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.wxml +1 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.js +4 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.wxml +1 -1
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.js +4 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.wxml +1 -1
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.js +21 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.json +7 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxml +16 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxss +1 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-badge.wxss +41 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-cell.wxss +220 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-item.wxss +7 -0
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-switch.wxss +176 -0
- package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.js +1 -1
- package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxss +1 -0
- package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.js +4 -0
- package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxml +2 -2
- package/weapps-plugin-jingtong-verify/i18n/rules.js +21 -8
- package/weapps-plugin-jingtong-verify/images/close-circle.png +0 -0
- package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxml +4 -1
- package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxss +15 -2
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.js +156 -60
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +2 -1
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +99 -15
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +40 -0
- package/weapps-plugin-jingtong-verify/pages/log-off/log-off.js +1 -0
- package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.js +21 -8
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.js +178 -31
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.json +2 -1
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxml +132 -51
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxss +46 -0
- package/weapps-plugin-jingtong-verify/utils/country.js +7 -1
- package/weapps-plugin-jingtong-verify/utils/request.js +89 -24
- package/weapps-plugin-jingtong-verify/utils/rules.js +101 -5
- package/weapps-plugin-jingtong-verify/utils/validate.js +26 -8
|
@@ -24,10 +24,17 @@
|
|
|
24
24
|
value="{{ formData.cid_type }}"
|
|
25
25
|
label="证件类型"
|
|
26
26
|
bind:change="handleChange"
|
|
27
|
+
required
|
|
27
28
|
range="{{ cidTypeRange }}"
|
|
28
29
|
></g-picker>
|
|
29
30
|
</view>
|
|
30
31
|
|
|
32
|
+
<!-- 外国人提示 -->
|
|
33
|
+
<view class="foreign-tip" wx:if="{{ formData.cid_type === '111' && showForeignTip }}">
|
|
34
|
+
<text>For foreign nationals, please click here to select International passport.</text>
|
|
35
|
+
<image src="../../images/close-circle.png" mode="widthFix" bind:tap="closeForeignTip" />
|
|
36
|
+
</view>
|
|
37
|
+
|
|
31
38
|
<!-- 银行卡核验(港澳/台居住证) -->
|
|
32
39
|
<view wx:if="{{ currentAuthType === 'cardAuth' }}">
|
|
33
40
|
<view class="form-tip">
|
|
@@ -87,7 +94,7 @@
|
|
|
87
94
|
placeholder="请输入本人姓名"
|
|
88
95
|
value="{{ formData.strName || formData.name }}"
|
|
89
96
|
clearable="{{ false }}"
|
|
90
|
-
showEye="{{
|
|
97
|
+
showEye="{{ formData.name }}"
|
|
91
98
|
isOpen="{{ !formData.strName }}"
|
|
92
99
|
bind:change="handleChange"
|
|
93
100
|
showQuestion="{{ true }}"
|
|
@@ -104,7 +111,7 @@
|
|
|
104
111
|
placeholder="请输入本人证件号码"
|
|
105
112
|
value="{{ formData.strCid || formData.id_card_number }}"
|
|
106
113
|
clearable="{{ false }}"
|
|
107
|
-
showEye="{{
|
|
114
|
+
showEye="{{ formData.id_card_number }}"
|
|
108
115
|
isOpen="{{ !formData.strCid }}"
|
|
109
116
|
bind:change="handleChange"
|
|
110
117
|
showQuestion="{{ true }}"
|
|
@@ -165,38 +172,115 @@
|
|
|
165
172
|
</view>
|
|
166
173
|
</view>
|
|
167
174
|
|
|
175
|
+
<!-- 港澳/台通行证、永居证、华侨护照 -->
|
|
168
176
|
<view wx:else>
|
|
177
|
+
<!-- 证件号码 -->
|
|
169
178
|
<view class="form-item-wrap">
|
|
170
179
|
<g-input
|
|
171
180
|
id="id_card_number"
|
|
172
|
-
data-star="strCid"
|
|
173
181
|
label="证件号码"
|
|
174
182
|
placeholder="请输入本人证件号码"
|
|
175
|
-
value="{{ formData.
|
|
183
|
+
value="{{ formData.id_card_number }}"
|
|
176
184
|
clearable="true"
|
|
177
185
|
bind:change="handleChange"
|
|
178
186
|
/>
|
|
179
187
|
</view>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
|
|
189
|
+
<!-- 证件有效期: 港澳通行证、台湾通行证、华侨护照-->
|
|
190
|
+
<view wx:if="{{ formData.cid_type !== '553' }}">
|
|
191
|
+
<view class="form-item-wrap">
|
|
192
|
+
<g-picker
|
|
193
|
+
id="cid_expire_date"
|
|
194
|
+
mode="date"
|
|
195
|
+
value="{{ formData.cid_expire_date }}"
|
|
196
|
+
label="证件有效期"
|
|
197
|
+
placeholder="请选择证件有效期截止日期"
|
|
198
|
+
bind:change="handleChange"
|
|
199
|
+
>
|
|
200
|
+
</g-picker>
|
|
201
|
+
</view>
|
|
189
202
|
</view>
|
|
190
203
|
|
|
191
|
-
|
|
204
|
+
<!-- 国籍:台湾通行证和华侨没有 -->
|
|
205
|
+
<view class="form-item-wrap" wx:if="{{ formData.cid_type !== '511' && formData.cid_type !== '414' }}">
|
|
192
206
|
<g-picker
|
|
193
207
|
id="nation"
|
|
194
208
|
value="{{ formData.nation_name }}"
|
|
195
209
|
label="国籍"
|
|
196
210
|
mode="none"
|
|
197
|
-
|
|
211
|
+
placeholder="请选择国籍"
|
|
212
|
+
bind:tap="handleNationTap"
|
|
213
|
+
actionText="选择"
|
|
198
214
|
/>
|
|
199
215
|
</view>
|
|
216
|
+
|
|
217
|
+
<!-- 三证照:港澳通行证、台湾通行证、华侨护照 -->
|
|
218
|
+
<view wx:if="{{ formData.cid_type !== '553' }}">
|
|
219
|
+
<!-- 港澳居民来往内地通行证-外籍 -->
|
|
220
|
+
<view wx:if="{{ formData.cid_type === '516' && formData.nation !== 'CHN'}}">
|
|
221
|
+
<view class="form-item-wrap">
|
|
222
|
+
<g-picker
|
|
223
|
+
id="sex"
|
|
224
|
+
value="{{ formData.sex }}"
|
|
225
|
+
label="性别"
|
|
226
|
+
placeholder="请选择本人性别"
|
|
227
|
+
bind:change="handleChange"
|
|
228
|
+
range="{{ sexRangeZH }}"
|
|
229
|
+
actionText="选择"
|
|
230
|
+
></g-picker>
|
|
231
|
+
</view>
|
|
232
|
+
|
|
233
|
+
<view class="form-item-wrap">
|
|
234
|
+
<g-picker
|
|
235
|
+
id="birthday"
|
|
236
|
+
mode="date"
|
|
237
|
+
value="{{ formData.birthday }}"
|
|
238
|
+
label="出生日期"
|
|
239
|
+
placeholder="请选择本人出生日期"
|
|
240
|
+
bind:change="handleChange"
|
|
241
|
+
>
|
|
242
|
+
</g-picker>
|
|
243
|
+
</view>
|
|
244
|
+
</view>
|
|
245
|
+
<view wx:else>
|
|
246
|
+
<view class="form-item-wrap">
|
|
247
|
+
<g-switch
|
|
248
|
+
value="{{ formData.sbSwitch }}"
|
|
249
|
+
showTip="{{ true }}"
|
|
250
|
+
label="性别 / 出生日期"
|
|
251
|
+
desc="性别和出生日期可选填,以便办理出生医学证明等相关服务"
|
|
252
|
+
bind:change="handleChangeSwtich"
|
|
253
|
+
></g-switch>
|
|
254
|
+
</view>
|
|
255
|
+
<view wx:if="{{ formData.sbSwitch }}" class="form-options">
|
|
256
|
+
<view class="form-item-wrap">
|
|
257
|
+
<g-picker
|
|
258
|
+
id="sex"
|
|
259
|
+
value="{{ formData.sex }}"
|
|
260
|
+
label="性别"
|
|
261
|
+
placeholder="请选择本人性别"
|
|
262
|
+
bind:change="handleChange"
|
|
263
|
+
range="{{ sexRangeZH }}"
|
|
264
|
+
actionText="选择"
|
|
265
|
+
required="{{ false }}"
|
|
266
|
+
></g-picker>
|
|
267
|
+
</view>
|
|
268
|
+
|
|
269
|
+
<view class="form-item-wrap">
|
|
270
|
+
<g-picker
|
|
271
|
+
id="birthday"
|
|
272
|
+
mode="date"
|
|
273
|
+
value="{{ formData.birthday }}"
|
|
274
|
+
label="出生日期"
|
|
275
|
+
placeholder="请选择本人出生日期"
|
|
276
|
+
bind:change="handleChange"
|
|
277
|
+
required="{{ false }}"
|
|
278
|
+
>
|
|
279
|
+
</g-picker>
|
|
280
|
+
</view>
|
|
281
|
+
</view>
|
|
282
|
+
</view>
|
|
283
|
+
</view>
|
|
200
284
|
</view>
|
|
201
285
|
</view>
|
|
202
286
|
|
|
@@ -74,4 +74,44 @@
|
|
|
74
74
|
.tip-desc {
|
|
75
75
|
color: #27282eff;
|
|
76
76
|
font-size: 14px;
|
|
77
|
+
}
|
|
78
|
+
.form-options {
|
|
79
|
+
width: 750rpx;
|
|
80
|
+
background: linear-gradient( #F5FAFF 0%, #F1F7FF 100%);
|
|
81
|
+
padding: 0 20rpx 20rpx;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.foreign-tip {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: row;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
align-items: center;
|
|
90
|
+
margin: -12rpx 32rpx 0;
|
|
91
|
+
background: #EEF2F6;
|
|
92
|
+
border-radius: 8rpx;
|
|
93
|
+
padding: 24rpx 16rpx 24rpx 24rpx;
|
|
94
|
+
position: relative;
|
|
95
|
+
}
|
|
96
|
+
.foreign-tip::before {
|
|
97
|
+
content: '';
|
|
98
|
+
position: absolute;
|
|
99
|
+
border-left: 17rpx solid transparent;
|
|
100
|
+
border-top: 17rpx solid transparent;
|
|
101
|
+
border-bottom: 17rpx solid #EEF2F6;
|
|
102
|
+
border-right: 17rpx solid transparent;
|
|
103
|
+
top: -30rpx;
|
|
104
|
+
right: 18rpx;
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
.foreign-tip text {
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
font-size: 26rpx;
|
|
110
|
+
color: #62667A;
|
|
111
|
+
line-height: 30rpx;
|
|
112
|
+
}
|
|
113
|
+
.foreign-tip image {
|
|
114
|
+
width: 40rpx;
|
|
115
|
+
height: 40rpx;
|
|
116
|
+
flex-shrink: 0;
|
|
77
117
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// pages/authenticate/countrySerchList/countrySerchList.js
|
|
2
|
-
const { nation } = require("../../utils/country")
|
|
2
|
+
const { nation, fullNation } = require("../../utils/country")
|
|
3
|
+
const nationFull = fullNation()
|
|
4
|
+
|
|
3
5
|
Page({
|
|
4
6
|
|
|
5
7
|
/**
|
|
@@ -27,9 +29,20 @@ Page({
|
|
|
27
29
|
return arr;
|
|
28
30
|
},
|
|
29
31
|
|
|
32
|
+
whoNation() {
|
|
33
|
+
if (this.data.cid_type === '516') {
|
|
34
|
+
// 港澳居民来往内地通行证:加入中国
|
|
35
|
+
console.log('加入中国', nationFull.length)
|
|
36
|
+
return nationFull
|
|
37
|
+
} else {
|
|
38
|
+
console.log('国籍', nation.length)
|
|
39
|
+
return nation
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
30
43
|
handleChange(e) {
|
|
31
44
|
let { value } = e.detail
|
|
32
|
-
let nationsList = this.fuzzyQuery(
|
|
45
|
+
let nationsList = this.fuzzyQuery(this.whoNation(), value)
|
|
33
46
|
this.setData({
|
|
34
47
|
nationsList
|
|
35
48
|
})
|
|
@@ -57,12 +70,15 @@ Page({
|
|
|
57
70
|
* 生命周期函数--监听页面加载
|
|
58
71
|
*/
|
|
59
72
|
onLoad: function (options) {
|
|
73
|
+
const { cid_type } = options
|
|
74
|
+
this.setData({
|
|
75
|
+
cid_type
|
|
76
|
+
})
|
|
77
|
+
|
|
60
78
|
wx.hideShareMenu()
|
|
61
|
-
|
|
62
79
|
const language = wx.getStorageSync('tif.currentLanguage') || 'zh_CN'
|
|
63
|
-
const { cid_type } = options
|
|
64
80
|
this.setData({
|
|
65
|
-
|
|
81
|
+
nationsList: this.whoNation(),
|
|
66
82
|
language
|
|
67
83
|
})
|
|
68
84
|
this.initDomText(language)
|
|
@@ -91,8 +107,5 @@ Page({
|
|
|
91
107
|
* 生命周期函数--监听页面显示
|
|
92
108
|
*/
|
|
93
109
|
onShow: function () {
|
|
94
|
-
this.setData({
|
|
95
|
-
nationsList: nation
|
|
96
|
-
})
|
|
97
110
|
}
|
|
98
111
|
})
|
|
@@ -10,6 +10,7 @@ Page({
|
|
|
10
10
|
* 页面的初始数据
|
|
11
11
|
*/
|
|
12
12
|
data: {
|
|
13
|
+
showPage: true,
|
|
13
14
|
name: '',
|
|
14
15
|
star_name: '',
|
|
15
16
|
sex: '',
|
|
@@ -17,10 +18,22 @@ Page({
|
|
|
17
18
|
star_cid: '',
|
|
18
19
|
phone: '',
|
|
19
20
|
star_phone: '',
|
|
20
|
-
|
|
21
|
+
phoneModal: false,
|
|
21
22
|
showEye: false,
|
|
22
23
|
authExpired: false,
|
|
23
|
-
showTipModal: false
|
|
24
|
+
showTipModal: false,
|
|
25
|
+
birthday: '',
|
|
26
|
+
canSave: false,
|
|
27
|
+
showFullInfoModal: false,
|
|
28
|
+
sexIndex: -1,
|
|
29
|
+
sexRangeZH: [
|
|
30
|
+
{ name: '男', value: 1 },
|
|
31
|
+
{ name: '女', value: 2 }
|
|
32
|
+
],
|
|
33
|
+
fourTypeCert: false, // 港澳/台通行证、华侨护照和外国护照四类证件
|
|
34
|
+
showSBModal: false,
|
|
35
|
+
sbDesc: '',
|
|
36
|
+
showLeaveModal: false
|
|
24
37
|
},
|
|
25
38
|
|
|
26
39
|
/**
|
|
@@ -35,7 +48,7 @@ Page({
|
|
|
35
48
|
})
|
|
36
49
|
jingtongVerifyRequest.getSession({
|
|
37
50
|
success: (res) => {
|
|
38
|
-
let { star_name, star_cid, phone, name, cid, face_time, realname_time, cid_type, openid } = res
|
|
51
|
+
let { star_name, star_cid, phone, name, cid, face_time, realname_time, cid_type, openid, birth_date = '' } = res
|
|
39
52
|
let pho = /(\d{3})\d*(\d{4})/
|
|
40
53
|
let sex = '未知'
|
|
41
54
|
let authExpired = (!face_time && !realname_time) || !cid
|
|
@@ -51,13 +64,30 @@ Page({
|
|
|
51
64
|
// Age = utils.parseIDCard(cid).age
|
|
52
65
|
} else {
|
|
53
66
|
let resSex = res.sex
|
|
54
|
-
if (resSex
|
|
67
|
+
if (resSex === '1') {
|
|
55
68
|
sex = '男'
|
|
56
|
-
} else if (resSex
|
|
69
|
+
} else if (resSex === '2') {
|
|
57
70
|
sex = '女'
|
|
58
71
|
}
|
|
59
72
|
}
|
|
73
|
+
// 港澳/台通行证、华侨护照三类证件
|
|
74
|
+
const fourTypeCertList = ['516', '511', '414']
|
|
75
|
+
const fourTypeCert = fourTypeCertList.includes(cid_type) || false
|
|
76
|
+
|
|
77
|
+
// 获取弹窗时间戳
|
|
78
|
+
let nowTimestamp = Date.now()
|
|
79
|
+
const stamp = wx.getStorageSync('tif.fullInfoModalStamp') || 0
|
|
80
|
+
|
|
81
|
+
let birthday = ''
|
|
82
|
+
if (birth_date) {
|
|
83
|
+
birthday = birth_date.slice(0, 4) + '-' + birth_date.slice(4, 6) + '-' + birth_date.slice(6, 8);
|
|
84
|
+
}
|
|
60
85
|
this.setData({
|
|
86
|
+
cid_type,
|
|
87
|
+
sexIndex: sex === '未知' ? 0 : Number(res.sex) - 1,
|
|
88
|
+
birthday,
|
|
89
|
+
fourTypeCert,
|
|
90
|
+
showFullInfoModal: (fourTypeCert && (sex === '未知' || !birthday) && nowTimestamp > stamp) || false,
|
|
61
91
|
star_name,
|
|
62
92
|
name,
|
|
63
93
|
sex,
|
|
@@ -77,7 +107,7 @@ Page({
|
|
|
77
107
|
},
|
|
78
108
|
|
|
79
109
|
// 显示换绑手机号码弹窗
|
|
80
|
-
|
|
110
|
+
showPhoneModal() {
|
|
81
111
|
if (!this.data.authExpired) {
|
|
82
112
|
// 上报事件
|
|
83
113
|
SDKTrack('function_btn_click', {
|
|
@@ -85,9 +115,8 @@ Page({
|
|
|
85
115
|
item_code: '110000000000511211993408000000', // 事项ID
|
|
86
116
|
item_access: '19', // 业务入口
|
|
87
117
|
})
|
|
88
|
-
|
|
89
118
|
this.setData({
|
|
90
|
-
|
|
119
|
+
phoneModal: true
|
|
91
120
|
})
|
|
92
121
|
} else {
|
|
93
122
|
wx.showToast({
|
|
@@ -106,41 +135,42 @@ Page({
|
|
|
106
135
|
},
|
|
107
136
|
|
|
108
137
|
// 弹框确认
|
|
109
|
-
|
|
138
|
+
confirmPhoneModal() {
|
|
110
139
|
this.setData({
|
|
111
|
-
|
|
140
|
+
phoneModal: false
|
|
112
141
|
})
|
|
113
142
|
},
|
|
114
143
|
|
|
115
144
|
// 获取手机号码
|
|
116
|
-
getPhoneNumberFun(e) {
|
|
145
|
+
async getPhoneNumberFun(e) {
|
|
117
146
|
const params = Object.assign(e.detail, {
|
|
118
147
|
source: '1'
|
|
119
148
|
})
|
|
120
|
-
jingtongVerifyRequest.loginPhone(params)
|
|
121
|
-
|
|
122
|
-
title: '换绑成功',
|
|
123
|
-
icon: 'none',
|
|
124
|
-
duration: 3000,
|
|
125
|
-
mask: true
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
// 登录成功回调 => 业务侧操作事项
|
|
129
|
-
wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
|
|
130
|
-
|
|
131
|
-
let phone = session.phone
|
|
132
|
-
let pho = /(\d{3})\d*(\d{4})/
|
|
133
|
-
|
|
134
|
-
this.setData({
|
|
135
|
-
phone: wx.getStorageSync('tif.realPhone') || '',
|
|
136
|
-
star_phone: phone ? phone.replace(pho, '$1****$2') : ''
|
|
137
|
-
})
|
|
138
|
-
}).catch(err => {
|
|
149
|
+
const [err, session] = await utils.awaitTo(jingtongVerifyRequest.loginPhone(params))
|
|
150
|
+
if (err) {
|
|
139
151
|
console.log(err, '换绑手机号码')
|
|
140
152
|
wx.showToast({
|
|
141
153
|
title: err.errmsg || '换绑失败,请稍后再试',
|
|
142
154
|
icon: 'none'
|
|
143
155
|
})
|
|
156
|
+
return
|
|
157
|
+
}
|
|
158
|
+
wx.showToast({
|
|
159
|
+
title: '换绑成功',
|
|
160
|
+
icon: 'none',
|
|
161
|
+
duration: 3000,
|
|
162
|
+
mask: true
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
// 登录成功回调 => 业务侧操作事项
|
|
166
|
+
wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
|
|
167
|
+
|
|
168
|
+
let phone = session.phone
|
|
169
|
+
let pho = /(\d{3})\d*(\d{4})/
|
|
170
|
+
|
|
171
|
+
this.setData({
|
|
172
|
+
phone: wx.getStorageSync('tif.realPhone') || '',
|
|
173
|
+
star_phone: phone ? phone.replace(pho, '$1****$2') : ''
|
|
144
174
|
})
|
|
145
175
|
},
|
|
146
176
|
|
|
@@ -154,7 +184,124 @@ Page({
|
|
|
154
184
|
// 关闭弹窗
|
|
155
185
|
handleCloseModal() {
|
|
156
186
|
this.setData({
|
|
157
|
-
showTipModal: false
|
|
187
|
+
showTipModal: false,
|
|
188
|
+
showSBModal: false,
|
|
189
|
+
showLeaveModal: false
|
|
190
|
+
})
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
// 关闭弹窗+记录10个自然日
|
|
194
|
+
handleFullInfoModalOk() {
|
|
195
|
+
this.setData({
|
|
196
|
+
showFullInfoModal: false
|
|
197
|
+
})
|
|
198
|
+
// 计算10个自然日后的时间戳
|
|
199
|
+
let nowTimestamp = Date.now()
|
|
200
|
+
let futureDate = new Date(nowTimestamp)
|
|
201
|
+
futureDate.setDate(futureDate.getDate() + 10)
|
|
202
|
+
let futureTimestamp = futureDate.getTime()
|
|
203
|
+
wx.setStorageSync('tif.fullInfoModalStamp', futureTimestamp)
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
// 性别
|
|
207
|
+
bindSexChange(e) {
|
|
208
|
+
const sexIndex = e.detail.value
|
|
209
|
+
this.setData({
|
|
210
|
+
sex: this.data.sexRangeZH[sexIndex].name,
|
|
211
|
+
sexIndex,
|
|
212
|
+
canSave: true
|
|
213
|
+
})
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
// 出生日期
|
|
217
|
+
bindBirthChange(e) {
|
|
218
|
+
this.setData({
|
|
219
|
+
birthday: e.detail.value,
|
|
220
|
+
canSave: true
|
|
221
|
+
})
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
// 保存信息
|
|
225
|
+
async toSave() {
|
|
226
|
+
const sex = this.data.sex
|
|
227
|
+
const birthday = this.data.birthday
|
|
228
|
+
if (sex === '未知') {
|
|
229
|
+
this.setData({
|
|
230
|
+
sbDesc: '您的性别信息尚未完善, ',
|
|
231
|
+
showSBModal: true
|
|
232
|
+
})
|
|
233
|
+
return
|
|
234
|
+
} else if (!birthday) {
|
|
235
|
+
this.setData({
|
|
236
|
+
sbDesc: '您的出生日期尚未完善, ',
|
|
237
|
+
showSBModal: true
|
|
238
|
+
})
|
|
239
|
+
return
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const [err, data] = await utils.awaitTo(jingtongVerifyRequest.updateSB({
|
|
243
|
+
sex: this.data.sexRangeZH[this.data.sexIndex].value || '',
|
|
244
|
+
birthday
|
|
245
|
+
}))
|
|
246
|
+
if (err) {
|
|
247
|
+
console.log(err, '保存信息')
|
|
248
|
+
wx.showToast({
|
|
249
|
+
title: err.errmsg || '保存失败,请稍后再试',
|
|
250
|
+
icon: 'none'
|
|
251
|
+
})
|
|
252
|
+
return
|
|
253
|
+
}
|
|
254
|
+
console.log('更新信息', data)
|
|
255
|
+
wx.showToast({
|
|
256
|
+
title: '保存成功',
|
|
257
|
+
icon: 'none',
|
|
258
|
+
duration: 2000,
|
|
259
|
+
mask: true
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
this.setData({
|
|
263
|
+
canSave: false
|
|
264
|
+
})
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
onBeforeLeave() {
|
|
268
|
+
console.log('监听到返回上一页', this.data.canSave)
|
|
269
|
+
// 返回上一页的逻辑处理
|
|
270
|
+
if (this.data.canSave) {
|
|
271
|
+
this.setData({
|
|
272
|
+
showLeaveModal: true
|
|
273
|
+
})
|
|
274
|
+
} else {
|
|
275
|
+
console.log('返回上一页')
|
|
276
|
+
this.setData({
|
|
277
|
+
showPage: false
|
|
278
|
+
}, () => {
|
|
279
|
+
setTimeout(() => {
|
|
280
|
+
wx.navigateBack()
|
|
281
|
+
}, 10)
|
|
282
|
+
})
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
toBack() {
|
|
287
|
+
this.setData({
|
|
288
|
+
showLeaveModal: false
|
|
289
|
+
}, () => {
|
|
290
|
+
setTimeout(() => {
|
|
291
|
+
wx.navigateBack()
|
|
292
|
+
}, 10)
|
|
293
|
+
})
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
stopBack() {
|
|
297
|
+
this.setData({
|
|
298
|
+
showLeaveModal: false,
|
|
299
|
+
showPage: true
|
|
158
300
|
})
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
preventSwipe() {
|
|
304
|
+
/* 空函数阻止默认滑动 */
|
|
305
|
+
console.log('空函数阻止默认滑动')
|
|
159
306
|
}
|
|
160
307
|
})
|