Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_Travel
Commits
203542de
Commit
203542de
authored
Jan 21, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化优惠券列表
parent
8b503633
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
index.vue
pages/coupon/index/index.vue
+20
-17
No files found.
pages/coupon/index/index.vue
View file @
203542de
...
...
@@ -29,7 +29,7 @@
<view
v-if=
"couponDataList.length > 0"
style=
" height: calc(100vh - 50px); width: calc(100vw); overflow: hidden;padding-bottom: 50px;"
>
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
@
scrolltolower=
"lower"
:style=
"
{ height: '100%' }">
<view
class=
"couponList"
>
<view
class=
"couponListBox"
:class=
"[x.couponsUseScope>
=0?'active'+x.couponsUseScope
:'active0']"
<view
class=
"couponListBox"
:class=
"[x.couponsUseScope>
0?'active'+(x.couponsUseScope-1)
:'active0']"
v-for=
"(x, i) in couponDataList"
:key=
"i"
>
<view
class=
"item"
>
<view
:style=
"
{'background-image':`url(${x.backGroubd}) `}" class="couponItemLeft">
...
...
@@ -238,7 +238,6 @@
}
},
(
failed
)
=>
{
uni
.
showToast
({
title
:
failed
.
message
,
icon
:
"none"
,
});
...
...
@@ -283,21 +282,19 @@
}
arrList
(
res
.
data
.
pageData
)
this
.
couponDataList
=
res
.
data
.
pageData
;
this
.
couponDataList
.
forEach
(
x
=>
{
if
(
x
.
couponsUseScope
<=
8
){
if
(
x
.
couponsUseScope
==
0
)
x
.
backGroubd
=
this
.
lineImgs
[
0
]
if
(
x
.
couponsUseScope
==
1
)
x
.
backGroubd
=
this
.
lineImgs
[
1
]
if
(
x
.
couponsUseScope
==
2
)
x
.
backGroubd
=
this
.
lineImgs
[
2
]
if
(
x
.
couponsUseScope
==
3
)
x
.
backGroubd
=
this
.
lineImgs
[
3
]
if
(
x
.
couponsUseScope
==
4
)
x
.
backGroubd
=
this
.
lineImgs
[
4
]
if
(
x
.
couponsUseScope
==
5
)
x
.
backGroubd
=
this
.
lineImgs
[
5
]
if
(
x
.
couponsUseScope
==
6
)
x
.
backGroubd
=
this
.
lineImgs
[
6
]
if
(
x
.
couponsUseScope
==
7
)
x
.
backGroubd
=
this
.
lineImgs
[
7
]
if
(
x
.
couponsUseScope
==
8
)
x
.
backGroubd
=
this
.
lineImgs
[
8
]
}
else
{
x
.
backGroubd
=
this
.
lineImgs
[
0
]
}
this
.
couponDataList
.
forEach
((
x
,
index
)
=>
{
// if(x.couponsUseScope==1) x.backGroubd = this.lineImgs[0]
// if(x.couponsUseScope==2) x.backGroubd = this.lineImgs[1]
// if(x.couponsUseScope==3) x.backGroubd = this.lineImgs[2]
// if(x.couponsUseScope==4) x.backGroubd = this.lineImgs[3]
// if(x.couponsUseScope==5) x.backGroubd = this.lineImgs[4]
// if(x.couponsUseScope==6) x.backGroubd = this.lineImgs[5]
// if(x.couponsUseScope==7) x.backGroubd = this.lineImgs[6]
// if(x.couponsUseScope==8) x.backGroubd = this.lineImgs[7]
// if(x.couponsUseScope==9) x.backGroubd = this.lineImgs[8]
// if(x.couponsUseScope==10) x.backGroubd = this.lineImgs[0]
// if(x.couponsUseScope==11) x.backGroubd = this.lineImgs[1]
if
(
x
.
couponsUseScope
==
this
.
getLineImgs
()
+
1
)
x
.
backGroubd
=
this
.
lineImgs
[
this
.
getLineImgs
()]
})
this
.
page_count
=
res
.
data
.
pageCount
;
if
(
this
.
page_count
==
1
)
this
.
status
=
'nomore'
...
...
@@ -313,6 +310,12 @@
this
.
loading
=
false
;
})
},
getLineImgs
(){
let
i
=
0
if
(
i
<
this
.
lineImgs
.
length
-
1
)
i
++
if
(
i
==
this
.
lineImgs
.
length
-
1
)
i
=
0
return
i
},
lower
(
e
)
{
if
(
this
.
msg
.
pageIndex
<
this
.
page_count
)
{
this
.
msg
.
pageIndex
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment