完善商品分类及商品管理
This commit is contained in:
@ -88,8 +88,8 @@ try {
|
||||
uIcon: function () {
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-icon/u-icon */ "components/uview-ui/components/u-icon/u-icon").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-icon/u-icon.vue */ 318))
|
||||
},
|
||||
uBadge: function () {
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-badge/u-badge */ "components/uview-ui/components/u-badge/u-badge").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-badge/u-badge.vue */ 573))
|
||||
loadingFooter: function () {
|
||||
return __webpack_require__.e(/*! import() | components/loading-footer/loading-footer */ "components/loading-footer/loading-footer").then(__webpack_require__.bind(null, /*! @/components/loading-footer/loading-footer.vue */ 670))
|
||||
},
|
||||
uPopup: function () {
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-popup/u-popup */ "components/uview-ui/components/u-popup/u-popup").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-popup/u-popup.vue */ 510))
|
||||
@ -124,6 +124,10 @@ var render = function () {
|
||||
var _c = _vm._self._c || _h
|
||||
if (!_vm._isMounted) {
|
||||
_vm.e0 = function ($event) {
|
||||
$event.stopPropagation()
|
||||
_vm.count++
|
||||
}
|
||||
_vm.e1 = function ($event) {
|
||||
_vm.showSpec = false
|
||||
}
|
||||
}
|
||||
@ -169,6 +173,16 @@ Object.defineProperty(exports, "__esModule", {
|
||||
exports.default = void 0;
|
||||
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
|
||||
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
|
||||
var _tools = __webpack_require__(/*! @/utils/tools */ 41);
|
||||
var _store = __webpack_require__(/*! @/api/store */ 40);
|
||||
var _type = __webpack_require__(/*! @/utils/type */ 42);
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -282,57 +296,84 @@ var _default2 = {
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
page: 1,
|
||||
status: _type.loadingType.LOADING,
|
||||
selectIndex: 0,
|
||||
cateList: [],
|
||||
goodsList: [],
|
||||
cateName: '',
|
||||
numberVal: 1,
|
||||
showCart: false,
|
||||
showSpec: false
|
||||
showSpec: false,
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeActive: function changeActive(index) {
|
||||
var cateList = this.cateList;
|
||||
this.selectIndex = index;
|
||||
this.cateName = cateList[index].name;
|
||||
// this.onRefresh()
|
||||
this.selectIndex = index;
|
||||
this.onRefresh();
|
||||
},
|
||||
onRefresh: function onRefresh() {
|
||||
var _this = this;
|
||||
this.page = 1;
|
||||
this.goodsList = [];
|
||||
this.status = _type.loadingType.LOADING;
|
||||
this.$nextTick(function () {
|
||||
_this.getGoodsSearchFun();
|
||||
});
|
||||
},
|
||||
getGoodsSearchFun: function getGoodsSearchFun() {
|
||||
var _this2 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
||||
var page, goodsList, priceSort, saleSort, status, cateList, selectIndex, item, params, data;
|
||||
return _regenerator.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
page = _this2.page, goodsList = _this2.goodsList, priceSort = _this2.priceSort, saleSort = _this2.saleSort, status = _this2.status, cateList = _this2.cateList, selectIndex = _this2.selectIndex;
|
||||
item = cateList[selectIndex];
|
||||
if (!(item.type == 0)) {
|
||||
_context.next = 4;
|
||||
break;
|
||||
}
|
||||
return _context.abrupt("return");
|
||||
case 4:
|
||||
if (!(status == _type.loadingType.FINISHED)) {
|
||||
_context.next = 6;
|
||||
break;
|
||||
}
|
||||
return _context.abrupt("return");
|
||||
case 6:
|
||||
params = {
|
||||
category_id: item.id,
|
||||
page_no: page,
|
||||
price: priceSort,
|
||||
sales_sum: saleSort
|
||||
};
|
||||
_context.next = 9;
|
||||
return (0, _tools.loadingFun)(_store.getGoodsSearch, page, goodsList, status, params);
|
||||
case 9:
|
||||
data = _context.sent;
|
||||
console.log(data);
|
||||
if (data) {
|
||||
_context.next = 13;
|
||||
break;
|
||||
}
|
||||
return _context.abrupt("return");
|
||||
case 13:
|
||||
_this2.page = data.page;
|
||||
_this2.goodsList = data.dataList;
|
||||
_this2.status = data.status;
|
||||
case 16:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
} // let {
|
||||
// page,
|
||||
// goodsList,
|
||||
// priceSort,
|
||||
// saleSort,
|
||||
// status,
|
||||
// cateList,
|
||||
// selectIndex
|
||||
// } = this;
|
||||
// const item = cateList[selectIndex]
|
||||
// if(item.type == 0) return
|
||||
// if (status == loadingType.FINISHED) return;
|
||||
// const params = {
|
||||
// category_id: item.id,
|
||||
// page_no: page,
|
||||
// price: priceSort,
|
||||
// sales_sum: saleSort
|
||||
// }
|
||||
// const data = await loadingFun(getGoodsSearch, page, goodsList, status, params)
|
||||
// if (!data) return
|
||||
// this.page = data.page
|
||||
// this.goodsList = data.dataList
|
||||
// this.status = data.status
|
||||
,
|
||||
},
|
||||
changeNumber: function changeNumber() {},
|
||||
// 跳转商品详情页
|
||||
toShop: function toShop() {
|
||||
@ -341,6 +382,14 @@ var _default2 = {
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
buyNumber: function buyNumber() {
|
||||
if (this.count > 0) {
|
||||
return this.count > 99 ? '99+' : this.count;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
list: {
|
||||
handler: function handler(val) {
|
||||
@ -351,7 +400,6 @@ var _default2 = {
|
||||
this.selectIndex = index == -1 ? 0 : index;
|
||||
this.cateName = val[this.selectIndex].name;
|
||||
this.cateList = val;
|
||||
this.cateTwoList = val[this.selectIndex] ? val[this.selectIndex].sons : [];
|
||||
this.getGoodsSearchFun();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user