mobileclient/combiningAlipay.html

131 lines
4.3 KiB
HTML
Raw Normal View History

2024-02-24 19:17:51 +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>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/js/swiper.min.js"></script>
<link href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/css/swiper.min.css" rel="stylesheet" />
2024-02-29 16:14:15 +08:00
<link rel="stylesheet" href="./combiningAlipay.css" />
2024-03-18 16:31:59 +08:00
<script src="./api2_0.js"></script>
2024-02-24 19:17:51 +08:00
</head>
<body>
2024-02-29 16:14:15 +08:00
<div id="app">
<div class="banner-box">
2024-02-29 16:41:09 +08:00
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_img.png" alt=""
class="banner">
2024-02-29 16:14:15 +08:00
<p class="title">{{goods.title}}</p>
2024-02-29 16:41:09 +08:00
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_btn.png" alt=""
class="but" @click="toReceive">
2024-02-24 19:17:51 +08:00
</div>
2024-02-29 16:14:15 +08:00
<div class="content">
2024-02-29 16:42:35 +08:00
<p class="time">
生效时间:{{goods.group_info.time_limit.effect_time.start_time}} ~
{{goods.group_info.time_limit.effect_time.end_time}}
</p>
<p class="time" v-if="goods.group_info.time_limit.receive_time.start_time">
领取时间:{{goods.group_info.time_limit.receive_time.start_time}} ~
{{goods.group_info.time_limit.receive_time.end_time}}
</p>
2024-02-29 16:14:15 +08:00
<div class="explain">
2024-02-29 16:41:09 +08:00
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_title.png"
alt="" class="title-img">
2024-02-29 16:14:15 +08:00
<div class="explain-box">
2024-03-02 02:34:16 +08:00
<img v-if="goods.group_info.instructionType==2" :src="goods.group_info.group_image" alt=""
class="group_image">
2024-02-29 16:14:15 +08:00
<div v-else v-html="goods.group_info.instruction" class="instruction"></div>
2024-02-24 19:17:51 +08:00
</div>
2024-02-29 16:41:09 +08:00
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_bottom.png"
alt="" class="title-img mt-1">
2024-02-24 19:17:51 +08:00
</div>
</div>
</div>
</body>
<script>
new Vue({
2024-02-29 16:14:15 +08:00
el: "#app",
2024-02-24 19:17:51 +08:00
data () {
return {
openId: "+UfCzEgd0h2Psj245UmcyHfW6QW0msZIAxO6RJBZ7Hk=",
2024-02-29 16:14:15 +08:00
goods: '',
loading: false,
2024-02-24 19:17:51 +08:00
};
},
2024-02-29 16:14:15 +08:00
2024-02-24 19:17:51 +08:00
created () {
//唤起支付宝授权,打开领取
this.openId = this.getQueryString(
window.location.search,
"alipayuserid"
);
2024-02-29 16:14:15 +08:00
2024-02-24 19:17:51 +08:00
this.code_batch_id = this.getQueryString(
window.location.search,
"codeBatchId"
);
2024-02-29 16:14:15 +08:00
2024-02-24 19:17:51 +08:00
this.token = this.getQueryString(
window.location.search,
"token"
);
this.getProductDetail();
},
2024-02-29 16:14:15 +08:00
2024-02-24 19:17:51 +08:00
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;
},
//获取商品详情
2024-02-29 16:14:15 +08:00
getProductDetail (isNext, message = '') {
2024-02-24 19:17:51 +08:00
req.axiosGet('/key/group/groupProductDetail', {
token: this.token,
code_batch_id: this.code_batch_id,
}).then(res => {
if (res.code == 200) {
2024-02-29 16:14:15 +08:00
this.goods = res.data;
if (isNext) {
window.location.href = './advise.html';
sessionStorage.setItem('messageTip', message);
}
2024-02-24 19:17:51 +08:00
}
}).catch();
},
//领取立减金
toReceive () {
let data = {
token: this.token,
channel_user_id: this.openId, // "渠道用户id"
code_batch_id: this.code_batch_id,
};
2024-02-29 16:14:15 +08:00
if (this.loading) return;
this.loading = true;
2024-02-24 19:17:51 +08:00
req.axiosPost("/voucher/groupVoucherGrant", data)
.then((res) => {
2024-02-29 16:14:15 +08:00
const clr = setTimeout(() => {
this.loading = false;
clearTimeout(clr);
2024-02-24 19:17:51 +08:00
}, 2000);
2024-02-29 16:53:10 +08:00
const text = res.code == 200 ? '' : res.message;
this.getProductDetail(true, text);
2024-02-24 19:17:51 +08:00
})
.catch((err) => { });
},
}
});
</script>
</html>