uniapp微信公众号内支付微信点金计划商家小票支付成功页代码
uniapp微信公众号内支付微信点金计划商家小票支付成功页代码。
·
uniapp微信公众号内支付微信点金计划商家小票支付成功页代码
<template>
<view>
<view id="success">恭喜您,支付成功</view>
<view @tap="go">联系客服</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
onShow() {
},
mounted() {
// #ifdef H5
let initData = {
action: 'onIframeReady',
displayStyle: 'SHOW_CUSTOM_PAGE',
height: 960
}
let initPostData = JSON.stringify(initData)
parent.postMessage(initPostData, "*")
document.getElementById("success").onclick = function () {
var mchData = {
action: 'jumpOut',
jumpOutUrl: 'https://www.xxx.com' //跳转你想去的页面
}
var postData = JSON.stringify(mchData)
parent.postMessage(postData, "*")
}
const link = location.href
let sub_mch_id = this.getQueryString(link, "sub_mch_id"); //特约商户号
let out_trade_no = this.getQueryString(link, "out_trade_no"); //商户订单号
console.log("以下进入你的骚操作")
// #endif
},
methods: {
//获取URL参数
getQueryString(path,name){
const reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
if (reg.test(path)) {
return unescape(RegExp.$2.replace(/\+/g, " "));
}
return "";
}
//跳转
go() {
window.location.assign('https://www.xxx.com')
},
},
}
</script>
相关问题链接https://developers.weixin.qq.com/community/develop/article/doc/0002e816648fe0e42b2b4305a53c13
更多推荐
已为社区贡献5条内容
所有评论(0)