Commit 7c304602 authored by 罗超's avatar 罗超

Merge branch 'B2C' of http://gitlab.oytour.com/zk123/jz_travel into B2C

parents a6fd2b64 0cadf8d0
......@@ -305,7 +305,6 @@
for (let i = 0; i < this.count; i++) {
var days = [];
var week = 0;
// #ifdef MP-DI
for (var j = 0; j < new Date(year, month + 1, 0).getDate(); j++) {
let isexsit = false;
const m = month + 1 > 9 ? month + 1 : "0" + (month + 1);
......@@ -315,28 +314,12 @@
if (price) {
isexsit = true
if (price.remainNum > 0){
// #ifdef MP-DI
days.push(price.b2CPrice)
}
else if (price.isSubstitution == 1)
days.push(-2)
else
days.push(-1)
} else {
days.push(0);
}
}
// #endif
// #ifdef MP-AG
for (var j = 0; j < new Date(year, month + 1, 0).getDate(); j++) {
let isexsit = false;
const m = month + 1 > 9 ? month + 1 : "0" + (month + 1);
const d = j + 1 > 9 ? j + 1 : "0" + (j + 1);
const ds = `${year}-${m}-${d}`
const price = this.priceList.find(p => p.startDate == ds)
if (price) {
isexsit = true
if (price.remainNum > 0){
// #endif
// #ifdef MP-AG
days.push(price.b2BPrice)
// #endif
}
else if (price.isSubstitution == 1)
days.push(-2)
......@@ -345,34 +328,7 @@
} else {
days.push(0);
}
console.log(this.priceList.length, new Date(year, month + 1, 0).getDate(), price)
// for (var k = 0; k < this.priceList.length; k++) {
// const x = this.priceList[k];
// console.log(x)
// }
// this.priceList.forEach((x) => {
// let m = month + 1 > 9 ? month + 1 : "0" + (month + 1);
// let d = j + 1 > 9 ? j + 1 : "0" + (j + 1);
// //console.log(x.startDate+'-----'+`${year}-${m}-${d}`)
// if (x.startDate == `${year}-${m}-${d}`) {
// isexsit = true;
// if (x.remainNum > 0) {
// let priceNum = 0
// // #ifdef MP-DI
// priceNum = x.b2CPrice
// // #endif
// // #ifdef MP-AG
// priceNum = x.b2BPrice
// // #endif
// days.push(priceNum);
// //days.push(x.b2CPrice);
// } else {
// days.push(-1);
// }
// }
// });
}
// #endif
data.push(days);
if (month == 11) {
......
......@@ -1323,6 +1323,7 @@
})
}
this.customer = uni.getStorageSync("b2b_user");
console.log(this.customer,'----')
// #ifdef MP-DI
this.delMsg.directCustomerId = this.customer.customerId
// #endif
......@@ -1891,7 +1892,8 @@
let createBy = 0
// #ifdef MP-DI
createBy = this.createBy>0?this.createBy:this.customer.pid
let employeeId = this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId?this.customer.salesBaseInfo.employeeId:0
createBy = this.createBy>0?this.createBy:employeeId
// #endif
// #ifdef MP-AG
if(this.createBy>0||this.SaleId) createBy = this.createBy>0?this.createBy:this.SaleId
......
<style>
<style scoped>
@import url("@/asset/css/flex.css");
.jz_Reserve {
padding-bottom: 180rpx;
background-color: #fff;
......@@ -99,7 +100,7 @@
}
.jz_form {
margin-top: 60rpx;
margin-top: 40rpx;
padding: 0 45rpx;
}
......@@ -123,6 +124,7 @@
margin-right: 60rpx;
flex-shrink: 0;
width: 115rpx;
text-align: right;
}
.jz_form .form-items .val {
......@@ -267,6 +269,21 @@
margin: 25rpx;
padding: 20rpx;
}
.visaProduct_rColor{
color: #FF3166;
}
.visaProductTitle{
font-weight: 800;
font-size: 32rpx;
}
.visaProductTextR{
font-size: 20rpx;
margin-left: 24rpx;
}
.visaProductTextL{
font-size: 35rpx;
font-weight: bold;
}
</style>
<template>
......@@ -301,6 +318,38 @@
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zuanshi.png" />即时确认:本产品付款后可快速确认,放心期待您的旅行
</view>
</view>
<!-- #ifdef MP-DI -->
<view class="column jz_form">
<view class="row" style="margin-bottom: 40rpx;">
<view class="visaProduct_rColor visaProductTextL">*</view>
<view class="visaProductTitle">联系信息</view>
</view>
<view class="form-items">
<view class="label"></view>
<view class="val">
<input type="text" v-model="customer.SurName" placeholder="输入姓" />
</view>
</view>
<view class="form-items">
<view class="label"></view>
<view class="val">
<input type="text" v-model="customer.name" placeholder="输入名" />
</view>
</view>
<view class="form-items">
<view class="label">联系电话</view>
<view class="val">
<input type="text" v-model="customer.contactNumber" placeholder="输入电话号码" />
</view>
</view>
<view class="form-items">
<view class="label">邮箱地址</view>
<view class="val">
<input type="text" v-model="customer.Mailbox" placeholder="输入邮箱地址" />
</view>
</view>
</view>
<!-- #endif -->
<view>
<textarea class="jz_TextArea" placeholder="请输入备注信息" v-model="Remarks"></textarea>
</view>
......@@ -555,8 +604,11 @@
this.activeStyle = `background:${this.mainColor};`;
},
onLoad(option) {
this.customer = uni.getStorageSync("b2b_user");
console.log(this.customer,'--------');
this.customer = {
SurName: '',
Mailbox: '',
...uni.getStorageSync("b2b_user")
};
if (option.currentPriceInfo) {
this.currentPriceInfo = JSON.parse(
decodeURIComponent(option.currentPriceInfo)
......@@ -583,15 +635,7 @@
this.getUserCouponList();
},
methods: {
getUserInfoHandler() {
this.apipost("GetCustomerInfo_post", { Id: this.customer.customerId }, (res) => {
if (res.resultCode == 1) {
this.userInfo = res.data;
console.log(this.userInfo,'----');
}
});
},
submitB2COrderHandler(orderId) {
submitB2COrderHandler(OrderId) {
let productType = 0
if (this.currentPriceInfo.teamType == "0") {
//跟团游
......@@ -615,10 +659,10 @@
}
let startCityName = this.realCurrentPriceInfo.priceUnion && this.realCurrentPriceInfo.priceUnion.startCityName?this.realCurrentPriceInfo.priceUnion.startCityName:this.currentPriceInfo.startCityName
let msg = {
SurName: '',
SurName: this.customer.SurName,
Name: this.customer.name,
ContactNumber: this.customer.contactNumber,
Mailbox: '',
Mailbox: this.customer.Mailbox,
GoodsId: this.currentPriceInfo.tcid,
GoodsName: this.currentPriceInfo.title,
GoodsPic: this.currentPriceInfo.CoverImg? this.currentPriceInfo.CoverImg : '',
......@@ -626,30 +670,70 @@
OrderMake: `${this.currentPriceInfo.startDate}${startCityName}出发 ${guestInfo}`,
TotalPrice: this.price,
PreferentialPrice: this.currentCoupon.discountMoney,
ErpOrderId: orderId,
Country: '',
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)
console.log(this.orderInfo,'----orderInfo');
uni.showToast({
icon: 'none',
title: '订单创建成功'
})
this.goPayHandler(res.data);
this.goPayHandler(res.data.OrderNo);
} else {
uni.showToast({
title:res.message,
icon:'none',
duration:3000
})
this.submit = false;
}
});
},
goPayHandler(pay) {
goPayHandler(OrderNo) {
//pay.OrderNo
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);
this.submit = false;
uni.showToast({
title: "支付失败",
icon: "none",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/jz_SureOrder?OrderNo=" + OrderNo,
});
}, 100);
},
});
},
showCouponHandler() {
this.showCoupon = this.couponList.length > 0;
......@@ -687,7 +771,12 @@
"userId": 0, //AccountId
"CouponsUseScope": 2, //特定使用平台(当地游=8 跟团游=2 小包团=10)
"isExpansion": 0, //是否启动膨胀金1-是
// #ifdef MP-DI
"CustomerType": 1, //客户类型 0-同行,1-直客
// #endif
// #ifdef MP-AG
"CustomerType": 0, //客户类型 0-同行,1-直客
// #endif
"TCID": this.currentPriceInfo.tcid,
}
console.log("this.currentPriceInfo", this.currentPriceInfo);
......@@ -894,8 +983,40 @@
this.GuestList.push(obj);
}
},
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.customer.SurName==''||!this.customer.SurName){
msg = '请输入姓'
} else if(this.customer.name==''||!this.customer.name){
msg = '请输入名'
} else if(this.customer.contactNumber==''||!this.customer.name){
msg = '请输入联系电话'
} else if(this.customer.contactNumber&&this.customer.contactNumber.length!=11){
msg = '请输入正确的电话号码'
}else if(this.customer.Mailbox==''||!this.customer.Mailbox){
uni.showToast({
title: `请输入邮箱地址`,
icon: "none",
});
}else if (!email.test(this.customer.Mailbox)) {
uni.showToast({
title: `请输入正确的邮箱地址`,
icon: "none",
});
}
return msg
},
//去支付
goPay() {
const error = this.validate()
if(error!=''){
uni.showToast({
icon:'none',
title:error
})
return
}
this.submit = true;
this.userInfo = uni.getStorageSync("mall_UserInfo");
this.basedataObj = uni.getStorageSync("basedata").mall;
......@@ -913,9 +1034,15 @@
MiniAppUserId = this.userInfo.UserId;
}
var ContactName = this.customer.name; //联系人
var ContactName = this.customer.SurName+this.customer.name; //联系人
var ContactMobile = this.customer.contactNumber; //联系电话
var CustomerType = this.customer.isMember //4;
var CustomerType = 0;
// #ifdef MP-DI
CustomerType = 4;
// #endif
// #ifdef MP-AG
CustomerType = this.customer.isMember
// #endif
var CustomerCreateBy = this.customer.createBy;
var price = 0;
var CreateBy = 0
......@@ -971,7 +1098,6 @@
TradeDate: this.currentPriceInfo.startDate,
CostType: 0,
MinOrderPrice: 0,
Remarks: "",
VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum + this.orderMsg.BabyNum,
SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum + this.orderMsg.BabyNum,
AirticketNum: 0,
......@@ -985,15 +1111,27 @@
MiniAppUserId: MiniAppUserId,
CreateBy: CreateBy, //同行联系人创建人 CustomerCreateBy
DirectCustomerId: DirectCustomerId, //直客Id
// #ifdef MP-WEIXIN
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// // #ifdef MP-WEIXIN
// OrderSource: 5,
// // #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
//MiniAppUserId: this.userInfo.UserId,
Remarks: this.Remarks, //备注
//GuestList: newobj,
// #ifdef MP-DI
ClientType: 2,
// #endif
// #ifdef MP-AG
ClientType: 1,
// #endif
};
if (this.realCurrentPriceInfo.priceUnion) {
msg.DepartureCityId = this.realCurrentPriceInfo.priceUnion.unionCityId
......
......@@ -207,6 +207,7 @@
font-weight: 600;
margin-right: 60rpx;
flex-shrink: 0;
width: 115rpx;
}
.jz_form .form-items .val {
flex: 1;
......@@ -394,6 +395,14 @@
{{ orderData.model.CreateDate.replace("T", " ") }}
</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="label">下单日期</view>
<view class="jz_SureVal">
......@@ -509,7 +518,7 @@
}}</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">
<text style="margin-right: 30rpx">优惠金额</text>
</view>
......@@ -535,10 +544,20 @@
</view>
<view class="jz_orderbox flex">
<view style="display: flex" v-if="showPayBtn">
<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>
<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
class="jz_OrderReNow"
......@@ -586,6 +605,8 @@
submit: false,
submitCancel: false,
showPayBtn: true,
orderInfo:null,
OrderNo: '',
};
},
created() {},
......@@ -594,9 +615,74 @@
this.orderData = JSON.parse(decodeURIComponent(option.orderData));
} else if (option.orderId) {
this.initOrderInfo(option.orderId);
} else if(option.OrderNo){
this.OrderNo = option.OrderNo
this.getOrderInfoHandler(this.OrderNo)
}
},
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{
}
})
},
//跳转至详情
goJzDetail() {
let model = this.orderData.model;
......@@ -611,6 +697,7 @@
},
goCancel() {
if (this.submit || this.submitCancel) return;
this.submitCancel = true;
//未付款-调用后台取消
if (this.orderData.model.OrderState == 2 || this.orderData.model.OrderState == 3) {
this.apipost(
......@@ -625,12 +712,16 @@
});
uni.navigateTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
});
}
this.submitCancel = false
},
(err) => {}
(err) => {
this.submitCancel = false
}
);
} else {
this.submitCancel = true
let msg = {
OrderId: this.orderData.model.OrderId,
UserId: uni.getStorageSync("mall_UserInfo").UserId,
......@@ -649,6 +740,7 @@
url: "/pages/jiuzhai/jz_MyOrder",
});
} else {}
this.submitCancel = false
},
null
);
......@@ -705,7 +797,9 @@
} else if (status == 3 && isCancel != 1) {
this.orderStatus.code = 0;
this.orderStatus.text = "候补中";
this.showPayBtn = true;
// #ifdef MP-AG
this.showPayBtn = true;
// #endif
} else if (status == 2 && isCancel == 1) {
this.orderStatus.code = -2;
this.orderStatus.text = "审核中";
......
......@@ -93,6 +93,7 @@
</view>
<!-- #ifdef MP-DI -->
<view class="line-flex col" style="padding: 30rpx; background: #fff;margin-top: 20rpx"
v-if="createBy==0&&SaleList&&SaleList.length>1"
@click="showSalePreviwe=true">
......@@ -113,6 +114,7 @@
<u-icon name="arrow-down" size="24"></u-icon>
</view>
</view>
<!-- #endif -->
<view class="visaDetailDesBox">
<view class="visaDetailDes">
<view class="visaDetailDesTitle">签证说明</view>
......@@ -521,9 +523,14 @@
"lineId": '', //线路ID
"lineteamId": '', //系列ID
"userId": this.customer.accountId, //AccountId
"CouponsUseScope": 3, //特定使用平台(当地游=8 跟团游=2 小包团=10)
"CouponsUseScope": 3, //签证优惠券
"isExpansion": 0, //是否启动膨胀金1-是
// #ifdef MP-DI
"CustomerType": 1, //客户类型 0-同行,1-直客
// #endif
// #ifdef MP-AG
"CustomerType": 0, //客户类型 0-同行,1-直客
// #endif
"TCID": '',
}
this.apipost(
......@@ -721,7 +728,8 @@
// #endif
let createBy = 0
// #ifdef MP-DI
createBy = this.createBy>0?this.createBy:this.customer.pid
let employeeId = this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId?this.customer.salesBaseInfo.employeeId:0
createBy = this.createBy>0?this.createBy:employeeId
// #endif
// #ifdef MP-AG
if(this.createBy>0||this.SaleId) createBy = this.createBy>0?this.createBy:this.SaleId
......
This diff is collapsed.
......@@ -207,6 +207,7 @@
font-weight: 600;
margin-right: 60rpx;
flex-shrink: 0;
width: 115rpx;
}
.jz_form .form-items .val {
flex: 1;
......@@ -485,7 +486,7 @@
</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">
<text style="margin-right: 30rpx">优惠金额</text>
</view>
......@@ -511,10 +512,19 @@
</view>
<view class="jz_orderbox flex" v-if="showPayBtn">
<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>
<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
class="jz_OrderReNow"
......@@ -563,6 +573,8 @@
submitCancel: false,
showPayBtn: true,
Refund: 0,
orderInfo:null,
OrderNo: '',
};
},
created() {},
......@@ -571,9 +583,74 @@
this.orderData = JSON.parse(decodeURIComponent(option.orderData));
} else if (option.orderId) {
this.initOrderInfo(option.orderId);
} else if(option.OrderNo){
this.OrderNo = option.OrderNo
this.getOrderInfoHandler(this.OrderNo)
}
},
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() {
uni.navigateTo({
url: "/pages/visa/visaDetail?id="+this.orderData.ProductModel.Id
......@@ -590,6 +667,7 @@
if (this.orderData.OrderModel.VisaOrderStatus!=2&&
(this.orderData.OrderModel.VisaOrderStatus==1&&this.orderData.OrderModel.Income==0)
||(this.orderData.OrderModel.VisaOrderStatus==3)) {
this.submitCancel = true
let that = this
wx.showModal({
title: '提示',
......@@ -613,12 +691,13 @@
});
}
uni.hideLoading()
this.submitCancel = false
},
(err) => {
uni.hideLoading()
}
);
}
}else this.submitCancel = false
}
})
}
......@@ -755,11 +834,11 @@
},
fail: function(err) {
console.log("fail:", err);
that.submit = false;
uni.showToast({
title: "支付失败",
icon: "none",
});
that.submit = false;
that.initOrderInfo(that.orderData.OrderModel.Id);
},
});
......@@ -858,8 +937,8 @@
},
(err) => {
console.log("err", err);
uni.hideLoading();
that.submit = false;
uni.hideLoading();
uni.showToast({
title: "支付失败",
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