1.3.5 • Published 6 years ago

timepack-album v1.3.5

Weekly downloads
191
License
-
Repository
-
Last release
6 years ago

timepack-album

timepack相簿组件包和工具类

Build Setup

# install dependencies
npm install 'timepack-album' --save

组件API

AlbumGlobal

相簿全局预览组件

使用

import {AlbumGlobal} from 'timepack-album'

入参

名称类型含义
productObject产品参数(包含产品类型:相簿/台历)
layoutArray容器数据
photoListArray相簿数据

方法

名称参数含义
change(photoList,layout)数据结构变更,反馈变更数据,供父组件处理
upload触发上传事件

AlbumGallery

照片库组件,提供图片的修改删除上传和选择操作

使用

import {AlbumGallery} from 'timepack-album'

入参

名称类型含义
layoutArray容器数据
photoListArray相簿数据
modeString上传模式,有group,single

方法

名称参数含义
load懒加载图片列表的请求
pageChange懒加载图片列表页数变更
delete(ids,groupIndex,imageIndex)删除图片
upload安卓端图片上传
savedata源图片信息数据图片上传保存到服务端
confirmdata相簿图片信息数据点击确认按钮,同步图片数据结构
afterImageLoaded(page,data)由父组件触发,图片加载完成后调用
afterTokenCreateduptoken由父组件触发,获取到七牛token后调用
afterImageDeleted(groupIndex,imageIndex)由父组件触发,图片删除后调用
afterImageSaveddata源图片信息数据由父组件触发,图片保存完成后调用

工具API

TimepackQiniu

使用

import {TimepackQiniu} from 'timepack-album'

TimepackUtil

使用

import {TimepackUtil} from 'timepack-album'

方法

methodreturndescription
getQueryByName(str)String or Nullget url query-value by query-key
isTelephone(str)Booleanjudge string is telephone or not
dateFormat(date,fmt)Stringformat date
removeArrayItem(array,index)Stringremove item from an array
browser().isIE()Booleanjudge current browser is ie or not
browser().isFirefox()Booleanjudge current browser is firefox or not
browser().isChrome()Booleanjudge current browser is chrome or not
browser().isAndroid()Booleanjudge current browser is android or not
browser().isIOS()Booleanjudge current browser is ios or not
browser().isWeixin()Booleanjudge current browser is wechat or not
string().trim(str)Stringtrim string
string().isEmpty(str)Stringjudge the input string is empty
string().isNotEmpty(str)Stringjudge the input string is not empty
string().isBlank(str)Stringjudge the input string is blank
string().isNotBlank(str)Stringjudge the input string is blank
fileUploader(param,callback)No Returnupload a file to server through qiniu

fileUploader method statement

paramdefaultrequired
fileTypejpg,png,jpegfalse
buttonIdnulltrue
uptokennulltrue
domainhttps://images.cache.timepack.cn/true
size4mbfalse
callbackdescriptionrequired
addedtrigger when files have been addedfalse
progresstrigger when a file were uploadingfalse
completetrigger when a file uploading event completedfalse
uploadedtrigger when a file uploading successfullytrue
errortrigger when a file uploading event came across an errorfalse

AlbumCanvas

相簿图片自动合成,拖拽,旋转,删除核心模块

render(photo,layout,temp)

init()

初始化相簿数据

compatable()

跨设备分享,数据兼容处理

getter()

  • template(index):模板图片
  • photo(pageIndex,imageIndex):
  • radio(index):获取容器的长宽比
  • rest():获取整页剩余的未填充数量
  • pageRest(index):获取指定页数空区域的数量(即未填充的数量)

setter()

  • editPageStyle(pageIndex,imageIndex,editWidth,editable):单页容器模板样式
  • photoStyle(pageIndex,imageIndex):单页图片样式
  • groupImage($list): 用jquery对象列表批量填充图片
  • listImage(list):用图片数据列表填充图片
  • fillImageByPage($list,page):根据页数填充图片
  • indexImage($list, page, index):单页内根据下标填充图片

operate()

  • exchange(pageIndex,lastIndex,currentIndex):更换图片间顺序
  • rotate(pageIndex,imageIndex):顺时针旋转图片90度
  • zoomImage(pageIndex,index,type):放大或缩小图片,type-1放大,type-2缩小
  • convert($list):图片jquery对象转换为可用的数据结构
  • changeLayout(index):修改容器模板

delete()

  • deleteImageByIndex(pageIndex,imageIndex):删除指定页内指定图片

event

  • touchstart(e,target):
  • touchmove(e, startPosition, position, target):
  • touchend(e, page, index, position, target):
1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.30

6 years ago

1.1.29

6 years ago

1.1.28

6 years ago

1.1.27

6 years ago

1.1.26

6 years ago

1.1.25

6 years ago

1.1.24

6 years ago

1.1.23

6 years ago

1.1.22

6 years ago

1.1.21

6 years ago

1.1.20

6 years ago

1.1.19

6 years ago

1.1.18

6 years ago

1.1.17

6 years ago

1.1.16

6 years ago

1.1.15

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago