diff --git a/commitlint.config.js b/commitlint.config.js index 29412e43..d1593f7d 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -69,7 +69,9 @@ module.exports = { 'IndexList', 'Behavior', 'CapsuleBar', - 'Circle' + 'Circle', + 'ImageClipper', + 'CustomTabBar' ] ] } diff --git a/dist/album/index.js b/dist/album/index.js index 983e8928..f5f5b05b 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"}},data:{newType:!0,shortSideValue:0,row:0,colum:0},lifetimes:{attached(){if(this.data.urls.length>9){const e=this.data.urls.slice(0,9);this.setData({urls:e}),console.warn("超过9张图片!")}this.preview()}},observers:{urls:function(){this.preview()}},methods:{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,i=e.width>=e.height?e.height:e.width;this.setData({horizontalScreen:e.width>=e.height,shortSideValue:i*this.data.singleSize/t})}})},preview:function(){const e=this.judgeType();this.setData({newType:e});const t=this.data.urls,i=this.data.key;1===t.length&&this.horizontalOrVertical(e?t[0][i]:t[0])},onPreviewTap(e){const t=e.currentTarget.id,i=this.data.urls;let s="",a=[];const l=this.data.newType,r=this.data.key;if(l){s=i[t][r];for(let e=0;ethis.data.maxNumber?(e=this.data.urls.slice(0,this.data.maxNumber),this.setData({isLong:!0}),console.warn("图片数量超过maxNumber指定数量")):e=this.data.urls,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})}this.preview()}},observers:{urls:function(){this.preview()}},methods:{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})}})},preview:function(){const e=this.judgeType();this.setData({newType:e});const t=this.data.urls,a=this.data.key;1===t.length&&this.horizontalOrVertical(e?t[0][a]:t[0])},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/dist/album/index.wxs b/dist/album/index.wxs index 05bae060..b41eda00 100644 --- a/dist/album/index.wxs +++ b/dist/album/index.wxs @@ -1,5 +1,4 @@ var containerStyle = function (urls, multipleSize, gapRow, gapColumn) { - urls.length === 2 || urls.length === 4 ? 'width:' + (2 * multipleSize + gapRow) + 'rpx;' : 'width:' + (3 * multipleSize + 2 * gapRow) + 'rpx;' if (urls.length === 2 || urls.length === 4) { return 'width:' + (2 * multipleSize + gapRow) + 'rpx; grid-row-gap:' + gapColumn + 'rpx; grid-column-gap:' + gapRow + 'rpx;grid-template-columns:repeat(auto-fit, ' + multipleSize + 'rpx);' } else { @@ -32,8 +31,49 @@ var blockStyle = function (urls, horizontalScreen, shortSideValue, singleSize, m } } +var gridStyle = function (gapRow, gapColumn, multipleSize, everyRowNumber) { + return 'display:inline-grid;grid-template-columns: repeat(' + everyRowNumber + ',' + multipleSize + 'rpx);grid-row-gap:' + gapRow + 'rpx;grid-column-gap:' + gapColumn + 'rpx;' +} + +var dimBack = function (isLong, index, maxNumber, previewFullImage) { + if (previewFullImage) { + if (isLong) { + if (index == maxNumber - 1) { + return 'dimback' + } + } + } + return '' +} + +var dim = function (isLong, index, maxNumber, previewFullImage) { + if (previewFullImage) { + if (isLong) { + if (index == maxNumber - 1) { + return 'dim' + } + } + } + return '' +} + +var image = function (isLong, index, maxNumber, previewFullImage) { + if (previewFullImage) { + if (isLong) { + if (index == maxNumber - 1) { + return true + } + } + } + return false +} + module.exports = { containerStyle: containerStyle, blockClass: blockClass, - blockStyle: blockStyle + blockStyle: blockStyle, + gridStyle: gridStyle, + dimBack: dimBack, + dim: dim, + image: image, } diff --git a/dist/album/index.wxss b/dist/album/index.wxss index d7650fc8..73f94e0d 100644 --- a/dist/album/index.wxss +++ b/dist/album/index.wxss @@ -1 +1 @@ -.container{display:grid}.vertical{height:360rpx} \ No newline at end of file +.container{display:grid}.vertical{height:360rpx}.parent{display:inline-grid;grid-template-columns:repeat(auto-fill)}.child{box-sizing:border-box;background-color:#fff;flex:0 0 44%;height:100px;border:1px solid red;margin-top:4%;margin-left:2%;margin-right:2%}.dimback{background:#000}.dim{opacity:.6}.imageContainer{position:relative}.imageContainer:last-child>.text{color:#fff;font-weight:700;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:larger} \ No newline at end of file diff --git a/dist/avatar/index.wxml b/dist/avatar/index.wxml index 8c983c12..16835cb4 100644 --- a/dist/avatar/index.wxml +++ b/dist/avatar/index.wxml @@ -1,5 +1,5 @@ - + diff --git a/dist/badge/index.wxml b/dist/badge/index.wxml index 4d7df27e..1e687872 100644 --- a/dist/badge/index.wxml +++ b/dist/badge/index.wxml @@ -1,7 +1,7 @@ - + {{finalCount}} - \ No newline at end of file + diff --git a/dist/button/index.wxml b/dist/button/index.wxml index 82159c9c..1021e64b 100644 --- a/dist/button/index.wxml +++ b/dist/button/index.wxml @@ -1,4 +1,4 @@ -