Commit b0733978 authored by youjie's avatar youjie

同业下单支付

parent 01ced0c0
......@@ -294,6 +294,7 @@
b2bResult.groupId = b2bData.groupId;
b2bResult.isVip=b2bData.isVip;
b2bResult.contactNumber = b2bData.contactNumber;
b2bResult.isGuideOrLeader = b2bData.isGuideOrLeader;
uni.setStorageSync('b2b_user', b2bResult)
that.$emit("changeuserinfo");
uni.setStorageSync("lastLogin",new Date().getTime())
......
......@@ -69,7 +69,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid": "wx5564525562e92ddb",
"appid": "wxcf0727a7c78b501e",
"navigateToMiniProgramAppIdList" : [ "wxacd9f8cc3480d29e" ],
"setting" : {
"urlCheck" : true,
......
......@@ -73,7 +73,7 @@
style="width: 110rpx;margin-left: 10rpx;" @click.stop="cancelHotelOrder(item)">取消</view>
<view v-if="item.goodsType!=7&&item.income == 0&&item.orderStatus==1" class="jz_Zailai"
style="width: 110rpx;margin-left: 10rpx;" @click.stop="goCancel(item)">取消</view>
<view v-if="item.goodsType==7&&item.orderStatus==1" class="jz_Zailai jz_ZailaiZF"
<view v-if="(item.goodsType==7&&item.orderStatus==1)||(b2b_user.isGuideOrLeader==1&&item.goodsType!=7&&item.orderStatus==1)" class="jz_Zailai jz_ZailaiZF"
style="margin-left: 10rpx;"
:style="{'width':!item.remainingSeconds?'150rpx':'auto'}"
:class="[item.remainingSeconds?'active':'']"
......@@ -470,9 +470,9 @@
let phone = `SalePhone=${item.SalePhone}&`
url = `bus/orderdetails?`;
if(item.SalePhone) url+=phone
} else if (item.goodsType == 6) url = `visa/visa_SureOrder?` //签证
} else if (item.goodsType == 6) url = `visa/visa_SureOrder?OrderNo=${item.directOrderNo}&` //签证
else if (item.goodsType == 1) { //机票
url = `airTicket/airTicketOrderDetail?`
url = `airTicket/airTicketOrderDetail?OrderNo=${item.directOrderNo}&`
msg = `id=${item.erpOrderId}`
}
// #endif
......
......@@ -251,7 +251,10 @@
</view>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<view class="text-center cities-name" @click="cancelVisible=true" v-if="order.status==0" style="background-color: #1d1d20;border-radius: 10rpx;height: 80rpx; line-height: 80rpx;color:#EEF1F4">取消订单</view>
<view style=" display: flex;justify-content: space-between;">
<view class="text-center cities-name" @click="cancelVisible=true" v-if="!submit&&order.status==0&&((b2b_user.isGuideOrLeader!=1)||(b2b_user.isGuideOrLeader==1&&order.Income==0))" style="background-color: #fff;border: 1px solid #1d1d20;flex:1; border-radius: 10rpx;height: 80rpx; line-height: 80rpx;color:#333">取消订单</view>
<view class="text-center cities-name" @click="submitGetCodeByOrderNo" v-if="b2b_user.isGuideOrLeader==1&&order.Income==0&&order.status==0" style="background-color: #1d1d20;flex:1;border-radius: 10rpx;height: 80rpx; line-height: 80rpx;color:#EEF1F4;margin-left: 20rpx;">立即支付</view>
</view>
<view class="text-center cities-name" @click="requeryHandle" v-if="order.status==2" style="background-color: #1d1d20;border-radius: 10rpx;height: 80rpx; line-height: 80rpx;color:#EEF1F4">再次预定</view>
<view class="row" v-if="order.ResultPrice && order.status==1">
<view class="col" style="color: #9999A5;">
......@@ -364,6 +367,7 @@
OrderNo: '',
showModal: false,
erpBaseInfo: null,
b2b_user: {},
}
},
computed:{
......@@ -394,6 +398,7 @@
},
},
onLoad(options) {
this.b2b_user = uni.getStorageSync("b2b_user")
this.erpBaseInfo = uni.getStorageSync("b2b_user").erpBaseInfo
if(options.OrderNo||(options.id&&options.OrderTypeStr)){
this.id = options.id
......@@ -427,7 +432,9 @@
this.submit = true
this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo,
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
}, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
......
......@@ -67,6 +67,16 @@
required>
</u-field>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<u-field v-if="customer.isGuideOrLeader==1"
v-model="Mailbox"
label="邮箱地址"
placeholder="请填写邮箱地址"
padding="20rpx 28rpx"
:borderBottom="true"
required>
</u-field>
<!-- #endif -->
</view>
<!-- #ifdef MP-AG -->
<view class="flight-card q-mt-md" v-if="sales.length>1">
......@@ -177,7 +187,12 @@
立即支付
<!-- #endif -->
<!-- #ifdef MP-AG -->
<template v-if="customer.isGuideOrLeader==1">
立即支付
</template>
<template v-else>
立即预定
</template>
<!-- #endif -->
</button>
</view>
......@@ -344,6 +359,12 @@
},
methods: {
submitB2COrderHandler(OrderId) {
var CreateBy = this.createBy.CreateBy
// #ifdef MP-DI
if(this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId){
CreateBy = this.customer.salesBaseInfo.employeeId
}
// #endif
let guestInfo = `${this.guest.length}人; `;
let msg = {
SurName: this.contactName,
......@@ -353,7 +374,6 @@
GoodsId: this.id,
GoodsName: `${this.goList[0].DepartureName}${this.backList[0].DepartureName}`,
GoodsPic: this.goList[0].AirlineUrl? this.goList[0].AirlineUrl : '',
GoodsType: 16,
OrderMake: `${guestInfo} ${this.goList[0].FlightDate}${this.goList[0].DepartureName}出发到${this.backList[0].DepartureName}; ${this.backList[this.backList.length-1].FlightDate}出发回${this.backList[this.backList.length-1].ArrivalCityName}`,
TotalPrice: this.price,
PreferentialPrice: this.currentCoupon.discountMoney,
......@@ -363,7 +383,17 @@
Income: 0,
Refund: 0,
MallBaseId: uni.getStorageSync('mall_UserInfo').MallBaseId,
// #ifdef MP-DI
DOrderType:1,
GoodsType: 16,
// #endif
// #ifdef MP-AG
DOrderType:2,
GoodsType: 2,
// #endif
CustomerId: this.customer.customerInfoChildrenId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
CreateBy: CreateBy,
};
this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) {
......@@ -460,7 +490,11 @@
this.submitB2COrderHandler(tempData)
// #endif
// #ifdef MP-AG
if(this.customer.isGuideOrLeader==1){
this.submitB2COrderHandler(tempData)
}else{
this.successVisible=true
}
// #endif
}else{
uni.showToast({
......@@ -494,10 +528,21 @@
// #ifdef MP-DI
msg = '请输入邮箱地址'
// #endif
// #ifdef MP-AG
if(this.customer.isGuideOrLeader==1){
msg = '请输入邮箱地址'
}
// #endif
}else if (!email.test(this.Mailbox)) {
// #ifdef MP-DI
msg = '请输入正确的邮箱地址'
// #endif
// #ifdef MP-AG
if(this.customer.isGuideOrLeader==1){
msg = '请输入正确的邮箱地址'
}
// #endif
} else if(this.createBy.CreateBy==0){
// #ifdef MP-AG
msg = '请选择与你对接的服务人员'
......
......@@ -575,7 +575,15 @@
Income: 0,
Refund: 0,
MallBaseId: this.userInfo.MallBaseId,
DOrderType:1
// #ifdef MP-DI
DOrderType:1,
// #endif
// #ifdef MP-AG
DOrderType:2,
// #endif
CustomerId: this.customer.customerInfoChildrenId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
CreateBy: this.CreateBy,
};
this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) {
......@@ -627,7 +635,7 @@
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/bus/orderdetails?orderId=" + that.ErpOrderId,
url: `/pages/bus/orderdetails?orderId=${that.ErpOrderId}&OrderNo=${item.OrderNo}`,
});
// let OrderTypeStr = ''
// // #ifdef MP-DI
......@@ -997,6 +1005,9 @@
this.submitB2COrderHandler(tempData.Id)
// #endif
// #ifdef MP-AG
if(this.customer.isGuideOrLeader==1){
this.submitB2COrderHandler(tempData.Id)
}else{
uni.showToast({
title: '订单创建成功.',
icon: 'none'
......@@ -1005,6 +1016,8 @@
uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=5`,
});
}
// #endif
} else {
uni.showToast({
......
......@@ -245,11 +245,16 @@
</button>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<button v-if="orderData.OrderStatus==1" class="jz_OrderReNow"
<button v-if="!submit&&((orderData.OrderStatus==1&&customer.isGuideOrLeader!=1)||(customer.isGuideOrLeader==1&&orderData.Income==0&&orderData.OrderStatus==1))" class="jz_OrderReNow"
@click="goCancel" style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel" :loading="submitCancel">
取消
</button>
<button v-if="!submitCancel&&(customer.isGuideOrLeader==1&&orderData.Income==0&&orderData.OrderStatus==1)" class="jz_OrderReNow" style="margin-left: 20rpx;"
@click="payHotelOrder" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
</view>
</view>
......@@ -389,11 +394,12 @@
this.showModal = false
},
payHotelOrder() {
if(this.submit) return
let userInfo = uni.getStorageSync("mall_UserInfo");
var payMsg = {
OrderNo: this.OrderNo,
OpenId: userInfo.OpenId,
MallBaseId:userInfo.MallBaseId,
MallBaseId: userInfo.MallBaseId,
};
this.submit = true
this.apipost("GetCodeByOrderNo_post", payMsg, (res) => {
......@@ -505,6 +511,7 @@
title: "操作成功",
icon: "success",
});
that.submitCancel = false
that.getOrderDetail()
}
},
......@@ -625,7 +632,7 @@
uni.hideLoading();
this.orderData = res.data
this.initData(res.data.ProductId)
this.OrderNo = res.data.OrderNo
if(this.OrderNo=='')this.OrderNo = res.data.OrderNo
this.peopleNum = Number(this.orderData.ManNum) + Number(this.orderData.ChildNum) +Number(this.orderData.BabyNum);
// #ifdef MP-AG
this.formatStatus(
......@@ -633,6 +640,9 @@
res.data.Income,
(res.data.Money-res.data.DiscountsMoney).toFixed(2),
);
if(this.customer.isGuideOrLeader==1&&res.data.OrderStatus==1){
this.getOrderInfoByIdAndType()
}
// #endif
// #ifdef MP-DI
this.getOrderInfoByIdAndType()
......
......@@ -350,6 +350,16 @@
</view>
</view>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<view class="column jz_form" v-if="customer.isGuideOrLeader==1">
<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>
......@@ -549,7 +559,7 @@
立即支付
<!-- #endif -->
<!-- #ifdef MP-AG -->
立即预定
{{customer.isGuideOrLeader==1?'立即支付':'立即预定'}}
<!-- #endif -->
</button>
......@@ -779,7 +789,15 @@
Refund: 0,
MallBaseId: this.userInfo.MallBaseId,
CreateBy:0,
DOrderType:1
// #ifdef MP-DI
DOrderType:1,
// #endif
// #ifdef MP-AG
DOrderType:2,
// #endif
CustomerId: this.customer.customerInfoChildrenId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
CreateBy: this.CreateBy,
};
// #ifdef MP-DI
if(this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId){
......@@ -1184,6 +1202,7 @@
},
//去支付
goPay() {
if(this.submit) return
// #ifdef MP-DI
const error = this.validate()
if(error!=''){
......@@ -1336,6 +1355,9 @@
this.submitB2COrderHandler(tempData.OrderId)
// #endif
// #ifdef MP-AG
if(this.customer.isGuideOrLeader==1){
this.submitB2COrderHandler(tempData.OrderId)
}else{
uni.showToast({
title: '订单创建成功.',
icon: 'none'
......@@ -1343,6 +1365,8 @@
uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=2`,
});
}
// #endif
} else {
......
......@@ -179,7 +179,7 @@
}
.jz_OrderReNow {
width: 170rpx;
min-width: 170rpx;
height: 80rpx;
background-color: #111111;
text-align: center;
......@@ -580,7 +580,7 @@
</button>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<button class="jz_OrderReNow" @click="goCancel"
<button v-if="!submit&&((orderData.model.OrderState==2&&b2b_user.isGuideOrLeader==1&&orderData.model.Income==0)||(orderData.model.OrderState==2&&b2b_user.isGuideOrLeader!=1))" class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel"
:loading="submitCancel">
......@@ -588,6 +588,11 @@
<!-- <text v-if="!submitCancel">取消</text>
<u-loading v-if="submitCancel" size="32" color="#111"></u-loading> -->
</button>
<button v-if="!submitCancel&&(orderData.model.OrderState==2&&b2b_user.isGuideOrLeader==1&&orderData.model.Income==0)" class="jz_OrderReNow"
style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
</view>
<view style="display: flex; margin-left: 30rpx">
......@@ -633,10 +638,12 @@
showCoupons:false,
couponMessage:[],
showModal: false,
b2b_user: {}
};
},
created() {},
onLoad(option) {
this.b2b_user = uni.getStorageSync("b2b_user");
if (option.orderData) {
this.orderData = JSON.parse(decodeURIComponent(option.orderData));
this.orderId = this.orderData.model.OrderId
......@@ -662,7 +669,8 @@
this.submit = true
this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo,
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
}, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
......@@ -741,11 +749,13 @@
this.apipost("GetDetailsByErpOrderId_post",parameter,res=>{
if(res.resultCode==1){
this.OrderNo = res.data.OrderNo
// #ifdef MP-DI
this.formatStatus(
res.data.OrderStatus,
null,
null
);
// #endif
}else{
}
......@@ -907,6 +917,9 @@
res.data.model.IsChargeLossOrders,
res.data.model.IsApplyForCancel
);
if(this.b2b_user.isGuideOrLeader==1&&res.data.model.OrderState==2){
this.getOrderInfoByIdAndType()
}
// #endif
// #ifdef MP-DI
if(!this.OrderNo||!this.orderId){
......
......@@ -899,6 +899,7 @@
}
this.getUserCouponList();
this.initCountry()
},
methods: {
navigatorToHomeHandle() {
......@@ -941,7 +942,15 @@
Income: 0,
Refund: 0,
MallBaseId: this.userInfo.MallBaseId,
DOrderType:1
// #ifdef MP-DI
DOrderType:1,
// #endif
// #ifdef MP-AG
DOrderType:2,
// #endif
CustomerId: this.customer.customerInfoChildrenId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
CreateBy: this.CreateBy,
};
this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) {
......@@ -995,7 +1004,7 @@
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/visa/visa_SureOrder?OrderNo=" + OrderNo,
url: `/pages/visa/visa_SureOrder?OrderNo=${OrderNo}`,
});
}, 100);
},
......@@ -1351,7 +1360,7 @@
// #endif
this.submit = true;
let mall_customer = uni.getStorageSync("mall_customer");
let mall_UserInfo = uni.getStorageSync("mall_UserInfo");
this.basedataObj = uni.getStorageSync("basedata").mall;
var price = (this.price-this.currentCoupon.discountMoney).toFixed(2)
......@@ -1419,14 +1428,13 @@
this.submitB2COrderHandler(tempData.airOrderId)
// #endif
// #ifdef MP-AG
// this.successVisible = true
// uni.showToast({
// title: '订单创建成功.',
// icon: 'none'
// })
if(this.customer.isGuideOrLeader==1){
this.submitB2COrderHandler(tempData.airOrderId)
}else{
uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=6`,
});
}
// #endif
} else {
uni.showToast({
......@@ -1461,7 +1469,7 @@
OrderId: OrderId,
GoodsName: GoodsName,
OrderPayType: 1,
OpenId: uni.getStorageSync("mall_customer").OpenId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
},
},
(res) => {
......@@ -1560,7 +1568,7 @@
OrderId: data.OrderId,
GoodsName: GoodsName,
OrderPayType: 2,
OpenId: uni.getStorageSync("mall_customer").OpenId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
},
},
(res) => {
......@@ -1628,7 +1636,7 @@
data: {
OrderNo: obj.OrderNo,
OrderId: obj.OrderId,
UserId: uni.getStorageSync("mall_customer").UserId,
UserId: uni.getStorageSync("mall_UserInfo").UserId,
TradeNo: obj.TradeNo,
ProjectType: 2,
PreferPrice: obj.preferPrice,
......
......@@ -540,12 +540,17 @@
</button>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<button class="jz_OrderReNow" @click="goCancel"
<button v-if="!submit&&((b2b_user.isGuideOrLeader==1&&orderData.OrderModel.Income==0&&orderData.OrderModel.VisaOrderStatus==3)||b2b_user.isGuideOrLeader!=1)" class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel"
:loading="submitCancel">
取消
</button>
<button v-if="b2b_user.isGuideOrLeader==1&&orderData.OrderModel.Income==0&&orderData.OrderModel.VisaOrderStatus==3" class="jz_OrderReNow"
style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
</view>
</view>
......@@ -588,22 +593,17 @@
OrderTypeStr: 0,
OrderNo: '',
showModal: false,
b2b_user: {}
};
},
created() {},
onLoad(option) {
this.b2b_user = uni.getStorageSync("b2b_user");
if (option.orderData) {
this.orderData = JSON.parse(decodeURIComponent(option.orderData));
}else if(option.OrderNo||(option.orderId&&option.OrderTypeStr)){
if(option.OrderTypeStr){
this.OrderTypeStr = option.OrderTypeStr
}
if(option.orderId){
}else if(option.OrderNo&&option.orderId){
this.orderId = option.orderId
}
if(option.OrderNo){
this.OrderNo = option.OrderNo
}
this.getOrderInfoHandler()
} else if (option.orderId) {
this.orderId = option.orderId
......@@ -620,6 +620,7 @@
this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo,
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
}, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
......
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