diff --git a/pages/idCheck/index.js b/pages/idCheck/index.js new file mode 100644 index 00000000..f7c700d9 --- /dev/null +++ b/pages/idCheck/index.js @@ -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); + }, +}) \ No newline at end of file diff --git a/pages/idCheck/index.json b/pages/idCheck/index.json new file mode 100644 index 00000000..d406af27 --- /dev/null +++ b/pages/idCheck/index.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "实名认证" +} \ No newline at end of file diff --git a/pages/idCheck/index.wxml b/pages/idCheck/index.wxml new file mode 100644 index 00000000..9f1bbc5e --- /dev/null +++ b/pages/idCheck/index.wxml @@ -0,0 +1,18 @@ + + + + 立即认证 + \ No newline at end of file diff --git a/pages/idCheck/index.wxss b/pages/idCheck/index.wxss new file mode 100644 index 00000000..c7ce17c3 --- /dev/null +++ b/pages/idCheck/index.wxss @@ -0,0 +1,4 @@ +.btn { + width: 700rpx; + margin: 64rpx auto; +} \ No newline at end of file