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

修改样式

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