Skip to content

Commit 15fe170

Browse files
author
二一
authored
feat:发布0.6.13版本
2 parents e3e36c7 + 089b65b commit 15fe170

File tree

50 files changed

+443
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+443
-145
lines changed

build/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const {
1212
const path = require('path');
1313

1414
const componentData = require('./until');
15-
const result = `{common,behaviors,untils,${componentData()}}`;
16-
const isCustom = (result !== `{common,behaviors,untils,}`);
15+
const result = `{common/*,behaviors,utils,${componentData()}}`;
16+
const isCustom = (result !== `{common/*,behaviors,utils,}`);
1717

1818
const distPath = path.resolve(__dirname, '../dist');
1919
const examplePath = path.resolve(__dirname, '../examples/dist');

dist/combined-tabs/index.wxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<view class="l-tabs l-sub-placement-left l-tabs-vertical {{aminmated ? 'l-aminmated' :''}} {{scrollable ? 'l-tabs-scroll':''}}">
55
<template is="tab-header" wx:if="{{tabList[currentIndex].subTabs.length}}" data="{{tab:tabList[currentIndex].subTabs,placemanet,scrollable,transformY,transformX,activeKey:tabList[currentIndex].activeSubKey,hasLine,activeColor,inactiveColor,headerType:'subTab'}}"></template>
66
<view class="l-tabs-main">
7-
<view wx:if="{{!swipeable}}" class="l-tabpanel-content" style="{{'margin-left:'+ -100 *currentIndex +'%;'}}">
7+
<view wx:if="{{!swipeable}}" class="l-tabpanel-content">
88
<view class="l-tabpanel {{item.key===activeKey?'l-tabpanel-active':'l-tabpanel-inactive'}}" wx:for="{{tabList}}" wx:key="{{item.key}}" style="{{placement=='left'||placement=='right' ? 'position:absolute;width:100%;height:100%;transform:translate(0,'+ 100 * index +'%) translateZ(0px);':''}}">
9-
<view class="l-tabpanel-content" wx:if="{{item.subTabs.length>0}}" style="{{'transform:translate(0,'+ -100 * item.subCurrentIndex +'%) translateZ(0px);'}}">
10-
<view class="l-tabpanel" wx:for="{{item.subTabs}}" wx:for-item="tab" wx:key="{{tab.key}}">
9+
<view class="l-subpanel-content" wx:if="{{item.subTabs.length>0}}" style="{{'transform:translate(0,'+ -100 * item.subCurrentIndex +'%) translateZ(0px);'}}">
10+
<view class="l-subpanel" wx:for="{{item.subTabs}}" wx:for-item="tab" wx:key="{{tab.key}}">
1111
<slot name="{{tab.key}}"></slot>
1212
</view>
1313
</view>

dist/combined-tabs/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.l-tabs{display:flex;border-radius:8rpx;box-sizing:border-box;overflow:hidden;flex-direction:column;background:#fff;height:100%}.l-tabs .l-tabs-header{display:flex;width:100%;flex-direction:row;background:#fff;align-items:center}.l-tabs .l-tabs-header .l-tabs-item{flex:1;font-size:28rpx;text-align:center;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.l-tabs .l-tabs-header .l-icon-active,.l-tabs .l-tabs-header .l-tabs-active{color:#333;font-size:28rpx}.l-tabs .l-tabs-header .l-icon-inactive,.l-tabs .l-tabs-header .l-tabs-inactive{font-size:28rpx;color:#bbb}.l-tabs .l-tabs-header .l-tabsitems-row{flex-direction:row}.l-tabs .l-tabs-header .l-tabsitems-row .l-icon-active,.l-tabs .l-tabs-header .l-tabsitems-row .l-icon-inactive{margin-right:10rpx}.l-tabs .l-tabs-header .l-tabsitems-row-reverse{flex-direction:row-reverse}.l-tabs .l-tabs-header .l-tabsitems-row-reverse .l-icon-active,.l-tabs .l-tabs-header .l-tabsitems-row-reverse .l-icon-inactive{margin-left:10rpx}.l-placement-top .l-tabs-header{height:80rpx}.l-placement-top .l-tabs-header .l-tabs-item{min-height:100%}.l-sub-placement-left{flex-direction:row}.l-sub-placement-left .l-tabs-header{flex-direction:column;width:160rpx}.l-sub-placement-left .l-tabs-header>view{width:100%;height:80rpx;background:#f6f8fa}.l-sub-placement-left .l-tabs-header>.l-tabs-active{background:#fff}.l-tabpanel-content{display:flex}.l-sub-placement-left .l-tabs-main .l-tabpanel-content{width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;position:relative;will-change:transform;transition:transform .3s cubic-bezier(.645,.045,.355,1)}.l-placement-top .l-tabpanel-content{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.l-aminmated.l-placement-top .l-tabpanel-content{will-change:margin-left;-webkit-transition:margin-left .3s cubic-bezier(.645,.045,.355,1);transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.l-tabpanel{width:100%;height:100%;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:opacity .45s;transition:opacity .45s;opacity:1;text-overflow:ellipsis}.l-tabpanel-inactive{opacity:0;height:0;padding:0!important;pointer-events:none}.l-tabs-scroll.l-tabs-horizontal .l-tabs-header{-webkit-overflow-scrolling:touch;white-space:nowrap}.l-tabs-scroll.l-tabs-horizontal .l-tabs-header .l-tabs-item{overflow:visible;min-width:160rpx}.l-tabs-vertical .l-tabsscroll{width:160rpx}.l-tabs-vertical .l-tabs-header{height:100%;min-height:80rpx;-webkit-overflow-scrolling:touch;white-space:nowrap}.l-tabs-vertical .l-tabs-header .l-tabs-item{overflow:visible;min-height:80rpx}.l-tabs-item{position:relative}.l-tab-line{position:absolute;bottom:0;left:0;right:0;width:0;background:#000}.l-tabs-horizontal .l-tab-line{height:4rpx;margin:0 auto}.l-tabs-horizontal .l-tabs-active .l-tab-line{width:100%;transition-delay:.1s}.l-placement-top .l-tab-line{bottom:0}.l-placement-top .l-tabs-header-line{border-bottom:1px solid #f3f3f3}.l-tabs-vertical .l-tabs-active .l-tab-line{width:6rpx!important;height:40rpx!important;border-radius:0 6rpx 6rpx 0;top:0;left:0;margin:auto 0;transition-delay:.1s}.l-sub-placement-left .l-tab-line{left:0;right:auto}.l-sub-placement-left .l-tabs-header-line{border-right:1px solid #f3f3f3}.l-tab-image{width:100rpx;height:100rpx}.l-tab-image-placement-top{flex-direction:column}.l-tab-image-placement-left{flex-direction:row}.l-tabs-main{width:100%;height:100%;display:flex;flex-direction:row}.l-combined-tabs-main{display:flex}
1+
.l-tabs{display:flex;border-radius:8rpx;box-sizing:border-box;overflow:hidden;flex-direction:column;background:#fff;height:100%}.l-tabs .l-tabs-header{display:flex;width:100%;flex-direction:row;background:#fff;align-items:center}.l-tabs .l-tabs-header .l-tabs-item{flex:1;font-size:28rpx;text-align:center;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.l-tabs .l-tabs-header .l-icon-active,.l-tabs .l-tabs-header .l-tabs-active{color:#333;font-size:28rpx}.l-tabs .l-tabs-header .l-icon-inactive,.l-tabs .l-tabs-header .l-tabs-inactive{font-size:28rpx;color:#bbb}.l-tabs .l-tabs-header .l-tabsitems-row{flex-direction:row}.l-tabs .l-tabs-header .l-tabsitems-row .l-icon-active,.l-tabs .l-tabs-header .l-tabsitems-row .l-icon-inactive{margin-right:10rpx}.l-tabs .l-tabs-header .l-tabsitems-row-reverse{flex-direction:row-reverse}.l-tabs .l-tabs-header .l-tabsitems-row-reverse .l-icon-active,.l-tabs .l-tabs-header .l-tabsitems-row-reverse .l-icon-inactive{margin-left:10rpx}.l-placement-top .l-tabs-header{height:80rpx}.l-placement-top .l-tabs-header .l-tabs-item{min-height:100%}.l-sub-placement-left{flex-direction:row}.l-sub-placement-left .l-tabs-header{flex-direction:column;width:160rpx}.l-sub-placement-left .l-tabs-header>view{width:100%;height:80rpx;background:#f6f8fa}.l-sub-placement-left .l-tabs-header>.l-tabs-active{background:#fff}.l-sub-placement-left .l-tabs-main .l-tabpanel-content{width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;position:relative;will-change:transform;transition:transform .3s cubic-bezier(.645,.045,.355,1)}.l-placement-top .l-tabpanel-content{width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.l-subpanel-content{width:100%;height:100%}.l-tabpanel{width:100%;height:100%;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:opacity .45s;transition:opacity .45s;opacity:1;text-overflow:ellipsis}.l-tabpanel-inactive{opacity:0;height:0;padding:0!important;pointer-events:none}.l-subpanel{height:100%}.l-tabs-scroll.l-tabs-horizontal .l-tabs-header{-webkit-overflow-scrolling:touch;white-space:nowrap}.l-tabs-scroll.l-tabs-horizontal .l-tabs-header .l-tabs-item{overflow:visible;min-width:160rpx}.l-tabs-scroll.l-tabs-horizontal .l-tabpanel-content{height:150px}.l-tabs-vertical .l-tabsscroll{width:160rpx}.l-tabs-vertical .l-tabs-header{height:100%;min-height:80rpx;-webkit-overflow-scrolling:touch;white-space:nowrap}.l-tabs-vertical .l-tabs-header .l-tabs-item{overflow:visible;min-height:80rpx}.l-tabs-item{position:relative}.l-tab-line{position:absolute;bottom:0;left:0;right:0;width:0;background:#000}.l-tabs-horizontal .l-tab-line{height:4rpx;margin:0 auto}.l-tabs-horizontal .l-tabs-active .l-tab-line{width:100%;transition-delay:.1s}.l-placement-top .l-tab-line{bottom:0}.l-placement-top .l-tabs-header-line{border-bottom:1px solid #f3f3f3}.l-tabs-vertical .l-tabs-active .l-tab-line{width:6rpx!important;height:40rpx!important;border-radius:0 6rpx 6rpx 0;top:0;left:0;margin:auto 0;transition-delay:.1s}.l-sub-placement-left .l-tab-line{left:0;right:auto}.l-sub-placement-left .l-tabs-header-line{border-right:1px solid #f3f3f3}.l-tab-image{width:100rpx;height:100rpx}.l-tab-image-placement-top{flex-direction:column}.l-tab-image-placement-left{flex-direction:row}.l-tabs-main{flex:1}.l-combined-tabs-main{display:flex}

dist/counter/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
value="{{result}}"
1414
bindblur="onBlur"></input>
1515
<view wx:else class="l-count-class count" bindtap="onCount">{{result}}</view>
16-
<view class="l-symbol-class symbol {{result>=max|| disabled?'disabled l-disabled-class':'abled l-symbol-class'}}"
16+
<view class="symbol {{result>=max|| disabled?'disabled l-disabled-class':'abled l-symbol-class'}}"
1717
catchtap="{{result>=max|| disabled?'doNothing':'addTap'}}"
1818
data-type="overflow_max"
1919
hover-class="{{isHover?'count-hover':''}}">

dist/grid-item/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ Component({
1818
attached() {
1919

2020
},
21+
observers: {
22+
'key': function() {
23+
const parent = this.getRelationNodes('../grid/index')[0];
24+
if (parent) {
25+
parent.setData({
26+
gridItems: [],
27+
childNum: 0
28+
});
29+
parent.initGrids();
30+
}
31+
}
32+
},
2133

2234
lifetimes: {
2335
show() {
@@ -31,4 +43,4 @@ Component({
3143
}, { bubbles: true, composed: true });
3244
},
3345
}
34-
});
46+
});

dist/image-picker/index.js

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ Component({
4646
value: false
4747
},
4848
// 是否可以预览
49-
isPreview: {
49+
preview: {
5050
type: Boolean,
5151
value: true
52+
},
53+
// 所选图片最大限制,单位字节
54+
maxImageSize: {
55+
type: Number,
56+
value: 10000000,
5257
}
5358
},
5459

@@ -78,7 +83,7 @@ Component({
7883
*/
7984
methods: {
8085
handleClear() {
81-
var urls = this.data.urls;
86+
let urls = this.data.urls;
8287
this.setData({
8388
urls: [],
8489
clear: false,
@@ -97,8 +102,8 @@ Component({
97102
onPreviewTap(e) {
98103
const index = e.currentTarget.dataset.index;
99104
const urls = this.data.urls;
100-
var tempFilePath = '';
101-
var previewImageList = [];
105+
let tempFilePath = '';
106+
let previewImageList = [];
102107
const newOrOld = this.data.newOrOld;
103108

104109
if (newOrOld == 'old') {
@@ -107,7 +112,7 @@ Component({
107112

108113
} else {
109114
tempFilePath = this.data.urls[index].url;
110-
for (var i = 0; i < urls.length; i++) {
115+
for (let i = 0; i < urls.length; i++) {
111116
previewImageList.push(urls[i].url);
112117
}
113118
}
@@ -119,7 +124,7 @@ Component({
119124
all: urls // 需要预览的图片http链接列表
120125
};
121126
let option = {};
122-
if (this.data.isPreview === true) {
127+
if (this.data.preview === true) {
123128
wx.previewImage({
124129
current: tempFilePath, // 当前显示图片的http链接
125130
urls: previewImageList // 需要预览的图片http链接列表
@@ -143,15 +148,21 @@ Component({
143148
sourceType: ['album', 'camera'],
144149
success(res) {
145150
// tempFilePath可以作为img标签的src属性显示图片
146-
var tempFilePath = [];
151+
let tempFilePath = [];
147152
if (newOrOld == 'old') {
148153
tempFilePath = res.tempFilePaths;
149154
} else {
150-
for (var i = 0; i < res.tempFilePaths.length; i++) {
155+
for (let i = 0; i < res.tempFilePaths.length; i++) {
151156
tempFilePath.push({
152157
url: res.tempFilePaths[i],
153158
// key: null
159+
imageSize: res.tempFiles[i].size
154160
});
161+
if (res.tempFiles[i].size > that.data.maxImageSize) {
162+
tempFilePath[i].overSize = true;
163+
} else {
164+
tempFilePath[i].overSize = false;
165+
}
155166
}
156167
}
157168
const newtempFilePaths = that.data.urls.concat(tempFilePath);
@@ -174,6 +185,23 @@ Component({
174185

175186
that.triggerEvent('linchange', detail, option);
176187
that.triggerEvent('linpush', detail, option);
188+
189+
// 超过大小的image集合
190+
let overSizeList = [];
191+
for (let n = 0; n < newtempFilePaths.length; n++) {
192+
if (newtempFilePaths[n].overSize) {
193+
overSizeList.push(newtempFilePaths[n]);
194+
}
195+
}
196+
197+
if (overSizeList.length > 0) {
198+
let detail = {
199+
current: tempFilePath,
200+
all: newtempFilePaths,
201+
overSizeList: overSizeList,
202+
};
203+
that.triggerEvent('linoversize', detail, option);
204+
}
177205
}
178206
});
179207

dist/loading/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</block>
3636
</view>
3737
</view>
38-
<view wx:if="{{!fullScreen}}" style="position: relative">
38+
<view wx:if="{{!fullScreen}}" class="l-container-class" style="position: relative">
3939
<slot name="content"/>
4040
<view wx:if="{{show}}" class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
4141
<view wx:if="{{show}}" class="l-class loading-icon-container" style="z-index:{{zIndex + 1}}">

dist/popup/index.js

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Component({
1313
},
1414
// 动画效果的显示和隐藏
1515
animation: {
16-
type: String,
17-
value: 'show'
16+
type: Boolean,
17+
value: true
1818
},
1919
// slot的位置
2020
contentAlign: {
@@ -41,7 +41,7 @@ Component({
4141
* 组件的初始数据
4242
*/
4343
data: {
44-
44+
status: 'show'
4545
},
4646

4747
/**
@@ -53,7 +53,7 @@ Component({
5353
wx.lin.showPopup = (options) => {
5454
const {
5555
zIndex = 99,
56-
animation = 'show',
56+
animation = true,
5757
contentAlign = 'center',
5858
locked = false
5959
} = { ...options };
@@ -67,8 +67,14 @@ Component({
6767
};
6868
wx.lin.hidePopup = () => {
6969
this.setData({
70-
show: false
70+
status: 'hide'
7171
});
72+
setTimeout(()=>{
73+
this.setData({
74+
show: false,
75+
status: 'show'
76+
});
77+
},300);
7278
};
7379
},
7480
// 阻止滑动
@@ -84,9 +90,25 @@ Component({
8490
let detail = true;
8591
let option = { bubbles: true, composed: true };
8692
if (this.data.locked !== true) {
87-
this.setData({
88-
show: !this.data.show
89-
});
93+
if(!this.data.show) {
94+
this.setData({
95+
show: true,
96+
status: 'show'
97+
});
98+
} else {
99+
this.setData({
100+
status: 'hide'
101+
});
102+
setTimeout(()=>{
103+
this.setData({
104+
show: false,
105+
status: 'show'
106+
});
107+
},300);
108+
}
109+
// this.setData({
110+
// show: !this.data.show
111+
// });
90112
}
91113

92114
this.triggerEvent('lintap', detail, option);

dist/popup/index.wxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<view class='container-bg l-bg-class'></view>
44
<view
55
wx:if="{{show}}"
6-
class="popup-content {{ show ? contentAlign : ''}} popup-fade-{{show ? contentAlign : ''}}-active-{{animation}}" catchtap='onPupopTap'>
6+
class="popup-content {{ show ? contentAlign : ''}} popup-fade-{{contentAlign}}-active-{{animation ? status:''}}" catchtap='onPupopTap'>
77
<view catchtap="doNothingTap">
88
<slot></slot>
99
</view>
1010
</view>
11-
</view>
11+
</view>

0 commit comments

Comments
 (0)