acdr-ui/dist/dev/mp-weixin/modules/mall/order/express/log.js

106 lines
3.6 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const common_vendor = require("../../../../common/vendor.js");
2024-10-01 09:15:35 +08:00
const modules_mall_sheep_index = require("../../sheep/index.js");
const modules_mall_sheep_api_trade_order = require("../../sheep/api/trade/order.js");
2024-09-19 07:20:14 +08:00
if (!Array) {
const _easycom_uni_swiper_dot2 = common_vendor.resolveComponent("uni-swiper-dot");
const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
const _component_layout_default_uni = common_vendor.resolveComponent("layout-default-uni");
(_easycom_uni_swiper_dot2 + _easycom_s_layout2 + _component_layout_default_uni)();
}
const _easycom_uni_swiper_dot = () => "../../../../uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.js";
2024-10-01 09:15:35 +08:00
const _easycom_s_layout = () => "../../sheep/components/s-layout/s-layout.js";
2024-09-19 07:20:14 +08:00
if (!Math) {
(_easycom_uni_swiper_dot + _easycom_s_layout)();
}
const _sfc_main = {
__name: "log",
setup(__props) {
const state = common_vendor.reactive({
info: [],
tracks: []
});
const goodsImages = common_vendor.computed(() => {
const array = [];
if (state.info.items) {
state.info.items.forEach((item) => {
array.push({
image: item.picUrl
});
});
}
return array;
});
function getExpressDetail(id) {
return __async(this, null, function* () {
2024-10-01 09:15:35 +08:00
const { data } = yield modules_mall_sheep_api_trade_order.OrderApi.getOrderExpressTrackList(id);
2024-09-19 07:20:14 +08:00
state.tracks = data.reverse();
});
}
function getOrderDetail(id) {
return __async(this, null, function* () {
2024-10-01 09:15:35 +08:00
const { data } = yield modules_mall_sheep_api_trade_order.OrderApi.getOrder(id);
2024-09-19 07:20:14 +08:00
state.info = data;
});
}
common_vendor.onLoad((options) => {
getExpressDetail(options.id);
getOrderDetail(options.id);
});
return (_ctx, _cache) => {
return common_vendor.e({
a: goodsImages.value.length > 0
}, goodsImages.value.length > 0 ? {
b: common_vendor.f(goodsImages.value, (item, index, i0) => {
return {
2024-10-01 09:15:35 +08:00
a: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static(item.image),
2024-09-19 07:20:14 +08:00
b: index
};
}),
c: common_vendor.p({
info: goodsImages.value,
current: state.current,
mode: "round"
}),
d: common_vendor.t(state.info.logisticsNo),
e: common_vendor.t(state.info.logisticsName)
} : {}, {
f: common_vendor.f(state.tracks, (item, index, i0) => {
return common_vendor.e({
a: state.tracks.length - 1 !== index
}, state.tracks.length - 1 !== index ? {} : {}, {
b: common_vendor.t(item.content),
2024-10-01 09:15:35 +08:00
c: common_vendor.t(common_vendor.unref(modules_mall_sheep_index.sheep).$helper.timeFormat(item.time, "yyyy-mm-dd hh:MM:ss")),
2024-09-19 07:20:14 +08:00
d: item.title
});
}),
g: common_vendor.p({
title: "物流追踪"
})
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-10ea51e7"]]);
wx.createPage(MiniProgramPage);