更新
This commit is contained in:
parent
8ac54b5542
commit
cc8ea0734d
@ -139,10 +139,11 @@ export function getBrandlist(data) {
|
||||
* 获取推荐产品
|
||||
*
|
||||
*/
|
||||
export function getProductHot(page, limit) {
|
||||
export function getProductHot(page, limit, sale_type) {
|
||||
return request.get("product/spu/recommend", {
|
||||
page: page === undefined ? 1 : page,
|
||||
limit: limit === undefined ? 10 : limit
|
||||
limit: limit === undefined ? 10 : limit,
|
||||
sale_type: sale_type || null
|
||||
}, {
|
||||
noAuth: true
|
||||
});
|
||||
|
@ -47,7 +47,7 @@
|
||||
</view>
|
||||
|
||||
<view class='recommendList' :class="indexP?'on':''">
|
||||
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
||||
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" :sale_type="sale_type"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -93,7 +93,11 @@
|
||||
isLogin: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
sale_type:{
|
||||
type: [Number, String],
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -1037,7 +1037,7 @@
|
||||
if (that.hotLoading) return;
|
||||
that.hotLoading = true;
|
||||
that.hotTitle = '加载中';
|
||||
getProductHot(that.hotPage, that.hotLimit).then(res => {
|
||||
getProductHot(that.hotPage, that.hotLimit, 1).then(res => {
|
||||
let list = res.data.list;
|
||||
let productList = that.$util.SplitArray(list, that.hostProduct);
|
||||
let hotScroll = list.length <= num && list.length != 0;
|
||||
|
@ -133,7 +133,7 @@
|
||||
<image :src="`${domain}/static/images/noCart.png`"></image>
|
||||
<view>暂无商品,去添加点什么吧</view>
|
||||
</view>
|
||||
<recommend v-if="recommend_switch == 1" :hostProduct='hostProduct' :isLogin="isLogin"></recommend>
|
||||
<recommend v-if="recommend_switch == 1" :hostProduct='hostProduct' :isLogin="isLogin" :sale_type="tabsCurr"></recommend>
|
||||
<view class='loadingicon acea-row row-center-wrapper'
|
||||
v-if="hostProduct.length>5 && recommend_switch == 1">
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
@ -784,11 +784,13 @@
|
||||
})
|
||||
this.cartList.valid = res.data.list
|
||||
this.cartList.invalid = res.data.fail
|
||||
if (res.data.list.length == 0 && res.data.list.length == 0) {
|
||||
if (res.data.list.length == 0 && res.data.fail.length == 0) {
|
||||
this.recommend = true;
|
||||
if (!this.hostProduct.length) {
|
||||
this.getHostProduct();
|
||||
}
|
||||
this.hostProduct = [];
|
||||
this.loadend = false;
|
||||
this.hotScroll = false;
|
||||
this.hotPage = 1;
|
||||
this.getHostProduct();
|
||||
} else {
|
||||
this.recommend = false
|
||||
}
|
||||
@ -871,6 +873,7 @@
|
||||
getProductHot(
|
||||
that.hotPage,
|
||||
that.hotLimit,
|
||||
that.tabsCurr
|
||||
).then(res => {
|
||||
let list = res.data.list || [];
|
||||
that.hotPage++
|
||||
|
Loading…
x
Reference in New Issue
Block a user