-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const WXAPI = require('apifm-wxapi') | ||
Page({ | ||
data: { | ||
|
||
}, | ||
onLoad: function (options) { | ||
|
||
}, | ||
onShow: function () { | ||
|
||
}, | ||
async submit() { | ||
if (!this.data.name) { | ||
wx.showToast({ | ||
title: '请输入姓名', | ||
icon: 'none' | ||
}) | ||
return | ||
} | ||
if (!this.data.idcard) { | ||
wx.showToast({ | ||
title: '请输入身份证号码', | ||
icon: 'none' | ||
}) | ||
return | ||
} | ||
wx.showLoading({ | ||
title: '', | ||
}) | ||
this.setData({ | ||
loading: true | ||
}) | ||
const res = await WXAPI.idcardCheck(wx.getStorageSync('token'), this.data.name, this.data.idcard) | ||
wx.hideLoading({ | ||
success: (res) => {}, | ||
}) | ||
this.setData({ | ||
loading: false | ||
}) | ||
if (res.code != 0) { | ||
wx.showToast({ | ||
title: res.msg, | ||
icon: 'none' | ||
}) | ||
return | ||
} | ||
wx.showToast({ | ||
title: '认证通过', | ||
}) | ||
setTimeout(() => { | ||
wx.navigateBack() | ||
}, 1000); | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"navigationBarTitleText": "实名认证" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<van-field | ||
label="姓名" | ||
size="large" | ||
model:value="{{ name }}" | ||
placeholder="请输入姓名" | ||
required | ||
/> | ||
<van-field | ||
label="身份证号码" | ||
type="idcard" | ||
size="large" | ||
model:value="{{ idcard }}" | ||
placeholder="请输入身份证号码" | ||
required | ||
/> | ||
<view class="btn"> | ||
<van-button type="primary" block loading="{{loading}}" bind:click="submit">立即认证</van-button> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.btn { | ||
width: 700rpx; | ||
margin: 64rpx auto; | ||
} |