From 88ce566fdb66bbc7c253b1ca7a4ed0276d8d240c Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期六, 11 十月 2025 16:08:59 +0800
Subject: [PATCH] 以及新增商品选择定制商品模板,订单详情页面展示定制商品模板信息
---
manager/src/views/order/order/orderDetail.vue | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 238 insertions(+), 1 deletions(-)
diff --git a/manager/src/views/order/order/orderDetail.vue b/manager/src/views/order/order/orderDetail.vue
index 0007005..e2bb4d5 100644
--- a/manager/src/views/order/order/orderDetail.vue
+++ b/manager/src/views/order/order/orderDetail.vue
@@ -112,6 +112,75 @@
<div class="div-item-left">涔板鐣欒█锛�</div>
<div class="div-item-right">{{ orderInfo.order.remark }}</div>
</div>
+ <div class="div-item" >
+ <div class="div-item-left">鍟嗗搧妯℃澘锛�</div>
+ <div class="div-item-right">
+ <template v-if="orderInfo.orderItems[0] && orderInfo.orderItems[0].goodsCustomizeTemplateVO">
+ {{
+ orderInfo.orderItems[0].goodsCustomizeTemplateVO.templateName
+ }}
+ </template>
+ <template v-else>
+ 鏆傛棤
+ </template>
+ </div>
+ </div>
+ <div class="div-item" >
+ <div class="div-item-left">妯℃澘鏍囬锛�</div>
+ <div class="div-item-right">
+ <!-- 鍏堥�愬眰鍒ゆ柇鏄惁瀛樺湪锛岄伩鍏嶆姤閿� -->
+ <template v-if="orderInfo.orderItems[0] && orderInfo.orderItems[0].goodsCustomizeTemplateVO && orderInfo.orderItems[0].goodsCustomizeTemplateVO.titles && orderInfo.orderItems[0].goodsCustomizeTemplateVO.titles.length">
+ <span
+ v-for="(item, index) in orderInfo.orderItems[0].goodsCustomizeTemplateVO.titles"
+ :key="index"
+ >{{ item.templateTitle }}
+ <span v-if="index !== orderInfo.orderItems[0].goodsCustomizeTemplateVO.titles.length - 1">銆�</span>
+ </span>
+ </template>
+ <template v-else>
+ 鏆傛棤
+ </template>
+ </div>
+ </div>
+ <div class="div-item">
+ <div class="div-item-left">妯℃澘鍥剧墖锛�</div>
+ <div class="div-item-right">
+ <!-- 鍥剧墖鍒楄〃瀹瑰櫒 -->
+ <div v-if="hasImages" class="image-list">
+ <div
+ class="image-item"
+ v-for="(image, index) in imageList"
+ :key="index"
+ @click="previewImage(index)"
+ >
+ <img
+ :src="image.imgUrl"
+ :alt="'妯℃澘鍥剧墖' + (index + 1)"
+ class="small-image"
+ loading="lazy"
+ >
+ </div>
+ </div>
+
+ <!-- 鏃犲浘鐗囨椂鏄剧ず -->
+ <div v-else >鏆傛棤鍥剧墖</div>
+
+ <!-- 鍥剧墖棰勮寮圭獥 -->
+ <div v-if="isPreviewVisible" class="preview-modal" @click="closePreview">
+ <div class="preview-content" @click.stop>
+ <img
+ :src="currentPreviewImage"
+ :alt="`棰勮鍥剧墖 ${currentPreviewIndex + 1}`"
+ class="preview-image"
+ >
+ <div class="preview-nav">
+ <button class="close-btn" @click="closePreview">脳</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
<!-- <div class="div-item" v-if="orderInfo.order.needReceipt == false">
<div class="div-item-left">鍙戠エ淇℃伅锛�</div>
@@ -520,6 +589,9 @@
},
data () {
return {
+ isPreviewVisible: false,
+ currentPreviewImage: '',
+ currentPreviewIndex: 0,
typeList: [],
showPrices: false,
printHiddenFlag: false,//闅愯棌淇℃伅
@@ -677,6 +749,45 @@
minWidth: 80,
},
{
+ title: "閫�娆剧姸鎬�",
+ key: "isRefund",
+ minWidth: 100,
+ render:(h, params) => {
+ if(params.row.isRefund==='NO_REFUND'){
+ return h(
+ "div",
+ "鏈��娆�"
+ );
+ }else if(params.row.isRefund==='ALL_REFUND'){
+ return h(
+ "div",
+ { style: {color:"red"} },
+ "鍏ㄩ儴閫�娆�"
+ );
+ }else if(params.row.isRefund==='PART_REFUND'){
+ return h(
+ "div",
+ { style: {color:"red"} },
+ "閮ㄥ垎閫�娆�"
+ );
+ }else if(params.row.isRefund==='REFUNDING'){
+ return h(
+ "div",
+ { style: {color:"red"} },
+ "閫�娆句腑"
+ );
+ }
+ else {
+ return h(
+ "div",
+ { style: {color:"red"} },
+ "鏈煡鐘舵��"
+ );
+ }
+
+ }
+ },
+ {
title: "灏忚",
key: "subTotal",
minWidth: 100,
@@ -713,10 +824,51 @@
},
watch: {
$route (to, from) {
- this.$router.go(0);
+ console.log("to:",to.fullPath)
+ console.log("form:",from.fullPath)
+ // 姝g‘鎵撳嵃璺敱瀵硅薄鐨勬柟娉�
+ if((from.fullPath === "/orderList"|| from.fullPath === "/fictitiousOrderList" ||from.fullPath === "/orderStatistics"||from.fullPath.includes( "/member-detail")) && to.fullPath.includes("/order-detail")){
+ this.sn = this.$route.query.sn;
+ this.getDataList();
+ this.getOrderPackage();
+ }
},
},
+ computed: {
+ // 鑾峰彇鍥剧墖鍒楄〃锛堝鐞嗙┖鍊兼儏鍐碉級
+ imageList() {
+ console.log(this.orderInfo.orderItems[0].goodsCustomizeTemplateVO)
+ if (this.orderInfo &&
+ this.orderInfo.orderItems &&
+ this.orderInfo.orderItems[0] &&
+ this.orderInfo.orderItems[0].goodsCustomizeTemplateVO &&
+ this.orderInfo.orderItems[0].goodsCustomizeTemplateVO.listImages &&
+ Array.isArray(this.orderInfo.orderItems[0].goodsCustomizeTemplateVO.listImages)) {
+ return this.orderInfo.orderItems[0].goodsCustomizeTemplateVO.listImages;
+ }
+ return [];
+ },
+ // 鍒ゆ柇鏄惁鏈夊浘鐗�
+ hasImages() {
+ return this.imageList.length > 0;
+ }
+ },
methods: {
+ previewImage(index) {
+ if (this.imageList[index]) {
+ this.currentPreviewIndex = index;
+ this.currentPreviewImage = this.imageList[index].imgUrl;
+ this.isPreviewVisible = true;
+ // 闃绘椤甸潰婊氬姩
+ document.body.style.overflow = 'hidden';
+ }
+ },
+ // 鍏抽棴棰勮
+ closePreview() {
+ this.isPreviewVisible = false;
+ // 鎭㈠椤甸潰婊氬姩
+ document.body.style.overflow = '';
+ },
gotoHomes () {
return false
},
@@ -738,6 +890,7 @@
}
},
logisticsList () {
+ this.packageTraceList = []
this.logisticsModal = true;
API_Order.getPackage(this.sn).then((res) => {
if (res.success && res.result != null) {
@@ -796,6 +949,7 @@
// 鑾峰彇璁㈠崟璇︽儏
getDataList () {
this.loading = true;
+ console.log("鎵ц鑾峰彇璁㈠崟淇℃伅鎿嶄綔")
API_Order.orderDetail(this.sn).then((res) => {
this.loading = false;
if (res.success) {
@@ -910,6 +1064,7 @@
},
},
mounted () {
+ console.log("鍔犺浇鏁版嵁")
this.sn = this.$route.query.sn;
this.getDataList();
this.getOrderPackage();
@@ -917,6 +1072,88 @@
};
</script>
<style lang="scss">
+.image-list {
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+ max-width: 600px;
+}
+
+.image-item {
+ cursor: pointer;
+ border: 1px solid #eee;
+ border-radius: 4px;
+ overflow: hidden;
+ transition: transform 0.2s;
+}
+
+.image-item:hover {
+ transform: scale(1.02);
+}
+
+.small-image {
+ width: 80px;
+ height: 80px;
+ object-fit: cover;
+}
+
+.no-image {
+ color: #999;
+ padding: 10px 0;
+}
+
+/* 棰勮寮圭獥鏍峰紡 */
+.preview-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.8);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 1000;
+}
+
+.preview-content {
+ position: relative;
+ max-width: 90%;
+ max-height: 90%;
+}
+
+.preview-image {
+ max-width: 100%;
+ object-fit: contain;
+}
+
+.preview-nav {
+ position: absolute;
+ top: -30px;
+ right: 0;
+ color: white;
+ display: flex;
+ align-items: center;
+ gap: 15px;
+}
+
+.preview-count {
+ font-size: 14px;
+}
+
+.close-btn {
+ background: none;
+ border: none;
+ color: white;
+ font-size: 20px;
+ cursor: pointer;
+ width: 24px;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0;
+}
.lineH30 {
line-height: 30px;
}
--
Gitblit v1.8.0