Browse Source

发起拼团,砍价订阅推送,首页跳转领券UI调整

home_hotList^2
ld0104 2 years ago
parent
commit
31c2123e70
  1. 23
      pages/activity/DargainGoodsDetails/index.vue
  2. 17
      pages/activity/GroupDetails/index.vue
  3. 59
      pages/activity/activity/index.vue
  4. 45
      pages/home/index.vue
  5. 7
      pages/shop/HotNewGoods/index.vue
  6. BIN
      static/images/welfare.png

23
pages/activity/DargainGoodsDetails/index.vue

@ -155,7 +155,8 @@
tagStyle: { tagStyle: {
a: 'color:#0A59F7;text-decoration:underline;', a: 'color:#0A59F7;text-decoration:underline;',
img: 'padding:0;margin:0;font-size:0;display:block;' img: 'padding:0;margin:0;font-size:0;display:block;'
} },
subType:true
}; };
}, },
onLoad() { onLoad() {
@ -215,10 +216,30 @@
}) })
}, },
goDargain() { goDargain() {
let isParticipation=JSON.parse(this.$yroute.query.isParticipation)
if(this.subType && !isParticipation) {
let tmplIds = ['iUviwf1eQoQ2BGXdCQx7ki_EAj_4e4v1eLI5IeUbT_0'];
uni.requestSubscribeMessage({
tmplIds,
success:res=> {
this.subType=false
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",
query: { id: this.bargainId, partake: 0 }
});
},
fail(err) {
console.log("requestSubscribeMessage err", err)
}
})
}else{
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/activity/DargainDetails/index", path: "/pages/activity/DargainDetails/index",
query: { id: this.bargainId, partake: 0 } query: { id: this.bargainId, partake: 0 }
}); });
}
}, },
linktap(e) { linktap(e) {
// console.log('description', e.innerText); // console.log('description', e.innerText);

17
pages/activity/GroupDetails/index.vue

@ -352,7 +352,8 @@ export default {
tagStyle: { tagStyle: {
a: 'color:#0A59F7;text-decoration:underline;', a: 'color:#0A59F7;text-decoration:underline;',
img: 'padding:0;margin:0;font-size:0;display:block;' img: 'padding:0;margin:0;font-size:0;display:block;'
} },
subType:true
} }
}, },
computed: {}, computed: {},
@ -581,10 +582,24 @@ export default {
}) })
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId }); // this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
}, },
subscribeMessage(){
let tmplIds = ['kNUN676-t1H3mQplI3iG8_aztf6c1TStnAADF104e4M'];
uni.requestSubscribeMessage({
tmplIds,
success:res=> {
this.subType=false
},
fail(err) {
console.log("requestSubscribeMessage err", err)
}
})
},
// //
openTeam: function() { openTeam: function() {
var that = this var that = this
console.log(this.attr) console.log(this.attr)
if(this.subType) this.subscribeMessage()
if (that.attr.cartAttr == false) { // if (that.attr.cartAttr == false) { //
console.log(this.attr.cartAttr) console.log(this.attr.cartAttr)
that.attr.cartAttr = !this.attr.cartAttr that.attr.cartAttr = !this.attr.cartAttr

59
pages/activity/activity/index.vue

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

45
pages/home/index.vue

@ -58,10 +58,11 @@
</view> </view>
</view> --> </view> -->
<view class="selection-box acea-row row-between"> <view class="selection-box acea-row row-between">
<view class="left"> <view class="left" hover-class="none">
<navigator url="/pages/user/coupon/GetCoupon/index"> <navigator url="/pages/user/coupon/GetCoupon/index">
<view class="title">福利领券</view> <!-- <view class="title">福利领券</view>
<view class="subtitle">大额优惠券领不停</view> <view class="subtitle">大额优惠券领不停</view> -->
<!-- <image class="img" src="@/static/images/welfare.png" mode=""></image> -->
<image class="img" src="@/static/images/welfare.png" mode=""></image> <image class="img" src="@/static/images/welfare.png" mode=""></image>
</navigator> </navigator>
</view> </view>
@ -665,9 +666,9 @@
goComDetail(item){ goComDetail(item){
let id=item.id let id=item.id
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/activity/GroupDetails/index', path: "/pages/activity/activity/index",
query: { id } query: { isType:2 }
}) });
}, },
goSeckillDetail(sec){ goSeckillDetail(sec){
let id=sec.id let id=sec.id
@ -1077,26 +1078,26 @@
width: 230rpx; width: 230rpx;
height: 350rpx; height: 350rpx;
background-color: #F5F6F8; background-color: #F5F6F8;
padding-top: 24rpx; // padding-top: 24rpx;
color: #3A3A3C; color: #3A3A3C;
border-radius: 16rpx; border-radius: 16rpx;
margin-right: 20rpx; margin-right: 20rpx;
box-shadow: 0px 10px 16px 0px rgba(0,0,0,0.06); box-shadow: 0px 10px 16px 0px rgba(0,0,0,0.06);
.title{ overflow: hidden;
margin-left: 26rpx; // .title{
font-size: 36rpx; // margin-left: 26rpx;
font-weight: 600; // font-size: 36rpx;
} // font-weight: 600;
.subtitle{ // }
margin-left: 26rpx; // .subtitle{
font-size: 20rpx; // margin-left: 26rpx;
font-weight: 600; // font-size: 20rpx;
} // font-weight: 600;
// }
.img{ .img{
width: 213rpx; width: 230rpx;
height: 236rpx; height: 350rpx;
margin-left: 18rpx; border-radius: 16rpx;
margin-top: 15rpx;
} }
} }
.right{ .right{
@ -1278,7 +1279,7 @@
font-size: 34rpx; font-size: 34rpx;
position: absolute; position: absolute;
top: 90rpx; top: 90rpx;
left: 22rpx; left: 24rpx;
} }
} }
.hot-right{ .hot-right{

7
pages/shop/HotNewGoods/index.vue

@ -158,7 +158,7 @@ export default {
// observeParents: true // observeParents: true
// } // }
// isShow:false, // isShow:false,
isShowBind:false // isShowBind:false
}; };
}, },
mounted: function() { mounted: function() {
@ -199,8 +199,9 @@ export default {
}, },
// //
bindPickerChange(e) { bindPickerChange(e) {
// if(this.mouthIndex == e.detail.value) return; if(e.detail.value!=0 && this.mouthIndex == e.detail.value) return;
this.mouthIndex = e.detail.value; this.mouthIndex = e.detail.value;
this.subclassIndex=0
this.form.mouth = this.mouthList[this.mouthIndex]; this.form.mouth = this.mouthList[this.mouthIndex];
this.goodsList = []; this.goodsList = [];
this.classifyList = this.hotListData[this.form.mouth].hotListDTOS; this.classifyList = this.hotListData[this.form.mouth].hotListDTOS;
@ -223,7 +224,7 @@ export default {
// //
bindPickerSubclassChange(e) { bindPickerSubclassChange(e) {
// if(this.subclassIndex == e.detail.value) return; // if(this.subclassIndex == e.detail.value) return;
if(this.isShowBind && this.subclassIndex == e.detail.value) { if(e.detail.value!=0 && this.subclassIndex == e.detail.value) {
return; return;
}else{ }else{
if(e.detail.value=="0"){ if(e.detail.value=="0"){

BIN
static/images/welfare.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Loading…
Cancel
Save