mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-05 11:46:40 +08:00
Redirect to userPayData.wxPay
This commit is contained in:
parent
300788a552
commit
808807c563
@ -33,6 +33,22 @@ let util = {
|
|||||||
} else {
|
} else {
|
||||||
return 2;
|
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;
|
export default util;
|
@ -140,10 +140,12 @@
|
|||||||
import Myheader from "~/components/header.vue";
|
import Myheader from "~/components/header.vue";
|
||||||
import MyFooter from '~/components/rc-footer.vue';
|
import MyFooter from '~/components/rc-footer.vue';
|
||||||
import tabs from "~/components/tabs.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 {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
util,
|
||||||
crumbs:[
|
crumbs:[
|
||||||
{
|
{
|
||||||
path:'/personal/mypersonal/',
|
path:'/personal/mypersonal/',
|
||||||
@ -348,26 +350,37 @@ export default {
|
|||||||
|
|
||||||
//订单立即支付
|
//订单立即支付
|
||||||
async getwei(item) {
|
async getwei(item) {
|
||||||
console.log(item);
|
let data = await this.repayOrde(item.orderNumber);
|
||||||
let postData = [];
|
if(data.code==1) {
|
||||||
let userPayData = {
|
let userPayData = {
|
||||||
userprice: item.salesAmount,
|
userprice: item.usersalesAmount,
|
||||||
orderId:item.orderNumber,
|
orderId: item.orderNumber,
|
||||||
userinformation:item.addressUserName +
|
userinformation: item.addressUserName + " " + item.addressPhoneNumber,
|
||||||
" " +
|
wxPay:data.msg
|
||||||
item.phoneNumber,
|
|
||||||
wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/personal/userpay",
|
path: "/personal/userpay",
|
||||||
query: {
|
query: {
|
||||||
userData:item.orderNumber,
|
userData: item.orderNumber,
|
||||||
stype:1,
|
stype: 1,
|
||||||
userPayData: JSON.stringify(userPayData),
|
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){
|
usertiaozhuan(item){
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/myorder/usertion",
|
path: "/myorder/usertion",
|
||||||
|
@ -94,7 +94,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<div style="display:none">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -112,6 +114,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
util,
|
util,
|
||||||
|
h5payRedirectUrl:'',
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
paymentTimer:undefined,
|
paymentTimer:undefined,
|
||||||
isSucess: false,
|
isSucess: false,
|
||||||
@ -176,6 +179,7 @@ export default {
|
|||||||
goPayH5() {
|
goPayH5() {
|
||||||
let isMobile = this.util.isMobile();
|
let isMobile = this.util.isMobile();
|
||||||
if(this.userPayData.wxPay && 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"].action=this.userPayData.wxPay;
|
||||||
this.$refs["h5SubmitForm"].submit();
|
this.$refs["h5SubmitForm"].submit();
|
||||||
//window.location.href=this.userPayData.wxPay;;
|
//window.location.href=this.userPayData.wxPay;;
|
||||||
|
Loading…
Reference in New Issue
Block a user