Commit 4c91197f authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/goods' into 'master'

fix: H5支付跳转

See merge request !108
parents 1703e665 25826555
......@@ -2,7 +2,7 @@
* @Description: 支付微信h5, jsapi, 第三方收银台,跳转)
* @Date: 2020-07-28 15:03:52
* @LastEditors: gzw
* @LastEditTime: 2020-08-28 11:56:33
* @LastEditTime: 2020-08-28 13:22:33
*/
import qs from "qs";
......@@ -55,7 +55,7 @@ function payByWeixinJsapi(info = {}, callback) {
*/
function payByWeixinH5(info) {
if (!info.url) return;
info.params.isXyqb = isXyqb;
info.params.isXyqb = isXyqb ? 1 : 0;
const currentPath = encodeURIComponent(
window.location.origin +
"/payWaiting" +
......@@ -74,7 +74,7 @@ function payByWeixinH5(info) {
*/
function payByThirdPartyCashier(info) {
if (!info.url) return;
info.params.isXyqb = isXyqb;
info.params.isXyqb = isXyqb ? 1 : 0;
const currentPath = encodeURIComponent(
window.location.origin +
"/payWaiting" +
......@@ -91,7 +91,7 @@ function payByThirdPartyCashier(info) {
* @return {Promise} 回调
*/
export function payByWay(type = "THIRD", payInfo) {
return new Promise(resolve => {
return new Promise((resolve, reject) => {
if (type === "JSAPI" && !payInfo.url) {
payByWeixinJsapi(payInfo, function() {
// if (e === "ok") {
......@@ -104,10 +104,12 @@ export function payByWay(type = "THIRD", payInfo) {
} else {
if (payInfo.url.indexOf("tenpay") > -1) {
payByWeixinH5(payInfo);
reject();
} else {
payByThirdPartyCashier(payInfo);
reject();
}
resolve();
// resolve();
}
});
}
......@@ -73,9 +73,13 @@ export default {
}
};
}
payByWay(tradeType, payInfo).then(() => {
this.getPayResult();
});
payByWay(tradeType, payInfo)
.then(() => {
this.getPayResult();
})
.catch(() => {
console.log("h5支付");
});
} else {
this.setIsPayWait(false);
}
......
......@@ -15,8 +15,8 @@ export default {
mounted() {
this.setIsPayWait(true);
this.orderInfo = this.$route.query;
if (this.orderInfo.isXyqb) {
window.location.href = "xyqb://";
if (this.orderInfo.isXyqb == 1) {
window.location.href = "xyqb://my";
return;
}
if (!this.orderInfo.payOrderNo) {
......
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