From cad79143aeae484fcd500b39ac07fde1a67f0ee6 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 11 二月 2026 18:31:44 +0800
Subject: [PATCH] 合并

---
 mini-program/pagesA/pages/order-details/order-details.vue |  236 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 194 insertions(+), 42 deletions(-)

diff --git a/mini-program/pagesA/pages/order-details/order-details.vue b/mini-program/pagesA/pages/order-details/order-details.vue
index c3f1881..9013427 100644
--- a/mini-program/pagesA/pages/order-details/order-details.vue
+++ b/mini-program/pagesA/pages/order-details/order-details.vue
@@ -4,43 +4,86 @@
 			<view class="head-bar" :style="{ height: navHeight + statusbarHeight + 'px' }">
 				<view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
 				<view class="head-bar-nav" :style="{ height: navHeight + 'px' }">
-					<image src="/static/icon/nav_ic_back@2x.png" mode="widthFix"></image>
+					<image src="/static/icon/nav_ic_back@2x.png" mode="widthFix" @click="jumpBack()"></image>
 					<text>璁㈠崟璇︽儏</text>
 					<image style="opacity: 0;" src="/static/icon/nav_ic_back@2x.png" mode="widthFix"></image>
 				</view>
 			</view>
 			<view class="info">
-				<view class="info-status">寰呮敮浠�</view>
-				<view class="info-desc">
-					鍓╀綑鏀粯鏃堕棿 08:32锛岃灏藉揩浠樻鍝︼紝杩囨湡灏嗚嚜鍔ㄥ彇娑垀
+				<text v-if="info.orderStatus ==0" class="info-status">寰呮敮浠�</text>
+				<text  v-if="info.orderStatus ==1" class="info-status">{{info.receiveType==1?'寰呰嚜鎻�':'寰呭彂璐�'}}</text>
+				<text  v-if="info.orderStatus ==2" class="info-status">寰呮敹璐�</text>
+				<text  v-if="info.orderStatus ==3" class="info-status grey">浜ゆ槗瀹屾垚</text>
+				<text  v-if="info.orderStatus ==4" class="info-status grey">宸插彇娑�</text>
+				<text  v-if="info.orderStatus ==6" class="info-status grey">宸查��娆�</text>
+				<template  v-if="userType==1">
+					<view class="info-desc"  v-if="info.orderStatus ==0">
+						鍓╀綑鏀粯鏃堕棿 08:32锛岃繃鏈熷皢鑷姩鍙栨秷~
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==1">
+						{{info.receiveType==1?'璇风瓑寰呭鎴疯嚜鎻愯喘涔扮殑鍟嗗搧锝�':'绛夊緟骞冲彴鍙戣揣'}}
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==2">
+						璇风瓑寰呭鎴风‘璁ゆ敹璐
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==3">
+						{{info.receiveType==1?'璁㈠崟宸茶嚜鎻愶紝浜ゆ槗瀹屾垚锝�':'瀹㈡埛宸茬‘璁ゆ敹璐э紝浜ゆ槗宸插畬鎴悀'}}
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==4">
+						{{info.cancelInfo||'璁㈠崟宸插彇娑�'}}
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==6">
+						璁㈠崟宸茬敱鍚庡彴鎿嶄綔閫�娆緙
+					</view>
+				</template>
+				<view class="info-desc"  v-if="userType==0">
+					<view class="info-desc"  v-if="info.orderStatus ==0">
+						鍓╀綑鏀粯鏃堕棿 08:32锛岃灏藉揩浠樻鍝︼紝杩囨湡灏嗚嚜鍔ㄥ彇娑垀
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==1">
+						{{info.receiveType==1?'璇峰墠寰�鎸囧畾闂ㄥ簵杩涜鏍搁攢锝�':'鍟嗗搧宸叉墦鍖咃紝绛夊緟鍙戣揣锝�'}}
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==2">
+						鍗栧宸插彂璐э紝璇风瓑寰呮敹璐э綖
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==3">
+						{{info.receiveType==1?'璁㈠崟宸茶嚜鎻愶紝浜ゆ槗瀹屾垚~':'璁㈠崟宸插畬鎴愶紝鎰熻阿鎮ㄧ殑鏀寔~'}}
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==4">
+						{{info.cancelInfo||'璁㈠崟宸插彇娑�'}}
+					</view>
+					<view class="info-desc"  v-if="info.orderStatus ==6">
+						璁㈠崟宸茬敱鍚庡彴鎿嶄綔閫�娆緙
+					</view>
 				</view>
 			</view>
 			<view class="user">
 				<view class="user-jxa">
 					<view class="user-jxa-title">
 						<image src="/static/icon/ic_address@2x1.png" mode="widthFix"></image>
