Commit fd5dce1f authored by 罗超's avatar 罗超

1

parent 59232b8f
......@@ -461,31 +461,23 @@ export default {
},
},
(res) => {
this.goPayAli(res.data);
this.goPayAli(res.data, item);
}
);
},
goPayAli(tradeNO) {
goPayAli(tradeNO, item) {
let that = this;
my.tradePay({
tradeNO: tradeNO,
success: function (res) {
console.log("success", res);
if (res.resultCode == "9000") {
uni.showToast({
title: "支付成功",
});
uni.redirectTo({
url:
"/pages/jiuzhai/paysuccess?PreferPrice=" +
that.price +
"&isFrom=1",
});
} else if (res.resultCode == "6001") {
uni.showToast({
title: "支付取消",
});
}
let obj = {
TradeNo: tradeNO,
OrderNo: item.orderNo,
OrderId: item.orderId,
preferPrice: item.preferPrice,
};
that.payAliCallback(obj);
},
fail: function (err) {
console.log("fail:", err);
......@@ -496,6 +488,38 @@ export default {
},
});
},
payAliCallback(obj) {
console.log(893), 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?PreferPrice=" +
obj.PreferPrice +
"&isFrom=1",
});
},
(err) => {
console.log("cb2", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
}
);
},
// #endif
},
};
......
......@@ -874,9 +874,7 @@ export default {
OrderId: data.OrderId,
preferPrice: data.PreferPrice,
};
console.log(883, cbObj);
this.payAliCallback(cbObj);
console.log(884);
} else {
uni.showToast({
title: "获取交易号失败",
......@@ -892,19 +890,13 @@ export default {
tradeNO: tradeNO,
success: function (res) {
console.log("success", res);
if (res.resultCode == "9000") {
let cbObj = {
TradeNo: tradeNO,
OrderNo: data.OrderNo,
OrderId: data.OrderId,
preferPrice: data.PreferPrice,
};
that.payAliCallback(cbObj);
} else if (res.resultCode == "6001") {
uni.showToast({
title: "支付取消",
});
}
let cbObj = {
TradeNo: tradeNO,
OrderNo: data.OrderNo,
OrderId: data.OrderId,
preferPrice: data.PreferPrice,
};
that.payAliCallback(cbObj);
},
fail: function (err) {
console.log("fail:", err);
......@@ -916,7 +908,6 @@ export default {
});
},
payAliCallback(obj) {
console.log(893, obj);
this.request2(
{
url: "/api/AliPay/ALiPayCallBackDmcNotify",
......@@ -931,19 +922,23 @@ export default {
},
(res) => {
console.log("cb", res);
this.submit = false;
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + obj.PreferPrice,
});
},
(err) => {
this.submit = false;
console.log("cb2", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
// uni.redirectTo({
// url: "/pages/jiuzhai/paysuccess?PreferPrice=" + obj.PreferPrice,
// });
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
}, 1000);
}
);
},
......
......@@ -726,15 +726,23 @@ export default {
if (loss == 1 || status == 4) {
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.submit = false;
this.submitCancel = false;
} else if (status == 2 && isCancel != 1) {
this.orderStatus.code = 0;
this.orderStatus.text = "待付款";
this.submit = true;
this.submitCancel = true;
} else if (status == 2 && isCancel == 1) {
this.orderStatus.code = -2;
this.orderStatus.text = "审核中";
this.submit = false;
this.submitCancel = false;
} else if (status == 1) {
this.orderStatus.code = 1;
this.orderStatus.text = "正常";
this.submit = false;
this.submitCancel = false;
}
},
// #ifdef MP-WEIXIN
......@@ -844,14 +852,13 @@ export default {
tradeNO: tradeNO,
success: function (res) {
console.log("success", res);
if (res.resultCode == "9000") {
that.submit = false;
that.initOrderInfo(that.orderData.model.OrderId);
} else if (res.resultCode == "6001") {
uni.showToast({
title: "支付取消",
});
}
let obj = {
TradeNo: tradeNO,
OrderNo: item.orderNo,
OrderId: item.orderId,
preferPrice: item.preferPrice,
};
that.payAliCallback(obj);
},
fail: function (err) {
console.log("fail:", err);
......@@ -864,6 +871,41 @@ export default {
},
});
},
payAliCallback(obj) {
console.log(893), Obj;
let that = this;
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?PreferPrice=" +
// obj.PreferPrice +
// "&isFrom=1",
// });
that.submit = false;
that.initOrderInfo(that.orderData.model.OrderId);
},
(err) => {
console.log("cb2", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
}
);
},
// #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