From 9d3f8da62934f0f9374078a1217f910e8d61d885 Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Fri, 7 Aug 2020 17:34:59 +0800 Subject: [PATCH] rewrite tab swiper 8.7 --- components/mine/collection-item/index.vue | 15 +- components/mine/coupon/index.vue | 2 +- components/shop/recommend/pintuan.vue | 5 +- components/shop/seckill/item.vue | 5 +- pageB/sdetails/index.vue | 32 +++-- pageC/cart/index.vue | 6 +- pageE/mine/MemberServeCoupon.vue | 163 ++++++++++++++-------- pageE/order/Index.vue | 17 +-- 8 files changed, 153 insertions(+), 92 deletions(-) diff --git a/components/mine/collection-item/index.vue b/components/mine/collection-item/index.vue index 95c511c..c772971 100644 --- a/components/mine/collection-item/index.vue +++ b/components/mine/collection-item/index.vue @@ -9,7 +9,7 @@ @click="removeFavorite" @open="open" > - + @@ -45,6 +45,18 @@ export default { this.getGoodsFavoritesList(); }, methods: { + viewGoodsDetails(item) { + const list = this.list.filter(item => { + return item.show; + }) + if(list.length) return false; + this.$u.route({ + url: 'pageB/sdetails/index', + params: { + id: item.fav_id, + } + }) + }, getGoodsFavoritesList() { this.$u.api.getFavoritesList().then(res => { if(res.errCode == 0) { @@ -75,6 +87,7 @@ export default { this.list.map((val, idx) => { if(index != idx) this.list[idx].show = false; }) + this.$forceUpdate(); } }, }; diff --git a/components/mine/coupon/index.vue b/components/mine/coupon/index.vue index 67bbb89..f9648e3 100644 --- a/components/mine/coupon/index.vue +++ b/components/mine/coupon/index.vue @@ -10,7 +10,7 @@ {{ couponInfo.vouchertemplate_price }} 满{{ couponInfo.vouchertemplate_limit }}使用 - 仅限{{ couponInfo.vouchertemplate_storename }}商品使用 + 仅限{{ couponInfo.type == 2 ? couponInfo.vouchertemplate_storename : '指定商品' }}使用 兑换积分:{{ couponInfo.vouchertemplate_points }}积分 有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }} diff --git a/components/shop/recommend/pintuan.vue b/components/shop/recommend/pintuan.vue index f27c76e..25a7589 100644 --- a/components/shop/recommend/pintuan.vue +++ b/components/shop/recommend/pintuan.vue @@ -60,8 +60,9 @@ export default { this.$u.route({ url: 'pageB/sdetails/index', params: { - id: this.recommendData.pintuan_id, - type: 2, + // id: this.recommendData.pintuan_id, + id: this.recommendData.groupbuy_id, + // type: 2, } }) } diff --git a/components/shop/seckill/item.vue b/components/shop/seckill/item.vue index efebd34..1dc7258 100644 --- a/components/shop/seckill/item.vue +++ b/components/shop/seckill/item.vue @@ -45,8 +45,9 @@ export default { this.$u.route({ url: 'pageB/sdetails/index', params: { - id: this.item.groupbuy_id, - type: 3, + // id: this.item.groupbuy_id, + id: this.item.goods_id, + // type: 3, } }) }, diff --git a/pageB/sdetails/index.vue b/pageB/sdetails/index.vue index 3e16d25..d937efc 100644 --- a/pageB/sdetails/index.vue +++ b/pageB/sdetails/index.vue @@ -133,7 +133,7 @@ 购买数量 - + @@ -230,7 +230,6 @@ export default { // this.type = Number(option.type); // this.type = 1; this.id = option.id; - this.setTitle(); // 先请求普通商品详情获取商品类型再渲染页面 this.ordinaryDetails(this.id); }, @@ -299,9 +298,9 @@ export default { }, getGoodsDetails(id) { switch (this.type) { - // case 1: - // this.ordinaryDetails(id); - // break; + case 1: + this.ordinaryDetails(id); + break; case 2: this.pinTuanDetails(id); break; @@ -322,7 +321,16 @@ export default { this.setSwiperList(res.data.goods_image); this.glist = res.data.spec_list; this.type = res.data.view_type; - this.getGoodsDetails(this.type); + this.setTitle(); + if(this.type == 1) { + this.id = res.data.goods.goods_id; + } else if(this.type == 2) { + this.id = res.data.goods.pintuan_id; + this.getGoodsDetails(this.id); + } else if(this.type == 3) { + this.id = res.data.goods.groupbuy_id; + this.getGoodsDetails(this.id); + } } }) }, @@ -338,7 +346,7 @@ export default { this.glist = res.data.data.spec_list; this.user_suc = res.data.data.user_suc; this.groupUser =res.data.data.user; - console.log(this.groupUser); + // console.log(this.groupUser); } }) }, @@ -348,6 +356,7 @@ export default { groupbuy_id: id }).then(res => { if(res.errCode == 0) { + this.id = res.data.groupbuy_id; this.groupbuyInfo = res.data.groupbuyInfo; this.evaluate = res.data.goodsInfo.goods_evaluate_info; this.goodsInfo = res.data.goodsInfo.goods; @@ -361,7 +370,7 @@ export default { this.$u.route({ url: '/pageB/triedDress/index', params: { - id: this.id, + id: this.goodsInfo.goods_id, } }) }, @@ -412,9 +421,6 @@ export default { this.showInvolvementUser = true; // console.log(this.involvemenGroupInfo); }, - valChange(e) { - // console.log(this.value) - }, self(){ // console.log(this.$refs.guige) let index = 0; @@ -490,7 +496,7 @@ export default { } }, addFavoriteGoods() { - this.$u.api.addFavoriteGoods({ fid: this.id }).then(res => { + this.$u.api.addFavoriteGoods({ fid: this.goodsInfo.goods_id }).then(res => { if(res.errCode == 0) { this.getGoodsDetails(this.id); } else { @@ -499,7 +505,7 @@ export default { }) }, removeFavorite() { - this.$u.api.removeFavorite({ fid: this.id, type: 'goods' }).then(res => { + this.$u.api.removeFavorite({ fid: this.goodsInfo.goods_id, type: 'goods' }).then(res => { if(res.errCode == 0) { this.getGoodsDetails(this.id); } else { diff --git a/pageC/cart/index.vue b/pageC/cart/index.vue index bb720dd..6e49827 100644 --- a/pageC/cart/index.vue +++ b/pageC/cart/index.vue @@ -14,8 +14,8 @@ - - {{ goods.goods_name }} + + {{ goods.goods_name }} ¥{{ goods.goods_price }} @@ -238,7 +238,7 @@ export default { // #ifdef APP-PLUS let currentWebview = page.$getAppWebview(); let titleObj = currentWebview.getStyle().titleNView; - console.log(JSON.stringify(titleObj.buttons[0])); + // console.log(JSON.stringify(titleObj.buttons[0])); if (!titleObj.buttons) { return; } diff --git a/pageE/mine/MemberServeCoupon.vue b/pageE/mine/MemberServeCoupon.vue index e9a9a0b..f2694f0 100644 --- a/pageE/mine/MemberServeCoupon.vue +++ b/pageE/mine/MemberServeCoupon.vue @@ -1,9 +1,11 @@ \ No newline at end of file diff --git a/pageE/order/Index.vue b/pageE/order/Index.vue index d7d149e..f2c2e82 100644 --- a/pageE/order/Index.vue +++ b/pageE/order/Index.vue @@ -5,7 +5,7 @@ - + @@ -13,7 +13,7 @@ - + @@ -162,8 +162,7 @@ export default { return res.data.list.length; }, reachBottom() { - // 大于15条才会加载更多 - if(this.orderList.length < 15) return false; + if(this.current == 4) return; if(!this.timer) return false; this.timer = false; this.loadStatus.splice(this.current, 1, "loading"); @@ -171,8 +170,8 @@ export default { let promise; // if(this.current == 6) promise = this.getAfterSaleList(); // else - if(this.current == 4) promise = this.goodsTryOrderList(); - else promise = this.getOrderList(); + // if(this.current == 4) promise = this.goodsTryOrderList(); + promise = this.getOrderList(); promise.then(length => { this.loadStatus.splice(this.current, 1, "nomore"); if(length == 0) this.page--; @@ -204,8 +203,10 @@ export default { display: flex; flex-direction: column; .swiper-item { - .item-container { - padding: 20rpx 30rpx; + .order-scroll { + .item-container { + padding: 20rpx 30rpx; + } } } } -- 2.45.2