| | |
| | | money: '', |
| | | remark: '', |
| | | userId:'' |
| | | } |
| | | }, |
| | | loading:false |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.loading=false |
| | | this.form.userId = this.fetchParams("userId",window.location.href) |
| | | }, |
| | | methods: { |
| | |
| | | return decodeURIComponent(results[2].replace(/\+/g, ' ')); |
| | | }, |
| | | async sendSave() { |
| | | if(this.loading){ |
| | | return |
| | | } |
| | | this.loading=true |
| | | var that = this |
| | | if(!this.form.name){ |
| | | uni.showToast({ |
| | | 'title': '请输入姓名',icon:'none' |
| | | }) |
| | | this.loading=false |
| | | return |
| | | } |
| | | if(!this.form.phone){ |
| | | uni.showToast({ |
| | | 'title': '请输入手机号',icon:'none' |
| | | }) |
| | | this.loading=false |
| | | return |
| | | } |
| | | if(!this.form.money || this.form.money < 0.01){ |
| | |
| | | return |
| | | } |
| | | let res = await this.$u.api.orderCreate(this.form) |
| | | if (res.code === 200) { |
| | | if (res && res.code === 200) { |
| | | const url = res.data.url |
| | | // axios.post('https://third-party-website.com/api/submit', this.formData, { |
| | | // headers: { 'Content-Type': 'application/json' } // 根据需要添加其他头部信息,如认证令牌等。 |
| | | // }) |
| | | // axios.post(res.data.url, res.data.params); |
| | | // const resolve = this.$router.push(url,params); |
| | | // window.open(resolve.href, "_blank") |
| | | console.log(res) |
| | | const elements = document.querySelectorAll('form'); |
| | | if(elements&& elements.length){ |
| | | elements.forEach(element => { |
| | | element.remove(); |
| | | }) |
| | | } |
| | | uni.showToast({title:'发起支付中'}) |
| | | var demo_form = document.createElement("form"); |
| | | demo_form.action = url; |
| | | demo_form.id = "tempFromId"; |
| | |
| | | } |
| | | } |
| | | document.body.appendChild(demo_form) |
| | | uni.showToast({ |
| | | 'title': '特挑剔',icon:'none' |
| | | }) |
| | | demo_form.submit() |
| | | |
| | | // this.toSuccess() |
| | | } |
| | | this.loading=false |
| | | }, |
| | | } |
| | | } |