mobileclient/combiningAlipay.html

131 lines
4.4 KiB
HTML

<!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" />
<link rel="stylesheet" href="./combiningAlipay.css" />
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js?v=1000"></script>
</head>
<body>
<div id="app">
<div class="banner-box">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_img.png" alt=""
class="banner">
<p class="title">{{goods.title}}</p>
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_btn.png" alt=""
class="but" @click="toReceive">
</div>
<div class="content">
<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>
<div class="explain">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_title.png"
alt="" class="title-img">
<div class="explain-box">
<img v-if="goods.group_info.instructionType==2" :src="goods.group_info.group_image" alt=""
class="group_image">
<div v-else v-html="goods.group_info.instruction" class="instruction"></div>
</div>
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/reduce/zfb_combining_bottom.png"
alt="" class="title-img mt-1">
</div>
</div>
</div>
</body>
<script>
new Vue({
el: "#app",
data() {
return {
openId: "+UfCzEgd0h2Psj245UmcyHfW6QW0msZIAxO6RJBZ7Hk=",
goods: '',
loading: false,
};
},
created() {
//唤起支付宝授权,打开领取
this.openId = this.getQueryString(
window.location.search,
"alipayuserid"
);
this.code_batch_id = this.getQueryString(
window.location.search,
"codeBatchId"
);
this.token = this.getQueryString(
window.location.search,
"token"
);
this.getProductDetail();
},
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;
},
//获取商品详情
getProductDetail(isNext, message = '') {
req.axiosGet('/key/group/groupProductDetail', {
token: this.token,
code_batch_id: this.code_batch_id,
}).then(res => {
if (res.code == 200) {
this.goods = res.data;
if (isNext) {
window.location.href = './advise.html';
sessionStorage.setItem('messageTip', message);
}
}
}).catch();
},
//领取立减金
toReceive() {
let data = {
token: this.token,
channel_user_id: this.openId, // "渠道用户id"
code_batch_id: this.code_batch_id,
};
if (this.loading) return;
this.loading = true;
req.axiosPost("/voucher/groupVoucherGrant", data)
.then((res) => {
const clr = setTimeout(() => {
this.loading = false;
clearTimeout(clr);
}, 2000);
const text = res.code == 200 ? '' : res.message;
this.getProductDetail(true, text);
})
.catch((err) => { });
},
}
});
</script>
</html>