Commit 94519171 authored by 罗超's avatar 罗超

1

parent 43ed46a2
......@@ -838,7 +838,9 @@ export default {
data.CoverImg = this.currentPriceInfo.CoverImg;
let myData = JSON.stringify(data);
this.orderData = encodeURIComponent(myData);
this.querenAli(data.OrderId);
console.log(841, data);
this.querenAli(data);
OrderId;
} else {
}
this.submit = false;
......@@ -849,14 +851,15 @@ export default {
);
}
},
querenAli(OrderId) {
querenAli(data) {
let that = this;
let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.currentPriceInfo.title;
this.request2(
{
url: url,
data: {
OrderId: OrderId,
OrderId: data.OrderId,
GoodsName: GoodsName,
OrderPayType: 2,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
......@@ -865,7 +868,15 @@ export default {
(res) => {
this.orderInfo = JSON.parse(res.data);
if (res.data) {
this.PayAli(res.data);
let cbObj = {
tradeNO: res.data,
OrderNo: data.OrderNo,
OrderId: data.OrderId,
preferPrice: data.PreferPrice,
};
console.log(891, cbObj);
that.payAliCallback(cbObj);
// this.PayAli(res.data, data);
} else {
uni.showToast({
title: "获取交易号失败",
......@@ -875,18 +886,21 @@ export default {
}
);
},
PayAli(tradeNO) {
PayAli(tradeNO, data) {
let that = this;
my.tradePay({
tradeNO: tradeNO,
success: function (res) {
console.log("success", res);
if (res.resultCode == "9000") {
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
}, 1000);
let cbObj = {
tradeNO: tradeNO,
OrderNo: data.OrderNo,
OrderId: data.OrderId,
preferPrice: data.PreferPrice,
};
console.log(893, cbObj);
that.payAliCallback(cbObj);
} else if (res.resultCode == "6001") {
uni.showToast({
title: "支付取消",
......@@ -902,6 +916,39 @@ export default {
},
});
},
payAliCallback(obj) {
console.log("919", obj);
this.request2(
{
url: "/api/AliPay/ALiPayCallBackDmcNotify",
data: {
OrderNo: obj.OrderNo,
OrderId: obj.OrderId,
UserId: uni.getStorageSync("mall_UserInfo").UserId,
TradeNo: obj.TradeNo,
ProjectType: 2,
PreferPrice: obj.preferPrice,
},
},
(res) => {
console.log("cb", res);
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess",
});
// setTimeout(() => {
// uni.redirectTo({
// url: "/pages/jiuzhai/jz_MyOrder",
// });
// }, 1000);
},
() => {
console.log("2", res);
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess",
});
}
);
},
// #endif
},
};
......
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