From 37d8ab7a2bb40ea79aa6531e61f447087989c165 Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Tue, 11 Aug 2020 15:38:43 +0800 Subject: [PATCH 1/2] fixing bug 8.11 --- common/api/shop.js | 12 ++-- pageB/components/sdetails/guige.vue | 2 +- pageB/coupon/details.vue | 9 --- pageB/coupon/index.vue | 85 +++++++++++++++++++++++++++++ pageB/sdetails/index.vue | 49 +++++++++-------- pageB/search/index.vue | 29 +++++++++- pageC/cart/ConfirmOrder.vue | 2 +- pageE/order/Logistics.vue | 2 +- pages.json | 16 +++++- pages/index/index.vue | 62 ++------------------- 10 files changed, 170 insertions(+), 98 deletions(-) create mode 100644 pageB/coupon/index.vue diff --git a/common/api/shop.js b/common/api/shop.js index 8b65eef..b4b890b 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -202,9 +202,10 @@ export default { return vm.$u.post('Spike/recommendedSpike'); }, // 秒杀详情 - getSpikeInfo({ groupbuy_id }) { + getSpikeInfo({ groupbuy_id, goods_id }) { return vm.$u.post('Spike/spikeInfo', { - groupbuy_id: groupbuy_id + groupbuy_id: groupbuy_id, + goods_id: goods_id, }); }, // 秒杀列表 @@ -221,8 +222,11 @@ export default { }); }, // 拼团商品详情 - getPinTuanDetails({ pintuan_id }) { - return vm.$u.post('Specialci/pintuanInfo', { pintuan_id: pintuan_id }); + getPinTuanDetails({ pintuan_id, goods_id }) { + return vm.$u.post('Specialci/pintuanInfo', { + pintuan_id: pintuan_id, + goods_id: goods_id, + }); }, // 推荐拼团 getPinTuanPush() { diff --git a/pageB/components/sdetails/guige.vue b/pageB/components/sdetails/guige.vue index a55da42..e156f6b 100644 --- a/pageB/components/sdetails/guige.vue +++ b/pageB/components/sdetails/guige.vue @@ -57,7 +57,7 @@ export default { props:['item','title'], watch:{ select(){ - console.log(this.select) + // console.log(this.select) this.$emit("sel", this.select); } } diff --git a/pageB/coupon/details.vue b/pageB/coupon/details.vue index 3d368a2..81e8a3d 100644 --- a/pageB/coupon/details.vue +++ b/pageB/coupon/details.vue @@ -56,17 +56,8 @@ export default { }, onLoad(option) { this.price = option.price; - // this.isNewmembervoucher(); }, methods: { - // 是否显示新人优惠券 - isNewmembervoucher() { - this.$u.api.isNewmembervoucher().then(res => { - if(res.errCode == 0) { - this.price = res.data.price; - } - }) - }, exchangeCoupon() { this.$u.api.getCoupon({ id: 1 }).then(res => { this.$u.toast(res.message); diff --git a/pageB/coupon/index.vue b/pageB/coupon/index.vue new file mode 100644 index 0000000..fa92d6a --- /dev/null +++ b/pageB/coupon/index.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/pageB/sdetails/index.vue b/pageB/sdetails/index.vue index 2b14b17..15c9d8e 100644 --- a/pageB/sdetails/index.vue +++ b/pageB/sdetails/index.vue @@ -196,7 +196,7 @@ export default { goodsInfo: {}, // 商品信息 storeInfo: {}, // 店铺信息 glist: [], // 规格列表 - id: 0, // 商品id/秒杀id/拼团 id + id: 0, // 商品id type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券 groupUser: [], // 拼团用户 user_suc: [], // 拼团成功用户 @@ -215,7 +215,9 @@ export default { sel: "", // 拼接的规格 quanxuan: false, // 规格是否选择 debounce: true, // 防止多次提交订单 - storeid:0 // 店铺id + storeid:0, // 店铺 id + pintuan_id: '', // 拼团 id + groupbuy_id: '', // 秒杀 id } }, components: { @@ -383,10 +385,10 @@ export default { this.ordinaryDetails(id); break; case 2: - this.pinTuanDetails(id); + this.pinTuanDetails(); break; case 3: - this.spikeGoodsDetails(id); + this.spikeGoodsDetails(); break; default: break; @@ -394,38 +396,40 @@ export default { }, // 普通商品详情 ordinaryDetails(id) { - this.$u.api.getGoodsDetails({ id: id }).then((res)=>{ - // console.log(res) + this.$u.api.getGoodsDetails({ id: id }).then(res => { if (res.errCode == 0) { this.evaluate = res.data.goods_evaluate_info; this.goodsInfo = res.data.goods; this.storeInfo = res.data.store; this.setSwiperList(res.data.goods_image); this.glist = res.data.spec_list; - this.storeid = res.data.store.store_id - // console.log(this.goodsInfo.mobile_body); + this.storeid = res.data.store.store_id; this.type = res.data.view_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); + this.id = res.data.goods.goods_id; + this.pintuan_id = res.data.goods.pintuan_id; + this.getGoodsDetails(); } else if(this.type == 3) { - this.id = res.data.groupbuy_id; - this.getGoodsDetails(this.id); + this.id = res.data.goods.goods_id; + this.groupbuy_id = res.data.groupbuy_id; + this.getGoodsDetails(); } } }) }, // 拼团详情 - pinTuanDetails(id) { + pinTuanDetails() { this.$u.api.getPinTuanDetails({ - pintuan_id: id + pintuan_id: this.pintuan_id, + goods_id: this.id, }).then(res => { if(res.errCode == 0) { this.evaluate = res.data.data.goods_evaluate_info; this.goodsInfo = res.data.data.goods; + this.pintuan_id = res.data.data.pintuan_id; this.setSwiperList(res.data.data.goods_image); this.glist = res.data.data.spec_list; this.user_suc = res.data.data.user_suc; @@ -435,13 +439,14 @@ export default { }) }, // 秒杀详情 - spikeGoodsDetails(id) { + spikeGoodsDetails() { this.$u.api.getSpikeInfo({ - groupbuy_id: id + groupbuy_id: this.groupbuy_id, + goods_id: this.id, }).then(res => { if(res.errCode == 0) { - // this.id = res.data.groupbuy_id; this.groupbuyInfo = res.data.groupbuyInfo; + this.groupbuy_id = res.data.groupbuyInfo.groupbuy_id; this.evaluate = res.data.goodsInfo.goods_evaluate_info; this.goodsInfo = res.data.goodsInfo.goods; this.setSwiperList(res.data.goodsInfo.goods_image); @@ -497,16 +502,14 @@ export default { } if(this.type == 2) { if(type == 'involvement') { - // const userId = uni.getStorageSync('user_info').member.member_id; this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id); - // console.log(this.$store.state.pintuangroup_headid); Object.assign(params, { - pintuan_id: this.id, + pintuan_id: this.pintuan_id, pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id, }) } else { Object.assign(params, { - pintuan_id: this.id, + pintuan_id: this.pintuan_id, }) } } @@ -519,6 +522,7 @@ export default { url: '/pageC/cart/ConfirmOrder' }) } else { + this.$u.toast(res.message); this.debounce = true; } }) @@ -555,8 +559,9 @@ export default { // console.log(id) // 选择完规格后设商品type = 1 // this.type = 1; - this.getGoodsDetails(this.glist[id]) + // 改变 goods_id this.id = this.glist[id]; + this.getGoodsDetails(); }, // 设置页面标题 setTitle() { diff --git a/pageB/search/index.vue b/pageB/search/index.vue index 816dc2e..aed9950 100644 --- a/pageB/search/index.vue +++ b/pageB/search/index.vue @@ -18,10 +18,12 @@ export default { searchwordlist: [], } }, - // type: 2 商品 1: 其他 + // type: 1 商品 2: 其他 onLoad(option) { this.type = option.type; this.getWordList(); + if(option.type == 1) this.setNavSearchInput('搜索您需要的商品'); + else if(option.type == 2) this.setNavSearchInput('请输入搜索内容'); }, // 点击搜索按钮 onNavigationBarButtonTap(e) { @@ -36,6 +38,31 @@ export default { this.search(this.keyword); }, methods:{ + setNavSearchInput(placeholder) { + // #ifdef APP-PLUS + // 修改 placeholder + webview.setStyle({ + 'titleNView': { + "searchInput": { //修改当前窗口search样式 + "placeholder": placeholder, + } + } + }) + // #endif + // #ifdef H5 + let inputSearch=document.querySelector('.uni-input-input[type=search]'); + const evt = new InputEvent('input', { + inputType: 'insertText', + data: keyword, + dataTransfer: null, + isComposing: false + }); + if(inputSearch){ + inputSearch.value = keyword; + inputSearch.dispatchEvent(evt); + } + // #endif + }, getWordList() { this.$u.api.searchwordlist({type:this.type}).then(res => { console.log(res) diff --git a/pageC/cart/ConfirmOrder.vue b/pageC/cart/ConfirmOrder.vue index 0f368a5..5b683a6 100644 --- a/pageC/cart/ConfirmOrder.vue +++ b/pageC/cart/ConfirmOrder.vue @@ -148,7 +148,7 @@ export default { onLoad(option) { this.orderType = this.$store.state.orderType; this.orderInfo = this.$store.state.orderInfo; - console.log('orderType' + this.orderType); + // console.log('orderType' + this.orderType); // console.log(this.orderInfo); this.getGoodsClass(); this.setTotalPrice(); diff --git a/pageE/order/Logistics.vue b/pageE/order/Logistics.vue index 8217e5a..b4d3306 100644 --- a/pageE/order/Logistics.vue +++ b/pageE/order/Logistics.vue @@ -43,12 +43,12 @@ export default { methods: { getOrderLogistics(id) { this.$u.api.orderLogistics({ id: id }).then(res => { - this.$u.toast(res.message); if(res.errCode == 0) { this.expressInfo = res.data.express_info; this.list = res.data.express_list; } else { this.list = []; + this.$u.toast(res.message); } }) } diff --git a/pages.json b/pages.json index ccbeec4..9410c6a 100644 --- a/pages.json +++ b/pages.json @@ -178,7 +178,7 @@ "searchInput": { "align": "left", "borderRadius": "15px", - "placeholder": "搜索您需要的商品", + "placeholder": "", "backgroundColor": "rgb(236,236,236)", "placeholderColor": "#999999", "disabled": false, @@ -198,7 +198,7 @@ "searchInput": { "align": "left", "borderRadius": "15px", - "placeholder": "搜索您需要的商品", + "placeholder": "请输入搜索内容", "backgroundColor": "rgb(236,236,236)", "placeholderColor": "#999999", "disabled": false, @@ -238,6 +238,18 @@ } } }, + { + "path": "coupon/index", + "style": { + "navigationStyle": "custom", + "app-plus": { + "animationType": "fade-in", // 设置fade-in淡入动画,为最合理的动画类型 + "background": "transparent", // 背景透明 + "backgroundColor": "rgba(0,0,0,0)", // 背景透明 + "popGesture": "none" // 关闭IOS屏幕左边滑动关闭当前页面的功能 + } + } + }, { "path": "coupon/details", "style": { diff --git a/pages/index/index.vue b/pages/index/index.vue index c306ecd..e1c0ec6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -87,13 +87,6 @@ - - - {{ newMemberCoupon.price }} - - - - @@ -208,41 +201,6 @@ margin: 200rpx auto 0; text-align: center; } - .u-coupon-popup { - /deep/ .u-mode-center-box { - background-color: transparent; - } - .coupon { - width: 750rpx; - height: 583rpx; - position: relative; - .price { - z-index: 3; - color: #EBB36E; - position: absolute; - font-size: 108rpx; - font-weight: bold; - top: 200rpx; - left: 50%; - transform: translate(-68%, 0); - } - .coupon-image { - width: 568rpx; - height: 583rpx; - position: absolute; - top: 0; - left: 50%; - transform: translate(-60%, 0); - } - .close-image { - position: absolute; - top: 0; - right: 155rpx; - width: 60rpx; - height: 60rpx; - } - } - } @@ -284,8 +242,6 @@ loading: '努力加载中', nomore: '实在没有了' }, - showCoupon: false, - newMemberCoupon: {}, } }, components: { @@ -304,16 +260,16 @@ if(this.$store.state.hasLogin){ this.isNewmembervoucher(); const user = uni.getStorageSync('user_info'); - console.log(user) + // console.log(user) this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar) this.imService.connectIM() let that = this setTimeout(function(){ that.imService.disconnect() - console.log("guanbi") + // console.log("guanbi") },1000) setTimeout(function(){ - console.log("lianjie") + // console.log("lianjie") that.imService.connectIM() },2000) } @@ -340,7 +296,7 @@ }, // 关注 changeType(member_id) { - console.log(member_id); + // console.log(member_id); // this.$emit("pChangeType"); this.$u.api.attentionMember({ member_id: member_id @@ -504,18 +460,10 @@ isNewmembervoucher() { this.$u.api.isNewmembervoucher().then(res => { if(res.errCode == 0) { - this.newMemberCoupon = res.data; - this.showCoupon = true; - } else { - this.showCoupon = false; + this.$u.route('/pageB/coupon/index'); } }) }, - viewCoupon() { - this.$u.route('/pageB/coupon/details', { - price: this.newMemberCoupon.price - }); - } }, } -- 2.47.2 From 1ef4db7dc4bf192a0b1e24880384fc7d0a111641 Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Tue, 11 Aug 2020 15:39:56 +0800 Subject: [PATCH 2/2] fixing bug 8.11 --- pageB/search/index.vue | 13 ------------- pages.json | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/pageB/search/index.vue b/pageB/search/index.vue index aed9950..3cf49c2 100644 --- a/pageB/search/index.vue +++ b/pageB/search/index.vue @@ -49,19 +49,6 @@ export default { } }) // #endif - // #ifdef H5 - let inputSearch=document.querySelector('.uni-input-input[type=search]'); - const evt = new InputEvent('input', { - inputType: 'insertText', - data: keyword, - dataTransfer: null, - isComposing: false - }); - if(inputSearch){ - inputSearch.value = keyword; - inputSearch.dispatchEvent(evt); - } - // #endif }, getWordList() { this.$u.api.searchwordlist({type:this.type}).then(res => { diff --git a/pages.json b/pages.json index 9410c6a..e8b773e 100644 --- a/pages.json +++ b/pages.json @@ -178,7 +178,7 @@ "searchInput": { "align": "left", "borderRadius": "15px", - "placeholder": "", + "placeholder": "请输入搜索内容", "backgroundColor": "rgb(236,236,236)", "placeholderColor": "#999999", "disabled": false, -- 2.47.2