提交 f7c90bbd 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

Merge branch 'feature/xym' into 'release'

Feature/xym

See merge request !10
...@@ -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();
}) })
......
...@@ -34,7 +34,7 @@ service.interceptors.request.use(config => { ...@@ -34,7 +34,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,6 +86,7 @@ export default { ...@@ -86,6 +86,7 @@ export default {
}, },
data() { data() {
return { return {
selectedCoupon:{},
couponList: [], couponList: [],
hasTips: true, hasTips: true,
show: false, show: false,
...@@ -203,12 +204,14 @@ export default { ...@@ -203,12 +204,14 @@ 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;
// } else { console.log("this.selectedCoupon", this.selectedCoupon);
this.show = true;
} else {
this.$toast("领取成功"); this.$toast("领取成功");
// this.getSearchCoupons(); // this.getSearchCoupons();
// } }
}) })
.catch((err) => { .catch((err) => {
this.$set(this.couponList[index], "hasDown", false); this.$set(this.couponList[index], "hasDown", false);
...@@ -229,7 +232,9 @@ export default { ...@@ -229,7 +232,9 @@ export default {
} }
console.log(this.show, item); console.log(this.show, item);
}, },
close() {}, close() {
this.getSearchCoupons();
},
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: {
// 获取日期 // 获取日期
...@@ -270,7 +286,7 @@ export default { ...@@ -270,7 +286,7 @@ export default {
if ( if (
this.$route.path == "/coupon-center" && this.$route.path == "/coupon-center" &&
this.couponDetail.couponStatus == 0 && this.couponDetail.couponStatus == 0 &&
!this.hasDown !this.hasDown && this.couponDetail.couponType != 4
) { ) {
this.$emit("update:hasDown", !this.hasDown); this.$emit("update:hasDown", !this.hasDown);
} }
......
<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">
领取成功! 领取成功!
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="card-item-left shadow"> <div class="card-item-left shadow">
<div class="card-item-left-top"> <div class="card-item-left-top">
<span class="unit">¥</span> <span class="amount"> <span class="unit">¥</span> <span class="amount">
20 {{ amountPrice }}
</span> </span>
</div> </div>
<div class="card-item-left-bottom"> <div class="card-item-left-bottom">
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
<div class="card-item-right flex shadow"> <div class="card-item-right flex shadow">
<div class="card-item-right-center"> <div class="card-item-right-center">
<div class="right-coupon"> <div class="right-coupon">
可至「云鹊医App-个人中心-账户余额」中提现 可至「云鹊医App/小程序-个人中心-账户余额」中提现
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="card-bottom"> <div @click="navigateToWithdraw" class="card-bottom">
<span class="card-text"> 去提现 </span> <span class="card-text"> 去提现 </span>
</div> </div>
</div> </div>
...@@ -50,47 +50,65 @@ ...@@ -50,47 +50,65 @@
</div> </div>
</template> </template>
<script> <script>
export default { import { getWebPageUrl } from "@/utils";
components: {},
props: { export default {
tabsDetail: { components: {},
type: Array, props: {
default() { tabsDetail: {
return []; type: Array,
}, default() {
}, 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);
}, },
}; navigateToWithdraw() {
let webUrl = getWebPageUrl(`mall/banlance-detail?type=1`);
location.replace(webUrl);
return
}
},
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.coupon-dialog{ .coupon-dialog{
/deep/ .van-dialog__content{ height: auto !important;
height: 273px; overflow: visible !important;
} .content {
.body { position: absolute;
height: 215px; // height: 215px;
width: 295px; width: 290px;
background: url("https://files.yunqueyi.com/image/png/common/20240510112413239.png") background: url("https://files.yunqueyi.com/image/png/common/20240510112413239.png")
no-repeat; no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
...@@ -99,13 +117,14 @@ ...@@ -99,13 +117,14 @@
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
top: 50%; top: 50%;
box-sizing: content-box;
padding: 28px 24px 30px; padding: 28px 24px 30px;
.title { .title {
position: relative; position: relative;
margin-bottom: 25px; margin-bottom: 25px;
&-text { &-text {
font-weight: 600; font-weight: bold;
font-size: 28px; font-size: 28px;
color: #812603; color: #812603;
line-height: 28px; line-height: 28px;
...@@ -121,9 +140,9 @@ ...@@ -121,9 +140,9 @@
.card-item { .card-item {
margin-bottom: 10px; margin-bottom: 10px;
&-left { &-left {
width: 119px; width: 117px;
&-top { &-top {
font-weight: 600; font-weight: bold;
font-size: 33px; font-size: 33px;
color: #fff; color: #fff;
line-height: 33px; line-height: 33px;
...@@ -133,13 +152,13 @@ ...@@ -133,13 +152,13 @@
align-items: baseline; align-items: baseline;
justify-content: center; justify-content: center;
.unit { .unit {
font-weight: 600; font-weight: bold;
font-size: 15px; font-size: 15px;
color: #fff; color: #fff;
line-height: 15px; line-height: 15px;
} }
.amount { .amount {
font-weight: 600; font-weight: bold;
font-size: 33px; font-size: 33px;
color: #fff; color: #fff;
line-height: 33px; line-height: 33px;
...@@ -193,8 +212,8 @@ ...@@ -193,8 +212,8 @@
padding: 0 14px; padding: 0 14px;
height: 100px; height: 100px;
.right-coupon { .right-coupon {
font-weight: 600; font-weight: bold;
font-size: 13px; font-size: 11px;
color: #fff; color: #fff;
line-height: 15px; line-height: 15px;
padding-top: 31px; padding-top: 31px;
...@@ -219,7 +238,7 @@ ...@@ -219,7 +238,7 @@
no-repeat; no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
.card-text { .card-text {
font-weight: 600; font-weight: bold;
font-size: 16px; font-size: 16px;
color: #ffffff; color: #ffffff;
line-height: 19px; line-height: 19px;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册