提交 ea0776fd 编写于 作者: jingqi.liu's avatar jingqi.liu

修改样式

上级 7b5b4803
......@@ -26,7 +26,7 @@
</CommonNavbar>
<div class="page-content">
<van-pull-refresh
style="height: 100%;overflow:auto"
style="height: 100%; overflow: auto"
v-model="refreshing"
@refresh="onRefresh"
class="refresh-list"
......@@ -48,6 +48,7 @@
:coupon-detail="item"
:show-tips.sync="item.showTips"
:has-tips="hasTips"
:has-down.sync="item.hasDown"
:has-stock="false"
@goUse="chooseCoupon"
/>
......@@ -178,6 +179,7 @@ export default {
this.POST(`trade/coupon/app/searchCoupons`, {}).then((res) => {
res.data.baseCouponModelList.forEach((item) => {
item.showTips = false;
item.hasDown = false;
});
this.couponList = JSON.parse(
JSON.stringify(res.data.baseCouponModelList)
......@@ -193,7 +195,8 @@ export default {
this.POST(
`/trade/coupon/app/receive/${item.couponId}/${item.grantConfigId}`,
{}
).then((res) => {
)
.then((res) => {
console.log(res, "receiveCoupon");
// couponType 1 满减 2 立减 todo 现金红包
// if (item.couponType === 2) {
......@@ -202,6 +205,11 @@ export default {
this.$toast("领取成功");
// this.getSearchCoupons();
// }
})
.catch((err) => {
item.hasDown = false;
this.$toast(err.message);
console.log("err", err);
});
break;
......@@ -209,7 +217,8 @@ export default {
// uni.switchTab({
// url: "/pages/home/index",
// });
rocNative.goBack();
let webUrl = getWebPageUrl(`consultationHome?from=exam`);
location.replace(webUrl);
break;
default:
break;
......
......@@ -131,6 +131,7 @@
</div>
</template>
<script>
import { getWebPageUrl, getHactiveUrl } from "@/utils";
export default {
options: {},
props: {
......@@ -152,6 +153,12 @@ export default {
return true;
},
},
hasDown: {
type: Boolean,
default() {
return false;
},
},
hasStock: {
type: Boolean,
default() {
......@@ -205,7 +212,6 @@ export default {
label: "已失效",
},
},
hasDown: false,
};
},
computed: {
......@@ -232,9 +238,18 @@ export default {
this.$emit("update:showTips", !this.showTips);
},
goUse() {
console.log(this.$route);
if (this.$route.path == "/coupon-center") {
this.hasDown = true;
console.log(this.$route, this.hasDown);
if (this.hasDown) {
let webUrl = getWebPageUrl(`consultationHome?from=exam`);
location.replace(webUrl);
return;
}
if (
this.$route.path == "/coupon-center" &&
this.couponDetail.couponStatus == 0 &&
!this.hasDown
) {
this.$emit("update:hasDown", !this.hasDown);
}
this.$emit("goUse", this.couponDetail);
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册