diff --git a/src/pages/activity/index.vue b/src/pages/activity/index.vue index b389202..493876d 100644 --- a/src/pages/activity/index.vue +++ b/src/pages/activity/index.vue @@ -316,6 +316,13 @@ const flip = debounce(function (index) { }) return } + if (cardStateArray.length === 0 || cardStateArray.length === 1) { + uni.showToast({ + title: '无抽奖商品', + icon: 'error', + }) + return + } if (status.value !== 2) { uni.showToast({ title: '活动异常', diff --git a/src/pages/tt-activity/index.vue b/src/pages/tt-activity/index.vue index 8b90ddb..b5380e9 100644 --- a/src/pages/tt-activity/index.vue +++ b/src/pages/tt-activity/index.vue @@ -14,14 +14,10 @@ 站位 - + 恭喜您获得 - + - {{ jiang }} - 请到【我的奖品】中查看 + {{ jiang }} + 请到【我的奖品】中查看 { uni.hideLoading() @@ -275,7 +271,7 @@ export default { // 获取奖品列表 getPrizeList() { Api.getProducts({ - activity_code: this.activity_code, + activity_code: this.activity_code || 'zgp', }).then((res) => { if (res.code === 200) { const { products } = res.data @@ -346,6 +342,14 @@ export default { }) return } + if (this.prizeList.length === 0 || this.prizeList.length === 1) { + this.prizeing = false + uni.showToast({ + title: '无抽奖商品', + icon: 'error', + }) + return + } if (this.status !== 2) { this.prizeing = false uni.showToast({ diff --git a/src/pages/tt-coupon/index.vue b/src/pages/tt-coupon/index.vue index cd4e5b2..c7bf653 100644 --- a/src/pages/tt-coupon/index.vue +++ b/src/pages/tt-coupon/index.vue @@ -46,7 +46,7 @@ - {{ item.product_amount }} + {{ item.amount }} @@ -87,7 +87,7 @@ @@ -119,9 +118,10 @@ import api, { imgUrl } from './api' const istrue = ref(false) +const isShow = ref(false) const list = reactive([]) const query = reactive({ - activity_code: 'quanyi', + activity_code: 'zgp', }) const dui = (item) => { @@ -134,13 +134,31 @@ const dui = (item) => { const gomypre = (idx) => { if (idx.status === 1) { const url = - 'product_id=' + idx.product_id + '&id=' + idx.id + '&activity_code=' + query.activity_code + 'product_id=' + + idx.product_id + + '&id=' + + idx.id + + '&activity_code=' + + query.activity_code + + '&mobile=' + + idx.mobile + + '&account_type=' + + idx.account_type + + '&product_form=' + + idx.product_form const newUrl = encodeURIComponent(url) uni.navigateTo({ url: '/pages/tt-coupon/product?url=' + newUrl, }) } else { - idx.order_info && window.open(idx.order_info) + if (idx.product_form === 3) { + uni.showModal({ + content: `卡密:${idx.order_info}`, + showCancel: false, + }) + } else if (idx.product_form === 1) { + idx.order_info && window.open(idx.order_info) + } } } @@ -219,7 +237,9 @@ onLoad(() => { page { background: #f5f5f5 !important; } - +.not-view { + background-color: #848486; +} .three { overflow: hidden; text-overflow: ellipsis; diff --git a/src/pages/tt-coupon/product.vue b/src/pages/tt-coupon/product.vue index e67f00e..d2aff10 100644 --- a/src/pages/tt-coupon/product.vue +++ b/src/pages/tt-coupon/product.vue @@ -340,12 +340,16 @@ function chosem(index) { curindex.value = index } function okdiu() { - const params = { id: Number(id.value) } + const params = { + id: Number(id.value), + account: route.mobile, + account_type: route.product_form === 2 ? route.account_type : undefined, + } api.exchange(params).then((res: any) => { if (res.code === 200) { uni.hideLoading() uni.navigateTo({ - url: '/pages/tt-coupon/prizes?activity_code=' + route.activity_code, + url: '/pages/tt-coupon/index?activity_code=' + route.activity_code, }) } else { uni.hideLoading() diff --git a/src/pages/tt-coupon/redeem.vue b/src/pages/tt-coupon/redeem.vue index 4ac71dc..1ad916b 100644 --- a/src/pages/tt-coupon/redeem.vue +++ b/src/pages/tt-coupon/redeem.vue @@ -77,7 +77,7 @@ - + { if (res.code === 200) { ismask.value = true