-						<text>XXXX缁忛攢鍟�</text>
+						<text>{{info.shopInfo.name||''}}</text>
 					</view>
 					<view class="user-jxa-lx">
 						<image src="/static/icon/ic_call@2x.png" mode="widthFix"></image>
-						<text>鑱旂郴鍟嗗</text>
+						<text v-if="userType==1" @click="contact(info.linkphone)">鑱旂郴瀹㈡埛</text> 
+						<text v-if="info.orderStatus!=0 && userType==0" @click="contact(info.shopPhone)">鑱旂郴缁忛攢鍟�</text>
 					</view>
 				</view>
 				<view class="user-jxtime">
 					<image class="user-jxtime-icon" src="/static/icon/ic_openinghours@2x.png" mode="widthFix"></image>
-					<text>钀ヤ笟鏃堕棿锛氬懆涓�鑷冲懆浜� 09:00-19:00</text>
+					<text>钀ヤ笟鏃堕棿锛歿{info.shopInfo.startTime || ''}}</text>
 				</view>
 				<view class="user-jxtime">
 					<image class="user-jxtime-icon" src="/static/icon/ic_shopaddress@2x.png" mode="widthFix"></image>
-					<text>瀹夊窘鐪佸悎鑲ュ競缁忓紑鍖虹箒鍗庡ぇ閬�200鍙�</text>
+					<text>{{info.shopInfo.addr || ''}}</text>
 					<image class="user-jxtime-to" src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
 				</view>
-				<view class="user-qrcode">
+				<view class="user-qrcode" v-if="info.orderStatus ==1 &&info.receiveType==1">
 					<view class="user-qrcode-image">
-						<image src="/static/logo.png" mode="widthFix"></image>
+						<image v-if="qrCodeBase64" :src="qrCodeBase64"  ></image>
 					</view>
-					<view class="user-qrcode-code">767889</view>
-					<view class="user-qrcode-btn">澶嶅埗鑷彁鐮�</view>
+					<view class="user-qrcode-code">{{info.exchangeCode || ''}}</view>
+					<view class="user-qrcode-btn" @click="copyText(info.exchangeCode)">澶嶅埗鑷彁鐮�</view>
 				</view>
 			</view>
 			<!-- <view class="user">
@@ -65,43 +108,45 @@
 				</view>
 			</view> -->
 			<view class="shop">
-				<view class="shop-info" style="margin: 0;">
+				<view class="shop-info" style="margin: 0;"  v-if="info.status ==6">
 					<view class="shop-info-item" style="margin-bottom: 12rpx;">
 						<view class="shop-info-item-label" style="color: #222222; font-size: 30rpx; font-weight: 600;">閫�娆鹃噾棰�</view>
 						<view class="shop-info-item-price xfk">
-							<text>998</text>
-							<text>.00</text>
+							<text>{{(info.refundMoney||0).toFixed(2)}}</text>
+							<text></text>
 						</view>
 					</view>
 					<view class="shop-info-item" style="margin-bottom: 12rpx;">
 						<view class="shop-info-item-label" style="color: #999999; font-size: 24rpx; font-weight: 400;">宸查��鍥炴偍鐨勬敮浠樿处鎴�</view>
 						<view class="shop-info-item-price" style="color: #999999; font-size: 24rpx; font-weight: 400;">
-							2025-06-12 09:20:20
+							{{info.refundTime || ''}}
 						</view>
 					</view>
 					<view class="shop-info-item">
 						<view class="shop-info-item-label" style="color: #999999; font-size: 24rpx; font-weight: 400;">閫�娆惧娉�</view>
 						<view class="shop-info-item-price" style="color: #999999; font-size: 24rpx; font-weight: 400;">
-							鍗忓晢涓�鑷撮��娆�
+							{{info.refundInfo || ''}}
 						</view>
 					</view>
 				</view>
 			</view>
 			<view class="shop">
 				<view class="shop-top">
-					<view class="shop-top-tips">閰嶉��</view>
-					<text>鍚堣偉榧庡厓鏃嬪帇绉戞妧鏈夐檺鍏徃</text>
+					<view :class="'shop-top-tips '+(info.receiveType==1?'shop-top-tips-a':'shop-top-tips-b' )">{{info.receiveType==1?'鑷彁':'閰嶉��'}}</view>
+					<text v-if="info.receiveType==1">{{info.shopInfo.name}}</text>
+					<text v-if="info.receiveType!=1">{{info.kdName}}</text>
 				</view>
 				<view class="b">
