xbx #309

Merged
theluyuan merged 2 commits from xbx into master 2020-08-28 16:14:11 +00:00
3 changed files with 12 additions and 2 deletions

View File

@ -86,11 +86,12 @@ export default {
return vm.$u.post('Goods/getGoodsClassRecommend'); return vm.$u.post('Goods/getGoodsClassRecommend');
}, },
// goodsListByClassId // goodsListByClassId
goodsListByClassId({ gc_id, page, order }) { goodsListByClassId({ gc_id, page, order, keyword }) {
return vm.$u.post('goods/goodsListByClassId', { return vm.$u.post('goods/goodsListByClassId', {
gc_id: gc_id, gc_id: gc_id,
page: page, page: page,
order: order, order: order,
keyword:keyword
}); });
}, },
// 商品推荐 // 商品推荐

View File

@ -1,5 +1,6 @@
<template> <template>
<view class="classify-goods"> <view class="classify-goods">
<u-search style="padding: 0 30rpx" placeholder="日照香炉生紫烟" v-model="keyword" @search="select" @custom="select"></u-search>
<view class="tab-container"> <view class="tab-container">
<view class="salenum" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">销量</view> <view class="salenum" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">销量</view>
<view class="price" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)"> <view class="price" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">
@ -42,6 +43,8 @@ export default {
scrollHeight: '', scrollHeight: '',
loadStatus: 'loadmore', loadStatus: 'loadmore',
timer: true, // timer: true, //
keyword:"",
sel:""
} }
}, },
watch: { watch: {
@ -80,6 +83,7 @@ export default {
gc_id: this.cid, gc_id: this.cid,
page: this.page, page: this.page,
order: sort, order: sort,
keyword:this.sel
}) })
this.timer = true; this.timer = true;
if(res.errCode == 0) { if(res.errCode == 0) {
@ -123,6 +127,11 @@ export default {
id: id, id: id,
type: 1 // 1 2 3 4 type: 1 // 1 2 3 4
}); });
},
select(){
this.sel = this.keyword;
this.page = 1;
this.goodsListByClassId({ laod: 'reload' });
} }
} }
}; };

View File

@ -18,7 +18,7 @@
<view class="hot" :style="{'top': top + 10 * rpx}"> <view class="hot" :style="{'top': top + 10 * rpx}">
<text class="hottext">{{room.onlineUsers.users.length}}</text> <text class="hottext">{{room.onlineUsers.users.length}}</text>
</view> </view>
<image class="cart" src="../../static/cart.png" @click="show = true"> <image v-if="list.length != 0" class="cart" src="../../static/cart.png" @click="show = true">
</image> </image>
<view class="danmufasongbox" @click="danmu = $store.state.hasLogin"> <view class="danmufasongbox" @click="danmu = $store.state.hasLogin">