parent
6cee744ec1
commit
315dec741f
@ -1,9 +1,54 @@
|
|||||||
<template>
|
<template>
|
||||||
<van-cell-group>
|
<div>
|
||||||
<van-cell title="单元格" value="内容" />
|
<van-cell-group>
|
||||||
<van-cell title="单元格" value="内容" label="描述信息" />
|
<van-cell title="优惠劵编号" :value="couponTemplate.id" />
|
||||||
</van-cell-group>
|
<van-cell title="优惠劵名" :value="couponTemplate.title"/>
|
||||||
|
</van-cell-group>
|
||||||
|
<van-button slot="button" size="small" type="primary" @click="onFetchClick">领取优惠劵</van-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getCouponTemplate, doAddCouponCard } from '../../api/promotion';
|
||||||
|
import { Dialog } from 'vant';
|
||||||
|
import { setLoginToken } from '../../utils/cache';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
couponTemplate: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
let id = this.$route.query.id;
|
||||||
|
let response = getCouponTemplate(id);
|
||||||
|
response.then(data => {
|
||||||
|
this.couponTemplate = data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onFetchClick: function () {
|
||||||
|
let that = this;
|
||||||
|
let id = this.$route.query.id;
|
||||||
|
let response = doAddCouponCard(id);
|
||||||
|
response.then(data => {
|
||||||
|
Dialog.alert({
|
||||||
|
title: '系统提示',
|
||||||
|
message: '领取成功',
|
||||||
|
beforeClose: function (action, done) {
|
||||||
|
// 关闭弹窗
|
||||||
|
done();
|
||||||
|
// 跳转到我的优惠劵
|
||||||
|
that.$router.push('/user/coupon');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in new issue