weapps-plugin-jingtong-verify 1.3.8 → 1.4.0
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/pages/face-verify/face-verify.js +157 -58
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +2 -1
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +91 -13
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +6 -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 +177 -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 +125 -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
|
@@ -24,6 +24,7 @@
|
|
|
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>
|
|
@@ -165,38 +166,115 @@
|
|
|
165
166
|
</view>
|
|
166
167
|
</view>
|
|
167
168
|
|
|
169
|
+
<!-- 港澳/台通行证、永居证、华侨护照 -->
|
|
168
170
|
<view wx:else>
|
|
171
|
+
<!-- 证件号码 -->
|
|
169
172
|
<view class="form-item-wrap">
|
|
170
173
|
<g-input
|
|
171
174
|
id="id_card_number"
|
|
172
|
-
data-star="strCid"
|
|
173
175
|
label="证件号码"
|
|
174
176
|
placeholder="请输入本人证件号码"
|
|
175
|
-
value="{{ formData.
|
|
177
|
+
value="{{ formData.id_card_number }}"
|
|
176
178
|
clearable="true"
|
|
177
179
|
bind:change="handleChange"
|
|
178
180
|
/>
|
|
179
181
|
</view>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
182
|
+
|
|
183
|
+
<!-- 证件有效期: 港澳通行证、台湾通行证、华侨护照-->
|
|
184
|
+
<view wx:if="{{ formData.cid_type !== '553' }}">
|
|
185
|
+
<view class="form-item-wrap">
|
|
186
|
+
<g-picker
|
|
187
|
+
id="cid_expire_date"
|
|
188
|
+
mode="date"
|
|
189
|
+
value="{{ formData.cid_expire_date }}"
|
|
190
|
+
label="证件有效期"
|
|
191
|
+
placeholder="请选择证件有效期截止日期"
|
|
192
|
+
bind:change="handleChange"
|
|
193
|
+
>
|
|
194
|
+
</g-picker>
|
|
195
|
+
</view>
|
|
189
196
|
</view>
|
|
190
197
|
|
|
191
|
-
|
|
198
|
+
<!-- 国籍:台湾通行证和华侨没有 -->
|
|
199
|
+
<view class="form-item-wrap" wx:if="{{ formData.cid_type !== '511' && formData.cid_type !== '414' }}">
|
|
192
200
|
<g-picker
|
|
193
201
|
id="nation"
|
|
194
202
|
value="{{ formData.nation_name }}"
|
|
195
203
|
label="国籍"
|
|
196
204
|
mode="none"
|
|
197
|
-
|
|
205
|
+
placeholder="请选择国籍"
|
|
206
|
+
bind:tap="handleNationTap"
|
|
207
|
+
actionText="选择"
|
|
198
208
|
/>
|
|
199
209
|
</view>
|
|
210
|
+
|
|
211
|
+
<!-- 三证照:港澳通行证、台湾通行证、华侨护照 -->
|
|
212
|
+
<view wx:if="{{ formData.cid_type !== '553' }}">
|
|
213
|
+
<!-- 港澳居民来往内地通行证-外籍 -->
|
|
214
|
+
<view wx:if="{{ formData.cid_type === '516' && formData.nation !== 'CHN'}}">
|
|
215
|
+
<view class="form-item-wrap">
|
|
216
|
+
<g-picker
|
|
217
|
+
id="sex"
|
|
218
|
+
value="{{ formData.sex }}"
|
|
219
|
+
label="性别"
|
|
220
|
+
placeholder="请选择本人性别"
|
|
221
|
+
bind:change="handleChange"
|
|
222
|
+
range="{{ sexRangeZH }}"
|
|
223
|
+
actionText="选择"
|
|
224
|
+
></g-picker>
|
|
225
|
+
</view>
|
|
226
|
+
|
|
227
|
+
<view class="form-item-wrap">
|
|
228
|
+
<g-picker
|
|
229
|
+
id="birthday"
|
|
230
|
+
mode="date"
|
|
231
|
+
value="{{ formData.birthday }}"
|
|
232
|
+
label="出生日期"
|
|
233
|
+
placeholder="请选择本人出生日期"
|
|
234
|
+
bind:change="handleChange"
|
|
235
|
+
>
|
|
236
|
+
</g-picker>
|
|
237
|
+
</view>
|
|
238
|
+
</view>
|
|
239
|
+
<view wx:else>
|
|
240
|
+
<view class="form-item-wrap">
|
|
241
|
+
<g-switch
|
|
242
|
+
value="{{ formData.sbSwitch }}"
|
|
243
|
+
showTip="{{ true }}"
|
|
244
|
+
label="性别 / 出生日期"
|
|
245
|
+
desc="性别和出生日期可选填,以便办理出生医学证明等相关服务"
|
|
246
|
+
bind:change="handleChangeSwtich"
|
|
247
|
+
></g-switch>
|
|
248
|
+
</view>
|
|
249
|
+
<view wx:if="{{ formData.sbSwitch }}" class="form-options">
|
|
250
|
+
<view class="form-item-wrap">
|
|
251
|
+
<g-picker
|
|
252
|
+
id="sex"
|
|
253
|
+
value="{{ formData.sex }}"
|
|
254
|
+
label="性别"
|
|
255
|
+
placeholder="请选择本人性别"
|
|
256
|
+
bind:change="handleChange"
|
|
257
|
+
range="{{ sexRangeZH }}"
|
|
258
|
+
actionText="选择"
|
|
259
|
+
required="{{ false }}"
|
|
260
|
+
></g-picker>
|
|
261
|
+
</view>
|
|
262
|
+
|
|
263
|
+
<view class="form-item-wrap">
|
|
264
|
+
<g-picker
|
|
265
|
+
id="birthday"
|
|
266
|
+
mode="date"
|
|
267
|
+
value="{{ formData.birthday }}"
|
|
268
|
+
label="出生日期"
|
|
269
|
+
placeholder="请选择本人出生日期"
|
|
270
|
+
bind:change="handleChange"
|
|
271
|
+
required="{{ false }}"
|
|
272
|
+
>
|
|
273
|
+
</g-picker>
|
|
274
|
+
</view>
|
|
275
|
+
</view>
|
|
276
|
+
</view>
|
|
277
|
+
</view>
|
|
200
278
|
</view>
|
|
201
279
|
</view>
|
|
202
280
|
|
|
@@ -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,29 @@ 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', '700']
|
|
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
|
+
sexIndex: sex === '未知' ? 0 : Number(res.sex) - 1,
|
|
87
|
+
birthday,
|
|
88
|
+
fourTypeCert,
|
|
89
|
+
showFullInfoModal: (fourTypeCert && (sex === '未知' || !birthday) && nowTimestamp > stamp) || false,
|
|
61
90
|
star_name,
|
|
62
91
|
name,
|
|
63
92
|
sex,
|
|
@@ -77,7 +106,7 @@ Page({
|
|
|
77
106
|
},
|
|
78
107
|
|
|
79
108
|
// 显示换绑手机号码弹窗
|
|
80
|
-
|
|
109
|
+
showPhoneModal() {
|
|
81
110
|
if (!this.data.authExpired) {
|
|
82
111
|
// 上报事件
|
|
83
112
|
SDKTrack('function_btn_click', {
|
|
@@ -85,9 +114,8 @@ Page({
|
|
|
85
114
|
item_code: '110000000000511211993408000000', // 事项ID
|
|
86
115
|
item_access: '19', // 业务入口
|
|
87
116
|
})
|
|
88
|
-
|
|
89
117
|
this.setData({
|
|
90
|
-
|
|
118
|
+
phoneModal: true
|
|
91
119
|
})
|
|
92
120
|
} else {
|
|
93
121
|
wx.showToast({
|
|
@@ -106,41 +134,42 @@ Page({
|
|
|
106
134
|
},
|
|
107
135
|
|
|
108
136
|
// 弹框确认
|
|
109
|
-
|
|
137
|
+
confirmPhoneModal() {
|
|
110
138
|
this.setData({
|
|
111
|
-
|
|
139
|
+
phoneModal: false
|
|
112
140
|
})
|
|
113
141
|
},
|
|
114
142
|
|
|
115
143
|
// 获取手机号码
|
|
116
|
-
getPhoneNumberFun(e) {
|
|
144
|
+
async getPhoneNumberFun(e) {
|
|
117
145
|
const params = Object.assign(e.detail, {
|
|
118
146
|
source: '1'
|
|
119
147
|
})
|
|
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 => {
|
|
148
|
+
const [err, session] = await utils.awaitTo(jingtongVerifyRequest.loginPhone(params))
|
|
149
|
+
if (err) {
|
|
139
150
|
console.log(err, '换绑手机号码')
|
|
140
151
|
wx.showToast({
|
|
141
152
|
title: err.errmsg || '换绑失败,请稍后再试',
|
|
142
153
|
icon: 'none'
|
|
143
154
|
})
|
|
155
|
+
return
|
|
156
|
+
}
|
|
157
|
+
wx.showToast({
|
|
158
|
+
title: '换绑成功',
|
|
159
|
+
icon: 'none',
|
|
160
|
+
duration: 3000,
|
|
161
|
+
mask: true
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
// 登录成功回调 => 业务侧操作事项
|
|
165
|
+
wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
|
|
166
|
+
|
|
167
|
+
let phone = session.phone
|
|
168
|
+
let pho = /(\d{3})\d*(\d{4})/
|
|
169
|
+
|
|
170
|
+
this.setData({
|
|
171
|
+
phone: wx.getStorageSync('tif.realPhone') || '',
|
|
172
|
+
star_phone: phone ? phone.replace(pho, '$1****$2') : ''
|
|
144
173
|
})
|
|
145
174
|
},
|
|
146
175
|
|
|
@@ -154,7 +183,124 @@ Page({
|
|
|
154
183
|
// 关闭弹窗
|
|
155
184
|
handleCloseModal() {
|
|
156
185
|
this.setData({
|
|
157
|
-
showTipModal: false
|
|
186
|
+
showTipModal: false,
|
|
187
|
+
showSBModal: false,
|
|
188
|
+
showLeaveModal: false
|
|
189
|
+
})
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
// 关闭弹窗+记录10个自然日
|
|
193
|
+
handleFullInfoModalOk() {
|
|
194
|
+
this.setData({
|
|
195
|
+
showFullInfoModal: false
|
|
196
|
+
})
|
|
197
|
+
// 计算10个自然日后的时间戳
|
|
198
|
+
let nowTimestamp = Date.now()
|
|
199
|
+
let futureDate = new Date(nowTimestamp)
|
|
200
|
+
futureDate.setDate(futureDate.getDate() + 10)
|
|
201
|
+
let futureTimestamp = futureDate.getTime()
|
|
202
|
+
wx.setStorageSync('tif.fullInfoModalStamp', futureTimestamp)
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
// 性别
|
|
206
|
+
bindSexChange(e) {
|
|
207
|
+
const sexIndex = e.detail.value
|
|
208
|
+
this.setData({
|
|
209
|
+
sex: this.data.sexRangeZH[sexIndex].name,
|
|
210
|
+
sexIndex,
|
|
211
|
+
canSave: true
|
|
212
|
+
})
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
// 出生日期
|
|
216
|
+
bindBirthChange(e) {
|
|
217
|
+
this.setData({
|
|
218
|
+
birthday: e.detail.value,
|
|
219
|
+
canSave: true
|
|
220
|
+
})
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
// 保存信息
|
|
224
|
+
async toSave() {
|
|
225
|
+
const sex = this.data.sex
|
|
226
|
+
const birthday = this.data.birthday
|
|
227
|
+
if (sex === '未知') {
|
|
228
|
+
this.setData({
|
|
229
|
+
sbDesc: '您的性别信息尚未完善, ',
|
|
230
|
+
showSBModal: true
|
|
231
|
+
})
|
|
232
|
+
return
|
|
233
|
+
} else if (!birthday) {
|
|
234
|
+
this.setData({
|
|
235
|
+
sbDesc: '您的出生日期尚未完善, ',
|
|
236
|
+
showSBModal: true
|
|
237
|
+
})
|
|
238
|
+
return
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const [err, data] = await utils.awaitTo(jingtongVerifyRequest.updateSB({
|
|
242
|
+
sex: this.data.sexRangeZH[this.data.sexIndex].value || '',
|
|
243
|
+
birthday
|
|
244
|
+
}))
|
|
245
|
+
if (err) {
|
|
246
|
+
console.log(err, '保存信息')
|
|
247
|
+
wx.showToast({
|
|
248
|
+
title: err.errmsg || '保存失败,请稍后再试',
|
|
249
|
+
icon: 'none'
|
|
250
|
+
})
|
|
251
|
+
return
|
|
252
|
+
}
|
|
253
|
+
console.log('更新信息', data)
|
|
254
|
+
wx.showToast({
|
|
255
|
+
title: '保存成功',
|
|
256
|
+
icon: 'none',
|
|
257
|
+
duration: 2000,
|
|
258
|
+
mask: true
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
this.setData({
|
|
262
|
+
canSave: false
|
|
263
|
+
})
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
onBeforeLeave() {
|
|
267
|
+
console.log('监听到返回上一页', this.data.canSave)
|
|
268
|
+
// 返回上一页的逻辑处理
|
|
269
|
+
if (this.data.canSave) {
|
|
270
|
+
this.setData({
|
|
271
|
+
showLeaveModal: true
|
|
272
|
+
})
|
|
273
|
+
} else {
|
|
274
|
+
console.log('返回上一页')
|
|
275
|
+
this.setData({
|
|
276
|
+
showPage: false
|
|
277
|
+
}, () => {
|
|
278
|
+
setTimeout(() => {
|
|
279
|
+
wx.navigateBack()
|
|
280
|
+
}, 10)
|
|
281
|
+
})
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
toBack() {
|
|
286
|
+
this.setData({
|
|
287
|
+
showLeaveModal: false
|
|
288
|
+
}, () => {
|
|
289
|
+
setTimeout(() => {
|
|
290
|
+
wx.navigateBack()
|
|
291
|
+
}, 10)
|
|
292
|
+
})
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
stopBack() {
|
|
296
|
+
this.setData({
|
|
297
|
+
showLeaveModal: false,
|
|
298
|
+
showPage: true
|
|
158
299
|
})
|
|
300
|
+
},
|
|
301
|
+
|
|
302
|
+
preventSwipe() {
|
|
303
|
+
/* 空函数阻止默认滑动 */
|
|
304
|
+
console.log('空函数阻止默认滑动')
|
|
159
305
|
}
|
|
160
306
|
})
|
|
@@ -1,61 +1,135 @@
|
|
|
1
1
|
<!--weapps-plugin-jingtong-verify/pages/user-info/user-info.wxml-->
|
|
2
|
-
<view>
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<view class="cell">
|
|
9
|
-
<view class="cell-flex">
|
|
10
|
-
<text class="label">姓名</text>
|
|
11
|
-
<image src="../../images/question.png" mode="widthFix" catch:tap="showTip" />
|
|
2
|
+
<view wx:if="{{ showPage }}">
|
|
3
|
+
<page-container show="{{ showPage }}" position="center" duration="{{ false }}" overlay="{{ false }}" custom-style="height:100vh;overflow-y:scroll;" bind:beforeleave="onBeforeLeave" catch:touchmove="preventSwipe">
|
|
4
|
+
<view>
|
|
5
|
+
<view class="top-box">
|
|
6
|
+
<text class="title">基础信息</text>
|
|
7
|
+
<image src="{{ showEye ? '../../images/preview-open.png' : '../../images/preview-close.png' }}" mode="" class="icon" catchtap="changeEye"/>
|
|
12
8
|
</view>
|
|
9
|
+
<view class="content-box">
|
|
10
|
+
<view class="cell">
|
|
11
|
+
<view class="cell-flex">
|
|
12
|
+
<text class="label">姓名</text>
|
|
13
|
+
<image src="../../images/question.png" mode="widthFix" catch:tap="showTip" />
|
|
14
|
+
</view>
|
|
15
|
+
<text class="content">{{ showEye ? name : star_name }}</text>
|
|
16
|
+
</view>
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
<!-- 只限港澳/台通行证、华侨护照和外国护照四类证件可以补填 -->
|
|
19
|
+
<view wx:if="{{ fourTypeCert }}">
|
|
20
|
+
<view class="cell">
|
|
21
|
+
<text class="label">性别</text>
|
|
22
|
+
<view class="content">
|
|
23
|
+
<picker bindchange="bindSexChange" range="{{ sexRangeZH }}" mode="selector" range-key="name" value="{{ sexIndex }}">
|
|
24
|
+
<view>
|
|
25
|
+
<text class="to-full" wx:if="{{ sex === '未知' }}">去完善</text>
|
|
26
|
+
<text wx:else>{{ sex }}</text>
|
|
27
|
+
<image src="../../images/Vector.png" mode="" class="img" />
|
|
28
|
+
</view>
|
|
29
|
+
</picker>
|
|
30
|
+
</view>
|
|
31
|
+
</view>
|
|
32
|
+
<view class="cell">
|
|
33
|
+
<text class="label">出生日期</text>
|
|
34
|
+
<view class="content">
|
|
35
|
+
<picker bindchange="bindBirthChange" mode="date" value="{{ birthday }}">
|
|
36
|
+
<view>
|
|
37
|
+
<text class="to-full" wx:if="{{ !birthday }}">去完善</text>
|
|
38
|
+
<text wx:else>{{ birthday }}</text>
|
|
39
|
+
<image src="../../images/Vector.png" mode="" class="img" />
|
|
40
|
+
</view>
|
|
41
|
+
</picker>
|
|
42
|
+
</view>
|
|
43
|
+
</view>
|
|
44
|
+
</view>
|
|
16
45
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
46
|
+
<view class="cell" wx:else>
|
|
47
|
+
<text class="label">性别</text>
|
|
48
|
+
<text class="content">
|
|
49
|
+
<text>{{ sex }}</text>
|
|
50
|
+
</text>
|
|
51
|
+
</view>
|
|
21
52
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
53
|
+
<view class="cell">
|
|
54
|
+
<view class="cell-flex">
|
|
55
|
+
<text class="label">证件号码</text>
|
|
56
|
+
<image src="../../images/question.png" mode="widthFix" catch:tap="showTip" />
|
|
57
|
+
</view>
|
|
58
|
+
<text class="content">{{ showEye ? cid : star_cid }}</text>
|
|
59
|
+
</view>
|
|
29
60
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
61
|
+
<view class="cell">
|
|
62
|
+
<text class="label">换绑手机号</text>
|
|
63
|
+
<view class="content" catchtap="showPhoneModal">
|
|
64
|
+
<text>{{ showEye ? phone : star_phone }}</text>
|
|
65
|
+
<image src="../../images/Vector.png" mode="" class="img" wx:if="{{ phone }}"/>
|
|
66
|
+
</view>
|
|
67
|
+
</view>
|
|
68
|
+
</view>
|
|
69
|
+
<view class="bottom-box" wx:if="{{ fourTypeCert }}">
|
|
70
|
+
<button class="btn" bindtap="toSave" wx:if="{{ canSave }}">保存</button>
|
|
71
|
+
<button class="btn btn-disabled" wx:else>保存</button>
|
|
35
72
|
</view>
|
|
36
73
|
</view>
|
|
37
|
-
</
|
|
74
|
+
</page-container>
|
|
75
|
+
</view>
|
|
38
76
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</
|
|
52
|
-
</my-modal>
|
|
53
|
-
|
|
54
|
-
<!-- 姓名、证件号码提示弹窗 -->
|
|
55
|
-
<tip-modal
|
|
56
|
-
visible="{{ showTipModal }}"
|
|
57
|
-
bind:cancel="handleCloseModal"
|
|
58
|
-
desc1="1、如果您在公安局变更了您的姓名或证件号码等信息,请您退出京通小程序后填写变更后的身份信息重新登录。"
|
|
59
|
-
desc2="2、如果当前显示为他人信息(亲属/朋友等),请您退出京通小程序后使用本人身份信息重新登录。"
|
|
60
|
-
></tip-modal>
|
|
77
|
+
<!-- 绑定手机号码 -->
|
|
78
|
+
<my-modal
|
|
79
|
+
title="提示"
|
|
80
|
+
Confirm="true"
|
|
81
|
+
confirmColor="#ce0022"
|
|
82
|
+
Cancel="true"
|
|
83
|
+
visible="{{ phoneModal }}"
|
|
84
|
+
bind:ConfirmBtn="confirmPhoneModal"
|
|
85
|
+
bind:CancelBtn="confirmPhoneModal"
|
|
86
|
+
confirmOpenType="getPhoneNumber"
|
|
87
|
+
bind:getPhoneNumberFun="getPhoneNumberFun">
|
|
88
|
+
<view>
|
|
89
|
+
您修改的是统一身份认证平台绑定的手机号: <text style="color: #ce0022">{{ phone }}</text>
|
|
61
90
|
</view>
|
|
91
|
+
</my-modal>
|
|
92
|
+
|
|
93
|
+
<!-- 姓名、证件号码提示弹窗 -->
|
|
94
|
+
<tip-modal
|
|
95
|
+
visible="{{ showTipModal }}"
|
|
96
|
+
bind:cancel="handleCloseModal"
|
|
97
|
+
desc1="1、如果您在公安局变更了您的姓名或证件号码等信息,请您退出京通小程序后填写变更后的身份信息重新登录。"
|
|
98
|
+
desc2="2、如果当前显示为他人信息(亲属/朋友等),请您退出京通小程序后使用本人身份信息重新登录。"
|
|
99
|
+
></tip-modal>
|
|
100
|
+
|
|
101
|
+
<!-- 完善信息弹窗 -->
|
|
102
|
+
<tip-modal
|
|
103
|
+
visible="{{ showFullInfoModal }}"
|
|
104
|
+
bind:cancel="handleFullInfoModalOk"
|
|
105
|
+
xAlign="center"
|
|
106
|
+
desc1="为了您更便捷使用京通服务,请完善 个人信息并确保信息的真实有效"
|
|
107
|
+
></tip-modal>
|
|
108
|
+
|
|
109
|
+
<!-- 完善性别、出生日期弹窗 -->
|
|
110
|
+
<tip-modal
|
|
111
|
+
visible="{{ showSBModal }}"
|
|
112
|
+
xAlign="center"
|
|
113
|
+
bind:cancel="handleCloseModal"
|
|
114
|
+
desc1="{{ sbDesc }}"
|
|
115
|
+
desc2="需补充后才能保存"
|
|
116
|
+
></tip-modal>
|
|
117
|
+
|
|
118
|
+
<!-- 离开页面未保存提示弹窗 -->
|
|
119
|
+
<my-modal
|
|
120
|
+
title="温馨提示"
|
|
121
|
+
Confirm="true"
|
|
122
|
+
Cancel="true"
|
|
123
|
+
ConfirmText="去保存"
|
|
124
|
+
CancelText="直接离开"
|
|
125
|
+
confirmColor="#ce0022"
|
|
126
|
+
cancelColor="#999"
|
|
127
|
+
visible="{{ showLeaveModal }}"
|
|
128
|
+
bindConfirmBtn="stopBack"
|
|
129
|
+
bindCancelBtn="toBack">
|
|
130
|
+
<view class="leave-modal">
|
|
131
|
+
<view>您已修改的信息尚未保存,</view>
|
|
132
|
+
<view>确定直接离开吗?</view>
|
|
133
|
+
</view>
|
|
134
|
+
</my-modal>
|
|
135
|
+
|