This commit is contained in:
2026-04-14 18:11:00 +08:00
parent e894689918
commit 6deef6cdce

View File

@ -153,7 +153,6 @@ export default {
selected4: true,
recharge: true,
record: false,
walletBalance: "1000.00",
imgPrefix,
WeChat: undefined,
wallet: "2",
@ -176,75 +175,8 @@ export default {
},
},
onLoad(option) {
console.log(option,'?')
// console.log(option,'?')
this.getGoodsList(option.product_id)
// const { type, petOrderId = "", petOrderAddressId = "" } = option;
// this.type = type;
// this.petOrderId = petOrderId;
// this.petOrderAddressId = petOrderAddressId;
// if (petOrderAddressId) {
// getAddressInfo(petOrderAddressId).then((res) => {
// this.addressInfo = {
// ...res?.info,
// };
// });
// }
// uni.$on("selectAddress", this.addressChange);
// const eventChannel = this.getOpenerEventChannel();
// eventChannel.on("createOrder", (data) => {
// console.log(data,'--=?')
// const extractFirstImage = (imageList) => {
// if (!imageList) return "";
// try {
// const parsedList =
// typeof imageList === "string" ? JSON.parse(imageList) : imageList;
// if (Array.isArray(parsedList) && parsedList.length > 0) {
// return parsedList[0].url || parsedList[0] || "";
// }
// } catch (e) {
// console.error("Error parsing image_list:", e);
// }
// return "";
// };
// this.orderData = (data?.goodList || []).map((item) => {
// let processedItem = { ...item };
// if (processedItem.product_pic) {
// if (
// typeof processedItem.product_pic === "string" &&
// (processedItem.product_pic.startsWith("[") ||
// processedItem.product_pic.startsWith("{"))
// ) {
// const extractedUrl = extractFirstImage(processedItem.product_pic);
// if (extractedUrl) {
// processedItem.product_pic = extractedUrl;
// }
// } else if (Array.isArray(processedItem.product_pic)) {
// const extractedUrl = extractFirstImage(processedItem.product_pic);
// if (extractedUrl) {
// processedItem.product_pic = extractedUrl;
// }
// }
// }
// return processedItem;
// });
// this.payPrice = this.orderData.reduce(
// (sum, item) =>
// sum +
// Number((item.product_price || item.goods_price) * item.number || 0),
// 0
// );
// console.log(data, "--=?");
// const price = this.orderData.reduce(
// (total, prev) => total + +prev.item_price,
// 0
// );
// this.orderPrice = +price.toFixed(2);
// this.confirmPrice = +(this.orderPrice - this.couponFee).toFixed(2);
// });
},
methods: {
getGoodsList(id) {
@ -255,7 +187,7 @@ export default {
this.orderData = res.data
this.orPrice = res.data.price
this.orderPrice = res.data[0].price
// console.log(res,'--=')
console.log( this.orderData,'--=??')
})
},
createOrder(isPrePay) {
@ -266,6 +198,7 @@ export default {
mask: true,
});
}
console.log(this.orderData[0].goods_id,'-=-')
const params = {
id: Number(this.orderData[0].goods_id),
};