完善商品分类及商品管理
This commit is contained in:
@ -177,6 +177,7 @@ exports.default = void 0;
|
||||
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
|
||||
var _vuex = __webpack_require__(/*! vuex */ 33);
|
||||
var _app = __webpack_require__(/*! @/api/app */ 50);
|
||||
var _user = __webpack_require__(/*! @/api/user */ 34);
|
||||
var _store = __webpack_require__(/*! @/api/store */ 40);
|
||||
var _tools = __webpack_require__(/*! @/utils/tools */ 41);
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
@ -187,28 +188,67 @@ var _default = {
|
||||
list: [{
|
||||
image: "http://jianbing-media.stnav.com/frontend/img/banner.png",
|
||||
title: "昨夜星辰昨夜风,画楼西畔桂堂东"
|
||||
}]
|
||||
}],
|
||||
userAddress: '',
|
||||
addressId: 0
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad() {
|
||||
var _this = this;
|
||||
(0, _tools.setTabbar)();
|
||||
this.getUserAddress();
|
||||
|
||||
//更改收货地址
|
||||
uni.$on('selectaddress', function (params) {
|
||||
_this.addressId = params.id;
|
||||
_this.updateUserAddress();
|
||||
});
|
||||
},
|
||||
onShow: function onShow() {},
|
||||
methods: {
|
||||
// 选择门店
|
||||
chooseStore: function chooseStore() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/choose_store'
|
||||
onShow: function onShow() {
|
||||
this.getUser();
|
||||
this.getCartNum();
|
||||
},
|
||||
onUnload: function onUnload() {
|
||||
// 取消全局监听
|
||||
uni.$off(['selectaddress']);
|
||||
},
|
||||
methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)(['getCartNum', 'getUser'])), {}, {
|
||||
// 获取默认物流地址
|
||||
getUserAddress: function getUserAddress() {
|
||||
var _this2 = this;
|
||||
(0, _user.getDefaultAddress)().then(function (res) {
|
||||
if (res.code == 1) {
|
||||
var _res$data = res.data,
|
||||
id = _res$data.id,
|
||||
province = _res$data.province,
|
||||
city = _res$data.city,
|
||||
district = _res$data.district,
|
||||
address = _res$data.address;
|
||||
_this2.userAddress = "".concat(province, " ").concat(city, " ").concat(district, " ").concat(address);
|
||||
_this2.addressId = id;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择收货地址
|
||||
chooseAddress: function chooseAddress() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/choose_store'
|
||||
// 用户切换物流地址
|
||||
updateUserAddress: function updateUserAddress() {
|
||||
var _this3 = this;
|
||||
(0, _user.getOneAddress)(this.addressId).then(function (res) {
|
||||
if (res.code == 1) {
|
||||
var _res$data2 = res.data,
|
||||
id = _res$data2.id,
|
||||
province = _res$data2.province,
|
||||
city = _res$data2.city,
|
||||
district = _res$data2.district,
|
||||
address = _res$data2.address;
|
||||
_this3.userAddress = "".concat(province, " ").concat(city, " ").concat(district, " ").concat(address);
|
||||
_this3.addressId = id;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 立即下单
|
||||
buy: function buy() {
|
||||
console.log(this.$buyType);
|
||||
this.$buyType = 1;
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/store'
|
||||
});
|
||||
@ -219,7 +259,7 @@ var _default = {
|
||||
url: '/pages/signin/signin'
|
||||
});
|
||||
}
|
||||
},
|
||||
}),
|
||||
computed: _objectSpread(_objectSpread({}, (0, _vuex.mapGetters)(['cartNum', 'userInfo', 'inviteCode', 'appConfig', 'cityInfo'])), {}, {
|
||||
statusBar: function statusBar() {
|
||||
return uni.getSystemInfoSync().statusBarHeight + 10;
|
||||
|
||||
Reference in New Issue
Block a user