添加店铺云商品列表
This commit is contained in:
parent
311e326af3
commit
774211387e
10
api/store.js
10
api/store.js
@ -280,6 +280,16 @@ export function getStoreGoods(id, data) {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取商铺云商品列表
|
||||
* @param {Object} id 商铺 id
|
||||
* @param {Object} data 商铺商品列表数据
|
||||
*/
|
||||
export function getStoreCloudGoods(id, data) {
|
||||
return request.get("product/spu/merchant/" + id + "/merCloudProduct", data, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取商铺分类列表
|
||||
* @param {Object} id 商铺 id
|
||||
|
@ -379,6 +379,7 @@
|
||||
import {
|
||||
getStoreDetail,
|
||||
getStoreGoods,
|
||||
getStoreCloudGoods,
|
||||
getStoreCategory,
|
||||
followStore,
|
||||
unfollowStore,
|
||||
@ -636,7 +637,9 @@
|
||||
this.getCoupon();
|
||||
break;
|
||||
case 7:
|
||||
this.getCoupon();
|
||||
this.resetParmas();
|
||||
this.goods = [];
|
||||
this.getCloudGoods();
|
||||
break;
|
||||
}
|
||||
},
|
||||
@ -946,6 +949,36 @@
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
// 获取商铺云商品
|
||||
getCloudGoods: function() {
|
||||
let that = this;
|
||||
if (that.loadend) return;
|
||||
if (that.loading) return;
|
||||
if (that.goodsLoading) return;
|
||||
that.goodsLoading = true;
|
||||
that.loadTitle = '';
|
||||
getStoreCloudGoods(that.id, that.where).then(res => {
|
||||
that.goodsLoading = false;
|
||||
let list = res.data.list;
|
||||
let goodsList = that.$util.SplitArray(list, that.goods);
|
||||
let loadend = list.length < that.where.limit;
|
||||
that.loadend = loadend;
|
||||
that.loading = false;
|
||||
that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
||||
that.$set(that, 'goods', goodsList);
|
||||
that.$set(that.where, 'page', that.where.page + 1);
|
||||
}).catch(err => {
|
||||
that.loading = false;
|
||||
that.goodsLoading = false;
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
// 获取商铺分类
|
||||
getCategory: function() {
|
||||
if (this.category.length) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user