-					<view class="b-item" v-for="(item, index) in 2" :key="index">
+					<view class="b-item" v-for="(item, index) in (info.goodsorderDetailList||[])" :key="index">
 						<view class="b-item-image">
-							<image src="/static/logo.png" mode="widthFix"></image>
+<!-- 							<image v-if="item.imgurl!=null" :src="item.imgurl" mode="widthFix"></image>
+ -->							 <image src="/static/icon/default2.png" mode="widthFix"></image>
 						</view>
 						<view class="b-item-title">
-							<view class="b-item-title-val">涓仈鑹剧瀹介娇 閫傜敤闆锋矁/涓仈/涔呬繚鐢�</view>
+							<view class="b-item-title-val">{{item.name || ''}}</view>
 							<view class="b-item-jia">
-								<text>楼499.00</text>
-								<text>x1</text>
+								<text>楼{{(item.price || 0).toFixed(2)}}</text>
+								<text>x{{item.goodsNum || 1}}</text>
 							</view>
 						</view>
 					</view>
@@ -110,36 +155,36 @@
 					<view class="shop-info-item">
 						<view class="shop-info-item-label">鍟嗗搧鎬讳环</view>
 						<view class="shop-info-item-price">
-							<text>998</text>
-							<text>.00</text>
+							<text>{{((info.totalPrice || 0)-(info.mailPrice || 0)).toFixed(2)}}</text>
+							<text></text>
 						</view>
 					</view>
 					<view class="shop-info-item">
 						<view class="shop-info-item-label">杩愯垂</view>
 						<view class="shop-info-item-price yf">
-							<text>10</text>
-							<text>.00</text>
+							<text>{{(info.mailPrice || 0).toFixed(2)}}</text>
+							<text></text>
 						</view>
 					</view>
 					<view class="shop-info-item">
 						<view class="shop-info-item-label">浼樻儬鍒�</view>
 						<view class="shop-info-item-price yhj">
-							<text>998</text>
-							<text>.00</text>
+							<text>{{(info.couponPrice || 0).toFixed(2)}}</text>
+							<text></text>
 						</view>
 					</view>
 					<view class="shop-info-item">
 						<view class="shop-info-item-label">绉垎鎶垫墸</view>
 						<view class="shop-info-item-price yhj">
-							<text>10</text>
-							<text>.00</text>
+							<text>{{(info.integral || 0).toFixed(2)}}</text>
+							<text></text>
 						</view>
 					</view>
 					<view class="shop-info-item">
 						<view class="shop-info-item-label" style="color: #222222; font-size: 30rpx; font-weight: 600;">闇�浠樻</view>
 						<view class="shop-info-item-price xfk">
-							<text>998</text>
-							<text>.00</text>
+							<text>{{(info.price || 0).toFixed(2)}}</text>
+							<text></text>
 						</view>
 					</view>
 				</view>
@@ -150,20 +195,20 @@
 					<view class="xinxi-list-item">
 						<view class="xinxi-list-item-label">璁㈠崟缂栧彿锛�</view>
 						<view class="xinxi-list-item-right">
-							<text>202107131742520001</text>
-							<image src="/static/icon/ic_cppy@2x.png" mode="widthFix"></image>
+							<text>{{info.code || ''}}</text>
+							<image src="/static/icon/ic_cppy@2x.png"  @click="copyText(info.code )" mode="widthFix"></image>
 						</view>
 					</view>
 					<view class="xinxi-list-item">
 						<view class="xinxi-list-item-label">鍒涘缓鏃堕棿锛�</view>
 						<view class="xinxi-list-item-right">
-							<text>2025-08-12 12:00:00</text>
+							<text>{{info.createDate || ''}}</text>
 						</view>
 					</view>
 					<view class="xinxi-list-item">
 						<view class="xinxi-list-item-label">璁㈠崟澶囨敞锛�</view>
 						<view class="xinxi-list-item-right">
-							<text>-</text>
+							<text>{{info.memberInfo||'-'}}</text>
 						</view>
 					</view>
 				</view>
@@ -196,15 +241,108 @@
 </template>
 
 <script>
