Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-professional-exam
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-professional-exam
提交
af0158de
提交
af0158de
编写于
6月 06, 2024
作者:
jingqi.liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改样式
上级
832e0ea8
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
182 行增加
和
183 行删除
+182
-183
coupon-list.vue
src/views/coupon/coupon-list.vue
+182
-183
未找到文件。
src/views/coupon/coupon-list.vue
浏览文件 @
af0158de
...
@@ -3,8 +3,7 @@
...
@@ -3,8 +3,7 @@
class=
"coupon-list-wrapper"
class=
"coupon-list-wrapper"
:class=
"
{ 'no-pt': isWeb, 'pt-88': isWeb }"
:class=
"
{ 'no-pt': isWeb, 'pt-88': isWeb }"
>
>
<h1>
优惠券列表
</h1>
<div
class=
"page-wrapper"
>
<!--
<div
class=
"page-wrapper"
>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<CommonNavbar
<CommonNavbar
:isWeb=
"isWeb"
:isWeb=
"isWeb"
...
@@ -39,196 +38,196 @@
...
@@ -39,196 +38,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 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 {
export
default
{
//
components: {
components
:
{
//
CoupoItem,
CoupoItem
,
//
TabsComp,
TabsComp
,
//
empty,
empty
,
//
CouponBottom,
CouponBottom
,
//
CommonNavbar,
CommonNavbar
,
//
},
},
//
data() {
data
()
{
//
return {
return
{
//
bgColor: "#fff",
bgColor
:
"#fff"
,
//
token: "",
token
:
""
,
//
couponToken: "",
couponToken
:
""
,
//
shareUrl: "",
shareUrl
:
""
,
//
isWeb: window.__isWeb,
isWeb
:
window
.
__isWeb
,
//
isShowNavbar: true,
isShowNavbar
:
true
,
//
navTitle: "我的优惠券",
navTitle
:
"我的优惠券"
,
//
isFixNavbar: true,
isFixNavbar
:
true
,
//
paddingbtm: 0,
paddingbtm
:
0
,
//
isInMergeDetail: false,
isInMergeDetail
:
false
,
//
tabs: [
tabs
:
[
//
{
{
//
title: "已领取",
title
:
"已领取"
,
//
status: 2,
status
:
2
,
//
},
},
//
{
{
//
title: "已使用",
title
:
"已使用"
,
//
status: 6,
status
:
6
,
//
},
},
//
{
{
//
title: "已过期",
title
:
"已过期"
,
//
status: 5,
status
:
5
,
//
},
},
//
],
],
//
pageTitle: "我的优惠券",
pageTitle
:
"我的优惠券"
,
//
currentIndex: 0,
currentIndex
:
0
,
//
couponList: [],
couponList
:
[],
//
activeIndex: 0,
activeIndex
:
0
,
//
};
};
//
},
},
//
computed: {
computed
:
{
//
...mapGetters(["webUserInfo"]),
...
mapGetters
([
"webUserInfo"
]),
//
},
},
//
created() {
created
()
{
//
let _this = this;
let
_this
=
this
;
//
let href = location.href;
let
href
=
location
.
href
;
//
this.fromPage = this.$route.query.fromPage || "";
this
.
fromPage
=
this
.
$route
.
query
.
fromPage
||
""
;
//
this.couponToken = this.$route.query.couponToken || "";
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
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录