提交 9bd1045d 编写于 作者: 徐益明's avatar 徐益明

feat: 现金红包

上级 0edc7edb
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* 需引用ES5 * 需引用ES5
* GlobalWorkerOptions.workerSrc需要一个加载路径 * GlobalWorkerOptions.workerSrc需要一个加载路径
*/ */
import pdfJS from 'pdfjs-dist/es5/build/pdf'; // import pdfJS from 'pdfjs-dist/es5/build/pdf';
pdfJS.GlobalWorkerOptions.workerSrc = '//cdn.bootcdn.net/ajax/libs/pdf.js/2.4.456/pdf.worker.js'; pdfJS.GlobalWorkerOptions.workerSrc = '//cdn.bootcdn.net/ajax/libs/pdf.js/2.4.456/pdf.worker.js';
import coverImg from '@/images/course/lock-big.png'; import coverImg from '@/images/course/lock-big.png';
......
...@@ -100,7 +100,7 @@ router.beforeEach((to, from, next) => { ...@@ -100,7 +100,7 @@ router.beforeEach((to, from, next) => {
if (to.meta.title) { if (to.meta.title) {
document.title = to.meta.title document.title = to.meta.title
} }
next(); next();
}) })
......
...@@ -24,6 +24,7 @@ service.interceptors.request.use(config => { ...@@ -24,6 +24,7 @@ service.interceptors.request.use(config => {
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' }) config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
} }
config.headers.token = 'DB7F56CDC4C74C279C456B3953520326'
return config return config
}, error => { }, error => {
console.debug('service.interceptors.request: ', error) console.debug('service.interceptors.request: ', error)
...@@ -34,7 +35,7 @@ service.interceptors.request.use(config => { ...@@ -34,7 +35,7 @@ service.interceptors.request.use(config => {
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
const res = response.data const res = response.data
/* /*
baseUrl时,返回000000为成功 baseUrl时,返回000000为成功
apiUrl时,返回200为成功 apiUrl时,返回200为成功
*/ */
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</div> </div>
</van-pull-refresh> </van-pull-refresh>
</div> </div>
<coupon-tips :visible.sync="show" @close="close" /> <coupon-tips :view-value="selectedCoupon" :visible.sync="show" @close="close" />
</div> </div>
</section> </section>
</template> </template>
...@@ -86,9 +86,10 @@ export default { ...@@ -86,9 +86,10 @@ export default {
}, },
data() { data() {
return { return {
selectedCoupon:{},
couponList: [], couponList: [],
hasTips: true, hasTips: true,
show: false, show: true,
token: "", token: "",
couponToken: "", couponToken: "",
shareUrl: "", shareUrl: "",
...@@ -203,10 +204,12 @@ export default { ...@@ -203,10 +204,12 @@ export default {
.then((res) => { .then((res) => {
console.log(res, "receiveCoupon"); console.log(res, "receiveCoupon");
// couponType 1 满减 2 立减 todo 现金红包 // couponType 1 满减 2 立减 todo 现金红包
// if (item.couponType === 2) { // if (item.couponType == 4) {
// this.show = true; this.selectedCoupon = item;
console.log("this.selectedCoupon", this.selectedCoupon);
this.show = true;
// } else { // } else {
this.$toast("领取成功"); // this.$toast("领取成功");
// this.getSearchCoupons(); // this.getSearchCoupons();
// } // }
}) })
...@@ -229,7 +232,9 @@ export default { ...@@ -229,7 +232,9 @@ export default {
} }
console.log(this.show, item); console.log(this.show, item);
}, },
close() {}, close() {
},
goBack() { goBack() {
console.log("back"); console.log("back");
window.history.back(); window.history.back();
...@@ -263,7 +268,7 @@ export default { ...@@ -263,7 +268,7 @@ export default {
background-color: #fff; background-color: #fff;
} }
.page-content { .page-content {
height: 100%; height: 100%;
} }
.list { .list {
padding: 10px 12px 0 ; padding: 10px 12px 0 ;
...@@ -273,4 +278,4 @@ export default { ...@@ -273,4 +278,4 @@ export default {
padding-bottom: 50px; padding-bottom: 50px;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -30,6 +30,13 @@ ...@@ -30,6 +30,13 @@
> >
{{ couponDetail.requiredTotalFee / 100 }}可用 {{ couponDetail.requiredTotalFee / 100 }}可用
</div> </div>
<div v-if="couponDetail.couponType == 4" class="card-item-left-top">
<span :class="{ unit: true, opacity5: hasUsed }">¥</span>
<span :class="{ amount: true, opacity5: hasUsed }">{{ couponDetail.discountAmount / 100 }}</span>
</div>
<div v-if="couponDetail.couponType == 4" :class="['card-item-left-bottom', hasUsed ? 'cr-c1c1c1 ' : '']"
>现金红包</div
>
</div> </div>
<div <div
v-if="couponDetail.couponType == 3" v-if="couponDetail.couponType == 3"
...@@ -39,6 +46,7 @@ ...@@ -39,6 +46,7 @@
>{{ couponDetail.discountPercent }}</span >{{ couponDetail.discountPercent }}</span
> >
</div> </div>
</div> </div>
<div class="bar"> <div class="bar">
<div class="bar-top" /> <div class="bar-top" />
...@@ -116,7 +124,7 @@ ...@@ -116,7 +124,7 @@
</div> </div>
</div> </div>
<div <div
v-if="[0, 1, 4].includes(couponDetail.couponStatus)" v-if="[0, 1, 4].includes(couponDetail.couponStatus) && couponBtnShow"
class="use-coupon" class="use-coupon"
@click="goUse" @click="goUse"
> >
...@@ -241,6 +249,14 @@ export default { ...@@ -241,6 +249,14 @@ export default {
hasUsed() { hasUsed() {
return [3, 5, 6, 7, 8].includes(this.couponDetail.couponStatus); return [3, 5, 6, 7, 8].includes(this.couponDetail.couponStatus);
}, },
couponBtnShow() {
console.log('tag', this.$route.path)
if (this.$route.path === "/coupon-center") {
return true;
} else {
return this.couponDetail.couponType == 4 ? false : true;
}
},
}, },
methods: { methods: {
// 获取日期 // 获取日期
......
<template> <template>
<div> <div class="container">
<van-dialog <van-dialog
v-model="visible" v-model="visible"
class="coupon-dialog" class="coupon-dialog"
:show-confirm-button="false" :show-confirm-button="false"
> >
<div class="body"> <div class="content">
<div class="title"> <div class="title">
<div class="title-text"> <div class="title-text">
领取成功! 领取成功!
...@@ -50,45 +50,57 @@ ...@@ -50,45 +50,57 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
components: {}, components: {},
props: { props: {
tabsDetail: { tabsDetail: {
type: Array, type: Array,
default() { default() {
return []; return [];
},
},
visible: {
type: Boolean,
}, },
}, },
data() { visible: {
return { type: Boolean,
currentIndex: 0,
};
}, },
mounted() {}, viewValue: {
type: Object,
methods: { default() {
changeTab(index) { return {}
if (this.currentIndex === index) return; }
this.currentIndex = index; }
this.$emit('changeTab', this.currentIndex); },
}, data() {
close() { return {
this.$emit('update:visible', false); currentIndex: 0,
this.$emit('close', false); };
}, },
mounted() { },
computed: {
amountPrice() {
let price = this.viewValue.discountAmount / 100;
return Number.isNaN(price) ? "" : price;
},
},
methods: {
changeTab(index) {
if (this.currentIndex === index) return;
this.currentIndex = index;
this.$emit('changeTab', this.currentIndex);
},
close() {
this.$emit('update:visible', false);
this.$emit('close', false);
}, },
}; },
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.coupon-dialog{ .coupon-dialog{
/deep/ .van-dialog__content{ /deep/ .van-dialog__content{
height: 273px; height: 273px !important;
} }
.body { .content {
position: absolute;
height: 215px; height: 215px;
width: 295px; width: 295px;
background: url("https://files.yunqueyi.com/image/png/common/20240510112413239.png") background: url("https://files.yunqueyi.com/image/png/common/20240510112413239.png")
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册