|
@@ -134,19 +134,6 @@
|
|
|
// #ifdef MP
|
|
|
'from': 'routine',
|
|
|
// #endif
|
|
|
- // #ifdef H5
|
|
|
- 'from': this.$wechat.isWeixin() ? 'weixin' : 'weixinh5',
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
- quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location
|
|
|
- .port +
|
|
|
- '/pages/goods/order_details/index?order_id=' + this.order_id : location.protocol +
|
|
|
- '//' + location.hostname +
|
|
|
- '/pages/goods/order_details/index?order_id=' + this.order_id
|
|
|
- // #endif
|
|
|
- // #ifdef APP-PLUS
|
|
|
- quitUrl: '/pages/goods/order_details/index?order_id=' + this.order_id
|
|
|
- // #endif
|
|
|
}).then(res => {
|
|
|
let jsConfig = res.data.result.jsConfig;
|
|
|
switch (paytype) {
|
|
@@ -154,7 +141,6 @@
|
|
|
if (res.data.result === undefined) return that.$util.Tips({
|
|
|
title: that.$t(`缺少支付参数`)
|
|
|
});
|
|
|
-
|
|
|
// #ifdef MP
|
|
|
let mp_pay_name=''
|
|
|
if(uni.requestOrderPayment){
|
|
@@ -202,163 +188,6 @@
|
|
|
},
|
|
|
});
|
|
|
// #endif
|
|
|
- // #ifdef H5
|
|
|
- let data = res.data;
|
|
|
- if (data.status == "WECHAT_H5_PAY") {
|
|
|
- uni.hideLoading();
|
|
|
- location.replace(data.result.jsConfig.mweb_url);
|
|
|
- return that.$util.Tips({
|
|
|
- title: that.$t(`支付成功`),
|
|
|
- icon: 'success'
|
|
|
- }, () => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_complete'
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- that.$wechat.pay(data.result.jsConfig)
|
|
|
- .then(() => {
|
|
|
- return that.$util.Tips({
|
|
|
- title: that.$t(`支付成功`),
|
|
|
- icon: 'success'
|
|
|
- }, () => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_complete'
|
|
|
- });
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(()=> {
|
|
|
- return that.$util.Tips({
|
|
|
- title: that.$t(`支付失败`),
|
|
|
- }, () => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_fail'
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- // #endif
|
|
|
- // #ifdef APP-PLUS
|
|
|
- uni.requestPayment({
|
|
|
- provider: 'wxpay',
|
|
|
- orderInfo: jsConfig,
|
|
|
- success: (e) => {
|
|
|
- let url = '/pages/goods/order_pay_status/index?order_id=' + orderId +
|
|
|
- '&msg=支付成功';
|
|
|
- uni.showToast({
|
|
|
- title: that.$t(`支付成功`)
|
|
|
- })
|
|
|
- setTimeout(res => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_complete'
|
|
|
- });
|
|
|
- }, 2000)
|
|
|
- },
|
|
|
- fail: (e) => {
|
|
|
- uni.showModal({
|
|
|
- content: that.$t(`支付失败`),
|
|
|
- showCancel: false,
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_fail'
|
|
|
- });
|
|
|
- } else if (res.cancel) {}
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- complete: () => {
|
|
|
- uni.hideLoading();
|
|
|
- },
|
|
|
- });
|
|
|
- // #endif
|
|
|
- break;
|
|
|
- case 'yue':
|
|
|
- uni.hideLoading();
|
|
|
- return that.$util.Tips({
|
|
|
- title: res.msg,
|
|
|
- icon: 'success'
|
|
|
- }, () => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_complete'
|
|
|
- });
|
|
|
- });
|
|
|
- break;
|
|
|
- case 'offline':
|
|
|
- uni.hideLoading();
|
|
|
- return that.$util.Tips({
|
|
|
- title: res.msg,
|
|
|
- icon: 'success'
|
|
|
- }, () => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_complete'
|
|
|
- });
|
|
|
- });
|
|
|
- break;
|
|
|
- case 'friend':
|
|
|
- uni.hideLoading();
|
|
|
- return that.$util.Tips({
|
|
|
- title: res.msg,
|
|
|
- icon: 'success'
|
|
|
- }, () => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_complete'
|
|
|
- });
|
|
|
- });
|
|
|
- break;
|
|
|
- case 'alipay':
|
|
|
- uni.hideLoading();
|
|
|
- //#ifdef H5
|
|
|
- if (this.$wechat.isWeixin()) {
|
|
|
- uni.redirectTo({
|
|
|
- url: `/pages/users/alipay_invoke/index?id=${res.data.result.order_id}&pay_key=${res.data.result.pay_key}`
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.hideLoading();
|
|
|
- that.formContent = res.data.result.jsConfig;
|
|
|
- that.$nextTick(() => {
|
|
|
- document.getElementById('alipaysubmit').submit();
|
|
|
- });
|
|
|
- }
|
|
|
- //#endif
|
|
|
- // #ifdef MP
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/users/alipay_invoke/index?id=${res.data.result.order_id}&link=${res.data.result.jsConfig.qrCode}`
|
|
|
- });
|
|
|
- // #endif
|
|
|
- // #ifdef APP-PLUS
|
|
|
- uni.requestPayment({
|
|
|
- provider: 'alipay',
|
|
|
- orderInfo: jsConfig,
|
|
|
- success: (e) => {
|
|
|
- uni.showToast({
|
|
|
- title: that.$t(`支付成功`)
|
|
|
- })
|
|
|
- setTimeout(res => {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_complete'
|
|
|
- });
|
|
|
- }, 2000)
|
|
|
-
|
|
|
- },
|
|
|
- fail: (e) => {
|
|
|
- uni.showModal({
|
|
|
- content: that.$t(`支付失败`),
|
|
|
- showCancel: false,
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- that.$emit('onChangeFun', {
|
|
|
- action: 'pay_fail'
|
|
|
- });
|
|
|
- } else if (res.cancel) {}
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- complete: () => {
|
|
|
- uni.hideLoading();
|
|
|
- },
|
|
|
- });
|
|
|
- // #endif
|
|
|
break;
|
|
|
}
|
|
|
}).catch(err => {
|