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

修改样式

上级 9c223d16
...@@ -3,22 +3,8 @@ ...@@ -3,22 +3,8 @@
class="coupon-list-wrapper" class="coupon-list-wrapper"
:class="{ 'no-pt': isWeb, 'pt-88': isWeb }" :class="{ 'no-pt': isWeb, 'pt-88': isWeb }"
> >
<div class="page-wrapper"> <h1>优惠券列表</h1>
<!-- <common-header <!-- <div class="page-wrapper">
:bg-color="bgColor"
title="我的优惠券"
:is-black="true"
:is-fixheader="true"
:is-hundred-height="true"
>
<div slot="tabs" class="tabs">
<tabs-comp
:tabs-detail="tabs"
:default-index="activeIndex"
@changeTab="changeTab"
/>
</div>
</common-header> -->
<div class="page-content"> <div class="page-content">
<CommonNavbar <CommonNavbar
:isWeb="isWeb" :isWeb="isWeb"
...@@ -53,199 +39,196 @@ ...@@ -53,199 +39,196 @@
</div> </div>
</div> </div>
<coupon-bottom /> <coupon-bottom />
</div> </div> -->
</section> </section>
</template> </template>
<script> <script>
// https://dev-sc.yunqueyi.com/trade/coupon/swagger-ui.html#/app-coupon-controller/receiveCouponsUsingPOST // https://dev-sc.yunqueyi.com/trade/coupon/swagger-ui.html#/app-coupon-controller/receiveCouponsUsingPOST
// https://bq2ptvur1gb.feishu.cn/wiki/DpUfwKfhxiVYE4kbK8Pcj0F6nvf // https://bq2ptvur1gb.feishu.cn/wiki/DpUfwKfhxiVYE4kbK8Pcj0F6nvf
import CoupoItem from "./components/coupon-item.vue"; // import CoupoItem from "./components/coupon-item.vue";
import TabsComp from "./components/tabs.vue"; // import TabsComp from "./components/tabs.vue";
import CommonNavbar from "@/components/common/common-navbar"; // import CommonNavbar from "@/components/common/common-navbar";
// import CommonHeader from "@/components/common/header"; // import CouponBottom from "./components/coupon-bottom.vue";
import CouponBottom from "./components/coupon-bottom.vue"; // import empty from "./components/empty.vue";
import empty from "./components/empty.vue"; // import { getWebPageUrl, getHactiveUrl } from "@/utils";
import { getWebPageUrl, getHactiveUrl } from "@/utils"; // import { mapGetters, mapActions } from "vuex";
import { mapGetters, mapActions } from "vuex"; // import { Toast } from "vant";
import { Toast } from "vant"; // import { setCookie, getCookie, delCookie } from "@/utils/index";
import { setCookie, getCookie, delCookie } from "@/utils/index"; // export default {
// import { getMyCouponsList } from '@/api/coupon.js'; // components: {
export default { // CoupoItem,
components: { // TabsComp,
CoupoItem, // empty,
TabsComp, // CouponBottom,
empty, // CommonNavbar,
CouponBottom, // },
CommonNavbar, // data() {
// CommonHeader, // return {
}, // bgColor: "#fff",
data() { // token: "",
return { // couponToken: "",
bgColor: "#fff", // shareUrl: "",
token: "", // isWeb: window.__isWeb,
couponToken: "", // isShowNavbar: true,
shareUrl: "", // navTitle: "我的优惠券",
isWeb: window.__isWeb, // isFixNavbar: true,
isShowNavbar: true, // paddingbtm: 0,
navTitle: "我的优惠券", // isInMergeDetail: false,
isFixNavbar: true, // tabs: [
paddingbtm: 0, // {
isInMergeDetail: false, // title: "已领取",
tabs: [ // status: 2,
{ // },
title: "已领取", // {
status: 2, // title: "已使用",
}, // status: 6,
{ // },
title: "已使用", // {
status: 6, // title: "已过期",
}, // status: 5,
{ // },
title: "已过期", // ],
status: 5, // pageTitle: "我的优惠券",
}, // currentIndex: 0,
], // couponList: [],
pageTitle: "我的优惠券", // activeIndex: 0,
currentIndex: 0, // };
couponList: [], // },
activeIndex: 0, // computed: {
}; // ...mapGetters(["webUserInfo"]),
}, // },
computed: { // created() {
...mapGetters(["webUserInfo"]), // let _this = this;
}, // let href = location.href;
created() { // this.fromPage = this.$route.query.fromPage || "";
let _this = this; // this.couponToken = this.$route.query.couponToken || "";
let href = location.href;
this.fromPage = this.$route.query.fromPage || "";
this.couponToken = this.$route.query.couponToken || "";
this.shareUrl = getWebPageUrl(`profexam/#/coupon-list`); // this.shareUrl = getWebPageUrl(`profexam/#/coupon-list`);
if (href.indexOf("singlemessage") >= 0 || href.indexOf("wx_code") >= 0) { // if (href.indexOf("singlemessage") >= 0 || href.indexOf("wx_code") >= 0) {
location.replace(this.shareUrl); // location.replace(this.shareUrl);
} // }
localStorage.setItem("returnUrl", this.shareUrl); // localStorage.setItem("returnUrl", this.shareUrl);
if (this.fromPage) { // if (this.fromPage) {
this.$sendBuriedData({ // this.$sendBuriedData({
component_tag: `506#50601`, // component_tag: `506#50601`,
}); // });
} // }
window.__getUserInfo4CouponList = function (param) { // window.__getUserInfo4CouponList = function (param) {
console.log("__getUserInfo4CouponList", param); // console.log("__getUserInfo4CouponList", param);
_this.token = param.userToken; // _this.token = param.userToken;
_this.setUserInfo(param); // _this.setUserInfo(param);
_this.getMyCouponsList(); // _this.getMyCouponsList();
}; // };
window.__refresh = function () { // window.__refresh = function () {
_this.getUserInfo(); // _this.getUserInfo();
}; // };
}, // },
mounted() { // mounted() {
// 如果在浏览器或微信里 // // 如果在浏览器或微信里
if (this.isWeb) { // if (this.isWeb) {
const { token, info } = this.$store.state.user; // const { token, info } = this.$store.state.user;
this.token = // this.token =
token || // token ||
this.couponToken || // this.couponToken ||
localStorage.getItem("couponToken") || // localStorage.getItem("couponToken") ||
getCookie("couponToken"); // getCookie("couponToken");
if (this.token && !info.id) { // if (this.token && !info.id) {
console.log("4444 this.token", this.token); // console.log("4444 this.token", this.token);
// this.$store.dispatch('setToken', this.token); // // this.$store.dispatch('setToken', this.token);
this.commonCheckToken(() => { // this.commonCheckToken(() => {
this.$store.dispatch("setToken", this.token); // this.$store.dispatch("setToken", this.token);
// this.$store.dispatch("getUserInfo"); // // this.$store.dispatch("getUserInfo");
}); // });
} // }
// 从登陆页面过来的 // // 从登陆页面过来的
this.getMyCouponsList(); // this.getMyCouponsList();
} else { // } else {
this.getUserInfo(); // this.getUserInfo();
} // }
}, // },
methods: { // methods: {
...mapActions(["setUserInfo"]), // ...mapActions(["setUserInfo"]),
//获取用户信息 // //获取用户信息
getUserInfo() { // getUserInfo() {
rocNative.getUserInfo({ // rocNative.getUserInfo({
__funcName: "__getUserInfo4CouponList", // __funcName: "__getUserInfo4CouponList",
}); // });
}, // },
getMyCouponsList() { // getMyCouponsList() {
this.commonCheckToken(() => { // this.commonCheckToken(() => {
this.GET( // this.GET(
`trade/coupon/app/myCoupons?couponStatus=${ // `trade/coupon/app/myCoupons?couponStatus=${
this.tabs[this.activeIndex].status // this.tabs[this.activeIndex].status
}`, // }`,
{} // {}
).then(({ code, data }) => { // ).then(({ code, data }) => {
if (code == "000000") { // if (code == "000000") {
this.$nextTick((res) => { // this.$nextTick((res) => {
data.baseCouponModelList.forEach((item) => { // data.baseCouponModelList.forEach((item) => {
item.showTips = false; // item.showTips = false;
}); // });
this.couponList = JSON.parse( // this.couponList = JSON.parse(
JSON.stringify(data.baseCouponModelList) // JSON.stringify(data.baseCouponModelList)
); // );
}); // });
} // }
}); // });
}); // });
}, // },
changeTab(index) { // changeTab(index) {
console.log(index); // console.log(index);
this.activeIndex = index; // this.activeIndex = index;
this.getMyCouponsList(); // this.getMyCouponsList();
}, // },
chooseCoupon(item) { // chooseCoupon(item) {
console.log(); // console.log();
if (item.couponStatus === 1) { // if (item.couponStatus === 1) {
let webUrl = getWebPageUrl(`consultationHome`); // let webUrl = getWebPageUrl(`consultationHome`);
location.replace(webUrl); // location.replace(webUrl);
// uni.switchTab({ // // uni.switchTab({
// url: '/pages/home/index', // // url: '/pages/home/index',
// }); // // });
} // }
}, // },
}, // },
}; // };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.pt-88 { // .pt-88 {
padding-top: 88px; // padding-top: 88px;
} // }
.coupon-list-wrapper { // .coupon-list-wrapper {
min-height: 100vh; // min-height: 100vh;
background: #f8f9fa; // background: #f8f9fa;
&.no-pt { // &.no-pt {
padding-top: 10px; // padding-top: 10px;
} // }
} // }
.page-wrapper { // .page-wrapper {
padding-top: 134px; // padding-top: 134px;
height: 100vh; // height: 100vh;
background-color: #f5f6f8; // background-color: #f5f6f8;
display: flex; // display: flex;
flex-direction: column; // flex-direction: column;
.tabs { // .tabs {
margin-top: -1px; // margin-top: -1px;
} // }
/deep/ .nav-title { // /deep/ .nav-title {
border-bottom: 1px solid transparent !important; // border-bottom: 1px solid transparent !important;
position: relative !important; // position: relative !important;
} // }
.ios_safe_height { // .ios_safe_height {
background-color: #fff; // background-color: #fff;
height: auto !important; // height: auto !important;
} // }
.page-content { // .page-content {
padding: 10px 12px 24px; // padding: 10px 12px 24px;
} // }
.list { // .list {
padding-bottom: 50px; // padding-bottom: 50px;
} // }
} // }
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册