✨ feat: 对接支付宝H5立减金、红包接口
This commit is contained in:
parent
253878afba
commit
62de2ed128
17
alipay.html
17
alipay.html
|
@ -76,7 +76,7 @@
|
|||
<script>
|
||||
new Vue({
|
||||
el: "#alipay",
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
explain: `1.在活动期间,每名用户仅可参与一次活动并享受一次赠礼。请注意:【(a)如用户在参与活动前已经是亚朵酒店金卡及以上级别会员,该用户无法领取亚朵酒店会员权益赠礼,权益不叠加;(b)喜马拉雅会员叠加上限为10年;(c)QQ音乐会员叠加上限为120个月。】如用户合作平台会员叠加(含本次活动领取时长)达到上限时间,用户将无法(完整)领取该合作平台赠礼,因此无法领取的赠礼不做补发;购买前请您确认您在合作平台会员有效期情况。
|
||||
2.活动期间,开通/续费严选Pro会员年卡后,赠礼将发放至“联合会员领取页面”,可前往一键领取(赠礼仅支持领取到同一手机号);如遇到网络问题等原因,可能会存在延迟到账的情况,请在24小时内查看到账情况。
|
||||
|
@ -96,7 +96,7 @@
|
|||
disabledBtn: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
//唤起支付宝授权,打开领取
|
||||
this.openId = this.getQueryString(
|
||||
window.location.search,
|
||||
|
@ -110,7 +110,7 @@
|
|||
this.getOrderDetail(this.orderNumber);
|
||||
},
|
||||
methods: {
|
||||
getQueryString(path, name) {
|
||||
getQueryString (path, name) {
|
||||
//获取浏览器地址栏的参数
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = path.substr(1).match(reg);
|
||||
|
@ -118,7 +118,7 @@
|
|||
return null;
|
||||
},
|
||||
//获取订单详情
|
||||
getOrderDetail(id, isNext = false, message = '') {
|
||||
getOrderDetail (id, isNext = false, message = '') {
|
||||
req.axiosGet('/voucher/info', {
|
||||
order_number: id
|
||||
}).then(res => {
|
||||
|
@ -131,13 +131,14 @@
|
|||
}
|
||||
}).catch();
|
||||
},
|
||||
toReceive() {
|
||||
toReceive () {
|
||||
let self = this;
|
||||
//领取立减金
|
||||
let data = {
|
||||
order_number: this.orderNumber,
|
||||
channel: "1", //立减金发放渠道,1:支付宝;2:微信小程序
|
||||
channel_user_id: this.openId, // "渠道用户id"
|
||||
receive_mode: 1,
|
||||
};
|
||||
if (this.disabledBtn) {
|
||||
return;
|
||||
|
@ -154,19 +155,19 @@
|
|||
.catch((err) => { });
|
||||
},
|
||||
//提示弹出框
|
||||
openDialog(tip) {
|
||||
openDialog (tip) {
|
||||
this.maskshow = true;
|
||||
this.tiptext = tip;
|
||||
this.popboxshow = true;
|
||||
},
|
||||
knowFn() {
|
||||
knowFn () {
|
||||
this.maskshow = false;
|
||||
this.tiptext = '';
|
||||
this.popboxshow = false;
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
statusFn(val) {
|
||||
statusFn (val) {
|
||||
switch (val) {
|
||||
case 0:
|
||||
return '立即领取';
|
||||
|
|
|
@ -194,6 +194,7 @@
|
|||
order_number: order_number,
|
||||
channel: "3", //立减金发放渠道,1:支付宝;2:微信 3:云闪付
|
||||
channel_user_id: this.account,
|
||||
receive_mode: 1,
|
||||
};
|
||||
req.axiosPost("/voucher/grant", params)
|
||||
.then(({ code, message }) => {
|
||||
|
|
|
@ -307,7 +307,7 @@ body {
|
|||
|
||||
.type {
|
||||
font-size: 0.1rem;
|
||||
background-color: rgb(65, 139, 224);
|
||||
background-color: rgb(244, 52, 43);
|
||||
border-radius: 0.2rem;
|
||||
padding: 0.03rem 0.15rem;
|
||||
display: inline-block;
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
goods_id: this.goods.entity.goods_id,
|
||||
code_batch_id: this.goods.code_batch_id,
|
||||
token: localStorage.getItem("token"),
|
||||
account: this.account
|
||||
account: this.form.receive_account
|
||||
};
|
||||
/* 创建订单 */
|
||||
req.axiosPost("/key/usage", data)
|
||||
|
@ -190,7 +190,9 @@
|
|||
let params = {
|
||||
order_number: order_number,
|
||||
channel: "3", //立减金发放渠道,1:支付宝;2:微信 3:云闪付
|
||||
channel_user_id: this.account,
|
||||
receive_mode: 2, /* 领取方式 1:支付宝 2:H5 */
|
||||
channel_user_id: this.form.receive_account,
|
||||
real_name: this.form.receive_name,
|
||||
};
|
||||
req.axiosPost("/voucher/grant", params)
|
||||
.then(({ code, message }) => {
|
||||
|
|
Loading…
Reference in New Issue