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,20 +25,35 @@
...
@@ -25,20 +25,35 @@
>
>
</CommonNavbar>
</CommonNavbar>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<van-list
v-if=
"couponList.length"
class=
"list"
enable-flex
scroll-y
>
<van-pull-refresh
<coupo-item
style=
"height: 100%"
v-for=
"(item, index) in couponList"
v-model=
"refreshing"
:key=
"index"
@
refresh=
"onRefresh"
class=
"item"
>
:coupon-detail=
"item"
<van-list
:has-tips=
"hasTips"
:immediate-check=
"false"
:has-stock=
"false"
v-if=
"couponList.length"
@
goUse=
"chooseCoupon"
class=
"list"
/>
enable-flex
</van-list>
scroll-y
<div
v-else
>
v-model=
"loading"
<empty
/>
:finished=
"finished"
</div>
@
load=
"getSearchCoupons"
>
<coupo-item
v-for=
"(item, index) in couponList"
:key=
"index"
class=
"item"
:coupon-detail=
"item"
:has-tips=
"hasTips"
:has-stock=
"false"
@
goUse=
"chooseCoupon"
/>
</van-list>
<div
v-else
>
<empty
/>
</div>
</van-pull-refresh>
</div>
</div>
<coupon-tips
:visible
.
sync=
"show"
@
close=
"close"
/>
<coupon-tips
:visible
.
sync=
"show"
@
close=
"close"
/>
</div>
</div>
...
@@ -77,6 +92,9 @@ export default {
...
@@ -77,6 +92,9 @@ export default {
navTitle
:
"领券中心"
,
navTitle
:
"领券中心"
,
isFixNavbar
:
true
,
isFixNavbar
:
true
,
isInMergeDetail
:
false
,
isInMergeDetail
:
false
,
loading
:
false
,
refreshing
:
false
,
finished
:
false
,
};
};
},
},
watch
:
{
watch
:
{
...
@@ -142,6 +160,11 @@ export default {
...
@@ -142,6 +160,11 @@ export default {
},
},
methods
:
{
methods
:
{
...
mapActions
([
"setUserInfo"
]),
...
mapActions
([
"setUserInfo"
]),
onRefresh
()
{
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
this
.
getSearchCoupons
();
},
//获取用户信息
//获取用户信息
getUserInfo
()
{
getUserInfo
()
{
rocNative
.
getUserInfo
({
rocNative
.
getUserInfo
({
...
@@ -149,9 +172,12 @@ export default {
...
@@ -149,9 +172,12 @@ export default {
});
});
},
},
getSearchCoupons
()
{
getSearchCoupons
()
{
this
.
loading
=
true
;
this
.
POST
(
`trade/coupon/app/searchCoupons`
,
{}).
then
((
res
)
=>
{
this
.
POST
(
`trade/coupon/app/searchCoupons`
,
{}).
then
((
res
)
=>
{
console
.
log
(
res
);
this
.
couponList
=
res
.
data
.
baseCouponModelList
;
this
.
couponList
=
res
.
data
.
baseCouponModelList
;
this
.
loading
=
false
;
this
.
finished
=
true
;
this
.
refreshing
=
false
;
});
});
},
},
chooseCoupon
(
item
)
{
chooseCoupon
(
item
)
{
...
@@ -167,7 +193,7 @@ export default {
...
@@ -167,7 +193,7 @@ export default {
// this.show = true;
// this.show = true;
// } else {
// } else {
this
.
$toast
(
"领取成功"
);
this
.
$toast
(
"领取成功"
);
this
.
getSearchCoupons
();
//
this.getSearchCoupons();
// }
// }
});
});
...
@@ -204,7 +230,7 @@ export default {
...
@@ -204,7 +230,7 @@ export default {
}
}
.page-wrapper {
.page-wrapper {
padding-top: 84px;
padding-top: 84px;
height:
auto
;
height:
100vh
;
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
/deep/ .nav-title {
/deep/ .nav-title {
...
@@ -215,6 +241,7 @@ export default {
...
@@ -215,6 +241,7 @@ export default {
background-color: #fff;
background-color: #fff;
}
}
.page-content {
.page-content {
height: 100%;
padding: 10px 12px 24px;
padding: 10px 12px 24px;
}
}
.list {
.list {
...
...
src/views/coupon/components/coupon-item.vue
浏览文件 @
a0e4e544
...
@@ -108,7 +108,9 @@
...
@@ -108,7 +108,9 @@
btnList[couponDetail.couponStatus].class,
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
v-if=
"couponDetail.couponStatus == 1"
class=
"arrow"
/>
</div>
</div>
</div>
</div>
...
@@ -203,6 +205,7 @@ export default {
...
@@ -203,6 +205,7 @@ export default {
label
:
"已失效"
,
label
:
"已失效"
,
},
},
},
},
hasDown
:
false
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -229,6 +232,10 @@ export default {
...
@@ -229,6 +232,10 @@ export default {
this
.
$emit
(
"update:showTips"
,
!
this
.
showTips
);
this
.
$emit
(
"update:showTips"
,
!
this
.
showTips
);
},
},
goUse
()
{
goUse
()
{
console
.
log
(
this
.
$route
);
if
(
this
.
$route
.
path
==
"/coupon-center"
)
{
this
.
hasDown
=
true
;
}
this
.
$emit
(
"goUse"
,
this
.
couponDetail
);
this
.
$emit
(
"goUse"
,
this
.
couponDetail
);
},
},
},
},
...
...
src/views/coupon/coupon-list.vue
浏览文件 @
a0e4e544
...
@@ -23,19 +23,32 @@
...
@@ -23,19 +23,32 @@
/>
/>
</div>
</div>
</CommonNavbar>
</CommonNavbar>
<van-list
v-if=
"couponList.length"
class=
"list"
>
<van-pull-refresh
<coupo-item
style=
"height: 100%"
v-for=
"(item, index) in couponList"
v-model=
"refreshing"
:key=
"index"
@
refresh=
"onRefresh"
class=
"item"
>
:coupon-detail=
"item"
<van-list
:show-tips
.
sync=
"item.showTips"
:immediate-check=
"false"
@
goUse=
"chooseCoupon"
v-if=
"couponList.length"
/>
class=
"list"
</van-list>
v-model=
"loading"
<div
v-else
>
:finished=
"finished"
<empty
/>
@
load=
"getMyCouponsList"
</div>
>
<coupo-item
v-for=
"(item, index) in couponList"
:key=
"index"
class=
"item"
:coupon-detail=
"item"
:show-tips
.
sync=
"item.showTips"
@
goUse=
"chooseCoupon"
/>
</van-list>
<div
v-else
>
<empty
/>
</div>
</van-pull-refresh>
</div>
</div>
<coupon-bottom
/>
<coupon-bottom
/>
</div>
</div>
...
@@ -91,6 +104,9 @@ export default {
...
@@ -91,6 +104,9 @@ export default {
currentIndex
:
0
,
currentIndex
:
0
,
couponList
:
[],
couponList
:
[],
activeIndex
:
0
,
activeIndex
:
0
,
loading
:
false
,
refreshing
:
false
,
finished
:
false
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -150,6 +166,11 @@ export default {
...
@@ -150,6 +166,11 @@ export default {
},
},
methods
:
{
methods
:
{
...
mapActions
([
"setUserInfo"
]),
...
mapActions
([
"setUserInfo"
]),
onRefresh
()
{
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
this
.
getMyCouponsList
();
},
//获取用户信息
//获取用户信息
getUserInfo
()
{
getUserInfo
()
{
rocNative
.
getUserInfo
({
rocNative
.
getUserInfo
({
...
@@ -157,6 +178,7 @@ export default {
...
@@ -157,6 +178,7 @@ export default {
});
});
},
},
getMyCouponsList
()
{
getMyCouponsList
()
{
this
.
loading
=
true
;
this
.
commonCheckToken
(()
=>
{
this
.
commonCheckToken
(()
=>
{
this
.
GET
(
this
.
GET
(
`trade/coupon/app/myCoupons?couponStatus=
${
`trade/coupon/app/myCoupons?couponStatus=
${
...
@@ -172,6 +194,9 @@ export default {
...
@@ -172,6 +194,9 @@ export default {
this
.
couponList
=
JSON
.
parse
(
this
.
couponList
=
JSON
.
parse
(
JSON
.
stringify
(
data
.
baseCouponModelList
)
JSON
.
stringify
(
data
.
baseCouponModelList
)
);
);
this
.
loading
=
false
;
this
.
finished
=
true
;
this
.
refreshing
=
false
;
});
});
}
}
});
});
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录