Commit 0cadf8d0 authored by youjie's avatar youjie

签证支付

parent c239db09
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
font-weight: 600; font-weight: 600;
margin-right: 60rpx; margin-right: 60rpx;
flex-shrink: 0; flex-shrink: 0;
width: 115rpx;
} }
.jz_form .form-items .val { .jz_form .form-items .val {
flex: 1; flex: 1;
...@@ -394,6 +395,14 @@ ...@@ -394,6 +395,14 @@
{{ orderData.model.CreateDate.replace("T", " ") }} {{ orderData.model.CreateDate.replace("T", " ") }}
</view> </view>
</view> </view>
<!-- #ifdef MP-DI -->
<view class="form-items">
<view class="label">联系人</view>
<view class="jz_SureVal">
{{ orderData.model.ContactName+'/'+orderData.model.ContactMobile }}
</view>
</view>
<!-- #endif -->
<!-- <view class="form-items"> <!-- <view class="form-items">
<view class="label">下单日期</view> <view class="label">下单日期</view>
<view class="jz_SureVal"> <view class="jz_SureVal">
...@@ -509,7 +518,7 @@ ...@@ -509,7 +518,7 @@
}}</view> }}</view>
</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.DiscountMoney&&orderData.model.DiscountMoney>0">
<view style="flex: 1"> <view style="flex: 1">
<text style="margin-right: 30rpx">优惠金额</text> <text style="margin-right: 30rpx">优惠金额</text>
</view> </view>
...@@ -604,7 +613,6 @@ ...@@ -604,7 +613,6 @@
onLoad(option) { onLoad(option) {
if (option.orderData) { if (option.orderData) {
this.orderData = JSON.parse(decodeURIComponent(option.orderData)); this.orderData = JSON.parse(decodeURIComponent(option.orderData));
this.getOrderInfoHandler()
} else if (option.orderId) { } else if (option.orderId) {
this.initOrderInfo(option.orderId); this.initOrderInfo(option.orderId);
} else if(option.OrderNo){ } else if(option.OrderNo){
...@@ -622,10 +630,6 @@ ...@@ -622,10 +630,6 @@
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo) this.orderInfo =JSON.parse(res.data.sPayInfo)
console.log(this.orderInfo,'----orderInfo'); console.log(this.orderInfo,'----orderInfo');
uni.showToast({
icon: 'none',
title: '支付中...',
})
this.goPayHandler(); this.goPayHandler();
} else { } else {
uni.showToast({ uni.showToast({
...@@ -662,7 +666,7 @@ ...@@ -662,7 +666,7 @@
}, },
fail: function(err) { fail: function(err) {
console.log("fail:", err); console.log("fail:", err);
this.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
</view> </view>
<!-- #ifdef MP-DI -->
<view class="line-flex col" style="padding: 30rpx; background: #fff;margin-top: 20rpx" <view class="line-flex col" style="padding: 30rpx; background: #fff;margin-top: 20rpx"
v-if="createBy==0&&SaleList&&SaleList.length>1" v-if="createBy==0&&SaleList&&SaleList.length>1"
@click="showSalePreviwe=true"> @click="showSalePreviwe=true">
...@@ -113,6 +114,7 @@ ...@@ -113,6 +114,7 @@
<u-icon name="arrow-down" size="24"></u-icon> <u-icon name="arrow-down" size="24"></u-icon>
</view> </view>
</view> </view>
<!-- #endif -->
<view class="visaDetailDesBox"> <view class="visaDetailDesBox">
<view class="visaDetailDes"> <view class="visaDetailDes">
<view class="visaDetailDesTitle">签证说明</view> <view class="visaDetailDesTitle">签证说明</view>
...@@ -521,7 +523,7 @@ ...@@ -521,7 +523,7 @@
"lineId": '', //线路ID "lineId": '', //线路ID
"lineteamId": '', //系列ID "lineteamId": '', //系列ID
"userId": this.customer.accountId, //AccountId "userId": this.customer.accountId, //AccountId
"CouponsUseScope": 3, //特定使用平台(当地游=8 跟团游=2 小包团=10) "CouponsUseScope": 3, //签证优惠券
"isExpansion": 0, //是否启动膨胀金1-是 "isExpansion": 0, //是否启动膨胀金1-是
// #ifdef MP-DI // #ifdef MP-DI
"CustomerType": 1, //客户类型 0-同行,1-直客 "CustomerType": 1, //客户类型 0-同行,1-直客
......
...@@ -498,10 +498,6 @@ ...@@ -498,10 +498,6 @@
<view class="row items-center visaProductTextBox"> <view class="row items-center visaProductTextBox">
<view class="visaProduct_rColor visaProductTextL">*</view> <view class="visaProduct_rColor visaProductTextL">*</view>
<view class="visaProductTitle">订购人信息</view> <view class="visaProductTitle">订购人信息</view>
<view v-if="tipsText" class="row visaProduct_rColor visaProductTextR items-center">
<view>{{tipsText}}</view>
<img style="width: 19rpx;height: 19rpx;margin-left: 5rpx;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751271514841634.png"/>
</view>
</view> </view>
<view class="row visaProductNumBox"> <view class="row visaProductNumBox">
<!-- <view class="visaProductNum column"> <!-- <view class="visaProductNum column">
...@@ -807,7 +803,6 @@ ...@@ -807,7 +803,6 @@
showCity: false, showCity: false,
provinceList: [], provinceList: [],
cityList: [], cityList: [],
tipsText: '',
userInfo:{}, userInfo:{},
}; };
}, },
...@@ -819,6 +814,7 @@ ...@@ -819,6 +814,7 @@
this.activeStyle = `background:${this.mainColor};`; this.activeStyle = `background:${this.mainColor};`;
}, },
onLoad(option) { onLoad(option) {
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
...@@ -832,8 +828,10 @@ ...@@ -832,8 +828,10 @@
}); });
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.userInfo = uni.getStorageSync("mall_UserInfo");
this.customer = uni.getStorageSync("b2b_user"); this.customer = uni.getStorageSync("b2b_user");
this.customer.Mailbox = '' this.customer.Mailbox = ''
this.orderMsg.RelationName = this.customer.name
this.calcMoney() this.calcMoney()
if (option.id) { if (option.id) {
this.orderMsg.Pid = option.id this.orderMsg.Pid = option.id
...@@ -846,6 +844,85 @@ ...@@ -846,6 +844,85 @@
this.initCountry() this.initCountry()
}, },
methods: { methods: {
submitB2COrderHandler(OrderId) {
let guestInfo = `${this.orderMsg.AdultPeopleNum} 人; `;
if (this.orderMsg.ChildPeopleNum > 0) {
guestInfo += `儿童x${this.orderMsg.ChildPeopleNum}; `;
}
let msg = {
SurName: this.orderMsg.RelationName,
Name: '',
ContactNumber: this.customer.contactNumber,
Mailbox: this.customer.Mailbox,
GoodsId: this.orderMsg.Pid,
GoodsName: this.dataList.Name,
GoodsPic: this.dataList.CoverImageList[0].Url? this.dataList.CoverImageList[0].Url : '',
GoodsType: 15,
OrderMake: `${guestInfo} ${this.dataList.SendCityName?'送签地:'+this.dataList.SendCityName+';':''} ${this.dataList.VisaValidity?'有效日期:'+this.dataList.VisaValidity+';':''} ${this.orderMsg.EnterCountryTime}入境 `,
TotalPrice: this.price,
PreferentialPrice: this.currentCoupon.discountMoney,
ErpOrderId: OrderId,
Country: 0,
PlatformTax: 0,
Income: 0,
Refund: 0,
MallBaseId: this.userInfo.MallBaseId,
};
this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
uni.showToast({
icon: 'none',
title: '订单创建成功'
})
this.goPayHandler(res.data.OrderNo);
} else {
uni.showToast({
title:res.message,
icon:'none',
duration:3000
})
this.submit = false;
}
});
},
goPayHandler(OrderNo) {
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function(res) {
console.log("success", res);
this.submit = false;
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.price +
"&isFrom=1",
});
}, 100);
},
fail: function(err) {
console.log("fail:", err);
this.submit = false;
uni.showToast({
title: "支付失败",
icon: "none",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/visa/visa_SureOrder?OrderNo=" + OrderNo,
});
}, 100);
},
});
},
editNum(type) { editNum(type) {
if (type == 1) { if (type == 1) {
if(this.orderMsg.AdultPeopleNum>1)this.orderMsg.AdultPeopleNum--; if(this.orderMsg.AdultPeopleNum>1)this.orderMsg.AdultPeopleNum--;
...@@ -1007,7 +1084,7 @@ ...@@ -1007,7 +1084,7 @@
"lineId": '', //线路ID "lineId": '', //线路ID
"lineteamId": 0, //系列ID "lineteamId": 0, //系列ID
"userId": this.customer.accountId, "userId": this.customer.accountId,
"CouponsUseScope": 3, //特定使用平台(当地游=8 跟团游=2 小包团=10) "CouponsUseScope": 3, //签证优惠券
"isExpansion": 0, //是否启动膨胀金1-是 "isExpansion": 0, //是否启动膨胀金1-是
"CustomerType": 0, //客户类型 0-同行,1-直客 "CustomerType": 0, //客户类型 0-同行,1-直客
"TCID": '', "TCID": '',
...@@ -1120,104 +1197,45 @@ ...@@ -1120,104 +1197,45 @@
this.price = money; this.price = money;
}, },
validate(){
let email = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/
let msg = ''
if(this.orderMsg.EnterCountryTime == ""){
msg = '请选择入境日期'
}else if(this.orderMsg.RelationName==''){
msg = '请输入姓名'
}else if(this.customer.contactNumber==''){
msg = '请输入电话'
} else if(this.customer.contactNumber&&this.customer.contactNumber.length!=11){
msg = '请输入正确的电话'
}else if(this.customer.Mailbox==''){
msg = '请输入邮箱地址'
}else if (!email.test(this.customer.Mailbox)) {
msg = '请输入正确的邮箱地址'
}else if (this.orderMsg.Receiver == "") {
msg = '请输入收件人'
}else if (this.orderMsg.ReceiverPhone == "") {
msg = '请输入收件人电话'
}else if (this.orderMsg.ReceiverPhone&&this.orderMsg.ReceiverPhone.length!=11) {
msg = '请输入正确的收件人电话'
}else if (this.orderMsg.ReceiverProvince=="") {
msg = '请选择省'
}else if (this.orderMsg.ReceiverCity=="") {
msg = '请选择市'
}else if (this.orderMsg.ReceiverAddress=="") {
msg = '请输入收件人地址'
}
return msg
},
//去支付 //去支付
goPay() { goPay() {
if (this.orderMsg.EnterCountryTime == "") { const error = this.validate()
if(error!=''){
uni.showToast({ uni.showToast({
title: `请选择入境日期`, icon:'none',
icon: "none", title:error
}); })
return; return
}
this.tipsText = ''
if (this.orderMsg.RelationName == "") {
this.tipsText = '请输入姓名'
return;
}
if (this.customer.PhoneCountryStr == "") {
this.tipsText = '请选择国家/地区'
return;
}
if (this.customer.contactNumber == "") {
this.tipsText = '请输入电话'
return;
}
if (this.customer.contactNumber&&this.customer.contactNumber.length<11) {
this.tipsText = '请输入正确的电话'
return;
}
if (this.customer.Mailbox == "") {
this.tipsText = '请输入邮箱地址'
uni.showToast({
title: `请输入邮箱地址`,
icon: "none",
});
return;
}
let email = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/
if (!email.test(this.customer.Mailbox)) {
this.tipsText = '请输入正确的邮箱地址'
uni.showToast({
title: `请输入正确的邮箱地址`,
icon: "none",
});
return;
}
if (this.orderMsg.Receiver == "") {
uni.showToast({
title: `请输入收件人`,
icon: "none",
});
return;
}
if (this.orderMsg.RelationPhoneType == "") {
uni.showToast({
title: `请选择收件人国家/地区`,
icon: "none",
});
return;
}
if (this.orderMsg.ReceiverPhone == "") {
uni.showToast({
title: `请输入收件人电话`,
icon: "none",
});
return;
}
if (this.orderMsg.ReceiverPhone&&this.orderMsg.ReceiverPhone.length<11) {
uni.showToast({
title: `请输入正确的收件人电话`,
icon: "none",
});
return;
}
if (this.orderMsg.RelationPhoneType == "") {
uni.showToast({
title: `请选择收件人国家/地区`,
icon: "none",
});
return;
}
if (this.orderMsg.ReceiverProvince == "") {
uni.showToast({
title: `请选择省`,
icon: "none",
});
return;
}
if (this.orderMsg.ReceiverCity == "") {
uni.showToast({
title: `请选择市`,
icon: "none",
});
return;
}
if (this.orderMsg.ReceiverAddress == "") {
uni.showToast({
title: `请输入收件人地址`,
icon: "none",
});
return;
} }
// #ifdef MP-AG // #ifdef MP-AG
if(!this.CreateBy){ if(!this.CreateBy){
...@@ -1284,13 +1302,14 @@ ...@@ -1284,13 +1302,14 @@
msg, msg,
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
if (this.isUpdateUserInfo) {
this.setUserInfoHandler();
}
const tempData = res.data const tempData = res.data
if(tempData.CounponList && tempData.CounponList.length>0){ if(tempData.CounponList && tempData.CounponList.length>0){
uni.setStorageSync('coupons',tempData.CounponList) uni.setStorageSync('coupons',tempData.CounponList)
} }
// #ifdef MP-DI
this.submitB2COrderHandler(tempData.airOrderId)
// #endif
// #ifdef MP-AG
uni.showToast({ uni.showToast({
title: '订单创建成功.', title: '订单创建成功.',
icon: 'none' icon: 'none'
...@@ -1298,6 +1317,7 @@ ...@@ -1298,6 +1317,7 @@
uni.redirectTo({ uni.redirectTo({
url: "/pages/visa/visa_MyOrder", url: "/pages/visa/visa_MyOrder",
}); });
// #endif
} else { } else {
uni.showToast({ uni.showToast({
title:res.message, title:res.message,
...@@ -1305,7 +1325,9 @@ ...@@ -1305,7 +1325,9 @@
duration:3000 duration:3000
}) })
} }
// #ifdef MP-AG
this.submit = false; this.submit = false;
// #endif
}, },
(e) => { (e) => {
this.submit = false; this.submit = false;
...@@ -1317,22 +1339,6 @@ ...@@ -1317,22 +1339,6 @@
} }
); );
}, },
setUserInfoHandler() {
this.apipost("UpdateUserInfo_post", {
Mailbox: '',
Surname:'',//姓,
Name:'',//名,
EnSurname:'',//英文-姓,
EnName:'',//英文名,
Moblie:'',//手机号码,
Countr:'',//国家,
Appellation:'',//称谓,
PhoneCountry:'',//手机号所属国家,
BirthDate:'',//生日
}, (r) => {
console.log(r,'-----同步会员接口');
});
},
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
//微信支付 //微信支付
queren(OrderId) { queren(OrderId) {
......
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
font-weight: 600; font-weight: 600;
margin-right: 60rpx; margin-right: 60rpx;
flex-shrink: 0; flex-shrink: 0;
width: 115rpx;
} }
.jz_form .form-items .val { .jz_form .form-items .val {
flex: 1; flex: 1;
...@@ -485,7 +486,7 @@ ...@@ -485,7 +486,7 @@
</view> </view>
</view> </view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if=" orderData.model&& orderData.OrderModel.DiscountMoney&&orderData.OrderModel.DiscountMoney>0"> <view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index" v-if="orderData.OrderModel.DiscountMoney&&orderData.OrderModel.DiscountMoney>0">
<view style="flex: 1"> <view style="flex: 1">
<text style="margin-right: 30rpx">优惠金额</text> <text style="margin-right: 30rpx">优惠金额</text>
</view> </view>
...@@ -511,10 +512,19 @@ ...@@ -511,10 +512,19 @@
</view> </view>
<view class="jz_orderbox flex" v-if="showPayBtn"> <view class="jz_orderbox flex" v-if="showPayBtn">
<view style="display: flex"> <view style="display: flex">
<view class="jz_OrderReNow" @click="goCancel" style="background: #fff; color: #111; border: 1px solid #111"> <button class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel" :loading="submitCancel">
<text v-if="!submitCancel">取消</text> <text v-if="!submitCancel">取消</text>
<u-loading v-if="submitCancel" size="32" color="#111"></u-loading> <u-loading v-if="submitCancel" size="32" color="#111"></u-loading>
</view> </button>
<!-- #ifdef MP-DI -->
<button class="jz_OrderReNow"
style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
<!-- 返回上一页 --> <!-- 返回上一页 -->
<!-- <view <!-- <view
class="jz_OrderReNow" class="jz_OrderReNow"
...@@ -563,6 +573,8 @@ ...@@ -563,6 +573,8 @@
submitCancel: false, submitCancel: false,
showPayBtn: true, showPayBtn: true,
Refund: 0, Refund: 0,
orderInfo:null,
OrderNo: '',
}; };
}, },
created() {}, created() {},
...@@ -571,9 +583,74 @@ ...@@ -571,9 +583,74 @@
this.orderData = JSON.parse(decodeURIComponent(option.orderData)); this.orderData = JSON.parse(decodeURIComponent(option.orderData));
} else if (option.orderId) { } else if (option.orderId) {
this.initOrderInfo(option.orderId); this.initOrderInfo(option.orderId);
} else if(option.OrderNo){
this.OrderNo = option.OrderNo
this.getOrderInfoHandler(this.OrderNo)
} }
}, },
methods: { methods: {
submitGetCodeByOrderNo() {
this.submit = true
this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo,
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
}, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
console.log(this.orderInfo,'----orderInfo');
this.goPayHandler();
} else {
uni.showToast({
title:res.message,
icon:'none',
duration:3000
})
this.submit = false;
}
});
},
goPayHandler() {
let that = this;
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function(res) {
console.log("success", res);
this.submit = false;
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.price +
"&isFrom=1",
});
}, 100);
},
fail: function(err) {
console.log("fail:", err);
that.submit = false;
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
},
getOrderInfoHandler(OrderNo){
this.apipost("GetDetailsByOrderNo_post",{OrderNo},res=>{
if(res.resultCode==1){
this.initOrderInfo(res.data.ErpOrderId);
}else{
}
})
},
goDetail() { goDetail() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/visa/visaDetail?id="+this.orderData.ProductModel.Id url: "/pages/visa/visaDetail?id="+this.orderData.ProductModel.Id
...@@ -590,6 +667,7 @@ ...@@ -590,6 +667,7 @@
if (this.orderData.OrderModel.VisaOrderStatus!=2&& if (this.orderData.OrderModel.VisaOrderStatus!=2&&
(this.orderData.OrderModel.VisaOrderStatus==1&&this.orderData.OrderModel.Income==0) (this.orderData.OrderModel.VisaOrderStatus==1&&this.orderData.OrderModel.Income==0)
||(this.orderData.OrderModel.VisaOrderStatus==3)) { ||(this.orderData.OrderModel.VisaOrderStatus==3)) {
this.submitCancel = true
let that = this let that = this
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
...@@ -613,12 +691,13 @@ ...@@ -613,12 +691,13 @@
}); });
} }
uni.hideLoading() uni.hideLoading()
this.submitCancel = false
}, },
(err) => { (err) => {
uni.hideLoading() uni.hideLoading()
} }
); );
} }else this.submitCancel = false
} }
}) })
} }
...@@ -755,11 +834,11 @@ ...@@ -755,11 +834,11 @@
}, },
fail: function(err) { fail: function(err) {
console.log("fail:", err); console.log("fail:", err);
that.submit = false;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
}); });
that.submit = false;
that.initOrderInfo(that.orderData.OrderModel.Id); that.initOrderInfo(that.orderData.OrderModel.Id);
}, },
}); });
...@@ -858,8 +937,8 @@ ...@@ -858,8 +937,8 @@
}, },
(err) => { (err) => {
console.log("err", err); console.log("err", err);
uni.hideLoading();
that.submit = false; that.submit = false;
uni.hideLoading();
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
......
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