|
|
|
@ -149,13 +149,21 @@
|
|
|
|
|
this.getBargainList(); |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
if(this.$yroute.query.isType==1){ |
|
|
|
|
this.tabType=1 |
|
|
|
|
this.activityType=2 |
|
|
|
|
}else if(this.$yroute.query.isType==0){ |
|
|
|
|
this.tabType=0 |
|
|
|
|
this.activityType=2 |
|
|
|
|
switch (this.$yroute.query.isType){ |
|
|
|
|
case '0': |
|
|
|
|
this.tabType=0 |
|
|
|
|
this.activityType=2 |
|
|
|
|
break; |
|
|
|
|
case '1': |
|
|
|
|
this.tabType=1 |
|
|
|
|
this.activityType=2 |
|
|
|
|
break; |
|
|
|
|
case '2': |
|
|
|
|
this.tabType=0 |
|
|
|
|
this.activityType=1 |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getBanner(3).then( |
|
|
|
|
res => { |
|
|
|
|
this.$set(this,'banner',res.data.banner) |
|
|
|
@ -210,40 +218,25 @@
|
|
|
|
|
this.goodsList=[] |
|
|
|
|
// this.tabType = 0; |
|
|
|
|
if(i === 0) { |
|
|
|
|
this.seckillList=[] |
|
|
|
|
this.seckillForm.page=1 |
|
|
|
|
this.setTime(0); |
|
|
|
|
// this.goodsList = this.seckillList; |
|
|
|
|
} else if(i === 1) { |
|
|
|
|
this.groupForm.page=1 |
|
|
|
|
this.grouponList=[] |
|
|
|
|
this.groupLoaded=false |
|
|
|
|
this.getGrouponList() |
|
|
|
|
// this.goodsList = this.grouponList; |
|
|
|
|
} else { |
|
|
|
|
this.bargainList=[] |
|
|
|
|
this.bargainForm.page=1 |
|
|
|
|
this.getBargainList() |
|
|
|
|
// this.goodsList = this.bargainList; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
setTabType(i) { |
|
|
|
|
if(this.tabType == i) return; |
|
|
|
|
// this.goodsList=[] |
|
|
|
|
this.goodsList=[] |
|
|
|
|
this.tabType = i; |
|
|
|
|
if(this.activityType == 0) { |
|
|
|
|
this.seckillList=[] |
|
|
|
|
this.goodsList=[] |
|
|
|
|
this.seckillForm.page=1 |
|
|
|
|
this.setTime(i); |
|
|
|
|
}else if(this.activityType == 1){ |
|
|
|
|
this.groupForm.page=1 |
|
|
|
|
this.grouponList=[] |
|
|
|
|
this.groupLoaded=false |
|
|
|
|
this.getGrouponList() |
|
|
|
|
}else{ |
|
|
|
|
this.bargainList=[] |
|
|
|
|
this.bargainForm.page=1 |
|
|
|
|
this.getBargainList() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -266,9 +259,10 @@
|
|
|
|
|
query: { id } |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
let isParticipation=item.isParticipation |
|
|
|
|
this.$yrouter.push({ |
|
|
|
|
path: "/pages/activity/DargainGoodsDetails/index", |
|
|
|
|
query: { id, partake: 0 } |
|
|
|
|
query: { id, partake: 0 ,isParticipation} |
|
|
|
|
}); |
|
|
|
|
// this.$yrouter.push({ |
|
|
|
|
// path: "/pages/activity/DargainDetails/index", |
|
|
|
@ -281,7 +275,6 @@
|
|
|
|
|
title: "", |
|
|
|
|
}); |
|
|
|
|
getSeckillConfig().then(res => { |
|
|
|
|
console.log(res.data,55555555); |
|
|
|
|
this.timeList = res.data.seckillTime; |
|
|
|
|
this.timeList.forEach(res=>{ |
|
|
|
|
res.rule=res.rule.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"') |
|
|
|
@ -297,15 +290,12 @@
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
setTime(i) { |
|
|
|
|
this.seckillList=[] |
|
|
|
|
this.seckillForm.page=1 |
|
|
|
|
if(i == 0 && this.tabType==0) { |
|
|
|
|
console.log(1111111111111); |
|
|
|
|
this.seckillActive = this.seckillTimeIndex; |
|
|
|
|
} else { |
|
|
|
|
if(this.seckillTimeIndex == this.timeList.length-1) { |
|
|
|
|
// this.seckillActive = 0; |
|
|
|
|
this.seckillList=[] |
|
|
|
|
this.goodsList=[] |
|
|
|
|
this.seckillForm.page=1 |
|
|
|
|
return |
|
|
|
|
} else { |
|
|
|
|
this.seckillActive = this.seckillTimeIndex+1; |
|
|
|
@ -322,6 +312,9 @@
|
|
|
|
|
}, |
|
|
|
|
getSeckillList() { |
|
|
|
|
if (this.seckillLoaded) return; |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: "", |
|
|
|
|
}); |
|
|
|
|
let time = this.timeList[this.seckillActive].id; |
|
|
|
|
getSeckillList(time, this.seckillForm).then(res => { |
|
|
|
|
this.seckillLoaded = res.data.length < this.seckillForm.limit; |
|
|
|
@ -334,7 +327,13 @@
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getGrouponList() { |
|
|
|
|
this.groupForm.page=1 |
|
|
|
|
this.grouponList=[] |
|
|
|
|
this.groupLoaded=false |
|
|
|
|
if (this.groupLoaded) return |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: "", |
|
|
|
|
}); |
|
|
|
|
if(this.activityType === 1 && this.tabType===0){ |
|
|
|
|
getCombinationList(this.groupForm).then(res => { |
|
|
|
|
this.grouponList = this.grouponList.concat(res.data.storeCombinationQueryVos) |
|
|
|
@ -350,10 +349,16 @@
|
|
|
|
|
this.goodsList = this.grouponList; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
getBargainList() { |
|
|
|
|
if (this.bargainLoaded) return; |
|
|
|
|
this.bargainList=[] |
|
|
|
|
this.bargainForm.page=1 |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: "", |
|
|
|
|
}); |
|
|
|
|
getBargainList(this.bargainForm).then(res => { |
|
|
|
|
if(this.tabType===0){ |
|
|
|
|
this.bargainList.push.apply(this.bargainList, res.data.yxStoreBargainQueryVos); |
|
|
|
@ -365,7 +370,7 @@
|
|
|
|
|
if(this.activityType === 2) { |
|
|
|
|
this.goodsList = this.bargainList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|