79 lines
1.6 KiB
JavaScript
79 lines
1.6 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const useCarStore = common_vendor.defineStore({
|
|
id: "car",
|
|
state: () => ({
|
|
// 场馆ID
|
|
merchantId: null,
|
|
// 场馆名称
|
|
merchantName: null,
|
|
// 场馆编号
|
|
merchantCode: null,
|
|
// 场馆信息
|
|
merchant: null,
|
|
// 订单信息
|
|
order: null,
|
|
// 场地信息
|
|
orderInfo: [],
|
|
// 预定时段
|
|
period: null,
|
|
// 订单总金额
|
|
totalPrice: null,
|
|
// 实付金额
|
|
payPrice: null,
|
|
// 儿童票价
|
|
childrenPrice: null,
|
|
// 购物车数量
|
|
carNum: null,
|
|
// 儿童票数量
|
|
carNum2: null,
|
|
// 1全场 2半场
|
|
type: null,
|
|
// 下单日期
|
|
dateTime: null,
|
|
// 商品信息
|
|
goodsList: [],
|
|
// 用户收货地址
|
|
address: null
|
|
}),
|
|
getters: {},
|
|
actions: {
|
|
/**
|
|
* 添加购物车
|
|
*/
|
|
AddCar(value) {
|
|
var _a;
|
|
(_a = this.orderInfo) == null ? void 0 : _a.push(value);
|
|
},
|
|
/**
|
|
* 移除购物车
|
|
*/
|
|
DelCard(value) {
|
|
var _a, _b;
|
|
const index = (_a = this.orderInfo) == null ? void 0 : _a.findIndex((d) => d.fid == value.fid);
|
|
if (index) {
|
|
(_b = this.orderInfo) == null ? void 0 : _b.splice(index, 1);
|
|
}
|
|
},
|
|
setOrder(value) {
|
|
this.order = value;
|
|
},
|
|
setMerchant(value) {
|
|
this.merchant = value;
|
|
},
|
|
setGoodsList(value) {
|
|
this.goodsList = value;
|
|
},
|
|
setOrderInfo(value) {
|
|
this.orderInfo = value;
|
|
},
|
|
setAddress(value) {
|
|
this.address = value;
|
|
},
|
|
setPeriod(value) {
|
|
this.period = value;
|
|
}
|
|
}
|
|
});
|
|
exports.useCarStore = useCarStore;
|