From 77fc73142671d8aa8e0bf57bf1360a5aaed735fb Mon Sep 17 00:00:00 2001 From: wwl Date: Fri, 15 Mar 2024 10:18:40 +0800 Subject: [PATCH] update --- src/api/user.js | 3 ++ src/pages/recommend/detail.js | 61 ++++++++++++++++++----------------- src/subpages/member/scan.js | 4 +-- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/api/user.js b/src/api/user.js index c3361ea..7b5b2e7 100755 --- a/src/api/user.js +++ b/src/api/user.js @@ -79,6 +79,9 @@ export function registrationSubmit (data) { export function verifyRegistrationRecord (data) { return req.post('/verifyRegistrationRecord', data) } +export function getVerifyRegistrationRecordList (data) { + return req.get('/getVerifyRegistrationRecordList', data) +} export function registrationRecordList (data) { return req.get('/registrationRecordList', data) diff --git a/src/pages/recommend/detail.js b/src/pages/recommend/detail.js index 5f86664..33b2ea2 100644 --- a/src/pages/recommend/detail.js +++ b/src/pages/recommend/detail.js @@ -60,6 +60,29 @@ export default function detail () { const { isLoading, activeInfo = {}, visible, formInfo, checked, status } = state + const handleConfirm = async () => { + if (!checked) { + const res = await Taro.showModal({ + title: '提示', + content: `请先阅读并同意${appName}活动细则`, + showCancel: true, + cancel: '取消', + cancelText: '拒绝', + confirmText: '同意', + cancelColor: '#a5a5a5', + confirmColor: '#000' + }) + if (!res.confirm) return + setState((draft) => { + draft.checked = true + draft.visible = true + }) + } + setState((draft) => { + draft.visible = true + }) + } + const renderFooter = () => { if (isLoading || status === 'passed') { return null @@ -77,28 +100,7 @@ export default function detail () { - { - if (!checked) { - const res = await Taro.showModal({ - title: '提示', - content: `请先阅读并同意${appName}活动细则`, - showCancel: true, - cancel: '取消', - cancelText: '拒绝', - confirmText: '同意', - cancelColor: '#a5a5a5', - confirmColor: '#000' - }) - if (!res.confirm) return - setState((draft) => { - draft.checked = true - draft.visible = true - }) - } - setState((draft) => { - draft.visible = true - }) - }} className={"btn"}>{!status ? '确认报名' : status === 'pending' ? '报名中' : '已报名'} + {!status ? '确认报名' : status === 'pending' ? '报名中' : '已报名'} } @@ -139,23 +141,22 @@ export default function detail () { activity_id: activeInfo.activity_id }) if (status) { - // Taro.showToast({ - // title: '报名成功', - // icon: 'none' - // }) setState((draft) => { draft.visible = false draft.status = status }) + const templeparams = { + temp_name: 'yykweishop', + source_type: 'activity' + } + const { template_id } = await api.user.newWxaMsgTmpl(templeparams) + console.log("🚀 ~ template_id:", template_id) Taro.requestSubscribeMessage({ - tmplIds: ['tGJR7BS3HM9xLD4QUdBwtTAJkgzfl7cw_8-ngd74JM4'], + tmplIds: template_id, success: () => { - // onSubscribe() - console.log("🚀 ~ onSubscribe:", 'onSubscribe') }, fail: (err) => { console.log("🚀 ~ err:", err) - // onSubscribe() }, complete: () => { Taro.navigateTo({ url: '/pages/recommend/status?success=true&id=' + activeInfo.activity_id }) diff --git a/src/subpages/member/scan.js b/src/subpages/member/scan.js index 797cba6..ddbad12 100644 --- a/src/subpages/member/scan.js +++ b/src/subpages/member/scan.js @@ -60,8 +60,8 @@ export default function scan () { } const getRecords = async () => { - const data = await api.user.registrationRecordList() - const _list = (data?.list || []).filter(n => n.is_write_off == 1).map(item => { + const data = await api.user.getVerifyRegistrationRecordList({ activity_id: 1 }) + const _list = (data?.list || []).map(item => { let formData = item.content?.[0]?.formdata || [] if (formData.length > 0) { formData.forEach(_item => {