vue2 支付宝 网页支付 返回form 表单的解决
.then(res => { if(res.status === 20000 && this.form.type == 2){ //返回参数 let routerData = this.$ router.resolve({path:'/ finance / applyTex
.then(res => {
if(res.status === 20000 && this.form.type == 2){
//返回参数
let routerData = this.$ router.resolve({path:'/ finance / applyText',query:{htmls:res.data.result}})
this.htmls = res.data.result
//打开新页面
window.open(routerData.href,'_ blank')
const div = document.createElement('div');
div.innerHTML = htmls;
document.body.appendChild(div);
document.forms [0] .submit();
}
})
新的vue页面代码applyText.vue
<template>
<div v-html =“apply”>
{{apply}}
</ div>
</ template>
<script>
export default {
name:“applyText”,
data(){
return {
apply:''
}
} ,
mounted(){
let form = this。$ route.query.htmls
this.apply = form;
this.$ nextTick(()=> {
document.forms [0] .submit()
})
}
}
</ script>
<style scoped>
</ style>
更多推荐
所有评论(0)