This commit is contained in:
2021-12-07 10:05:20 +08:00
parent bdb7b98397
commit a914d22b66
5 changed files with 12772 additions and 62 deletions

View File

@@ -2,4 +2,4 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = 'http://122.51.199.160:8080/'
VUE_APP_BASE_API = 'http://192.168.43.231:53903/'

View File

@@ -2,7 +2,7 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = 'http://localhost:8080/'
VUE_APP_BASE_API = 'http://192.168.43.231:53903/'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.

View File

@@ -2,4 +2,4 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = 'https://www.example.com/'
VUE_APP_BASE_API = 'http://47.94.220.67:8080/'

12700
litemall-vue/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -77,67 +77,77 @@ export default {
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') != -1;
if (isWeixin) {
orderPrepay({ orderId: this.orderId })
.then(res => {
let data = res.data.data;
let prepay_data = JSON.stringify({
appId: data.appId,
timeStamp: data.timeStamp,
nonceStr: data.nonceStr,
package: data.packageValue,
signType: 'MD5',
paySign: data.paySign
});
setLocalStorage({ prepay_data: prepay_data });
// + this.order.orderInfo.actualPrice * 100
// window.location.href = "https:///m.jnbat.com/wxPay/pay/tencentPay?out_trade_no=" + this.orderId + "&total_fee=1"
// orderPrepay({ orderId: this.orderId })
// .then(res => {
// let data = res.data.data;
// let prepay_data = JSON.stringify({
// appId: data.appId,
// timeStamp: data.timeStamp,
// nonceStr: data.nonceStr,
// package: data.packageValue,
// signType: 'MD5',
// paySign: data.paySign
// });
// setLocalStorage({ prepay_data: prepay_data });
// if (typeof WeixinJSBridge == 'undefined') {
// if (document.addEventListener) {
// document.addEventListener(
// 'WeixinJSBridgeReady',
// this.onBridgeReady,
// false
// );
// } else if (document.attachEvent) {
// document.attachEvent(
// 'WeixinJSBridgeReady',
// this.onBridgeReady
// );
// document.attachEvent(
// 'onWeixinJSBridgeReady',
// this.onBridgeReady
// );
// }
// } else {
// this.onBridgeReady();
// }
// })
// .catch(err => {
// Dialog.alert({ message: err.data.errmsg });
// that.$router.replace({
// name: 'paymentStatus',
// params: {
// status: 'failed'
// }
// });
// });
window.location.href = "http://47.94.220.67:10000/pay?order_id=" + this.orderId
if (typeof WeixinJSBridge == 'undefined') {
if (document.addEventListener) {
document.addEventListener(
'WeixinJSBridgeReady',
this.onBridgeReady,
false
);
} else if (document.attachEvent) {
document.attachEvent(
'WeixinJSBridgeReady',
this.onBridgeReady
);
document.attachEvent(
'onWeixinJSBridgeReady',
this.onBridgeReady
);
}
} else {
this.onBridgeReady();
}
})
.catch(err => {
Dialog.alert({ message: err.data.errmsg });
that.$router.replace({
name: 'paymentStatus',
params: {
status: 'failed'
}
});
});
} else {
orderH5pay({ orderId: this.orderId })
.then(res => {
let data = res.data.data;
window.location.replace(
data.mwebUrl +
'&redirect_url=' +
encodeURIComponent(
window.location.origin +
'/#/?orderId=' +
this.orderId +
'&tip=yes'
)
);
})
.catch(err => {
Dialog.alert({ message: err.data.errmsg });
});
// orderH5pay({ orderId: this.orderId })
// .then(res => {
// // window.location.origin
// let data = res.data.data;
// console.log(data.mwebUrl)
// window.location.replace(
// data.mwebUrl +
// '&redirect_url=' +
// encodeURIComponent(
// 'https://m.jnbat.com' +
// '/#/?orderId=' +
// this.orderId +
// '&tip=yes'
// )
// );
// })
// .catch(err => {
// Dialog.alert({ message: err.data.errmsg });
// });
// window.location.href = "https:///m.jnbat.com/wxPay/pay/tencentPay?out_trade_no=" + this.orderId + "&total_fee=1"
window.location.href = "http://47.94.220.67:10000/pay?order_id=" + this.orderId
}
} else {
//todo : alipay