From febf1743bfa473d7a00eaec206e833c9bd4ee5e5 Mon Sep 17 00:00:00 2001 From: liuwh <liuwh@hugeinfo.com.cn> Date: Mon, 24 Feb 2020 01:14:29 +0800 Subject: [PATCH] 修改 --- SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js b/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js index 1efb2b9..5662339 100644 --- a/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js +++ b/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js @@ -12,6 +12,7 @@ loading: false, peopleInfo: {}, signStatus: '', + id: "" }, /** @@ -121,11 +122,39 @@ // 签到 sign: function () { + var id = this.data.id; + var userinfo = wx.getStorageSync("user"); + var userId = userinfo.id; // 只允许从相机扫码 wx.scanCode({ onlyFromCamera: true, success(res) { console.log(res) + wx.showLoading({ + title: '识别中', + }) + wx.request({ + url: app.globalData.url + '/api/activity/sign?id'+id+'&code='+res.result+'&userId='+userId, + method: 'GET', + header: { + "Content-Type": "application/json" + }, + success: function (res) { + wx.hideLoading(); + if (res.data.code == 0) { + wx.showToast({ + title: '签到成功!', + icon: 'success', + duration: 2000 + }) + } else { + wx.showToast({ + title: '报名失败,请稍后重试!', + icon: 'none' + }) + } + } + }) } }) }, -- Gitblit v1.8.0