Feat:抽奖2.0(中奖名单缺中奖等级,优惠券领取接口异常)
This commit is contained in:
@@ -572,6 +572,36 @@
|
||||
|
||||
<passkeyborad v-if="isShowPayPwdPop" :money="orderInfo.payPrice" showMoney :show="isShowPayPwdPop" ref='payPwdPop' @close="pwdPopClose"
|
||||
@finish="pwdPopFinish"></passkeyborad>
|
||||
<view v-if="drawTicketPopup.show" class="draw-ticket-mask" @touchmove.stop.prevent>
|
||||
<view class="draw-ticket-popup">
|
||||
<view class="draw-ticket-close" @click="closeDrawTicketPopup">×</view>
|
||||
<view class="draw-ticket-icon">
|
||||
<view class="ticket-icon-box">
|
||||
<view class="ticket-icon-check"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="draw-ticket-title">支付成功</view>
|
||||
<view class="ticket-card-container">
|
||||
<view class="ticket-badge">
|
||||
<text>恭喜获得抽奖码!</text>
|
||||
<view class="ticket-badge-arrow"></view>
|
||||
</view>
|
||||
<view class="ticket-card">
|
||||
<view class="ticket-card-subtitle">
|
||||
<text class="ticket-card-subtitle-text">您的专属抽奖码</text>
|
||||
</view>
|
||||
<view class="ticket-card-code-box">
|
||||
<text class="ticket-card-code">{{ drawTicketPopup.ticketCode }}</text>
|
||||
</view>
|
||||
<view class="ticket-card-time" v-if="drawTicketPopup.drawTime">开奖时间:{{ drawTicketPopup.drawTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="draw-ticket-actions">
|
||||
<view class="action-btn home-btn" @click="goHomeFromPopup">返回首页</view>
|
||||
<view class="action-btn primary" @click="goTicketsFromPopup">查看我的抽奖码</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -641,7 +671,14 @@ export default {
|
||||
isGroup: false,
|
||||
key: "",
|
||||
loading: true,
|
||||
addressEditOrderId: ""
|
||||
addressEditOrderId: "",
|
||||
drawTicketPopupHandled: false,
|
||||
drawTicketPopup: {
|
||||
show: false,
|
||||
orderId: '',
|
||||
ticketCode: '',
|
||||
drawTime: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -698,6 +735,7 @@ export default {
|
||||
this.id = this.$yroute.query.id;
|
||||
this.isGroup = Number(this.$yroute.query.isGroup || 0) === 1;
|
||||
this.key = this.$yroute.query.key || '';
|
||||
this.setDrawTicketPopupFromQuery()
|
||||
this.getDetail();
|
||||
}
|
||||
},
|
||||
@@ -710,6 +748,48 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
copyClipboard,
|
||||
setDrawTicketPopupFromQuery() {
|
||||
if (this.drawTicketPopupHandled) {
|
||||
return
|
||||
}
|
||||
this.drawTicketPopupHandled = true
|
||||
const drawTicketData = this.$yroute.query.drawTicketData
|
||||
if (!drawTicketData) {
|
||||
return
|
||||
}
|
||||
let result = {}
|
||||
try {
|
||||
result = JSON.parse(decodeURIComponent(drawTicketData))
|
||||
} catch (e) {
|
||||
result = {}
|
||||
}
|
||||
const hasTicket = Number(result.hasTicket || 0) === 1
|
||||
const howPopup = Number(result.showPopup || 0) === 1
|
||||
if (!hasTicket || !howPopup) {
|
||||
return
|
||||
}
|
||||
this.drawTicketPopup = {
|
||||
show: true,
|
||||
orderId: this.id || this.$yroute.query.id || '',
|
||||
ticketCode: result.ticketCode || '',
|
||||
drawTime: result.drawTime || ''
|
||||
}
|
||||
},
|
||||
closeDrawTicketPopup() {
|
||||
this.drawTicketPopup.show = false
|
||||
},
|
||||
goHomeFromPopup() {
|
||||
this.drawTicketPopup.show = false
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index'
|
||||
})
|
||||
},
|
||||
goTicketsFromPopup() {
|
||||
this.drawTicketPopup.show = false
|
||||
uni.navigateTo({
|
||||
url: '/pkg-video/views/county-my-tickets'
|
||||
})
|
||||
},
|
||||
getTime(type) {
|
||||
const timeMap = {
|
||||
1:"48小时内",
|
||||
@@ -1432,4 +1512,213 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.draw-ticket-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.draw-ticket-popup {
|
||||
width: 100%;
|
||||
max-width: 640rpx;
|
||||
background: #fff;
|
||||
border-radius: 40rpx;
|
||||
padding: 50rpx 40rpx 60rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.draw-ticket-close {
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
right: 30rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border: 4rpx solid #111;
|
||||
border-radius: 50%;
|
||||
font-size: 50rpx;
|
||||
color: #111;
|
||||
line-height: 52rpx;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.draw-ticket-icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.ticket-icon-box {
|
||||
width: 90rpx;
|
||||
height: 70rpx;
|
||||
border: 6rpx solid #111;
|
||||
border-radius: 10rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ticket-icon-box::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -16rpx;
|
||||
left: 14rpx;
|
||||
width: 50rpx;
|
||||
height: 12rpx;
|
||||
border-top: 6rpx solid #111;
|
||||
border-left: 6rpx solid #111;
|
||||
border-right: 6rpx solid #111;
|
||||
border-radius: 6rpx 6rpx 0 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.ticket-icon-check {
|
||||
width: 36rpx;
|
||||
height: 18rpx;
|
||||
border-left: 6rpx solid #c23326;
|
||||
border-bottom: 6rpx solid #c23326;
|
||||
transform: rotate(-45deg);
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
top: 14rpx;
|
||||
}
|
||||
|
||||
.draw-ticket-title {
|
||||
font-size: 56rpx;
|
||||
color: #222;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
margin-top: 24rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.ticket-card-container {
|
||||
margin-top: 50rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ticket-badge {
|
||||
background-color: #fff9eb;
|
||||
border: 6rpx solid #111;
|
||||
border-radius: 40rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 46rpx;
|
||||
font-weight: 800;
|
||||
color: #222;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
margin-bottom: -36rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.ticket-badge-arrow {
|
||||
position: absolute;
|
||||
bottom: -22rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 22rpx solid transparent;
|
||||
border-right: 22rpx solid transparent;
|
||||
border-top: 22rpx solid #111;
|
||||
}
|
||||
|
||||
.ticket-badge-arrow::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -26rpx;
|
||||
left: -16rpx;
|
||||
border-left: 16rpx solid transparent;
|
||||
border-right: 16rpx solid transparent;
|
||||
border-top: 16rpx solid #fff9eb;
|
||||
}
|
||||
|
||||
.ticket-card {
|
||||
width: 100%;
|
||||
background: #c23326;
|
||||
border-radius: 36rpx;
|
||||
padding: 70rpx 36rpx 40rpx;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ticket-card-subtitle {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.ticket-card-subtitle-text {
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
border: 2rpx solid #fff;
|
||||
border-radius: 40rpx;
|
||||
padding: 8rpx 50rpx;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.ticket-card-code-box {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 36rpx;
|
||||
padding: 36rpx 0;
|
||||
}
|
||||
|
||||
.ticket-card-code {
|
||||
color: #c23326;
|
||||
font-size: 72rpx;
|
||||
font-weight: 800;
|
||||
letter-spacing: 8rpx;
|
||||
}
|
||||
|
||||
.ticket-card-time {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
margin-top: 36rpx;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.draw-ticket-actions {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
height: 86rpx;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.action-btn.home-btn {
|
||||
color: #c23326;
|
||||
border: 2rpx solid #c23326;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.action-btn.primary {
|
||||
color: #fff;
|
||||
background: #c23326;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -309,38 +309,6 @@
|
||||
@close="pwdPopClose"
|
||||
@finish="pwdPopFinish"
|
||||
/>
|
||||
<view v-if="drawTicketPopup.show" class="draw-ticket-mask" @touchmove.stop.prevent>
|
||||
<view class="draw-ticket-popup">
|
||||
<view class="draw-ticket-close" @click="closeDrawTicketPopup">×</view>
|
||||
<view class="draw-ticket-icon">
|
||||
<view class="ticket-icon-box">
|
||||
<view class="ticket-icon-check"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="draw-ticket-title">支付成功</view>
|
||||
|
||||
<view class="ticket-card-container">
|
||||
<view class="ticket-badge">
|
||||
<text>恭喜获得抽奖码!</text>
|
||||
<view class="ticket-badge-arrow"></view>
|
||||
</view>
|
||||
<view class="ticket-card">
|
||||
<view class="ticket-card-subtitle">
|
||||
<text class="ticket-card-subtitle-text">您的专属抽奖码</text>
|
||||
</view>
|
||||
<view class="ticket-card-code-box">
|
||||
<text class="ticket-card-code">{{ drawTicketPopup.ticketCode }}</text>
|
||||
</view>
|
||||
<view class="ticket-card-time" v-if="drawTicketPopup.drawTime">开奖时间:{{ drawTicketPopup.drawTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="draw-ticket-actions">
|
||||
<view class="action-btn home-btn" @click="goHomeFromPopup">返回首页</view>
|
||||
<view class="action-btn primary" @click="goTicketsFromPopup">查看我的抽奖码</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -428,13 +396,7 @@ export default {
|
||||
pageKeyId: Object.freeze('orderConfirm'),
|
||||
total: 0,
|
||||
couponTitle: '',
|
||||
hasCoupon: false,
|
||||
drawTicketPopup: {
|
||||
show: false,
|
||||
orderId: '',
|
||||
ticketCode: '',
|
||||
drawTime: ''
|
||||
}
|
||||
hasCoupon: false
|
||||
}
|
||||
},
|
||||
computed: mapGetters(["userInfo", "storeItems"]),
|
||||
@@ -783,13 +745,11 @@ export default {
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
})
|
||||
this.afterPaySuccess(orderId, () => {
|
||||
this.afterPaySuccess(orderId, (drawTicketResult) => {
|
||||
if (this.orderGroupInfo.cartInfo && this.orderGroupInfo.cartInfo.length === 1) {
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: orderId
|
||||
}
|
||||
query: this.buildOrderDetailQuery(orderId, drawTicketResult)
|
||||
})
|
||||
} else {
|
||||
this.$yrouter.replace({
|
||||
@@ -891,6 +851,12 @@ export default {
|
||||
// this.couponId = uni.getStorageSync('couponId') || 0
|
||||
// this.couponTitle = item.couponTitle
|
||||
},
|
||||
buildOrderDetailQuery(orderId, drawTicketResult = {}) {
|
||||
return {
|
||||
id: orderId,
|
||||
drawTicketData: encodeURIComponent(JSON.stringify(drawTicketResult || {}))
|
||||
}
|
||||
},
|
||||
async afterPaySuccess(orderId, fallback) {
|
||||
if (!orderId) {
|
||||
fallback && fallback()
|
||||
@@ -899,42 +865,13 @@ export default {
|
||||
try {
|
||||
const res = await getDrawTicketByOrder(orderId)
|
||||
const result = (res && res.data) || {}
|
||||
const hasTicket = Number(result.hasTicket || 0) === 1
|
||||
const howPopup = Number(result.howPopup || 0) === 1
|
||||
if (hasTicket && howPopup) {
|
||||
this.drawTicketPopup = {
|
||||
show: true,
|
||||
orderId: orderId,
|
||||
ticketCode: result.ticketCode || '',
|
||||
drawTime: result.drawTime || ''
|
||||
}
|
||||
return
|
||||
}
|
||||
fallback && fallback(result)
|
||||
return
|
||||
} catch (e) {
|
||||
}
|
||||
fallback && fallback()
|
||||
fallback && fallback({})
|
||||
},
|
||||
closeDrawTicketPopup() {
|
||||
this.drawTicketPopup.show = false
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/MyOrder/index",
|
||||
query: {
|
||||
type: 1
|
||||
}
|
||||
})
|
||||
},
|
||||
goHomeFromPopup() {
|
||||
this.drawTicketPopup.show = false
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index'
|
||||
})
|
||||
},
|
||||
goTicketsFromPopup() {
|
||||
this.drawTicketPopup.show = false
|
||||
uni.navigateTo({
|
||||
url: '/pkg-video/views/county-my-tickets'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1112,212 +1049,4 @@ export default {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.draw-ticket-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.draw-ticket-popup {
|
||||
width: 100%;
|
||||
max-width: 640rpx;
|
||||
background: #fff;
|
||||
border-radius: 40rpx;
|
||||
padding: 50rpx 40rpx 60rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.draw-ticket-close {
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
right: 30rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border: 4rpx solid #111;
|
||||
border-radius: 50%;
|
||||
font-size: 50rpx;
|
||||
color: #111;
|
||||
line-height: 52rpx;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.draw-ticket-icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.ticket-icon-box {
|
||||
width: 90rpx;
|
||||
height: 70rpx;
|
||||
border: 6rpx solid #111;
|
||||
border-radius: 10rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ticket-icon-box::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -16rpx;
|
||||
left: 14rpx;
|
||||
width: 50rpx;
|
||||
height: 12rpx;
|
||||
border-top: 6rpx solid #111;
|
||||
border-left: 6rpx solid #111;
|
||||
border-right: 6rpx solid #111;
|
||||
border-radius: 6rpx 6rpx 0 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.ticket-icon-check {
|
||||
width: 36rpx;
|
||||
height: 18rpx;
|
||||
border-left: 6rpx solid #c23326;
|
||||
border-bottom: 6rpx solid #c23326;
|
||||
transform: rotate(-45deg);
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
top: 14rpx;
|
||||
}
|
||||
|
||||
.draw-ticket-title {
|
||||
font-size: 56rpx;
|
||||
color: #222;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
margin-top: 24rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.ticket-card-container {
|
||||
margin-top: 50rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ticket-badge {
|
||||
background-color: #fff9eb;
|
||||
border: 6rpx solid #111;
|
||||
border-radius: 40rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 46rpx;
|
||||
font-weight: 800;
|
||||
color: #222;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
margin-bottom: -36rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.ticket-badge-arrow {
|
||||
position: absolute;
|
||||
bottom: -22rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 22rpx solid transparent;
|
||||
border-right: 22rpx solid transparent;
|
||||
border-top: 22rpx solid #111;
|
||||
}
|
||||
|
||||
.ticket-badge-arrow::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -26rpx;
|
||||
left: -16rpx;
|
||||
border-left: 16rpx solid transparent;
|
||||
border-right: 16rpx solid transparent;
|
||||
border-top: 16rpx solid #fff9eb;
|
||||
}
|
||||
|
||||
.ticket-card {
|
||||
width: 100%;
|
||||
background: #c23326;
|
||||
border-radius: 36rpx;
|
||||
padding: 70rpx 36rpx 40rpx;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ticket-card-subtitle {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.ticket-card-subtitle-text {
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
border: 2rpx solid #fff;
|
||||
border-radius: 40rpx;
|
||||
padding: 8rpx 50rpx;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.ticket-card-code-box {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 36rpx;
|
||||
padding: 36rpx 0;
|
||||
}
|
||||
|
||||
.ticket-card-code {
|
||||
color: #c23326;
|
||||
font-size: 72rpx;
|
||||
font-weight: 800;
|
||||
letter-spacing: 8rpx;
|
||||
}
|
||||
|
||||
.ticket-card-time {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
margin-top: 36rpx;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.draw-ticket-actions {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
height: 86rpx;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.action-btn.home-btn {
|
||||
color: #c23326;
|
||||
border: 2rpx solid #c23326;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.action-btn.primary {
|
||||
color: #fff;
|
||||
background: #c23326;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1496,7 +1496,7 @@ export default {
|
||||
q.dailyGoodsId = Number(this.activityId)
|
||||
break
|
||||
case "countyLottery":
|
||||
q.activityId = Number(this.activityId || 0)
|
||||
q.drawActivityId = Number(this.activityId || 0)
|
||||
break
|
||||
}
|
||||
postCartAdd(q).then(function (res) {
|
||||
|
||||
Reference in New Issue
Block a user