上传代码
This commit is contained in:
80
uniapp04/unpackage/dist/dev/mp-alipay/pages/testFive/testFive.js
vendored
Normal file
80
uniapp04/unpackage/dist/dev/mp-alipay/pages/testFive/testFive.js
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const API_api = require("../../API/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_steps2 = common_vendor.resolveComponent("uni-steps");
|
||||
_easycom_uni_steps2();
|
||||
}
|
||||
const _easycom_uni_steps = () => "../../uni_modules/uni-steps/components/uni-steps/uni-steps.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_steps();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "testFive",
|
||||
setup(__props) {
|
||||
common_vendor.onUnload(() => {
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
});
|
||||
const active = common_vendor.ref(1);
|
||||
const list1 = common_vendor.reactive([]);
|
||||
const orderItem = common_vendor.ref("");
|
||||
const getOrderStatus = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/orders/list/status",
|
||||
method: "POST",
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
// 确保设置正确的 Content-Type
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
console.log(res.data.data);
|
||||
orderItem.value = res.data.data;
|
||||
if ([0, 1].includes(orderItem.value.pickupMethod)) {
|
||||
list1.splice(
|
||||
0,
|
||||
list1.length,
|
||||
{ title: "备餐中" },
|
||||
{ title: "已出餐" },
|
||||
{ title: "已完成" }
|
||||
);
|
||||
} else if (orderItem.value.pickupMethod === 2) {
|
||||
list1.splice(
|
||||
0,
|
||||
list1.length,
|
||||
{ title: "备餐中" },
|
||||
{ title: "已出餐" },
|
||||
{ title: "送餐中" },
|
||||
{ title: "已完成" }
|
||||
);
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getOrderStatus();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(orderItem.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item == null ? void 0 : item.id),
|
||||
b: "2e2c92b9-0-" + i0,
|
||||
c: index
|
||||
};
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
options: list1,
|
||||
active: active.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2e2c92b9"]]);
|
||||
my.createPage(MiniProgramPage);
|
Reference in New Issue
Block a user