增加新功能
This commit is contained in:
+43
-47
@@ -2,6 +2,7 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const utils_enumUtils = require("../../utils/enumUtils.js");
|
||||
const utils_enumCssUtils = require("../../utils/enumCssUtils.js");
|
||||
const api_order = require("../../api/order.js");
|
||||
const _sfc_main = {
|
||||
computed: {
|
||||
ORDER_TYPE() {
|
||||
@@ -16,13 +17,7 @@ const _sfc_main = {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 0,
|
||||
// 选中的类型
|
||||
orderTypeList: [
|
||||
{
|
||||
id: 0,
|
||||
title: "全部"
|
||||
},
|
||||
{
|
||||
id: utils_enumUtils.ORDER_TYPE.UNPAID,
|
||||
title: "待支付"
|
||||
@@ -36,13 +31,17 @@ const _sfc_main = {
|
||||
title: "待收货"
|
||||
},
|
||||
{
|
||||
id: utils_enumUtils.ORDER_TYPE.AFTER_SALE,
|
||||
title: "退款售后"
|
||||
id: utils_enumUtils.ORDER_TYPE.SUCCEED,
|
||||
title: "待评价"
|
||||
}
|
||||
],
|
||||
form: {
|
||||
search: null
|
||||
search: null,
|
||||
//搜索
|
||||
page: 1,
|
||||
pageSize: 15,
|
||||
type: 0
|
||||
// 选中的类型
|
||||
},
|
||||
orderList: [
|
||||
{
|
||||
@@ -183,7 +182,8 @@ const _sfc_main = {
|
||||
},
|
||||
onLoad(options) {
|
||||
const type = options.type;
|
||||
this.type = type ? parseInt(type, 10) : 0;
|
||||
this.form.type = type ? parseInt(type, 10) : utils_enumUtils.ORDER_TYPE.UNPAID;
|
||||
this.getOrderList();
|
||||
},
|
||||
methods: {
|
||||
getValue: utils_enumUtils.getValue,
|
||||
@@ -196,13 +196,24 @@ const _sfc_main = {
|
||||
common_vendor.index.__f__("log", "at pages/mine_order/mine_order.vue:297", "searchFun", val);
|
||||
},
|
||||
checkType(item) {
|
||||
this.type = item.id;
|
||||
this.form.type = item.id;
|
||||
this.getOrderList();
|
||||
},
|
||||
jumpOrderInfo() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine_order_info/mine_order_info?type=" + this.type
|
||||
});
|
||||
},
|
||||
async getOrderList() {
|
||||
const params = {
|
||||
...this.form
|
||||
};
|
||||
const resp = await api_order.getOrderList(params);
|
||||
common_vendor.index.__f__("log", "at pages/mine_order/mine_order.vue:313", "resp", resp);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
this.orderList = resp.data;
|
||||
}
|
||||
},
|
||||
checkCancel(status) {
|
||||
this.cancelShow = status;
|
||||
if (!status) {
|
||||
@@ -226,7 +237,7 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/mine_order/mine_order.vue:330", "params", params);
|
||||
common_vendor.index.__f__("log", "at pages/mine_order/mine_order.vue:342", "params", params);
|
||||
this.checkCancel(false);
|
||||
}
|
||||
}
|
||||
@@ -271,7 +282,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
e: common_vendor.f($data.orderTypeList, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.n($data.type === item.id ? "order_type_title_item order_type_title_item_sel" : "order_type_title_item"),
|
||||
b: common_vendor.n($data.form.type === item.id ? "order_type_title_item order_type_title_item_sel" : "order_type_title_item"),
|
||||
c: common_vendor.o(($event) => $options.checkType(item), item.id),
|
||||
d: item.id
|
||||
};
|
||||
@@ -282,63 +293,48 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: "abc152e3-2-" + i0,
|
||||
b: common_vendor.p({
|
||||
src: item.url,
|
||||
src: item.shopLogo,
|
||||
width: "22",
|
||||
height: "22",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
c: common_vendor.t(item.name),
|
||||
d: item.status !== 1
|
||||
}, item.status !== 1 ? {
|
||||
c: common_vendor.t(item.shopName),
|
||||
d: item.status !== $options.ORDER_TYPE.UNPAID
|
||||
}, item.status !== $options.ORDER_TYPE.UNPAID ? {
|
||||
e: common_vendor.t($options.getValue($options.ORDER_STATUS, item.status)),
|
||||
f: $options.ORDER_STATUS_CSS[item.status]
|
||||
} : {
|
||||
g: common_vendor.t(item.paymentTime)
|
||||
g: common_vendor.t(item.expireTime)
|
||||
}, {
|
||||
h: common_vendor.f(item.product, (pItem, k1, i1) => {
|
||||
h: common_vendor.f(item.items, (pItem, k1, i1) => {
|
||||
return {
|
||||
a: "abc152e3-3-" + i0 + "-" + i1,
|
||||
b: common_vendor.p({
|
||||
src: pItem.url,
|
||||
src: pItem.mainGraph,
|
||||
width: "80",
|
||||
height: "80",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
c: common_vendor.t(pItem.title),
|
||||
d: common_vendor.t(pItem.tag.join(" ")),
|
||||
e: common_vendor.f(pItem.description, (dItem, k2, i2) => {
|
||||
return {
|
||||
a: common_vendor.t(dItem)
|
||||
};
|
||||
}),
|
||||
f: common_vendor.t(pItem.total),
|
||||
g: common_vendor.t(pItem.quantity),
|
||||
h: pItem.id
|
||||
d: common_vendor.t(pItem.goodsSpece),
|
||||
e: common_vendor.t(pItem.goodsAmount),
|
||||
f: common_vendor.t(pItem.buyNum),
|
||||
g: pItem.id
|
||||
};
|
||||
}),
|
||||
i: item.status === $options.ORDER_TYPE.UNSHIPPED
|
||||
i: common_vendor.t(item.buyNum),
|
||||
j: common_vendor.t(item.sumAmount),
|
||||
k: item.status === $options.ORDER_TYPE.UNSHIPPED
|
||||
}, item.status === $options.ORDER_TYPE.UNSHIPPED ? {
|
||||
j: common_vendor.o(($event) => $options.checkCancel(true), item.id)
|
||||
l: common_vendor.o(($event) => $options.checkCancel(true), item.id)
|
||||
} : {}, {
|
||||
k: item.status === $options.ORDER_TYPE.UNPAID
|
||||
m: item.status === $options.ORDER_TYPE.UNPAID
|
||||
}, item.status === $options.ORDER_TYPE.UNPAID ? {
|
||||
l: common_vendor.o((...args) => $options.jumpOrderInfo && $options.jumpOrderInfo(...args), item.id)
|
||||
n: common_vendor.o((...args) => $options.jumpOrderInfo && $options.jumpOrderInfo(...args), item.id)
|
||||
} : {}, {
|
||||
m: item.status === $options.ORDER_TYPE.COMPLETED
|
||||
}, item.status === $options.ORDER_TYPE.COMPLETED ? {} : {}, {
|
||||
n: item.status === $options.ORDER_TYPE.NOT_RECEIVE
|
||||
o: item.status === $options.ORDER_TYPE.NOT_RECEIVE
|
||||
}, item.status === $options.ORDER_TYPE.NOT_RECEIVE ? {} : {}, {
|
||||
o: item.status === $options.ORDER_TYPE.UNSHIPPED
|
||||
}, item.status === $options.ORDER_TYPE.UNSHIPPED ? {} : {}, {
|
||||
p: item.status === $options.ORDER_TYPE.COMPLETED
|
||||
}, item.status === $options.ORDER_TYPE.COMPLETED ? {} : {}, {
|
||||
q: item.status === $options.ORDER_TYPE.AFTER_SALE
|
||||
}, item.status === $options.ORDER_TYPE.AFTER_SALE ? {} : {}, {
|
||||
r: [$options.ORDER_TYPE.COMPLETED].includes(item.status)
|
||||
}, [$options.ORDER_TYPE.COMPLETED].includes(item.status) ? {} : {}, {
|
||||
s: [$options.ORDER_TYPE.COMPLETED, $options.ORDER_TYPE.CANCELED].includes(item.status)
|
||||
}, [$options.ORDER_TYPE.COMPLETED, $options.ORDER_TYPE.CANCELED].includes(item.status) ? {} : {}, {
|
||||
t: item.id
|
||||
p: item.id
|
||||
});
|
||||
})
|
||||
} : {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user