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 @@
+
+
+
+
+
+ 奖品信息
+
+
+
+
+
+ {{ form.prizeName || '神秘奖品' }}
+ 颜色随机
+ 抽奖码:{{ form.ticketCode || '--' }}
+
+
+
+
+
+ 收货人
+
+
+
+ 手机号码
+
+
+
+ 所在地区
+
+
+
+
+
+
+
+
+ 详细地址
+
+
+
+
+
+
+ 清空
+ 识别
+
+
+
+
+ *请仔细核对收货信息,提交后不可修改,奖品将在7个工作日内寄出
+
+
+
+ 确认提交
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pkg-video/views/county-my-tickets.vue b/pkg-video/views/county-my-tickets.vue
index 0bf965e..f3bb244 100644
--- a/pkg-video/views/county-my-tickets.vue
+++ b/pkg-video/views/county-my-tickets.vue
@@ -226,8 +226,15 @@ export default {
},
onClaim(item) {
if (!item.id) return
+ const query = [
+ `lotteryRecordId=${item.id}`,
+ `ticketCode=${encodeURIComponent(item.ticketCode || '')}`,
+ `prizeName=${encodeURIComponent(item.prizeName || '')}`,
+ `prizeType=${encodeURIComponent(item.prizeType || '')}`,
+ `prizeTypeName=${encodeURIComponent(item.prizeTypeName || '')}`
+ ].join('&')
uni.navigateTo({
- url: `/pages/order/OrderSubmission/index?lotteryRecordId=${item.id}`
+ url: `/pkg-video/views/county-claim-address?${query}`
})
},
goOrder(item) {
diff --git a/pkg-video/views/county-realname.vue b/pkg-video/views/county-realname.vue
new file mode 100644
index 0000000..311335f
--- /dev/null
+++ b/pkg-video/views/county-realname.vue
@@ -0,0 +1,275 @@
+
+
+
+
+
+ 请完善以下信息
+ 根据平台活动规则,领取电子数码产品需要进行实名认证
+
+
+
+ *
+ 真实姓名
+
+
+
+ *
+ 身份证号
+
+
+
+ *
+ 手机号
+
+
+
+
+
+
+ 提交认证
+
+
+
+
+
+
+
diff --git a/pkg-video/views/county-winners.vue b/pkg-video/views/county-winners.vue
index 624a914..77d63a2 100644
--- a/pkg-video/views/county-winners.vue
+++ b/pkg-video/views/county-winners.vue
@@ -6,17 +6,15 @@
-
-
+
- 第{{ periodLabel }}期
+ 第
+ {{ periodLabel }}
+ 期
@@ -34,12 +32,7 @@
开奖时间:{{ drawTime }}
-
-
-
- 恭喜您中奖了!
-
-
+
您的抽奖码 {{ userWinList[0].ticketCode }} 获得了
@@ -64,9 +57,9 @@
-
- 🎁
- 中奖名单
+
+ 🎁
+ 中奖名单
@@ -105,20 +98,25 @@