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

修改样式

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