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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
6 deletions
+44
-6
src/views/shop/shop/components/commodity.vue
+40
-5
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 @@
...
@@ -74,6 +74,16 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</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>
</div>
</template>
</template>
...
@@ -96,12 +106,16 @@ export default {
...
@@ -96,12 +106,16 @@ export default {
components
:
{
SelectGoods
,
AddRecommend
,
Preferential
},
components
:
{
SelectGoods
,
AddRecommend
,
Preferential
},
data
()
{
data
()
{
return
{
return
{
pageNum
:
1
,
pageSize
:
10
,
totalNum
:
0
,
loading
:
false
,
loading
:
false
,
list
:
[],
list
:
[],
options
:
[],
options
:
[],
btnId
:
''
,
btnId
:
''
,
outIds
:
''
,
outIds
:
''
,
total
:
null
total
:
null
,
goodsList
:[]
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -133,8 +147,10 @@ export default {
...
@@ -133,8 +147,10 @@ export default {
},
},
setData
(
data
)
{
setData
(
data
)
{
this
.
list
=
data
.
goodsList
;
this
.
list
=
data
.
goodsList
;
this
.
goodsList
=
data
.
goodsList
;
this
.
btnId
=
data
.
id
;
this
.
btnId
=
data
.
id
;
this
.
total
=
this
.
list
.
length
;
this
.
total
=
this
.
list
.
length
;
this
.
totalNum
=
this
.
list
.
length
;
},
},
getList
()
{
getList
()
{
if
(
!
this
.
shopId
)
return
;
if
(
!
this
.
shopId
)
return
;
...
@@ -151,8 +167,10 @@ export default {
...
@@ -151,8 +167,10 @@ export default {
this
.
list
=
data
[
i
].
goodsList
;
this
.
list
=
data
[
i
].
goodsList
;
}
}
}
}
}
}
this
.
goodsList
=
this
.
list
;
this
.
total
=
this
.
list
.
length
;
this
.
total
=
this
.
list
.
length
;
this
.
totalNum
=
this
.
list
.
length
;
}
else
{
}
else
{
this
.
options
=
[];
this
.
options
=
[];
}
}
...
@@ -214,7 +232,23 @@ export default {
...
@@ -214,7 +232,23 @@ export default {
message
:
'已取消所选的商品!'
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
>
</
script
>
...
@@ -224,6 +258,6 @@ export default {
...
@@ -224,6 +258,6 @@ export default {
height
:
50px
;
height
:
50px
;
align-items
:
center
;
align-items
:
center
;
text-align
:
right
;
text-align
:
right
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/views/shop/shop/components/recommend.vue
View file @
ad00b1a8
...
@@ -108,6 +108,8 @@ export default {
...
@@ -108,6 +108,8 @@ export default {
height
:
50px
;
height
:
50px
;
align-items
:
center
;
align-items
:
center
;
text-align
:
right
;
text-align
:
right
;
}
.pagination-container
{
height
:
30px
;
}
}
</
style
>
</
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