Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
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
hooloo
web
soss
Commits
ad00b1a8
Commit
ad00b1a8
authored
Jun 26, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改店铺商品分页
parent
edabb35b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
src/views/shop/shop/components/commodity.vue
+38
-3
src/views/shop/shop/components/recommend.vue
+4
-1
No files found.
src/views/shop/shop/components/commodity.vue
View file @
ad00b1a8
...
...
@@ -74,6 +74,16 @@
</
template
>
</el-table-column>
</el-table>
<el-pagination
style=
"text-align:right;padding-top: 20px;"
@
size-change=
"configSizeChange"
@
current-change=
"configCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[10, 20, 30, 40]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next,jumper"
:total=
"totalNum"
>
</el-pagination>
</div>
</template>
...
...
@@ -96,12 +106,16 @@ export default {
components
:
{
SelectGoods
,
AddRecommend
,
Preferential
},
data
()
{
return
{
pageNum
:
1
,
pageSize
:
10
,
totalNum
:
0
,
loading
:
false
,
list
:
[],
options
:
[],
btnId
:
''
,
outIds
:
''
,
total
:
null
total
:
null
,
goodsList
:[]
}
},
mounted
()
{
...
...
@@ -133,8 +147,10 @@ export default {
},
setData
(
data
)
{
this
.
list
=
data
.
goodsList
;
this
.
goodsList
=
data
.
goodsList
;
this
.
btnId
=
data
.
id
;
this
.
total
=
this
.
list
.
length
;
this
.
totalNum
=
this
.
list
.
length
;
},
getList
()
{
if
(
!
this
.
shopId
)
return
;
...
...
@@ -152,7 +168,9 @@ export default {
}
}
}
this
.
goodsList
=
this
.
list
;
this
.
total
=
this
.
list
.
length
;
this
.
totalNum
=
this
.
list
.
length
;
}
else
{
this
.
options
=
[];
}
...
...
@@ -214,7 +232,23 @@ export default {
message
:
'已取消所选的商品!'
});
});
}
},
getPageList
(){
let
startRow
=
(
this
.
pageNum
-
1
)
*
this
.
pageSize
+
1
-
1
;
//开始显示的行
let
endRow
=
this
.
pageNum
*
this
.
pageSize
;
//结束显示的行
endRow
=
(
endRow
>
this
.
totalNum
)?
this
.
totalNum
:
endRow
;
this
.
list
=
this
.
goodsList
.
slice
(
startRow
,
endRow
);
},
configSizeChange
(
size
){
this
.
pageNum
=
1
;
this
.
pageSize
=
size
;
this
.
getPageList
();
},
configCurrentChange
(
current
){
this
.
pageNum
=
current
;
this
.
pageSize
=
this
.
pageSize
;
this
.
getPageList
();
},
}
}
</
script
>
...
...
@@ -224,6 +258,6 @@ export default {
height
:
50px
;
align-items
:
center
;
text-align
:
right
;
}
</
style
>
\ No newline at end of file
src/views/shop/shop/components/recommend.vue
View file @
ad00b1a8
...
...
@@ -108,6 +108,8 @@ export default {
height
:
50px
;
align-items
:
center
;
text-align
:
right
;
}
.pagination-container
{
height
:
30px
;
}
</
style
>
\ No newline at end of file
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