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

View File

@ -120,48 +120,47 @@ const sliverList = [
];
export default {
components: {
SelectModal,
GoodInfoModal,
RechargeCouponModal,
DraggableContact,
},
data() {
return {
orderData:[],
payPrice: 0,
orPrice:0,
type: "",
orderData: [],
addressInfo: {},
sliverInfo: {},
selectSliverInfo: {},
showSliverModal: false,
sliverTypeList: sliverList,
showGoodInfoModal: false,
showCouponModal: false,
couponList: [],
serviceOrderList: [],
useCouponInfo: null,
petOrderId: "",
petOrderAddressId: "",
orderPrice: 0,
confirmPrice: 0,
selected1: false,
selected2: false,
selected3: false,
selected4: true,
recharge: true,
record: false,
walletBalance: "1000.00",
imgPrefix,
WeChat: undefined,
wallet: "2",
orderId: "",
outOrderNo: "",
};
},
computed: {
components: {
SelectModal,
GoodInfoModal,
RechargeCouponModal,
DraggableContact,
},
data() {
return {
orderData:[],
payPrice: 0,
orPrice:0,
type: "",
orderData: [],
addressInfo: {},
sliverInfo: {},
selectSliverInfo: {},
showSliverModal: false,
sliverTypeList: sliverList,
showGoodInfoModal: false,
showCouponModal: false,
couponList: [],
serviceOrderList: [],
useCouponInfo: null,
petOrderId: "",
petOrderAddressId: "",
orderPrice: 0,
confirmPrice: 0,
selected1: false,
selected2: false,
selected3: false,
selected4: true,
recharge: true,
record: false,
imgPrefix,
WeChat: undefined,
wallet: "2",
orderId: "",
outOrderNo: "",
};
},
computed: {
goodsImgs() {
return this.orderData.map((item) => item.goods_pic).filter((v) => !!v);
},
@ -176,76 +175,9 @@ export default {
},
},
onLoad(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);
// });
},
// console.log(option,'?')
this.getGoodsList(option.product_id)
},
methods: {
getGoodsList(id) {
getGoodsDetail({
@ -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),
};