This commit is contained in:
Aiden 2024-10-24 15:26:16 +08:00
parent 0455590dfe
commit b3ed9f2b8d

View File

@ -16,74 +16,74 @@ export default {
// const token = window?.plus?.storage.getItem("token");
// uni.setStorageSync("token", token);
// console.log("App Show", uni.getStorageSync("token"));
// const params = new URLSearchParams(window.location.search); // URL
// state.id = params.get("id");
// state.pid = params.get("pid");
// console.log(state);
const params = new URLSearchParams(window.location.search); // URL
state.id = params.get("id");
state.pid = params.get("pid");
console.log(state);
// const paintingDetail = async () => {
// loading.value = true;
// console.log("state", state);
// const res = await pbDetail({
// id: state.id,
// pid: state.pid,
// });
// if (res.status === 0) {
// console.log("1");
// state.boxRelBucketStatus = res.data.boxRelBucketStatus;
// console.log("boxRelBucketStatus", state.boxRelBucketStatus);
// if (res.data.pbStatus == 1) {
// console.log("2");
// uni.navigateTo({
// url: "/pages/index/index?id=" + state.id + "&pid=" + state.pid,
// success: () => {
// loading.value = false;
// },
// fail: () => {
// loading.value = false;
// showMessage({ type: "default", message: "" });
// },
// });
// } else {
// if (
// res.data.boxRelBucketStatus == 3 &&
// res.data.locateAddress == ""
// ) {
// uni.navigateTo({
// url: "/pages/painting/index?id=" + state.id + "&pid=" + state.pid,
// success: () => {
// loading.value = false;
// },
// fail: () => {
// loading.value = false;
// showMessage({ type: "default", message: "" });
// },
// });
// } else {
// uni.setStorageSync("data", res.data);
// console.log();
// uni.navigateTo({
// url:
// "/pages/detail/index?id=" +
// state.id +
// "&pid=" +
// state.pid +
// "&boxRelBucketStatus=" +
// state.boxRelBucketStatus,
const paintingDetail = async () => {
loading.value = true;
console.log("state", state);
const res = await pbDetail({
id: state.id,
pid: state.pid,
});
if (res.status === 0) {
console.log("成功拉1");
state.boxRelBucketStatus = res.data.boxRelBucketStatus;
console.log("boxRelBucketStatus", state.boxRelBucketStatus);
if (res.data.pbStatus == 1) {
console.log("成功拉2");
uni.navigateTo({
url: "/pages/index/index?id=" + state.id + "&pid=" + state.pid,
success: () => {
loading.value = false;
},
fail: () => {
loading.value = false;
showMessage({ type: "default", message: "跳转失败" });
},
});
} else {
if (
res.data.boxRelBucketStatus == 3 &&
res.data.locateAddress == "公司内"
) {
uni.navigateTo({
url: "/pages/painting/index?id=" + state.id + "&pid=" + state.pid,
success: () => {
loading.value = false;
},
fail: () => {
loading.value = false;
showMessage({ type: "default", message: "跳转失败" });
},
});
} else {
uni.setStorageSync("data", res.data);
console.log();
uni.navigateTo({
url:
"/pages/detail/index?id=" +
state.id +
"&pid=" +
state.pid +
"&boxRelBucketStatus=" +
state.boxRelBucketStatus,
// success: () => {
// loading.value = false;
// },
// fail: () => {
// loading.value = false;
// showMessage({ type: "default", message: "" });
// },
// });
// }
// }
// }
// };
// paintingDetail();
success: () => {
loading.value = false;
},
fail: () => {
loading.value = false;
showMessage({ type: "default", message: "跳转失败" });
},
});
}
}
}
};
paintingDetail();
},
onHide: function () {
console.log("App Hide");