瀏覽代碼

Merge branch 'dev' of http://47.101.131.235:3000/LiChengjin/MiniScm into dev

Shu 2 月之前
父節點
當前提交
bd13164d64
共有 2 個文件被更改,包括 22 次插入8 次删除
  1. 6 6
      pages/order/order.vue
  2. 16 2
      subpkg/orderDetail/orderDetail.vue

+ 6 - 6
pages/order/order.vue

@@ -7,14 +7,14 @@
 		</view>
 		<view class="order-item" v-for="(order,index) in orderList" :key="index">
 			<view class="one-order">
-				<view class="order--no" @click="gotoOrderDetail(order.orderId)">
+				<view class="order--no" @click="gotoOrderDetail(order.orderId,order.roomTypeName)">
 					<view class="order--no__no">
 						<view>订单号:</view>
 						<view>{{ order.orderId.toUpperCase() }}</view>
 					</view>
 					<view class="order--no__status"></view>
 				</view>
-				<view class="order--room" @click="gotoOrderDetail(order.orderId)">
+				<view class="order--room" @click="gotoOrderDetail(order.orderId,order.roomTypeName)">
 					<view class="order--room__pic">
 						<u-image :src="getPicPath(order.roomPicPath)" width="180rpx" height="180rpx"></u-image>
 					</view>
@@ -25,7 +25,7 @@
 						{{ "¥"+ order.price }}
 					</view>
 				</view>
-				<view class="order--duration" @click="gotoOrderDetail(order.orderId)">
+				<view class="order--duration" @click="gotoOrderDetail(order.orderId,order.roomTypeName)">
 					<view class="order--duration__start">
 						<view class="order--duration__start-title">入住日期</view>
 						<view class="order--duration__start-date">
@@ -146,7 +146,7 @@
 					orderStatus: this.status[index],
 					hotelId: this.currentHotel.hotelId
 				}
-				
+
 				let res = await uni.$http.post(`/order/status`, condition)
 				this.orderList = [...this.orderList, ...res.data.data.records]
 				this.total = res.data.data.total
@@ -196,9 +196,9 @@
 			getPicPath(path) {
 				return IMG_BASE_URL + '/' + path
 			},
-			gotoOrderDetail(orderId) {
+			gotoOrderDetail(orderId, roomTypeName) {
 				uni.navigateTo({
-					url: '/subpkg/orderDetail/orderDetail?orderId=' + orderId
+					url: `/subpkg/orderDetail/orderDetail?orderId=${orderId}&roomTypeName=${roomTypeName}`
 				})
 			}
 		},

+ 16 - 2
subpkg/orderDetail/orderDetail.vue

@@ -23,11 +23,11 @@
 		</view>
 		<view class="info-item">
 			<u-text text="酒店:"></u-text>
-			<u-text :text="orderInfo.hotelName" align="right"></u-text>
+			<u-text :text="currentHotel.name" align="right"></u-text>
 		</view>
 		<view class="info-item">
 			<u-text text="房间类型:"></u-text>
-			<u-text :text="orderInfo.roomTypeName" align="right"></u-text>
+			<u-text :text="roomTypeName" align="right"></u-text>
 		</view>
 		<view class="info-item">
 			<u-text text="楼栋:"></u-text>
@@ -82,6 +82,10 @@
 <script>
 	import moment from "moment"
 	import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex'
 	export default {
 		components: {
 			NavigateBar
@@ -90,6 +94,7 @@
 			return {
 				orderId: '',
 				orderInfo: {},
+				roomTypeName: '',
 				paymentStatus: {
 					UNPAID: '待支付',
 					PAID: '已支付'
@@ -100,9 +105,16 @@
 					ROOM_SELECTED: "已选房",
 					CHECK_IN: "已入住",
 					FINISHED: "已完成"
+				},
+				paymentMethod: {
+					WECHAT: '微信',
+					ALIPAY: '支付宝'
 				}
 			};
 		},
+		computed: {
+			...mapState('m_business', ['currentHotel']),
+		},
 		methods: {
 			async queryOrder() {
 				let res = await uni.$http.get(`/order/orderId/${this.orderId}`, )
@@ -118,6 +130,7 @@
 				this.orderInfo.paymentStatus = this.paymentStatus[this.orderInfo.paymentStatus]
 				this.orderInfo.breakfastNum = this.orderInfo.breakfastNum === undefined ? 0 : this.orderInfo
 					.breakfastNum
+				this.orderInfo.paymentMethod = this.paymentMethod[this.orderInfo.platform]
 			},
 			async deleteOrder() {
 				let res = await uni.$http.delete('/hotelOrder/' + this.orderInfo.id)
@@ -137,6 +150,7 @@
 		async onLoad(options) {
 			console.log(options.orderId)
 			this.orderId = options.orderId
+			this.roomTypeName = options.roomTypeName
 			await this.queryOrder()
 		},
 		// #ifdef MP-WEIXIN