mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-05 03:36:39 +08:00
Redirect to userPayData.wxPay
This commit is contained in:
parent
300788a552
commit
808807c563
@ -33,6 +33,22 @@ let util = {
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
},
|
||||
checkPaytypeValidated($paytype) {
|
||||
if(isWx && $paytype == 1) {
|
||||
//return 3;
|
||||
return true;
|
||||
} else if(isWx && $paytype!=1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!isMobile && $paytype == 1) {
|
||||
//Desktop, use native pay
|
||||
return true;
|
||||
} else if(isMobile && $paytype == 2) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
export default util;
|
@ -140,10 +140,12 @@
|
||||
import Myheader from "~/components/header.vue";
|
||||
import MyFooter from '~/components/rc-footer.vue';
|
||||
import tabs from "~/components/tabs.vue";
|
||||
import { customerorders, userindent, canceldanhao,generateOrderWX } from "../../ajax/getData";
|
||||
import util from "@/ajax/util";
|
||||
import { customerorders, userindent, canceldanhao, repayOrde } from "../../ajax/getData";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
util,
|
||||
crumbs:[
|
||||
{
|
||||
path:'/personal/mypersonal/',
|
||||
@ -346,28 +348,39 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
//订单立即支付
|
||||
async getwei(item) {
|
||||
console.log(item);
|
||||
let postData = [];
|
||||
let userPayData = {
|
||||
userprice: item.salesAmount,
|
||||
orderId:item.orderNumber,
|
||||
userinformation:item.addressUserName +
|
||||
" " +
|
||||
item.phoneNumber,
|
||||
wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
||||
};
|
||||
this.$router.push({
|
||||
path: "/personal/userpay",
|
||||
query: {
|
||||
userData:item.orderNumber,
|
||||
stype:1,
|
||||
userPayData: JSON.stringify(userPayData),
|
||||
},
|
||||
});
|
||||
},
|
||||
//订单立即支付
|
||||
async getwei(item) {
|
||||
let data = await this.repayOrde(item.orderNumber);
|
||||
if(data.code==1) {
|
||||
let userPayData = {
|
||||
userprice: item.usersalesAmount,
|
||||
orderId: item.orderNumber,
|
||||
userinformation: item.addressUserName + " " + item.addressPhoneNumber,
|
||||
wxPay:data.msg
|
||||
};
|
||||
|
||||
this.$router.push({
|
||||
path: "/personal/userpay",
|
||||
query: {
|
||||
userData: item.orderNumber,
|
||||
stype: 1,
|
||||
userPayData: JSON.stringify(userPayData),
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "订单数据错误,请联系客服进行处理",
|
||||
});
|
||||
}
|
||||
},
|
||||
async repayOrde(ordernumber) {
|
||||
let payType = this.util.pickPaytype();
|
||||
let res = await repayOrde(ordernumber, payType);
|
||||
if (res) {
|
||||
return res;
|
||||
}
|
||||
},
|
||||
usertiaozhuan(item){
|
||||
this.$router.push({
|
||||
path: "/myorder/usertion",
|
||||
|
@ -94,7 +94,9 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div style="display:none">
|
||||
<form :action="this.h5PayUrl" method="post" ref="h5SubmitForm"></form>
|
||||
<form :action="this.h5PayUrl" method="post" ref="h5SubmitForm">
|
||||
<input type="hidden" v-model="h5payRedirectUrl">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -112,6 +114,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
util,
|
||||
h5payRedirectUrl:'',
|
||||
activeIndex: 0,
|
||||
paymentTimer:undefined,
|
||||
isSucess: false,
|
||||
@ -176,6 +179,7 @@ export default {
|
||||
goPayH5() {
|
||||
let isMobile = this.util.isMobile();
|
||||
if(this.userPayData.wxPay && isMobile) {
|
||||
//this.$refs["h5SubmitForm"].action="http://47.96.75.242:10086/royalcanin/royalcanin/redirectUrlWXH5";
|
||||
this.$refs["h5SubmitForm"].action=this.userPayData.wxPay;
|
||||
this.$refs["h5SubmitForm"].submit();
|
||||
//window.location.href=this.userPayData.wxPay;;
|
||||
|
Loading…
Reference in New Issue
Block a user