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
提交
a0e4e544
提交
a0e4e544
编写于
6月 06, 2024
作者:
jingqi.liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
下啦刷新
上级
af0158de
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
90 行增加
和
31 行删除
+90
-31
index.vue
src/views/coupon-center/index.vue
+44
-17
coupon-item.vue
src/views/coupon/components/coupon-item.vue
+8
-1
coupon-list.vue
src/views/coupon/coupon-list.vue
+38
-13
未找到文件。
src/views/coupon-center/index.vue
浏览文件 @
a0e4e544
...
...
@@ -25,7 +25,21 @@
>
</CommonNavbar>
<div
class=
"page-content"
>
<van-list
v-if=
"couponList.length"
class=
"list"
enable-flex
scroll-y
>
<van-pull-refresh
style=
"height: 100%"
v-model=
"refreshing"
@
refresh=
"onRefresh"
>
<van-list
:immediate-check=
"false"
v-if=
"couponList.length"
class=
"list"
enable-flex
scroll-y
v-model=
"loading"
:finished=
"finished"
@
load=
"getSearchCoupons"
>
<coupo-item
v-for=
"(item, index) in couponList"
:key=
"index"
...
...
@@ -39,6 +53,7 @@
<div
v-else
>
<empty
/>
</div>
</van-pull-refresh>
</div>
<coupon-tips
:visible
.
sync=
"show"
@
close=
"close"
/>
</div>
...
...
@@ -77,6 +92,9 @@ export default {
navTitle
:
"领券中心"
,
isFixNavbar
:
true
,
isInMergeDetail
:
false
,
loading
:
false
,
refreshing
:
false
,
finished
:
false
,
};
},
watch
:
{
...
...
@@ -142,6 +160,11 @@ export default {
},
methods
:
{
...
mapActions
([
"setUserInfo"
]),
onRefresh
()
{
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
this
.
getSearchCoupons
();
},
//获取用户信息
getUserInfo
()
{
rocNative
.
getUserInfo
({
...
...
@@ -149,9 +172,12 @@ export default {
});
},
getSearchCoupons
()
{
this
.
loading
=
true
;
this
.
POST
(
`trade/coupon/app/searchCoupons`
,
{}).
then
((
res
)
=>
{
console
.
log
(
res
);
this
.
couponList
=
res
.
data
.
baseCouponModelList
;
this
.
loading
=
false
;
this
.
finished
=
true
;
this
.
refreshing
=
false
;
});
},
chooseCoupon
(
item
)
{
...
...
@@ -167,7 +193,7 @@ export default {
// this.show = true;
// } else {
this
.
$toast
(
"领取成功"
);
this
.
getSearchCoupons
();
//
this.getSearchCoupons();
// }
});
...
...
@@ -204,7 +230,7 @@ export default {
}
.page-wrapper {
padding-top: 84px;
height:
auto
;
height:
100vh
;
display: flex;
flex-direction: column;
/deep/ .nav-title {
...
...
@@ -215,6 +241,7 @@ export default {
background-color: #fff;
}
.page-content {
height: 100%;
padding: 10px 12px 24px;
}
.list {
...
...
src/views/coupon/components/coupon-item.vue
浏览文件 @
a0e4e544
...
...
@@ -108,7 +108,9 @@
btnList[couponDetail.couponStatus].class,
]"
>
<span>
{{
btnList
[
couponDetail
.
couponStatus
].
label
}}
</span>
<span>
{{
!
hasDown
?
btnList
[
couponDetail
.
couponStatus
].
label
:
"去使用"
}}
</span>
<div
v-if=
"couponDetail.couponStatus == 1"
class=
"arrow"
/>
</div>
</div>
...
...
@@ -203,6 +205,7 @@ export default {
label
:
"已失效"
,
},
},
hasDown
:
false
,
};
},
computed
:
{
...
...
@@ -229,6 +232,10 @@ export default {
this
.
$emit
(
"update:showTips"
,
!
this
.
showTips
);
},
goUse
()
{
console
.
log
(
this
.
$route
);
if
(
this
.
$route
.
path
==
"/coupon-center"
)
{
this
.
hasDown
=
true
;
}
this
.
$emit
(
"goUse"
,
this
.
couponDetail
);
},
},
...
...
src/views/coupon/coupon-list.vue
浏览文件 @
a0e4e544
...
...
@@ -23,7 +23,19 @@
/>
</div>
</CommonNavbar>
<van-list
v-if=
"couponList.length"
class=
"list"
>
<van-pull-refresh
style=
"height: 100%"
v-model=
"refreshing"
@
refresh=
"onRefresh"
>
<van-list
:immediate-check=
"false"
v-if=
"couponList.length"
class=
"list"
v-model=
"loading"
:finished=
"finished"
@
load=
"getMyCouponsList"
>
<coupo-item
v-for=
"(item, index) in couponList"
:key=
"index"
...
...
@@ -36,6 +48,7 @@
<div
v-else
>
<empty
/>
</div>
</van-pull-refresh>
</div>
<coupon-bottom
/>
</div>
...
...
@@ -91,6 +104,9 @@ export default {
currentIndex
:
0
,
couponList
:
[],
activeIndex
:
0
,
loading
:
false
,
refreshing
:
false
,
finished
:
false
,
};
},
computed
:
{
...
...
@@ -150,6 +166,11 @@ export default {
},
methods
:
{
...
mapActions
([
"setUserInfo"
]),
onRefresh
()
{
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
this
.
getMyCouponsList
();
},
//获取用户信息
getUserInfo
()
{
rocNative
.
getUserInfo
({
...
...
@@ -157,6 +178,7 @@ export default {
});
},
getMyCouponsList
()
{
this
.
loading
=
true
;
this
.
commonCheckToken
(()
=>
{
this
.
GET
(
`trade/coupon/app/myCoupons?couponStatus=
${
...
...
@@ -172,6 +194,9 @@ export default {
this
.
couponList
=
JSON
.
parse
(
JSON
.
stringify
(
data
.
baseCouponModelList
)
);
this
.
loading
=
false
;
this
.
finished
=
true
;
this
.
refreshing
=
false
;
});
}
});
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录