diff --git a/dist/album/index.js b/dist/album/index.js index ea03b607..33508006 100644 --- a/dist/album/index.js +++ b/dist/album/index.js @@ -1 +1 @@ -Component({externalClasses:["l-class","l-single-image-class","l-multi-image-class"],properties:{urls:{type:Array},preview:{type:Boolean,value:!0},gapRow:{type:Number,value:10},gapColumn:{type:Number,value:10},singleSize:{type:Number,value:360},multipleSize:{type:Number,value:158},singleMode:{type:String,value:"aspectFit"},multipleMode:{type:String,value:"aspectFill"},key:{type:String,value:"url"},maxNumber:{type:Number,value:9},customRowNumber:{type:Boolean,value:!1},everyRowNumber:{type:Number,value:3},previewFullImage:{type:Boolean,value:!0}},data:{newType:!0,shortSideValue:0,showUrls:[],isLong:!1},observers:{urls:function(){this.init()}},methods:{init(){let{urls:e,maxNumber:t,key:a}=this.data;if(e.length>t&&(e=e.slice(0,t),this.setData({isLong:!0})),this.setData({showUrls:e}),!this.data.customRowNumber){let e=this.data.showUrls.length;e>1&&e<5?this.setData({everyRowNumber:2}):this.setData({everyRowNumber:3})}const s=this.judgeType();this.setData({newType:s}),1===e.length&&this.horizontalOrVertical(s?e[0][a]:e[0])},judgeType(){const e=this.data.urls;return 0===e.length||"object"==typeof e[0]},horizontalOrVertical:function(e){wx.getImageInfo({src:e,success:e=>{const t=e.width>=e.height?e.width:e.height,a=e.width>=e.height?e.height:e.width;this.setData({horizontalScreen:e.width>=e.height,shortSideValue:a*this.data.singleSize/t})}})},onPreviewTap(e){const t=e.currentTarget.id;let a;a=this.data.previewFullImage?this.data.urls:this.data.showUrls;let s="",i=[];const l=this.data.newType,r=this.data.key;if(l){s=a[t][r];for(let e=0;et&&(e=e.slice(0,t),this.setData({isLong:!0})),this.setData({showUrls:e}),!this.data.customRowNumber){let e=this.data.showUrls.length;e>1&&e<5&&3!==e?this.setData({everyRowNumber:2}):this.setData({everyRowNumber:3})}const s=this.judgeType();this.setData({newType:s}),1===e.length&&this.horizontalOrVertical(s?e[0][a]:e[0])},judgeType(){const e=this.data.urls;return 0===e.length||"object"==typeof e[0]},horizontalOrVertical:function(e){wx.getImageInfo({src:e,success:e=>{const t=e.width>=e.height?e.width:e.height,a=e.width>=e.height?e.height:e.width;this.setData({horizontalScreen:e.width>=e.height,shortSideValue:a*this.data.singleSize/t})}})},onPreviewTap(e){const t=e.currentTarget.id;let a;a=this.data.previewFullImage?this.data.urls:this.data.showUrls;let s="",i=[];const l=this.data.newType,r=this.data.key;if(l){s=a[t][r];for(let e=0;e - + - + +{{urls.length-maxNumber}} diff --git a/examples/dist/album/index.js b/examples/dist/album/index.js index 6873106e..6a637140 100644 --- a/examples/dist/album/index.js +++ b/examples/dist/album/index.js @@ -100,7 +100,7 @@ Component({ if (!this.data.customRowNumber) { let urlLength = this.data.showUrls.length; - if (urlLength > 1 && urlLength < 5) { + if (urlLength > 1 && urlLength < 5 && urlLength !== 3) { this.setData({ everyRowNumber: 2 }); diff --git a/examples/dist/album/index.wxml b/examples/dist/album/index.wxml index 8293cbc5..288ccc40 100644 --- a/examples/dist/album/index.wxml +++ b/examples/dist/album/index.wxml @@ -1,10 +1,10 @@ - + - + +{{urls.length-maxNumber}} diff --git a/package.json b/package.json index e28b88a1..f0393ada 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lin-ui", - "version": "0.9.7", + "version": "0.9.8", "description": "A high quality UI components library with MiniProgram", "main": "app.js", "directories": { diff --git a/src/album/index.js b/src/album/index.js index 6873106e..6a637140 100644 --- a/src/album/index.js +++ b/src/album/index.js @@ -100,7 +100,7 @@ Component({ if (!this.data.customRowNumber) { let urlLength = this.data.showUrls.length; - if (urlLength > 1 && urlLength < 5) { + if (urlLength > 1 && urlLength < 5 && urlLength !== 3) { this.setData({ everyRowNumber: 2 }); diff --git a/src/album/index.wxml b/src/album/index.wxml index 8293cbc5..288ccc40 100644 --- a/src/album/index.wxml +++ b/src/album/index.wxml @@ -1,10 +1,10 @@ - + - + +{{urls.length-maxNumber}}