From 95ad16de4e53db69db22e33b30ee08faf7124ea8 Mon Sep 17 00:00:00 2001 From: gooking Date: Mon, 9 Nov 2020 11:09:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=B8=8B=E5=8D=95=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E9=9C=80=E8=A6=81=E7=94=A8=E6=88=B7=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/idCheck/index.js | 54 ++++++++++++++++++++++++++++++++++++++++ pages/idCheck/index.json | 3 +++ pages/idCheck/index.wxml | 18 ++++++++++++++ pages/idCheck/index.wxss | 4 +++ 4 files changed, 79 insertions(+) create mode 100644 pages/idCheck/index.js create mode 100644 pages/idCheck/index.json create mode 100644 pages/idCheck/index.wxml create mode 100644 pages/idCheck/index.wxss 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