Browse Source

一键领取、最大优惠券

master
jiazhipeng 4 days ago
parent
commit
35cbf6f868
  1. 48
      subPackages/activity/dzxConSeason.vue
  2. 21
      subPackages/techan/order.vue

48
subPackages/activity/dzxConSeason.vue

@ -6,10 +6,14 @@
<view class="main-container"> <view class="main-container">
<view class="coupon-box" v-for="(prize,prizeIndex) in prizeList" :key="prizeIndex" <view class="coupon-box" v-for="(prize,prizeIndex) in prizeList" :key="prizeIndex"
:style="{'background-image':`url(${prize.backgroundImg})`}"> :style="{'background-image':`url(${prize.backgroundImg})`}">
<view class="flex-between" style="flex-wrap: wrap;" v-if="prize.isCoupon"> <view v-if="prize.isCoupon">
<image :class="['coupon-img','coupon-img'+i]" v-for="(item,i) in couponList" :key="i" <view class="flex-between" style="flex-wrap: wrap;" >
:src="item.img" @click="getCoupon(item)" mode="widthFix"></image> <image :class="['coupon-img','coupon-img'+i]" v-for="(item,i) in couponList" :key="i"
:src="item.img" @click="getCoupon(item)" mode="widthFix"></image>
</view>
<view class="getAllCoupon" @click="getAllCoupon()">一键领取</view>
</view> </view>
<view class="w-full" v-else @click="gotoPath(prize.path)"> <view class="w-full" v-else @click="gotoPath(prize.path)">
<image style="width: 100%;height: 262rpx;" :src="prize.img" mode="widthFix"></image> <image style="width: 100%;height: 262rpx;" :src="prize.img" mode="widthFix"></image>
</view> </view>
@ -195,6 +199,30 @@
}) })
}, },
getAllCoupon() {
if (!this.isReceive) {
uni.showToast({
title: "短时间内请勿重复点击!",
icon: 'none'
})
return;
}
this.isReceive = false
setTimeout(() => {this.isReceive = true}, 3000)
let ids = this.couponList.map(x=>x.id).join(',')
this.Post({
ids: ids,
is_all: 1,
},"/api/coupon/getNewCouponsByActivitiesIds").then(res => {
if (res) {
uni.showToast({
title: res.data,
icon: 'none'
})
}
})
},
viewDetail(item) { viewDetail(item) {
this.gotoDetailByType(item) this.gotoDetailByType(item)
@ -452,4 +480,18 @@
bottom: 66rpx; bottom: 66rpx;
right: 26rpx; right: 26rpx;
} }
.getAllCoupon{
width: 347rpx;
height: 67rpx;
background: linear-gradient( 92deg, #FFB86C 0%, #FE9D09 100%);
border-radius: 13rpx 13rpx 13rpx 13rpx;
font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 67rpx;
margin: 24rpx auto 30rpx;
}
</style> </style>

21
subPackages/techan/order.vue

@ -243,11 +243,11 @@ export default {
uni.$off("updateDataByConnect",this.getDataByConnect) uni.$off("updateDataByConnect",this.getDataByConnect)
}, },
onReady () { onReady () {
// this.$nextTick(()=>{ this.$nextTick(()=>{
// setTimeout(()=>{ setTimeout(()=>{
// this.getMaxCouponData() this.getMaxCouponData()
// },1000) },1000)
// }) })
}, },
methods: { methods: {
submitAgreeAdress (val) { submitAgreeAdress (val) {
@ -639,13 +639,14 @@ export default {
// //
async getMaxCouponData () { async getMaxCouponData () {
console.log("enter")
let allPrice =0 let allPrice =0
let skuIds = [] let skuIds = []
if (this.info && Array.isArray(this.info.goods)) { if (this.orderList && Array.isArray(this.orderList)) {
this.info.goods.forEach(v=>{ this.orderList.forEach(v=>{
allPrice += v.skuInfo.money*v.skuInfo.buyNum allPrice += v.sInfo.price*v.sInfo.buyNum
if (v.skuInfo.buyNum>0) { if (v.sInfo.buyNum>0) {
skuIds.push(v.skuInfo.id) skuIds.push(v.sInfo.id)
} }
}) })
} }

Loading…
Cancel
Save