新增预览分页,可以设置每页有多少张图片;将预览抽取为单独一个组件;(同步更新)
This commit is contained in:
+14
-12
@@ -118,18 +118,19 @@ const actions = {
|
||||
context.dispatch("updateGalleryTasks", "all").then(() => confirmCurrentTask(context.state))
|
||||
|
||||
//获取图片合适长度
|
||||
let screenWidth = window.screen.width * 0.9 - 40
|
||||
let width
|
||||
let i
|
||||
for(i=3; i>0; i--)
|
||||
if(screenWidth / i <= 350 || screenWidth / i >= 100){
|
||||
width = screenWidth / i
|
||||
break
|
||||
}
|
||||
|
||||
width = width - (width % 10)
|
||||
state.imageWidth = width + 'px'
|
||||
state.imagePadding = ((screenWidth - i * width) / i) + 'px'
|
||||
// let screenWidth = window.screen.width * 0.9 - 40
|
||||
// let width
|
||||
// let i
|
||||
// for(i=3; i>0; i--)
|
||||
// if(screenWidth / i <= 350 || screenWidth / i >= 100){
|
||||
// width = screenWidth / i
|
||||
// break
|
||||
// }
|
||||
//
|
||||
// width = width - (width % 10)
|
||||
//写死图片合适宽度
|
||||
state.imageWidth = 550 + 'px'
|
||||
state.imagePadding = 10 + 'px'
|
||||
}
|
||||
else
|
||||
context.commit("_unAuthed")
|
||||
@@ -615,6 +616,7 @@ const state = {
|
||||
currentLinks: [], //当前本子链接
|
||||
imageWidth: "", //图片宽度
|
||||
imagePadding: "", //图片padding
|
||||
lengthPerPage: 0, //在线预览每页图片数量
|
||||
|
||||
page: 1, //当前页数
|
||||
length: 10, //每页能有多少个链接
|
||||
|
||||
Reference in New Issue
Block a user