+	import QRCode from 'qrcode';
 	import { mapState } from 'vuex'
 	export default {
 		computed: {
-			...mapState(['navHeight', 'statusbarHeight'])
+			...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
 		},
 		data() {
 			return {
-				show: false
+				show: false,
+				qrCodeBase64:'',
+				id:null,
+				userType:0,
+				shop:{},
+				info:{shopInfo:{}}
 			};
+		},
+		onShow() {
+			this.info={shopInfo:{}}
+			this.qrCodeBase64=''
+			if(this.userType === 1){
+				this.shop  ={}
+				this.checkShopLogin()
+				this.shop = this.shopInfo || {} 
+				this.getShopDetail()
+			}else{
+				this.getUserDetail()
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			this.userType = Number(options.userType)
+			this.qrCodeUrl=''
+		},
+		methods:{
+			  copyText(text) {
+			      try {
+					   wx.setClipboardData({
+						  data: text||' ',
+						  success: function () {
+							uni.showToast({ title: '澶嶅埗鎴愬姛' });
+						  },
+						  fail: function () {
+							uni.showToast({ title: '澶嶅埗澶辫触', icon: 'none' });
+						  }
+						});
+			      } catch (err) {
+			        console.error('澶嶅埗澶辫触', err);
+			        uni.showToast({ title: '澶嶅埗澶辫触', icon: 'none' });
+			      }
+			    },
+			async getQrcodeByStr(){
+					try { 
+				  const ocanvas = uni.createOffscreenCanvas({ type: "2d" });
+						const qrCodeBase64 = await QRCode.toDataURL(ocanvas,this.info.exchangeCode, {
+													scale: 1, // 浜岀淮鐮佺殑缂╂斁姣斾緥锛屽彲浠ユ牴鎹渶瑕佽皟鏁�
+													width: 300, // 浜岀淮鐮佺殑瀹藉害锛屽彲浠ユ牴鎹渶瑕佽皟鏁�
+													margin: 1 // 浜岀淮鐮佸懆鍥寸殑绌虹櫧杈硅窛锛屽彲浠ユ牴鎹渶瑕佽皟鏁�
+												}); 
+						this.qrCodeBase64 =qrCodeBase64
+						console.log("==================this.info.exchangeCode1:",qrCodeBase64)
+				      } catch (err) {
+						  uni.showToast({
+						  	title:'鍒涘缓浜岀淮鐮佸け璐�',
+							icon:'error'
+						  })
+				      }
+			},
+			contact(phone){
+				if(phone !=null && phonee!=''){
+					uni.makePhoneCall({
+					   phoneNumber: phone 
+					})
+				}
+			},
+			async  getShopDetail(index){
+				var that =this 
+				let res = await that.$u.api.shopOrderDetail({orderId:this.id,tokenType:1  })
+				if (res.code === 200) { 
+					this.info = res.data 
+					this.info.shopInfo = this.info.shopInfo||{}
+					
+					this.getQrcodeByStr()
+				} 
+			},
+			async  getUserDetail(index){
+				var that =this 
+				let res = await that.$u.api.shopOrderDetail({orderId:this.id,tokenType:1  })
+				if (res.code === 200) { 
+					this.info = res.data 
+				} 
+			},
+			checkShopLogin(){
+				var that =this
+				if( this.shopInfo ==null || this.shopInfo.id==null ||  this.shopToken==null || this.shopToken==''){
+					uni.navigateTo({
+						url: '/pages/login/login'
+					})
+				} 
+			},
+			jumpBack(){
+				uni.navigateBack({ delta: 1 });
+			},
 		}
 	}
 </script>
@@ -417,10 +555,16 @@
 						font-weight: 400;
 						font-size: 22rpx;
 						color: #FFFFFF;
-						background: #004096;
 						border-radius: 8rpx;
-						border: 1rpx solid #004096;
 						margin-right: 16rpx;
+					}
+					.shop-top-tips-a { 
+						background: #00B775; 
+						border: 1rpx solid #00B775;
+					}
+					.shop-top-tips-b {
+						background: #004096;
+						border: 1rpx solid #004096;
 					}
 					text {
 						font-weight: 400;
@@ -466,6 +610,10 @@
 								font-weight: 400;
 								font-size: 30rpx;
 								color: #222222;
+								display: -webkit-box;
+								-webkit-line-clamp: 2; /* 闄愬埗鏂囨湰涓�2琛� */
+								-webkit-box-orient: vertical;
+								overflow: hidden;
 							}
 							.b-item-jia {
 								flex-shrink: 0;
@@ -671,6 +819,10 @@
 							width: 100%;
 							height: 100%;
 						}
+						canvas {
+							width: 180px;
+							height: 180px;
+						}
 					}
 					.user-qrcode-code {
 						font-weight: 600;

--
Gitblit v1.9.3