mobileclient/paySuccess.html

127 lines
5.3 KiB
HTML
Raw Normal View History

2022-10-09 14:29:13 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover" />
<title>支付成功</title>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
charset="utf-8"></script>
<script type="text/javascript"
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322"></script>
2022-10-09 14:29:13 +08:00
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/modelPop.js"></script>
2022-10-09 14:29:13 +08:00
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/paySuccess.css" />
</head>
<body>
<div id="app">
<div class="content">
<img class="img" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/paySuccess.png"
alt="" />
2022-10-09 14:29:13 +08:00
<p class="success">支付成功</p>
<p class="bottom" v-if="orderInfo.type==2" @click="receiveFn">立即兑换</p>
<p class="note" v-if="orderInfo.type==2">也可在【订单列表】中查看并兑换</p>
2022-10-09 14:29:13 +08:00
</div>
<!-- 弹出提示 -->
<model-pop :show.sync="popAttr.show" :title="popAttr.title" :status="popAttr.status" :text="popAttr.text"
@backFunction="backFunctionPop"></model-pop>
2022-10-09 14:29:13 +08:00
</div>
<script>
new Vue({
el: "#app",
data() {
return {
orderNumber: '',
orderInfo: {},
popAttr: {
show: false,
title: '温馨提示',
status: 2,/*1 成功 2提示 3失败 */
text: '错误信息'
},
plaflam:1,
redirect_url:'' //微信小程序链接
};
2022-10-09 14:29:13 +08:00
},
components: {},
created() {
let orderNumber = this.getQueryString(
window.location.search,
"order_number"
);
this.orderNumber = orderNumber;
this.getOrderDetail(orderNumber);
},
methods: {
getQueryString(path, name) {
//获取浏览器地址栏的参数
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = path.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
},
//获取订单详情
getOrderDetail(id) {
req.axiosGet("/key/order/detail/" + id).then((res) => {
if (res.code == 200) {
this.orderInfo = res.data;
if(res.data.type==2){ //1 商品 2立减金
//channel 1支付宝 2微信
this.plaflam=res.data.goods.entity.channel;//只有立减金商品才有channel字段
}
}
}).catch();
},
//弹出框提示
openTipDialog(popUpAttr) {
this.popAttr = popUpAttr;
},
/* 弹框回调,点击按钮触发 */
backFunctionPop() {
},
toLinkAlipay() {
//支付宝H5跳转
let self = this;
let banklink = encodeURIComponent(
window.location.origin +
"/alipay.html?orderNumber=" + this.orderNumber
);
let link = "http://openapi.1688sup.com/alipay/oauth?jump=" + banklink;
let ua = navigator.userAgent.toLowerCase(); //判断用户打开链接环境
window.location.replace(link);
},
//领取立减金
receiveFn(){
let ua = navigator.userAgent.toLowerCase(); //判断用户打开链接环境
if (this.plaflam == 1) {
//支付宝-微信环境中不能唤起支付宝
this.toLinkAlipay();
}
if (this.plaflam == 2) {
//微信
if (ua.indexOf("dingtalk") > -1) {
//在钉钉内置环境打开,不能唤起微信小程序
this.openTipDialog({
show: true,
title: '温馨提示',
status: 2,/*1 成功 2提示 3失败 */
text: '请在其他浏览器打开'
});
} else {
//唤起微信福利官小程序
window.location.replace(this.redirect_url);
}
}
}
},
});
2022-10-09 14:29:13 +08:00
</script>
</body>
</html>