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
提交
ea0776fd
提交
ea0776fd
编写于
6月 07, 2024
作者:
jingqi.liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改样式
上级
7b5b4803
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
40 行增加
和
16 行删除
+40
-16
index.vue
src/views/coupon-center/index.vue
+21
-12
coupon-item.vue
src/views/coupon/components/coupon-item.vue
+19
-4
未找到文件。
src/views/coupon-center/index.vue
浏览文件 @
ea0776fd
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</CommonNavbar>
</CommonNavbar>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<van-pull-refresh
<van-pull-refresh
style=
"height: 100%;
overflow:
auto"
style=
"height: 100%;
overflow:
auto"
v-model=
"refreshing"
v-model=
"refreshing"
@
refresh=
"onRefresh"
@
refresh=
"onRefresh"
class=
"refresh-list"
class=
"refresh-list"
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
:coupon-detail=
"item"
:coupon-detail=
"item"
:show-tips
.
sync=
"item.showTips"
:show-tips
.
sync=
"item.showTips"
:has-tips=
"hasTips"
:has-tips=
"hasTips"
:has-down
.
sync=
"item.hasDown"
:has-stock=
"false"
:has-stock=
"false"
@
goUse=
"chooseCoupon"
@
goUse=
"chooseCoupon"
/>
/>
...
@@ -178,6 +179,7 @@ export default {
...
@@ -178,6 +179,7 @@ export default {
this
.
POST
(
`trade/coupon/app/searchCoupons`
,
{}).
then
((
res
)
=>
{
this
.
POST
(
`trade/coupon/app/searchCoupons`
,
{}).
then
((
res
)
=>
{
res
.
data
.
baseCouponModelList
.
forEach
((
item
)
=>
{
res
.
data
.
baseCouponModelList
.
forEach
((
item
)
=>
{
item
.
showTips
=
false
;
item
.
showTips
=
false
;
item
.
hasDown
=
false
;
});
});
this
.
couponList
=
JSON
.
parse
(
this
.
couponList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
baseCouponModelList
)
JSON
.
stringify
(
res
.
data
.
baseCouponModelList
)
...
@@ -193,23 +195,30 @@ export default {
...
@@ -193,23 +195,30 @@ export default {
this
.
POST
(
this
.
POST
(
`/trade/coupon/app/receive/
${
item
.
couponId
}
/
${
item
.
grantConfigId
}
`
,
`/trade/coupon/app/receive/
${
item
.
couponId
}
/
${
item
.
grantConfigId
}
`
,
{}
{}
).
then
((
res
)
=>
{
)
console
.
log
(
res
,
"receiveCoupon"
);
.
then
((
res
)
=>
{
// couponType 1 满减 2 立减 todo 现金红包
console
.
log
(
res
,
"receiveCoupon"
);
// if (item.couponType === 2) {
// couponType 1 满减 2 立减 todo 现金红包
// this.show = true;
// if (item.couponType === 2) {
// } else {
// this.show = true;
this
.
$toast
(
"领取成功"
);
// } else {
// this.getSearchCoupons();
this
.
$toast
(
"领取成功"
);
// }
// this.getSearchCoupons();
});
// }
})
.
catch
((
err
)
=>
{
item
.
hasDown
=
false
;
this
.
$toast
(
err
.
message
);
console
.
log
(
"err"
,
err
);
});
break
;
break
;
case
1
:
case
1
:
// uni.switchTab({
// uni.switchTab({
// url: "/pages/home/index",
// url: "/pages/home/index",
// });
// });
rocNative
.
goBack
();
let
webUrl
=
getWebPageUrl
(
`consultationHome?from=exam`
);
location
.
replace
(
webUrl
);
break
;
break
;
default
:
default
:
break
;
break
;
...
...
src/views/coupon/components/coupon-item.vue
浏览文件 @
ea0776fd
...
@@ -131,6 +131,7 @@
...
@@ -131,6 +131,7 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getWebPageUrl
,
getHactiveUrl
}
from
"@/utils"
;
export
default
{
export
default
{
options
:
{},
options
:
{},
props
:
{
props
:
{
...
@@ -152,6 +153,12 @@ export default {
...
@@ -152,6 +153,12 @@ export default {
return
true
;
return
true
;
},
},
},
},
hasDown
:
{
type
:
Boolean
,
default
()
{
return
false
;
},
},
hasStock
:
{
hasStock
:
{
type
:
Boolean
,
type
:
Boolean
,
default
()
{
default
()
{
...
@@ -205,7 +212,6 @@ export default {
...
@@ -205,7 +212,6 @@ export default {
label
:
"已失效"
,
label
:
"已失效"
,
},
},
},
},
hasDown
:
false
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -232,9 +238,18 @@ export default {
...
@@ -232,9 +238,18 @@ export default {
this
.
$emit
(
"update:showTips"
,
!
this
.
showTips
);
this
.
$emit
(
"update:showTips"
,
!
this
.
showTips
);
},
},
goUse
()
{
goUse
()
{
console
.
log
(
this
.
$route
);
console
.
log
(
this
.
$route
,
this
.
hasDown
);
if
(
this
.
$route
.
path
==
"/coupon-center"
)
{
if
(
this
.
hasDown
)
{
this
.
hasDown
=
true
;
let
webUrl
=
getWebPageUrl
(
`consultationHome?from=exam`
);
location
.
replace
(
webUrl
);
return
;
}
if
(
this
.
$route
.
path
==
"/coupon-center"
&&
this
.
couponDetail
.
couponStatus
==
0
&&
!
this
.
hasDown
)
{
this
.
$emit
(
"update:hasDown"
,
!
this
.
hasDown
);
}
}
this
.
$emit
(
"goUse"
,
this
.
couponDetail
);
this
.
$emit
(
"goUse"
,
this
.
couponDetail
);
},
},
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录