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

feat: 现金红包

上级 0edc7edb
......@@ -14,7 +14,7 @@
* 需引用ES5
* 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';
import coverImg from '@/images/course/lock-big.png';
......
......@@ -100,7 +100,7 @@ router.beforeEach((to, from, next) => {
if (to.meta.title) {
document.title = to.meta.title
}
next();
})
......
......@@ -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.token = 'DB7F56CDC4C74C279C456B3953520326'
return config
}, error => {
console.debug('service.interceptors.request: ', error)
......@@ -34,7 +35,7 @@ service.interceptors.request.use(config => {
service.interceptors.response.use(
response => {
const res = response.data
/*
/*
baseUrl时,返回000000为成功
apiUrl时,返回200为成功
*/
......
......@@ -62,7 +62,7 @@
</div>
</van-pull-refresh>
</div>
<coupon-tips :visible.sync="show" @close="close" />
<coupon-tips :view-value="selectedCoupon" :visible.sync="show" @close="close" />
</div>
</section>
</template>
......@@ -86,9 +86,10 @@ export default {
},
data() {
return {
selectedCoupon:{},
couponList: [],
hasTips: true,
show: false,
show: true,
token: "",
couponToken: "",
shareUrl: "",
......@@ -203,10 +204,12 @@ export default {
.then((res) => {
console.log(res, "receiveCoupon");
// couponType 1 满减 2 立减 todo 现金红包
// if (item.couponType === 2) {
// this.show = true;
// if (item.couponType == 4) {
this.selectedCoupon = item;
console.log("this.selectedCoupon", this.selectedCoupon);
this.show = true;
// } else {
this.$toast("领取成功");
// this.$toast("领取成功");
// this.getSearchCoupons();
// }
})
......@@ -229,7 +232,9 @@ export default {
}
console.log(this.show, item);
},
close() {},
close() {
},
goBack() {
console.log("back");
window.history.back();
......@@ -263,7 +268,7 @@ export default {
background-color: #fff;
}
.page-content {
height: 100%;
height: 100%;
}
.list {
padding: 10px 12px 0 ;
......@@ -273,4 +278,4 @@ export default {
padding-bottom: 50px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -30,6 +30,13 @@
>
{{ couponDetail.requiredTotalFee / 100 }}可用
</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
v-if="couponDetail.couponType == 3"
......@@ -39,6 +46,7 @@
>{{ couponDetail.discountPercent }}</span
>
</div>
</div>
<div class="bar">
<div class="bar-top" />
......@@ -116,7 +124,7 @@
</div>
</div>
<div
v-if="[0, 1, 4].includes(couponDetail.couponStatus)"
v-if="[0, 1, 4].includes(couponDetail.couponStatus) && couponBtnShow"
class="use-coupon"
@click="goUse"
>
......@@ -241,6 +249,14 @@ export default {
hasUsed() {
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: {
// 获取日期
......
<template>
<div>
<div class="container">
<van-dialog
v-model="visible"
class="coupon-dialog"
:show-confirm-button="false"
>
<div class="body">
<div class="content">
<div class="title">
<div class="title-text">
领取成功!
......@@ -50,45 +50,57 @@
</div>
</template>
<script>
export default {
components: {},
props: {
tabsDetail: {
type: Array,
default() {
return [];
},
},
visible: {
type: Boolean,
export default {
components: {},
props: {
tabsDetail: {
type: Array,
default() {
return [];
},
},
data() {
return {
currentIndex: 0,
};
visible: {
type: Boolean,
},
mounted() {},
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);
},
viewValue: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
currentIndex: 0,
};
},
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>
<style scoped lang="less">
.coupon-dialog{
.coupon-dialog{
/deep/ .van-dialog__content{
height: 273px;
height: 273px !important;
}
.body {
.content {
position: absolute;
height: 215px;
width: 295px;
background: url("https://files.yunqueyi.com/image/png/common/20240510112413239.png")
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册