From 8f164cc6effebc0e609ca94a5baaa574a3d9cd01 Mon Sep 17 00:00:00 2001 From: LinCyJang Date: Tue, 28 Apr 2026 01:21:38 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9A=E6=8A=BD=E5=A5=962.0=EF=BC=88?= =?UTF-8?q?=E6=8A=BD=E5=A5=96=E6=B4=BB=E5=8A=A8=E6=97=A0=E6=B3=95=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E8=BF=9B=E5=85=A5=E5=88=B0=E4=B8=8B=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=8A=BD=E5=A5=96=E6=B4=BB=E5=8A=A8=EF=BC=8C=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E6=8A=BD=E5=A5=96=E5=95=86=E5=93=81=E6=97=A0=E6=B3=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=88=B0=E6=8A=BD=E5=A5=96=E7=A0=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/lottery.js | 42 +- pages.json | 12 + pages/home/index.vue | 30 +- pkg-video/views/county-claim-address.vue | 746 +++++++++++++++++++++++ pkg-video/views/county-my-tickets.vue | 9 +- pkg-video/views/county-realname.vue | 275 +++++++++ pkg-video/views/county-winners.vue | 162 +++-- 7 files changed, 1208 insertions(+), 68 deletions(-) create mode 100644 pkg-video/views/county-claim-address.vue create mode 100644 pkg-video/views/county-realname.vue diff --git a/api/lottery.js b/api/lottery.js index bb3815f..21e7b69 100644 --- a/api/lottery.js +++ b/api/lottery.js @@ -84,5 +84,45 @@ export function getLotteryShareInfo() { * @param orderId 订单号 */ export function getDrawTicketByOrder(orderId) { - return request.get('/draw/ticketByOrder', { orderId }) + return request.get('/draw/ticketCheck', { orderId }) +} + +/** + * 校验抽奖活动是否到开奖时间 + * @param activityId 抽奖活动ID + */ +export function checkDrawTime(activityId) { + return request.get('/draw/checkTime', { activityId }) +} + +/** + * 领取优惠券奖品 + * @param ticketId 抽奖券ID + */ +export function claimCoupon(ticketId) { + return request.post('/draw/claimCoupon', { ticketId }) +} + +/** + * 领取实物奖品 + * @param ticketId 抽奖券ID + * @param addressId 用户收货地址ID + */ +export function claimPrize(ticketId, addressId) { + return request.post('/draw/claimPrize', { ticketId, addressId }) +} + +/** + * 获取实名认证信息 + */ +export function getDrawRealname() { + return request.get('/draw/realname') +} + +/** + * 提交实名认证 + * @param data { realName, idCard, phone } + */ +export function submitDrawRealname(data = {}) { + return request.post('/draw/realname', data) } diff --git a/pages.json b/pages.json index 8cbd610..cd2bb44 100644 --- a/pages.json +++ b/pages.json @@ -430,6 +430,18 @@ "style": { "navigationStyle": "custom" } + }, + { + "path": "views/county-claim-address", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "views/county-realname", + "style": { + "navigationStyle": "custom" + } } ] }, diff --git a/pages/home/index.vue b/pages/home/index.vue index ba8b31e..bca3b65 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -441,6 +441,7 @@ import { openLocationSettting } from "@/utils/common" import { getWeixinShareConfig } from '@/api/public' +import { checkDrawTime } from '@/api/lottery' export default { name: 'IndexPage', components: { @@ -1658,12 +1659,35 @@ export default { this.isDrawPosterVisible = false this.showNextPoster() }, - goDrawLotteryPage() { + parseCheckTimeResult(res) { + if (typeof res === 'boolean') return res + if (typeof (res && res.data) === 'boolean') return res.data + if (res && typeof res.success !== 'undefined') return Boolean(res.data) + return false + }, + async goDrawLotteryPage() { const config = this.drawEntranceConfig || {} const linkType = Number(config.homePosterLinkType) || 1 - const activityId = Number(config.homePosterAreaId) || 0 + const activityId = Number(config.drawActivityId) || 0 + if (!activityId) { + uni.showToast({ + title: '活动配置异常', + icon: 'none' + }) + return + } + let opened = false + try { + const res = await checkDrawTime(activityId) + // opened = this.parseCheckTimeResult(res) + } catch (e) { + opened = false + } + const url = opened + ? `/pkg-video/views/county-winners?activityId=${activityId}` + : `/pkg-video/views/county-lottery?linkType=${linkType}&activityId=${activityId}` uni.navigateTo({ - url: `/pkg-video/views/county-lottery?linkType=${linkType}&activityId=${4}` + url }) }, tapDrawPoster() { diff --git a/pkg-video/views/county-claim-address.vue b/pkg-video/views/county-claim-address.vue new file mode 100644 index 0000000..f407464 --- /dev/null +++ b/pkg-video/views/county-claim-address.vue @@ -0,0 +1,746 @@ +