Przeglądaj źródła

改签补差价

gcz 2 tygodni temu
rodzic
commit
ad7b8ab8b7
4 zmienionych plików z 75 dodań i 8 usunięć
  1. 2 1
      center/order.vue
  2. 12 0
      center/orderdetails.vue
  3. 60 6
      pages/ticketlist.vue
  4. 1 1
      utils/filter.js

+ 2 - 1
center/order.vue

@@ -100,7 +100,8 @@
 					// ,{name:'查看评价',fun:'viewEvaluate',class:'green'}
 					7:[],
 					8:[],
-					9:[]
+					9:[],
+					10:[]
 				},
 				orderBadge:{
 					noPayNum:0,

+ 12 - 0
center/orderdetails.vue

@@ -109,6 +109,17 @@
 						<text class="copy-btn" @click="copyOrderNum(orderDetails[item.key])" v-if="item.key=='id'">复制</text>
 					</text>
 				</view>
+				<!-- 改签信息 -->
+				<view class="order-info-item rebook-info" v-if="orderDetails.resubmit">
+					<text class="til">改签时间</text>
+					<text class="con">{{orderDetails.resubmit.createTime}}</text>
+				</view>
+				<view class="order-info-item rebook-info" v-if="orderDetails.resubmit">
+					<text class="til">改签费用</text>
+					<text class="con" v-if="orderDetails.resubmit.diffType==0">补缴¥ {{orderDetails.resubmit.rebookPrice}}</text>
+					<text class="con" v-else-if="orderDetails.resubmit.diffType==1">系统退款¥ {{orderDetails.resubmit.refundPrice}}</text>
+					<text class="con" v-else>¥ {{orderDetails.resubmit.diffPrice}}</text>
+				</view>
 			</view>
 			<view class="box order-info refund-list" v-if="orderDetails.refundList&&orderDetails.refundList.length>0">
 				<view class="title u-flex u-row-between">
@@ -254,6 +265,7 @@
 					7:[{name:'订单编号',key:'id'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
 					8:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'id'},{name:'下单时间',key:'createTime'},{name:'备注信息',key:'remark'}],
 					9:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'id'},{name:'下单时间',key:'createTime'},{name:'备注信息',key:'remark'}],
+					10:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'id'},{name:'下单时间',key:'createTime'},{name:'备注信息',key:'remark'}],
 				},
 				tipsArr:[
 					'1.请提前到达影院现场,找到自助取票机,打印纸质电影票,完成取票',

+ 60 - 6
pages/ticketlist.vue

@@ -190,17 +190,34 @@
 				<view class="full-btn gray" v-else>确定</view> -->
 				<!-- 底部浮动条 -->
 				<view class="bottom-bar">
-					<view class="inner">
+					<view class="inner rebook"  v-if="fromPage=='rebook'">
+						<view class="price-info">
+							<view class="total-price">
+								<text class="price-item">原订单总额:{{originOrderInfo.realPrice}}</text>
+								<text class="price-item">改签总额:{{totalPrice}}</text>
+							</view>
+							<!-- 差价信息 -->
+							<view class="difference">
+								<view class="difference-item" v-if="originOrderInfo.realPrice - totalPrice>0">
+									<text>待退款:{{originOrderInfo.realPrice - totalPrice}}</text>
+								</view>
+								<view class="difference-item" v-if="originOrderInfo.realPrice - totalPrice<=0">
+									<text>待支付:{{totalPrice - originOrderInfo.realPrice}}</text>
+								</view>
+							</view>
+						</view>
+						<view class="submit-btn" :class="{active: hasSelectedTicket}" @click="handelRebook">
+							{{hasSelectedTicket ? '确认改签' : '请选择票'}}
+						</view>
+					</view>
+					<view class="inner" v-else>
 						<view class="price-info">
 							<view class="total-price">
 								<text>¥{{totalPrice}}</text>
 								<text class="original">¥{{originalPrice}}</text>
 							</view>
 						</view>
-						<view v-if="fromPage=='rebook'" class="submit-btn" :class="{active: hasSelectedTicket}" @click="handelRebook">
-							{{hasSelectedTicket ? '确认改签并支付' : '请选择票'}}
-						</view>
-						<view v-else class="submit-btn" :class="{active: hasSelectedTicket}" @click="book">
+						<view class="submit-btn" :class="{active: hasSelectedTicket}" @click="book">
 							{{hasSelectedTicket ? '去支付' : '请选择票'}}
 						</view>
 					</view>
@@ -366,6 +383,8 @@
 				payResult:{},
 				cansubmit: true,
 				newOrderId:'',
+				originOrderInfo:{},
+				resubmitInfo:{},
 			}
 		},
 		onShow() {
@@ -411,6 +430,8 @@
 				this.setDate(today);
 				this.getPerformInfo();
 				this.getPerformerNotice();
+				//获取订单信息
+				this.getOrderInfo();
 			} 
 			else{
 				this.performId = page.id;
@@ -445,6 +466,15 @@
 					console.log('uncompress',err);
 				})
 			},
+			getOrderInfo(){
+				this.$u.api.orderDetails({id:this.orderId}).then(res=>{
+					console.log('getOrderInfo',res.data);
+					this.originOrderInfo = res.data||{};
+					this.resubmitInfo = res.data.resubmitInfo||{};
+				}).catch(err=>{
+					console.log('getOrderInfo',err);
+				})
+			},
 			getPerformData(){
 				this.$u.api.performSell({performId:this.performId}).then(res=>{
 					// console.log('getPerformData',res.data);
@@ -874,6 +904,9 @@
 			  });
 			},
 			async handelRebook(){
+				if(!this.hasSelectedTicket){
+					return
+				}
 				const location = await this.getUserLocation();
 				let session = this.sessionList[this.sessionIndex];
 				let params = {
@@ -885,7 +918,7 @@
 				console.log('handelRebook params',params);
 				uni.showModal({
 				  title: '温馨提示',
-				  content: '每张票仅限改签一次,改签成功后原订单费用将会原路退还,您确定要改签吗?',
+				  content: '仅限改签一次,且改签后禁止退款,确定要继续改签吗?',
 				  success: res => {
 				    if (res.confirm) {
 						this.cansubmit = false;
@@ -1563,6 +1596,26 @@
 		padding: 0 30rpx;
 		box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
 		z-index: 100;
+		&.rebook{
+			.price-info{
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.price-item{
+					font-size: 24rpx;
+					color: #999;
+					display:block
+				}
+			}
+			.difference{
+				padding:0 10rpx;
+				.difference-item{
+					font-size: 26rpx;
+					color: #f00;
+					font-weight: bold;
+				}
+			}
+		}
 	}
 	.price-info {
 		flex: 1;
@@ -1580,6 +1633,7 @@
 				font-weight: normal;
 			}
 		}
+		
 	}
 	
 	.submit-btn {

+ 1 - 1
utils/filter.js

@@ -38,7 +38,7 @@ Vue.filter("filterToFixed", function(val) {
 
 // 订单状态
 Vue.filter("filterOrderState", function(val) {	
-	let orderList = ['待支付', '','超时取消', '待使用', '退款中', '己退款', '退款失败', '己使用', '己超期','己关闭']
+	let orderList = ['待支付', '','超时取消', '待使用', '退款中', '己退款', '退款失败', '己使用', '己超期','己关闭','已改签']
 	return orderList[val]
 });