Commit 947df9fe authored by 罗超's avatar 罗超

1

parent 9c854fd2
...@@ -170,13 +170,22 @@ ...@@ -170,13 +170,22 @@
>再来一单</view >再来一单</view
> >
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view <!-- <view
v-if="item.orderState == 2" v-if="item.orderState == 2"
class="jz_Zailai" class="jz_Zailai"
style="width: 110rpx; margin-right: 10rpx" style="width: 110rpx; margin-right: 10rpx"
@click.stop="goZhifu(item)" @click.stop="goZhifu(item)"
>付款</view >付款</view
> -->
<button
v-if="item.orderState == 2"
class="jz_Zailai"
style="width: 110rpx; margin-right: 10rpx"
@click.stop="goZhifu(item)"
:disabled="disabledBtn"
> >
付款
</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-ALIPAY --> <!-- #ifdef MP-ALIPAY -->
<view <view
...@@ -243,6 +252,7 @@ export default { ...@@ -243,6 +252,7 @@ export default {
status: "加载中", status: "加载中",
price: 0, price: 0,
showBar: true, showBar: true,
disabledBtn: false,
}; };
}, },
created() { created() {
...@@ -394,6 +404,7 @@ export default { ...@@ -394,6 +404,7 @@ export default {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
goZhifu(item) { goZhifu(item) {
console.log(item, "item"); console.log(item, "item");
this.disabledBtn = true;
let url = "/api/WeChatPay/GetTravlePayInfo"; let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = item.title; let GoodsName = item.title;
GoodsName = GoodsName.slice(0, 10); GoodsName = GoodsName.slice(0, 10);
...@@ -424,6 +435,7 @@ export default { ...@@ -424,6 +435,7 @@ export default {
signType: orderInfo.signType, signType: orderInfo.signType,
paySign: orderInfo.sign, paySign: orderInfo.sign,
success: function (res) { success: function (res) {
this.disabledBtn = false;
console.log("success", res); console.log("success", res);
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
...@@ -437,6 +449,7 @@ export default { ...@@ -437,6 +449,7 @@ export default {
}); });
}, },
fail: function (err) { fail: function (err) {
this.disabledBtn = false;
console.log("fail:", err); console.log("fail:", err);
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
...@@ -447,6 +460,7 @@ export default { ...@@ -447,6 +460,7 @@ export default {
// #endif // #endif
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
goZhifuAli(item) { goZhifuAli(item) {
this.disabledBtn = true;
console.log(item, "item"); console.log(item, "item");
let url = "/api/WeChatPay/GetTravlePayInfo"; let url = "/api/WeChatPay/GetTravlePayInfo";
this.price = item.preferPrice; this.price = item.preferPrice;
...@@ -481,6 +495,7 @@ export default { ...@@ -481,6 +495,7 @@ export default {
}, },
fail: function (err) { fail: function (err) {
console.log("fail:", err); console.log("fail:", err);
this.disabledBtn = false;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
...@@ -489,7 +504,6 @@ export default { ...@@ -489,7 +504,6 @@ export default {
}); });
}, },
payAliCallback(obj) { payAliCallback(obj) {
console.log(893), Obj;
this.request2( this.request2(
{ {
url: "/api/AliPay/ALiPayCallBackDmcNotify", url: "/api/AliPay/ALiPayCallBackDmcNotify",
...@@ -504,6 +518,7 @@ export default { ...@@ -504,6 +518,7 @@ export default {
}, },
(res) => { (res) => {
console.log("cb", res); console.log("cb", res);
this.disabledBtn = false;
uni.redirectTo({ uni.redirectTo({
url: url:
"/pages/jiuzhai/paysuccess?PreferPrice=" + "/pages/jiuzhai/paysuccess?PreferPrice=" +
...@@ -513,6 +528,7 @@ export default { ...@@ -513,6 +528,7 @@ export default {
}, },
(err) => { (err) => {
console.log("cb2", err); console.log("cb2", err);
this.disabledBtn = false;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
......
...@@ -98,7 +98,9 @@ ...@@ -98,7 +98,9 @@
} }
.jz_OrderReNow { .jz_OrderReNow {
/* #ifdef MP-ALIPAY */
width: 150rpx; width: 150rpx;
/* #endif */
height: 80rpx; height: 80rpx;
background-color: #111111; background-color: #111111;
text-align: center; text-align: center;
...@@ -443,18 +445,14 @@ ...@@ -443,18 +445,14 @@
> >
</view> </view>
<view style="display: flex; margin-top: -2px"> <view style="display: flex; margin-top: -2px">
<!-- #ifdef MP-WEIXIN --> <button
<view class="jz_OrderReNow" @click="goPay()"> class="jz_OrderReNow"
<text v-if="!submit">立即支付</text> @click="goPay()"
<u-loading v-if="submit" size="32" color="#f5f5f5"></u-loading> :disabled="submit"
</view> :loading="submit"
<!-- #endif --> >
<!-- #ifdef MP-ALIPAY --> 立即支付
<view class="jz_OrderReNow" @click="goPayAli()"> </button>
<text v-if="!submit">立即支付</text>
<u-loading v-if="submit" size="32" color="#f5f5f5"></u-loading>
</view>
<!-- #endif -->
</view> </view>
</view> </view>
</view> </view>
...@@ -497,7 +495,6 @@ export default { ...@@ -497,7 +495,6 @@ export default {
}); });
}, },
onLoad(option) { onLoad(option) {
console.log(504, option);
if (option.seat) { if (option.seat) {
this.currentPriceInfo = JSON.parse( this.currentPriceInfo = JSON.parse(
decodeURIComponent(option.currentPriceInfo) decodeURIComponent(option.currentPriceInfo)
...@@ -605,7 +602,6 @@ export default { ...@@ -605,7 +602,6 @@ export default {
this.price = money; this.price = money;
}, },
//去支付 //去支付
// #ifdef MP-WEIXIN
goPay() { goPay() {
if (this.contactName == "") { if (this.contactName == "") {
uni.showToast({ uni.showToast({
...@@ -676,7 +672,12 @@ export default { ...@@ -676,7 +672,12 @@ export default {
ScenicRefundArr: [], ScenicRefundArr: [],
CommissionSharePeople: 0, CommissionSharePeople: 0,
CommissionShareMoney: 0, CommissionShareMoney: 0,
// #ifdef MP-WEIXIN
OrderSource: 5, OrderSource: 5,
// #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
MiniAppUserId: this.userInfo.UserId, MiniAppUserId: this.userInfo.UserId,
}; };
this.apipost( this.apipost(
...@@ -688,7 +689,12 @@ export default { ...@@ -688,7 +689,12 @@ export default {
data.CoverImg = this.currentPriceInfo.CoverImg; data.CoverImg = this.currentPriceInfo.CoverImg;
let myData = JSON.stringify(data); let myData = JSON.stringify(data);
this.orderData = encodeURIComponent(myData); this.orderData = encodeURIComponent(myData);
// #ifdef MP-WEIXIN
this.queren(data.OrderId); this.queren(data.OrderId);
// #endif
// #ifdef MP-ALIPAY
this.querenAli(data);
// #endif
} else { } else {
} }
this.submit = false; this.submit = false;
...@@ -699,6 +705,8 @@ export default { ...@@ -699,6 +705,8 @@ export default {
); );
} }
}, },
// #ifdef MP-WEIXIN
//微信支付
queren(OrderId) { queren(OrderId) {
let url = "/api/WeChatPay/GetTravlePayInfo"; let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.currentPriceInfo.title; let GoodsName = this.currentPriceInfo.title;
...@@ -759,101 +767,7 @@ export default { ...@@ -759,101 +767,7 @@ export default {
}, },
// #endif // #endif
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
goPayAli() { //支付宝支付
if (this.contactName == "") {
uni.showToast({
title: "请输入联系人姓名",
icon: "none",
});
} else if (this.contactMobile == "") {
uni.showToast({
title: "请输入联系人电话",
icon: "none",
});
} else {
this.submit = true;
this.userInfo = uni.getStorageSync("mall_UserInfo");
this.basedataObj = uni.getStorageSync("basedata").mall;
var CustomerId = this.basedataObj.virtualB2BCustomerId;
var ContactName = this.contactName;
var ContactMobile = this.contactMobile;
var CustomerType = 4;
var price = this.currentPriceInfo.b2CPrice;
let msg = {
OrderId: 0,
TCID: this.currentPriceInfo.tcid,
CustomerType: CustomerType,
GroupType: 1,
ContactName: ContactName,
ContactMobile: ContactMobile,
CustomerId: CustomerId,
DepartureCityId: 262,
IsIntermodal: 2,
Unit_Price: price,
TC_Price: price,
ManNum: this.orderMsg.ManNum,
ChirdNum: this.orderMsg.ChirdNum,
ChirdNeedBedNum: this.orderMsg.ChirdNeedBedNum,
BabyNum: this.orderMsg.BabyNum,
OldPeopleNum: 0,
SingleRoomNum: 0,
PreferPrice: this.price,
YSeatNum: this.total,
ESeatNum: 0,
FSeatNum: 0,
Commission: 0, //todo 提成
ClientSource: 2,
BrandId: 0,
TradeWay: 0,
PlatformOrder: "",
GuestNum:
this.orderMsg.ManNum +
this.orderMsg.ChirdNum +
this.orderMsg.BabyNum,
IsChildrenTour: this.currentPriceInfo.isSupportChildren,
IsBirdDiscount: this.zaoniao > 0 ? 1 : 2,
PredictRoomNum: 1,
BigRoomNum: 0,
TripleRoomNum: 0,
TradeDate: this.currentPriceInfo.startDate,
CostType: 0,
MinOrderPrice: 0,
Remarks: "",
VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
AirticketNum: 0,
ReturnArriveCityId: 262,
IsReturnIntermodal: 2,
GoCityTime: "",
BackCityTime: "",
ScenicRefundArr: [],
CommissionSharePeople: 0,
CommissionShareMoney: 0,
OrderSource: 6,
MiniAppUserId: this.userInfo.UserId,
};
this.apipost(
"sellorder_post_SetOrderInfoForB2B",
msg,
(res) => {
if (res.resultCode == 1) {
let data = res.data;
data.CoverImg = this.currentPriceInfo.CoverImg;
let myData = JSON.stringify(data);
this.orderData = encodeURIComponent(myData);
this.querenAli(data);
OrderId;
} else {
}
this.submit = false;
},
(e) => {
this.submit = false;
}
);
}
},
querenAli(data) { querenAli(data) {
let that = this; let that = this;
let url = "/api/WeChatPay/GetTravlePayInfo"; let url = "/api/WeChatPay/GetTravlePayInfo";
...@@ -871,13 +785,7 @@ export default { ...@@ -871,13 +785,7 @@ export default {
(res) => { (res) => {
this.orderInfo = JSON.parse(res.data); this.orderInfo = JSON.parse(res.data);
if (res.data) { if (res.data) {
let cbObj = { that.PayAli(res.data, data);
TradeNo: res.data,
OrderNo: data.OrderNo,
OrderId: data.OrderId,
preferPrice: data.PreferPrice,
};
this.payAliCallback(cbObj);
} else { } else {
uni.showToast({ uni.showToast({
title: "获取交易号失败", title: "获取交易号失败",
......
...@@ -601,16 +601,24 @@ ...@@ -601,16 +601,24 @@
</view> </view>
<view style="display: flex; margin-left: 30rpx"> <view style="display: flex; margin-left: 30rpx">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view class="jz_OrderReNow" @click="goFukuan" v-if="showPayBtn"> <button
<text v-if="!submit">立即支付</text> class="jz_OrderReNow"
<u-loading v-if="submit" size="32" color="#f5f5f5"></u-loading> @click="goFukuan"
</view> v-if="showPayBtn"
:disabled="submit"
>
立即支付
</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-ALIPAY --> <!-- #ifdef MP-ALIPAY -->
<view class="jz_OrderReNow" @click="goZhifuAli" v-if="showPayBtn"> <button
<text v-if="!submit">立即支付</text> class="jz_OrderReNow"
<u-loading v-if="submit" size="32" color="#f5f5f5"></u-loading> @click="goZhifuAli"
</view> v-if="showPayBtn"
:disabled="submit"
>
立即支付
</button>
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>
...@@ -648,7 +656,9 @@ export default { ...@@ -648,7 +656,9 @@ export default {
}, },
methods: { methods: {
goback() { goback() {
uni.navigateBack(); uni.navigateBack({
delta: 1,
});
}, },
goCancel() { goCancel() {
if (this.submit || this.submitCancel) return; if (this.submit || this.submitCancel) return;
...@@ -863,9 +873,9 @@ export default { ...@@ -863,9 +873,9 @@ export default {
console.log("success", res); console.log("success", res);
let obj = { let obj = {
TradeNo: tradeNO, TradeNo: tradeNO,
OrderNo: item.orderNo, OrderNo: that.orderData.model.orderNo,
OrderId: item.orderId, OrderId: that.orderData.model.orderId,
preferPrice: item.preferPrice, preferPrice: that.orderData.model.PreferPrice,
}; };
that.payAliCallback(obj); that.payAliCallback(obj);
}, },
...@@ -900,6 +910,7 @@ export default { ...@@ -900,6 +910,7 @@ export default {
}, },
(err) => { (err) => {
console.log("err", err); console.log("err", err);
that.submit = false;
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