Commit c1fa2ee8 authored by youjie's avatar youjie

签证订单

parent 5bb41d5d
......@@ -137,9 +137,9 @@
</button> -->
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<view v-if="item.orderState == 2" class="jz_Zailai" style="width: 110rpx; margin-right: 10rpx" @click.stop="goZhifuAli(item)">付款</view>
<!-- <view class="jz_Zailai" style="width: 110rpx; margin-right: 10rpx" @click.stop="goZhifuAli(item)">付款</view> -->
<!-- #endif -->
<view v-if="item.isApplyForCancel != 1 && item.visaOrderStatus != 3 && item.customerPayMoney==0" class="jz_Zailai"
<view v-if="item.visaOrderStatus!=2&&item.income==0" class="jz_Zailai"
style="width: 110rpx" @click.stop="goCancel(item)">取消</view>
</view>
</view>
......@@ -246,9 +246,9 @@
//获取订单状态名称
getOrderStateName(item) {
var str = "待付款";
if (item.orderState == 1) {
if (item.visaOrderStatus == 1&&item.income>0) {
str = "已付款"
} else if (item.orderState == 3) {
} else if (item.visaOrderStatus == 2) {
str = "已取消"
}
return str;
......@@ -335,47 +335,32 @@
},
//取消订单
goCancel(item) {
//未付款-调用后台取消
if (
(item.paymentTime == null || item.paymentTime == "") &&
item.orderState == 2
) {
this.apipost(
"sellorder_post_B2BRemoveOrder", {
ID: item.orderId,
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
this.research();
}
},
(err) => {}
);
} else {
let msg = {
OrderId: item.orderId,
UserId: uni.getStorageSync("mall_UserInfo").UserId,
};
//已付款取消申请
this.apipost(
"sellorder_post_AppletUserCancelOrder",
msg,
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
this.research();
} else {}
},
null
);
}
let that = this
wx.showModal({
title: '提示',
content: '确定取消订单?',
success: (tip) => {
if (tip.confirm) {
that.apipost(
"b2c_get_SetB2BOrderCancel", {
OrderId: item.id,
OrderSource: 5
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.research();
}
},
(err) => {}
);
}
}
})
},
//付款
// #ifdef MP-WEIXIN
......
......@@ -474,7 +474,6 @@
<view class="visaProductNum visaProductNumR column">
<view class="visaProductNum_Title">入境日期</view>
<picker class="visaProductTetx" mode="date"
:start-date="startDate"
:value="orderMsg.EnterCountryTime" @change="bindDateChange"
>
<view class="row-sbas-n items-center">
......@@ -498,21 +497,19 @@
</view>
</view>
<view class="row visaProductNumBox">
<view class="visaProductNum column">
<!-- <view class="visaProductNum column">
<view class="visaProductNum_Title">请输入名</view>
<view class="row-sbas-n items-center">
<input class="visaProductTetx" v-model="customer.customerName" />
</view>
</view>
<view class="visaProductNum visaProductNumR column">
<view class="visaProductNum_Title">请输入姓</view>
</view> -->
<view class="visaProductNum column">
<view class="visaProductNum_Title">请输入姓</view>
<view class="row-sbas-n items-center">
<input class="visaProductTetx" v-model="customer.name" />
</view>
</view>
</view>
<view class="row visaProductNumBox">
<view class="visaProductNum column">
<view class="visaProductNum visaProductNumR column">
<view class="visaProductNum_Title">国家/地区</view>
<view class="row-sbas-n items-center" @click="CountryType=1,showCountry=true">
<view class="visaProductCount">{{ optionsTitle[0] }}</view>
......@@ -521,7 +518,9 @@
color="black" size="30" />
</view>
</view>
<view class="visaProductNum visaProductNumR column">
</view>
<view class="row visaProductNumBox">
<view class="visaProductNum column">
<view class="visaProductNum_Title">电话
<text style="font-weight: bold;font-size: 20rpx;color: #B99846;">
{{ customer.PhoneCountryStr }}
......@@ -531,15 +530,16 @@
<input class="visaProductTetx" v-model="customer.contactNumber" />
</view>
</view>
</view>
<view class="row visaProductNumBox">
<view class="visaProductNum visaProductNumR column col" style="margin-left: 0;">
<view class="visaProductNum visaProductNumR column">
<view class="visaProductNum_Title">邮箱地址</view>
<view class="row-sbas-n items-center">
<input class="visaProductTetx" v-model="customer.Mailbox" placeholder="输入邮箱地址"/>
</view>
</view>
</view>
<!-- <view class="row visaProductNumBox">
</view> -->
<view class="row items-center visaProductTextBox">
<view class="visaProduct_rColor visaProductTextL"></view>
<view class="visaProductTitle">收件信息</view>
......@@ -729,6 +729,7 @@
<script>
import coupon from '@/components/coupon/index';
import { gegerateDates,getBeforeDate,getDateWeek } from "../airTicket/dates.js";
export default {
components: {
coupon
......@@ -937,7 +938,15 @@
this.customer.PhoneCountryStr = "+" + this.customer.PhoneCountry;
},
bindDateChange(e) {
this.orderMsg.EnterCountryTime = e.detail.value
let dates = getBeforeDate(0, new Date())
if(e.detail.value<=dates){
uni.showToast({
title: `请选择大于今天的日期`,
icon: "none",
});
return;
}
this.orderMsg.EnterCountryTime = e.detail.value
},
scroll(e) {
this.boxOption = Math.floor((e.detail.scrollTop - 50) / 1.5);
......@@ -1095,12 +1104,12 @@
return;
}
this.tipsText = ''
if (this.customer.customerName == "") {
this.tipsText = '请输入名'
return;
}
// if (this.customer.customerName == "") {
// this.tipsText = '请输入名'
// return;
// }
if (this.customer.name == "") {
this.tipsText = '请输入姓'
this.tipsText = '请输入姓'
return;
}
if (this.customer.PhoneCountryStr == "") {
......@@ -1187,7 +1196,7 @@
EnterCountryTime: this.orderMsg.EnterCountryTime,//入境时间
GuestList: [],//this.guests
VisaOrderRelation:{
RelationName: this.customer.customerName + this.customer.name,// 联系名称
RelationName: this.customer.name ,// +this.customer.customerName联系名称
RelationPhone: this.customer.contactNumber,// 电话
RelationEmail: this.customer.Mailbox,// 邮箱
IsNeedInvoice: this.orderMsg.IsNeedInvoice,// 是否需要发票 ,0-默认
......
......@@ -346,20 +346,19 @@
</text>
</view>
<view style="margin-bottom: 30rpx" v-if="
orderData.model.RejectRemark && orderData.model.RejectRemark != ''
orderData.OrderModel.RejectRemark && orderData.OrderModel.RejectRemark != ''
">
<u-alert-tips type="error" title="订单取消失败" :description="orderData.model.RejectRemark"></u-alert-tips>
<u-alert-tips type="error" title="订单取消失败" :description="orderData.OrderModel.RejectRemark"></u-alert-tips>
</view>
<view class="o-timer flex">
<view class="time-item">{{ getDate(orderData.model.StartDate) }}
{{ getWeek(orderData.model.StartDate) }}</view>
<view class="time-item">
{{ orderData.OrderModel.EnterCountryTime }}
</view>
<view class="time-split">
<view>{{ orderData.model.DayNum }}</view>
<view> 出境</view>
</view>
<view class="time-item" style="font-size: 26rpx; font-weight: 500; flex: 1">
<text v-if="orderData.model.ManNum > 0">{{ orderData.model.ManNum }}成人</text>
<text v-if="orderData.model.ChirdNum > 0">{{ orderData.model.ChirdNum }}儿童</text>
<text v-if="orderData.model.BabyNum > 0">{{ orderData.model.BabyNum }}婴儿</text>
<text v-if="orderData.OrderModel.PeopleNum > 0">{{ orderData.OrderModel.PeopleNum }}</text>
</view>
<view class="update">
<!-- <text style="margin-right: 8rpx;">修改</text>
......@@ -367,14 +366,15 @@
</view>
</view>
<view class="jz_ReserTitle">
{{ orderData.model.Title }}
{{ orderData.ProductModel.Name }}
</view>
<view class="jz_ReserIn" style="margin: 33rpx 0 18rpx 0">
<!-- {{currentPriceInfo.startCityName}}出发 {{currentPriceInfo.startDate}} -->
{{ orderData.model.LtName }}
送签地:{{ orderData.ProductModel.SendCityName }}
<text style="margin-left: 15rpx;">有效期: {{ orderData.ProductModel.VisaValidity }}</text>
</view>
<view class="big-title" v-if="orderData.model.StartCityName">
<text>{{ orderData.model.StartCityName }}出发</text>
<view class="big-title" v-if="orderData.OrderModel.StartCityName">
<text>{{ orderData.OrderModel.StartCityName }}出发</text>
</view>
<view class="jz_ReseQue">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zuanshi.png" />即时确认:本产品付款后可快速确认,放心期待您的旅行
......@@ -385,24 +385,30 @@
<view class="form-items">
<view class="label">订单编号</view>
<view class="jz_SureVal">
{{ orderData.model.OrderId }}
{{ orderData.OrderModel.Id }}
</view>
</view>
<view class="form-items">
<view class="label">下单日期</view>
<view class="jz_SureVal">
{{ orderData.model.CreateDate.replace("T", " ") }}
{{ orderData.OrderModel.CreateTime.replace("T", " ") }}
</view>
</view>
<view class="form-items">
<view class="label">联系人</view>
<view class="jz_SureVal">
{{ orderData.OrderModel.VisaOrderRelation.RelationName }}/{{ orderData.OrderModel.VisaOrderRelation.RelationPhone }}
</view>
</view>
<!-- <view class="form-items">
<view class="label">下单日期</view>
<view class="jz_SureVal">
{{ orderData.model.CreateDate.replace("T", " ") }}
{{ orderData.OrderModel.CreateDate.replace("T", " ") }}
</view>
</view> -->
</view>
<view class="empty-block"></view>
<view class="jz_form jz_MyGuestList" v-for="(subItem, subIndex) in orderData.model.GuestList" :key="subIndex">
<view class="jz_form jz_MyGuestList" v-for="(subItem, subIndex) in orderData.OrderModel.GuestList" :key="subIndex">
<view style="margin: 10rpx 0 20rpx 0"> 游客{{ subIndex + 1 }} </view>
<view class="form-items">
<view class="label">游客姓名</view>
......@@ -424,10 +430,10 @@
</view>
</view>
<view class="empty-block"></view>
<view class="jz_form" v-if="orderData.model.Remarks">
<view class="jz_form" v-if="orderData.OrderModel.Remarks">
<view class="form-items" style="border-bottom: 0">
<view class="label">备注</view>
<view class="jz_SureVal">{{ orderData.model.Remarks }}</view>
<view class="jz_SureVal">{{ orderData.OrderModel.Remarks }}</view>
</view>
</view>
<view class="empty-block"></view>
......@@ -437,15 +443,15 @@
</view>
<view class="jz_form" style="margin: 40rpx 0; padding: 0">
<view class="form-items">
<view class="label"> 在线支付 </view>
<view class="label"> 支付 </view>
<view class="val f14 regular" style="text-align: right">
<text style="margin-right: 30rpx">{{ orderData.model.GuestNum }}</text>
<text style="margin-right: 30rpx">{{ orderData.OrderModel.PeopleNum }}</text>
<text class="red">
<template v-if=" orderData.model.DiscountMoney&&orderData.model.DiscountMoney>0">
{{ Number(orderData.model.PreferPrice) -Number(orderData.model.DiscountMoney)}}
<template v-if="orderData.OrderModel.DiscountMoney&&orderData.OrderModel.DiscountMoney>0">
{{ Number(orderData.OrderModel.TotalPrice) -Number(orderData.OrderModel.DiscountMoney) }}
</template>
<template v-else>
{{ orderData.model.PreferPrice }}
{{ Number(orderData.OrderModel.TotalPrice) }}
</template>
</text>
</view>
......@@ -455,66 +461,21 @@
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index">
<view style="flex: 1">
<text style="margin-right: 30rpx">成人</text>
</view>
<view style="text-align: right">{{ orderData.model.ManNum }}人 × ¥{{
orderData.model.Unit_Price
}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if="orderData.model.ChirdNeedBedNum > 0">
<view style="flex: 1">
<text style="margin-right: 30rpx">儿童(占床)</text>
</view>
<view style="text-align: right">{{ orderData.model.ChirdNeedBedNum }}人 × ¥{{
orderData.model.Unit_Price +
(orderData.modelPrice.ChildNeedPrice
? orderData.modelPrice.ChildNeedPrice
: 0)
}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if="orderData.model.ChirdNum - orderData.model.ChirdNeedBedNum > 0">
<view style="flex: 1">
<text style="margin-right: 30rpx">儿童(不占床)</text>
</view>
<view style="text-align: right">{{ orderData.model.ChirdNum - orderData.model.ChirdNeedBedNum }}人
× ¥{{
orderData.model.Unit_Price -
(orderData.modelPrice.ChildNoNeedPrice
? orderData.modelPrice.ChildNoNeedPrice
: 0)
}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if="orderData.model.BabyNum > 0">
<view style="flex: 1">
<text style="margin-right: 30rpx">婴儿</text>
<text style="margin-right: 30rpx">人数</text>
</view>
<view style="text-align: right">
{{ orderData.model.BabyNum }}人 × ¥{{
orderData.modelPrice.BabyPrice
? orderData.modelPrice.BabyPrice
: 0
}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if="
orderData.model.ChirdNum > 0 &&
orderData.modelPrice.BabyChargePrice &&
orderData.modelPrice.BabyChargePrice > 0
">
<view style="flex: 1">
<text style="margin-right: 30rpx">儿童(附加费)</text>
{{ orderData.OrderModel.PeopleNum }}人 × ¥{{
$utils.getretailer()?orderData.ProductModel.VisaPrice:orderData.ProductModel.VisaB2CPrice
}}
</view>
<view style="text-align: right">
{{ orderData.model.ChirdNum }}人 × ¥{{
orderData.modelPrice.BabyChargePrice
}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if=" orderData.model&& orderData.model.DiscountMoney&&orderData.model.DiscountMoney>0">
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if=" orderData.model&& orderData.OrderModel.DiscountMoney&&orderData.OrderModel.DiscountMoney>0">
<view style="flex: 1">
<text style="margin-right: 30rpx">优惠金额</text>
</view>
<view style="text-align: right">
{{ orderData.model.DiscountMoney}} </view>
{{ orderData.OrderModel.DiscountMoney}} </view>
</view>
</view>
</view>
......@@ -527,8 +488,8 @@
<view class="form-items">
<view class="label"> 已退款总额 </view>
<view class="val f14 regular" style="text-align: right">
<text style="margin-right: 30rpx">{{ orderData.model.GuestNum }}人</text>
<text class="red">¥{{ orderData.model.PreferPrice }}</text>
<text style="margin-right: 30rpx">{{ orderData.OrderModel.PeopleNum }}人</text>
<text class="red">¥{{ $utils.getretailer()?orderData.ProductModel.VisaPrice:orderData.ProductModel.VisaB2CPrice }}</text>
</view>
</view>
</view>
......@@ -586,6 +547,7 @@
submit: false,
submitCancel: false,
showPayBtn: true,
Refund: 0,
};
},
created() {},
......@@ -605,46 +567,40 @@
goCancel() {
if (this.submit || this.submitCancel) return;
//未付款-调用后台取消
if (this.orderData.model.OrderState == 2) {
this.apipost(
"sellorder_post_B2BRemoveOrder", {
ID: this.orderData.model.OrderId,
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
uni.navigateTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
if (this.orderData.OrderModel.VisaOrderStatus!=2&&
(this.orderData.OrderModel.VisaOrderStatus==1&&this.orderData.OrderModel.Income==0)
||(this.orderData.OrderModel.VisaOrderStatus==3)) {
let that = this
wx.showModal({
title: '提示',
content: '确定取消订单?',
success: (tip) => {
if (tip.confirm) {
uni.showLoading()
that.apipost(
"b2c_get_SetB2BOrderCancel", {
OrderId: this.orderData.OrderModel.Id,
OrderSource: 5
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
uni.navigateTo({
url: "/pages/visa/visa_MyOrder",
});
}
uni.hideLoading()
},
(err) => {
uni.hideLoading()
}
);
}
},
(err) => {}
);
} else {
let msg = {
OrderId: this.orderData.model.OrderId,
UserId: uni.getStorageSync("mall_UserInfo").UserId,
};
//已付款取消申请
this.apipost(
"sellorder_post_AppletUserCancelOrder",
msg,
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
uni.navigateTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
} else {}
},
null
);
}
})
}
},
getWeek(date) {
......@@ -660,48 +616,43 @@
},
initOrderInfo(orderId) {
let msg = {
ID: orderId,
IsGetGuest: 1,
Id: orderId,
};
this.apipost(
"sellorder_post_GetOrderEntity",
"b2c_get_GetB2CVisaOrderInfo",
msg,
(res) => {
if (res.resultCode == 1) {
this.orderData = res.data;
this.formatStatus(
this.orderData.model.OrderState,
this.orderData.model.IsChargeLossOrders,
this.orderData.model.IsApplyForCancel
);
this.orderData.OrderModel.VisaOrderStatus,
this.orderData.OrderModel.Income
);
} else {
this.orderData = {
result: -1,
};
}
console.log(res);
},
(e) => {}
);
},
formatStatus(status, loss, isCancel) {
loss = loss ? loss : -1;
//1、已申请;!=1未申请
if (loss == 1 || status == 4) {
formatStatus(status,Income) {
if (status == 2) {
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.showPayBtn = false;
} else if (status == 2 && isCancel != 1) {
} else if (status == 3) {
this.orderStatus.code = 0;
this.orderStatus.text = "待付款";
this.showPayBtn = true;
} else if (status == 2 && isCancel == 1) {
this.orderStatus.code = -2;
this.orderStatus.text = "审核中";
this.showPayBtn = false;
} else if (status == 1) {
} else if (status == 1&&Income==0) {
this.orderStatus.code = 1;
this.orderStatus.text = "正常";
this.showPayBtn = true;
} else if (status == 1&&Income>0) {
this.orderStatus.code = 1;
this.orderStatus.text = "已付款";
this.showPayBtn = false;
}
},
......@@ -733,12 +684,12 @@
goZhifu() {
this.submit = true;
let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.orderData.model.Title;
let GoodsName = this.orderData.OrderModel.Title;
GoodsName = GoodsName.slice(0, 10);
this.request2({
url: url,
data: {
OrderId: this.orderData.model.OrderId,
OrderId: this.orderData.OrderModel.Id,
GoodsName: GoodsName,
OrderPayType: 1,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
......@@ -778,7 +729,7 @@
});
that.submit = false;
//todo
that.initOrderInfo(that.orderData.model.OrderId);
that.initOrderInfo(that.orderData.OrderModel.Id);
},
fail: function(err) {
console.log("fail:", err);
......@@ -787,7 +738,7 @@
icon: "none",
});
that.submit = false;
that.initOrderInfo(that.orderData.model.OrderId);
that.initOrderInfo(that.orderData.OrderModel.Id);
},
});
},
......@@ -801,11 +752,11 @@
title: "支付中",
});
let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.orderData.model.Title;
let GoodsName = this.orderData.OrderModel.Title;
this.request2({
url: url,
data: {
OrderId: this.orderData.model.OrderId,
OrderId: this.orderData.OrderModel.Id,
GoodsName: GoodsName,
OrderPayType: 2,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
......@@ -836,9 +787,9 @@
if (list.includes(res.resultCode)) {
let obj = {
TradeNo: tradeNO,
OrderNo: that.orderData.model.OrderNo,
OrderId: that.orderData.model.OrderId,
preferPrice: that.orderData.model.PreferPrice,
OrderNo: that.orderData.OrderModel.OrderNo,
OrderId: that.orderData.OrderModel.Id,
preferPrice: that.orderData.OrderModel.PreferPrice,
};
that.payAliCallback(obj);
} else {
......@@ -857,7 +808,7 @@
icon: "none",
});
that.submit = false;
that.initOrderInfo(that.orderData.model.OrderId);
that.initOrderInfo(that.orderData.OrderModel.Id);
},
});
},
......@@ -891,7 +842,7 @@
title: "支付失败",
icon: "none",
});
that.initOrderInfo(that.orderData.model.OrderId);
that.initOrderInfo(that.orderData.OrderModel.Id);
}
);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment