Skip to content

Commit

Permalink
feat:发布0.6.13版本
Browse files Browse the repository at this point in the history
  • Loading branch information
二一 committed Dec 4, 2019
2 parents e3e36c7 + 089b65b commit 15fe170
Show file tree
Hide file tree
Showing 50 changed files with 443 additions and 145 deletions.
4 changes: 2 additions & 2 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const {
const path = require('path');

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

const distPath = path.resolve(__dirname, '../dist');
const examplePath = path.resolve(__dirname, '../examples/dist');
Expand Down
6 changes: 3 additions & 3 deletions dist/combined-tabs/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<view class="l-tabs l-sub-placement-left l-tabs-vertical {{aminmated ? 'l-aminmated' :''}} {{scrollable ? 'l-tabs-scroll':''}}">
<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>
<view class="l-tabs-main">
<view wx:if="{{!swipeable}}" class="l-tabpanel-content" style="{{'margin-left:'+ -100 *currentIndex +'%;'}}">
<view wx:if="{{!swipeable}}" class="l-tabpanel-content">
<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);':''}}">
<view class="l-tabpanel-content" wx:if="{{item.subTabs.length>0}}" style="{{'transform:translate(0,'+ -100 * item.subCurrentIndex +'%) translateZ(0px);'}}">
<view class="l-tabpanel" wx:for="{{item.subTabs}}" wx:for-item="tab" wx:key="{{tab.key}}">
<view class="l-subpanel-content" wx:if="{{item.subTabs.length>0}}" style="{{'transform:translate(0,'+ -100 * item.subCurrentIndex +'%) translateZ(0px);'}}">
<view class="l-subpanel" wx:for="{{item.subTabs}}" wx:for-item="tab" wx:key="{{tab.key}}">
<slot name="{{tab.key}}"></slot>
</view>
</view>
Expand Down
2 changes: 1 addition & 1 deletion dist/combined-tabs/index.wxss
Original file line number Diff line number Diff line change
@@ -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}
.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}
2 changes: 1 addition & 1 deletion dist/counter/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
value="{{result}}"
bindblur="onBlur"></input>
<view wx:else class="l-count-class count" bindtap="onCount">{{result}}</view>
<view class="l-symbol-class symbol {{result>=max|| disabled?'disabled l-disabled-class':'abled l-symbol-class'}}"
<view class="symbol {{result>=max|| disabled?'disabled l-disabled-class':'abled l-symbol-class'}}"
catchtap="{{result>=max|| disabled?'doNothing':'addTap'}}"
data-type="overflow_max"
hover-class="{{isHover?'count-hover':''}}">
Expand Down
14 changes: 13 additions & 1 deletion dist/grid-item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ Component({
attached() {

},
observers: {
'key': function() {
const parent = this.getRelationNodes('../grid/index')[0];
if (parent) {
parent.setData({
gridItems: [],
childNum: 0
});
parent.initGrids();
}
}
},

lifetimes: {
show() {
Expand All @@ -31,4 +43,4 @@ Component({
}, { bubbles: true, composed: true });
},
}
});
});
44 changes: 36 additions & 8 deletions dist/image-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ Component({
value: false
},
// 是否可以预览
isPreview: {
preview: {
type: Boolean,
value: true
},
// 所选图片最大限制,单位字节
maxImageSize: {
type: Number,
value: 10000000,
}
},

Expand Down Expand Up @@ -78,7 +83,7 @@ Component({
*/
methods: {
handleClear() {
var urls = this.data.urls;
let urls = this.data.urls;
this.setData({
urls: [],
clear: false,
Expand All @@ -97,8 +102,8 @@ Component({
onPreviewTap(e) {
const index = e.currentTarget.dataset.index;
const urls = this.data.urls;
var tempFilePath = '';
var previewImageList = [];
let tempFilePath = '';
let previewImageList = [];
const newOrOld = this.data.newOrOld;

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

} else {
tempFilePath = this.data.urls[index].url;
for (var i = 0; i < urls.length; i++) {
for (let i = 0; i < urls.length; i++) {
previewImageList.push(urls[i].url);
}
}
Expand All @@ -119,7 +124,7 @@ Component({
all: urls // 需要预览的图片http链接列表
};
let option = {};
if (this.data.isPreview === true) {
if (this.data.preview === true) {
wx.previewImage({
current: tempFilePath, // 当前显示图片的http链接
urls: previewImageList // 需要预览的图片http链接列表
Expand All @@ -143,15 +148,21 @@ Component({
sourceType: ['album', 'camera'],
success(res) {
// tempFilePath可以作为img标签的src属性显示图片
var tempFilePath = [];
let tempFilePath = [];
if (newOrOld == 'old') {
tempFilePath = res.tempFilePaths;
} else {
for (var i = 0; i < res.tempFilePaths.length; i++) {
for (let i = 0; i < res.tempFilePaths.length; i++) {
tempFilePath.push({
url: res.tempFilePaths[i],
// key: null
imageSize: res.tempFiles[i].size
});
if (res.tempFiles[i].size > that.data.maxImageSize) {
tempFilePath[i].overSize = true;
} else {
tempFilePath[i].overSize = false;
}
}
}
const newtempFilePaths = that.data.urls.concat(tempFilePath);
Expand All @@ -174,6 +185,23 @@ Component({

that.triggerEvent('linchange', detail, option);
that.triggerEvent('linpush', detail, option);

// 超过大小的image集合
let overSizeList = [];
for (let n = 0; n < newtempFilePaths.length; n++) {
if (newtempFilePaths[n].overSize) {
overSizeList.push(newtempFilePaths[n]);
}
}

if (overSizeList.length > 0) {
let detail = {
current: tempFilePath,
all: newtempFilePaths,
overSizeList: overSizeList,
};
that.triggerEvent('linoversize', detail, option);
}
}
});

Expand Down
2 changes: 1 addition & 1 deletion dist/loading/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</block>
</view>
</view>
<view wx:if="{{!fullScreen}}" style="position: relative">
<view wx:if="{{!fullScreen}}" class="l-container-class" style="position: relative">
<slot name="content"/>
<view wx:if="{{show}}" class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
<view wx:if="{{show}}" class="l-class loading-icon-container" style="z-index:{{zIndex + 1}}">
Expand Down
38 changes: 30 additions & 8 deletions dist/popup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Component({
},
// 动画效果的显示和隐藏
animation: {
type: String,
value: 'show'
type: Boolean,
value: true
},
// slot的位置
contentAlign: {
Expand All @@ -41,7 +41,7 @@ Component({
* 组件的初始数据
*/
data: {

status: 'show'
},

/**
Expand All @@ -53,7 +53,7 @@ Component({
wx.lin.showPopup = (options) => {
const {
zIndex = 99,
animation = 'show',
animation = true,
contentAlign = 'center',
locked = false
} = { ...options };
Expand All @@ -67,8 +67,14 @@ Component({
};
wx.lin.hidePopup = () => {
this.setData({
show: false
status: 'hide'
});
setTimeout(()=>{
this.setData({
show: false,
status: 'show'
});
},300);
};
},
// 阻止滑动
Expand All @@ -84,9 +90,25 @@ Component({
let detail = true;
let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
show: !this.data.show
});
if(!this.data.show) {
this.setData({
show: true,
status: 'show'
});
} else {
this.setData({
status: 'hide'
});
setTimeout(()=>{
this.setData({
show: false,
status: 'show'
});
},300);
}
// this.setData({
// show: !this.data.show
// });
}

this.triggerEvent('lintap', detail, option);
Expand Down
4 changes: 2 additions & 2 deletions dist/popup/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<view class='container-bg l-bg-class'></view>
<view
wx:if="{{show}}"
class="popup-content {{ show ? contentAlign : ''}} popup-fade-{{show ? contentAlign : ''}}-active-{{animation}}" catchtap='onPupopTap'>
class="popup-content {{ show ? contentAlign : ''}} popup-fade-{{contentAlign}}-active-{{animation ? status:''}}" catchtap='onPupopTap'>
<view catchtap="doNothingTap">
<slot></slot>
</view>
</view>
</view>
</view>
Loading

0 comments on commit 15fe170

Please sign in to comment.