diff --git a/README.md b/README.md
index bbd16fb9..b7fbd7fc 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
![](https://img.shields.io/badge/build-passing-00d508.svg)
-![](https://img.shields.io/badge/version-0.5.12-3963bc.svg)
+![](https://img.shields.io/badge/version-0.5.13-3963bc.svg)
![](https://img.shields.io/badge/license-MIT-3963bc.svg)
@@ -39,7 +39,7 @@ Lin UI 是基于 **微信小程序原生语法** 实现的组件库。遵循简
## 最新版本
-核心库:0.5.12
+核心库:0.5.13
示例工程:0.0.1-alpha.2
diff --git a/build/build-prod.js b/build/build-prod.js
index 596f555e..e8613165 100644
--- a/build/build-prod.js
+++ b/build/build-prod.js
@@ -13,7 +13,6 @@ gulp.task('dispose-js', () => {
.pipe(gulp.dest('../dist/'));
});
-
gulp.task('dispose-wxss', () => {
const path = isCustom ? `../src/${result}/*.less` : '../src/**/*.less',
remainPath = isCustom ? `!../src/${result}/_*.less` : '!../src/**/_*.less';
diff --git a/config/component.json b/config/component.json
index 03c93db7..026b5e89 100644
--- a/config/component.json
+++ b/config/component.json
@@ -1,5 +1,3 @@
{
- "components": [
-
- ]
+ "components": []
}
diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js
index 7ab61bcf..74f969e0 100644
--- a/dist/action-sheet/index.js
+++ b/dist/action-sheet/index.js
@@ -87,7 +87,7 @@ Component({
success
} = this.data;
success && success({ ...e.currentTarget.dataset });
- this.triggerEvent('linitemtap', { ...e.currentTarget.dataset });
+ this.triggerEvent('linitemtap', { ...e.currentTarget.dataset },{ bubbles: true, composed: true });
this._hideActionSheet();
},
@@ -112,7 +112,7 @@ Component({
});
this.triggerEvent('lincancel', {
errMsg: 'showactionsheet:fail cancel'
- });
+ },{ bubbles: true, composed: true });
this._hideActionSheet();
},
diff --git a/dist/badge/index.js b/dist/badge/index.js
index a1275d86..09721a18 100644
--- a/dist/badge/index.js
+++ b/dist/badge/index.js
@@ -1,5 +1,5 @@
Component({
- externalClasses: ['l-class','l-class-self'],
+ externalClasses: ['l-class', 'l-class-self'],
properties: {
// 红点模式
dot: {
@@ -32,32 +32,34 @@ Component({
// 最终数字
finalCount() {
switch (this.data.countType) {
- case 'overflow':
- this.setData({
- finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
- });
- break;
- case 'ellipsis':
- this.setData({
- finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
- });
- break;
- case 'limit':
- this.setData({
- finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
- })
- break;
- default:
- this.setData({
- finalCount: parseInt(this.data.count)
- })
- break;
+ case 'overflow':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
+ });
+ break;
+ case 'ellipsis':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
+ });
+ break;
+ case 'limit':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
+ });
+ break;
+ default:
+ this.setData({
+ finalCount: parseInt(this.data.count)
+ });
+ break;
}
},
// 点击事件
handleTap() {
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch', {}, { bubbles: true });
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
},
}
});
\ No newline at end of file
diff --git a/dist/button/index.js b/dist/button/index.js
index dfb4f0e2..5ed9c3a4 100644
--- a/dist/button/index.js
+++ b/dist/button/index.js
@@ -32,10 +32,11 @@ Component({
value: false,
},
// 微信原生接口
- width:Number,
- height:Number,
+ width: Number,
+ height: Number,
icon: String,
image: String,
+ bgColor: String,
iconStyle: {
type: String,
value: 'size:20;color:#3683D6'
@@ -68,8 +69,10 @@ Component({
// button点击事件
handleTap() {
if (this.data.disabled) return false;
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch',{},{ bubbles: true });
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
},
// 开放能力事件回调
openTypeEvent(data) {
diff --git a/dist/button/index.wxml b/dist/button/index.wxml
index 2a915345..7bfb7c5a 100644
--- a/dist/button/index.wxml
+++ b/dist/button/index.wxml
@@ -10,7 +10,7 @@
hover-stop-propagation="{{hoverStopPropagation}}"
hover-start-time="{{hoverStartTime}}"
hover-stay-time="{{hoverStayTime}}"
- style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0':''}}">
+ style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0;':''}} {{'background-color:'+bgColor}}">
diff --git a/dist/card/index.js b/dist/card/index.js
index 0f4226fe..b3d16fbe 100644
--- a/dist/card/index.js
+++ b/dist/card/index.js
@@ -35,4 +35,4 @@ Component({
methods: {
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/dist/count-selector/index.js b/dist/count-selector/index.js
index f7dfe4ac..4a5e110e 100644
--- a/dist/count-selector/index.js
+++ b/dist/count-selector/index.js
@@ -1,7 +1,7 @@
Component({
externalClasses: [
- 'l-class',
- 'l-symbol-class',
+ 'l-class',
+ 'l-symbol-class',
'l-count-class',
'l-disabled-class'
],
@@ -41,67 +41,76 @@ Component({
onBlur(e) {
let {
value
- } = e.detail
+ } = e.detail;
setTimeout(() => {
- this.blurCount(value)
- }, 50)
+ this.blurCount(value);
+ }, 50);
},
blurCount(value) {
if (value) {
if (value > this.properties.max) this.setData({
count: this.properties.max
- })
+ });
else if (value < this.properties.min) this.setData({
count: this.properties.min
- })
+ });
else this.setData({
count: value
- })
+ });
} else {
this.setData({
count: this.properties.count
- })
+ });
}
let detail = {
count: this.data.count,
type: 'blur'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
reduceTap() {
- let distance = this.data.count - this.properties.step
+ let distance = this.data.count - this.properties.step;
if (distance <= this.properties.min) {
- this.data.count = this.properties.min
+ this.data.count = this.properties.min;
} else {
- this.data.count -= this.properties.step
+ this.data.count -= this.properties.step;
}
this.setData({
count: this.data.count
- })
+ });
let detail = {
count: this.data.count,
type: 'reduce'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
addTap() {
let distance = this.data.count + this.properties.step;
if (distance >= this.properties.max) {
- this.data.count = this.properties.max
+ this.data.count = this.properties.max;
} else {
this.data.count += this.properties.step;
}
this.setData({
count: this.data.count
- })
+ });
let detail = {
count: this.data.count,
type: 'add'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/dist/custom-tab-bar/index.js b/dist/custom-tab-bar/index.js
index a3309a04..c4dd6580 100644
--- a/dist/custom-tab-bar/index.js
+++ b/dist/custom-tab-bar/index.js
@@ -90,7 +90,7 @@ Component({
idx,
path:this.route
};
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('lintap', detail, option);
},
showRedDot(idx) {
diff --git a/dist/dialog/index.js b/dist/dialog/index.js
index a87905c4..9cad9271 100644
--- a/dist/dialog/index.js
+++ b/dist/dialog/index.js
@@ -155,7 +155,7 @@ Component({
onCancelTap(e) {
let detail = 'cancel';
- let option = {};
+ let option = { bubbles: true, composed: true };
const {
success
@@ -175,7 +175,7 @@ Component({
// 背景点击事件
onDialogTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
diff --git a/dist/grid-item/index.js b/dist/grid-item/index.js
index ff43aec6..cb1e500d 100644
--- a/dist/grid-item/index.js
+++ b/dist/grid-item/index.js
@@ -22,9 +22,7 @@ Component({
tapGridItem(e) {
this.triggerEvent('lintap', {
...e
- }, {
- composed: true
- })
+ }, { bubbles: true, composed: true })
},
}
});
\ No newline at end of file
diff --git a/dist/grid/index.js b/dist/grid/index.js
index 7dd1f849..a303962f 100644
--- a/dist/grid/index.js
+++ b/dist/grid/index.js
@@ -70,7 +70,7 @@ Component({
tapGrid(e) {
this.triggerEvent('lintap', {
index:this.data.currentIndex
- })
+ },{ bubbles: true, composed: true })
}
}
});
\ No newline at end of file
diff --git a/dist/list/index.js b/dist/list/index.js
index 75728a45..e9e2ab42 100644
--- a/dist/list/index.js
+++ b/dist/list/index.js
@@ -77,7 +77,7 @@ Component({
}
this.triggerEvent('lintap', {
e
- }, {})
+ }, { bubbles: true, composed: true })
}
}
});
\ No newline at end of file
diff --git a/dist/loading/index.js b/dist/loading/index.js
index bd75066a..5deaf671 100644
--- a/dist/loading/index.js
+++ b/dist/loading/index.js
@@ -1,5 +1,5 @@
Component({
- externalClasses: ['l-container-class','l-class'],
+ externalClasses: ['l-container-class', 'l-class'],
properties: {
// 显示与隐藏
show: {
@@ -32,9 +32,39 @@ Component({
value: false,
}
},
+
+ attached() {
+ this._init();
+ },
+
methods: {
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.showLoading = (options) => {
+ const {
+ custom = false,
+ fullScreen = false,
+ color = '',
+ type = 'rotate',
+ size = 'default'
+ } = { ...options };
+ this.setData({
+ custom,
+ fullScreen,
+ color,
+ type,
+ size,
+ show: true
+ });
+ };
+ wx.lin.hideLoading = () => {
+ this.setData({
+ show: false
+ });
+ };
+ },
// 阻止滑动
- doNothingMove(e) {
+ doNothingMove() {
// do nothing……
},
}
diff --git a/dist/loadmore/index.js b/dist/loadmore/index.js
index 5a0c482e..d5163fd4 100644
--- a/dist/loadmore/index.js
+++ b/dist/loadmore/index.js
@@ -4,21 +4,21 @@ Component({
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
properties: {
- show:Boolean,
- custom:Boolean,
- line:Boolean,
- color:String,
- type:{
- type:String,
- value:'loading'
+ show: Boolean,
+ custom: Boolean,
+ line: Boolean,
+ color: String,
+ type: {
+ type: String,
+ value: 'loading'
},
- endText:{
- type:String,
- value:'我是有底线的~'
+ endText: {
+ type: String,
+ value: '我是有底线的~'
},
- loadingText:{
- type:String,
- value:'加载中...'
+ loadingText: {
+ type: String,
+ value: '加载中...'
}
},
@@ -26,13 +26,43 @@ Component({
},
- ready: function () {
-
+ attached() {
+ this._init();
},
+
methods: {
- onLoadmore(){
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch',{},{ bubbles: true });
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.showLoadmore = (options) => {
+ const {
+ custom = false,
+ line = false,
+ color = '',
+ type = 'loading',
+ endText = '我是有底线的',
+ loadingText = '加载中...'
+ } = { ...options };
+ this.setData({
+ custom,
+ line,
+ color,
+ type,
+ endText,
+ loadingText,
+ show: true
+ });
+ };
+ wx.lin.hideLoadmore = () => {
+ this.setData({
+ show: false
+ });
+ };
+ },
+ onLoadmore() {
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
}
}
});
diff --git a/dist/mask/index.js b/dist/mask/index.js
index c8040846..17637022 100644
--- a/dist/mask/index.js
+++ b/dist/mask/index.js
@@ -64,7 +64,7 @@ Component({
onMaskTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
diff --git a/dist/message/index.js b/dist/message/index.js
index 37467673..460dd7a7 100644
--- a/dist/message/index.js
+++ b/dist/message/index.js
@@ -35,7 +35,7 @@ Component({
observers: {
'show': function (show) {
- show && this.changeStatus()
+ show && this.changeStatus();
}
},
@@ -51,7 +51,7 @@ Component({
duration = 1500,
success = null
} = options;
- this.data.success = success
+ this.data.success = success;
this.setData({
content,
icon,
@@ -59,7 +59,7 @@ Component({
duration,
type
});
- this.changeStatus()
+ this.changeStatus();
return this;
};
},
@@ -67,15 +67,15 @@ Component({
changeStatus() {
this.setData({
status: true
- })
- if (this.data.timer) clearTimeout(this.data.timer)
+ });
+ if (this.data.timer) clearTimeout(this.data.timer);
this.data.timer = setTimeout(() => {
this.setData({
status: false
- })
- if (this.data.success) this.data.success()
- this.data.timer = null
- }, this.properties.duration)
+ });
+ if (this.data.success) this.data.success();
+ this.data.timer = null;
+ }, this.properties.duration);
}
}
});
\ No newline at end of file
diff --git a/dist/notice-bar/index.js b/dist/notice-bar/index.js
index 46953681..f6f5d2a0 100644
--- a/dist/notice-bar/index.js
+++ b/dist/notice-bar/index.js
@@ -17,9 +17,9 @@ Component({
type: Number,
value: 28
},
- frontIconColor:{
- type:String,
- value:'#3683D6'
+ frontIconColor: {
+ type: String,
+ value: '#3683D6'
},
endIconName: {
type: String,
@@ -29,9 +29,9 @@ Component({
type: Number,
value: 28
},
- endIconColor:{
- type:String,
- value:'#3683D6'
+ endIconColor: {
+ type: String,
+ value: '#3683D6'
},
// 背景颜色
backgroundcolor: {
@@ -83,7 +83,7 @@ Component({
const duration = rect.width / 40 * this.data.speed;
const animation = wx.createAnimation({
duration: duration,
- timingFunction: "linear",
+ timingFunction: 'linear',
});
this.setData({
wrapWidth: wrapRect.width,
@@ -126,20 +126,18 @@ Component({
}
},
handleTap() {
- this.triggerEvent('lintap');
- this.triggerEvent('lincatchtap', {}, { bubbles: true });
+ this.triggerEvent('lintap',{},{ bubbles: true, composed: true });
this.setData({
timer: null
});
},
- onSwip(e){
+ onSwip(e) {
this.triggerEvent('lintap', {
...e.currentTarget.dataset
- });
+ },{ bubbles: true, composed: true });
},
onIconTap(){
- this.triggerEvent('linicontap');
- this.triggerEvent('liniconcatchtap', {}, { bubbles: true });
+ this.triggerEvent('linicontap',{},{ bubbles: true, composed: true });
this.setData({
timer: null
});
diff --git a/dist/popup/index.js b/dist/popup/index.js
index 112a8b76..5fbfd543 100644
--- a/dist/popup/index.js
+++ b/dist/popup/index.js
@@ -54,7 +54,7 @@ Component({
// 点击事件
onPupopTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
show: !this.data.show
diff --git a/dist/price/index.js b/dist/price/index.js
index ab4bb540..cce91dec 100644
--- a/dist/price/index.js
+++ b/dist/price/index.js
@@ -2,7 +2,7 @@ Component({
/**
* 组件的属性列表
*/
- externalClasses: ['l-class', 'l-unit-class', 'l-count-class'],
+ externalClasses: ['l-deleted-class', 'l-unit-class', 'l-count-class', 'l-class'],
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
@@ -11,40 +11,31 @@ Component({
type: String,
value: '¥'
},
- unitColor: {
+ size: {
type: String,
- value: '#333'
+ value: '28'
},
- unitSize: {
- type: [String, Number],
- value: 28
- },
- unitBold: {
- type: String,
- value: 'normal'
- },
- count: {
- type: Number,
- value: 0.00,
- observer: 'reserveNumber'
- },
- countColor: {
+ color: {
type: String,
- value: '#333'
- },
- countSize: {
- type: [String, Number],
- value: 28
+ value: '#3963BC'
},
- countBold: {
+ bold: {
type: String,
- value: 'normal'
+ value: '500'
},
- delete: Boolean,
- delColor: {
+ unitColor: String,
+ unitSize: String,
+ unitBold: String,
+ count: {
type: String,
- value: '#777'
+ value: '0.00',
+ observer: 'reserveNumber'
},
+ countColor: String,
+ countSize: String,
+ countBold: String,
+ deleted: Boolean,
+ delColor: String,
reserveDigit: {
type: Number,
value: 2
@@ -63,21 +54,29 @@ Component({
* 组件的方法列表
*/
methods: {
- reserveNumber(value) {
- const strValue = value.toString();
+ reserveNumber() {
+ const strValue = this.data.count.toString();
+ const isNumber = !isNaN(Number(this.data.count));
const dotIndex = strValue.indexOf('.');
if (strValue.length - dotIndex - 1 > this.data.reserveDigit && dotIndex !== -1) {
this.setData({
- result: strValue.substring(0, dotIndex + this.data.reserveDigit)
+ result: isNumber ? strValue.substring(0, dotIndex + 1 + this.data.reserveDigit) : strValue
});
} else {
- this.addZero(strValue);
+ if (isNumber) {
+ this.addZero(strValue);
+ } else {
+ this.setData({
+ result: strValue
+ });
+ }
}
},
addZero(value) {
- const realLen = value.indexOf('.') + 1 + this.data.reserveDigit;
+ const dotIndex = value.indexOf('.') == -1 ? value.length - 1 : value.indexOf('.');
+ const realLen = dotIndex + 1 + this.data.reserveDigit;
if (value.length < realLen && this.data.autofix) {
- const result = value + '0'.repeat(realLen - value.length);
+ const result = dotIndex == value.indexOf('.') ? value + '0'.repeat(realLen - value.length) : value + '.' + '0'.repeat(realLen - value.length);
this.setData({
result
});
diff --git a/dist/price/index.wxml b/dist/price/index.wxml
index e35de0c8..4506ccfb 100644
--- a/dist/price/index.wxml
+++ b/dist/price/index.wxml
@@ -1,8 +1,8 @@
-
+
- {{unit}}
-
- {{result}}
+ {{unit}}
+
+ {{result}}
\ No newline at end of file
diff --git a/dist/price/index.wxss b/dist/price/index.wxss
index 9aeaeb87..892dfbdd 100644
--- a/dist/price/index.wxss
+++ b/dist/price/index.wxss
@@ -1 +1 @@
-.price-del{text-decoration:line-through!important}.price-container{display:inline-block;text-align:center}
\ No newline at end of file
+.price-del{text-decoration:line-through!important}.price-container{display:inline-block;text-align:center;color:#3963bc;font-size:28rpx}
\ No newline at end of file
diff --git a/dist/search-bar/index.js b/dist/search-bar/index.js
index 09c635ac..84199415 100644
--- a/dist/search-bar/index.js
+++ b/dist/search-bar/index.js
@@ -19,10 +19,6 @@ Component({
value: 'search'
},
placeholder: String,
- confirmType: {
- type: String,
- value: 'search'
- },
cancelText: {
type: String,
value: '取消'
@@ -92,7 +88,10 @@ Component({
*/
methods: {
onCancel() {
- this.triggerEvent('lincancel')
+ this.triggerEvent('lincancel', {}, {
+ bubbles: true,
+ composed: true
+ });
},
// input属性列表
handleInputChange(event) {
@@ -137,7 +136,10 @@ Component({
this.setData({
value: ''
});
- this.triggerEvent('linclear', event.detail);
+ this.triggerEvent('linclear', event.detail, {
+ bubbles: true,
+ composed: true
+ });
}
}
});
\ No newline at end of file
diff --git a/dist/segment/index.wxml b/dist/segment/index.wxml
index 93ea85b5..e2ae10e3 100644
--- a/dist/segment/index.wxml
+++ b/dist/segment/index.wxml
@@ -9,7 +9,7 @@
-
+
diff --git a/dist/slide-view/index.js b/dist/slide-view/index.js
index 698237f1..a3237484 100644
--- a/dist/slide-view/index.js
+++ b/dist/slide-view/index.js
@@ -156,7 +156,7 @@ Component({
// 点击 右边区域
onRightTap(e) {
let detail = 'click right';
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.properties.autoClose) {
this.setData({
popup: false,
@@ -171,7 +171,7 @@ Component({
// 打开后触发
onOpenTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('slideopen', detail, option);
},
@@ -179,7 +179,7 @@ Component({
// 关闭后触发
onCloseTap(e) {
let detail = false;
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('slideclose', detail, option);
}
diff --git a/dist/status-show/index.js b/dist/status-show/index.js
index 80e5cd1e..e7311525 100644
--- a/dist/status-show/index.js
+++ b/dist/status-show/index.js
@@ -28,7 +28,7 @@ Component({
},
ready() {
- this._changeStatus()
+ this._changeStatus();
},
/**
@@ -37,60 +37,59 @@ Component({
methods: {
_changeStatus() {
switch (this.properties.type) {
- case 'success':
- this.setData({
- typeImage: 'image/success.png',
- typeText: '操作成功~'
- })
- break
- case 'error':
- this.setData({
- typeImage: 'image/error.png',
- typeText: '操作失败~'
- })
- break
- case 'cart':
- this.setData({
- typeImage: 'image/cart.png',
- typeText: '购物车空空如也,去逛逛吧~'
- })
- break
- case 'order':
- this.setData({
- typeImage: 'image/order.png',
- typeText: '您暂时还没有订单哦~'
- })
- break
- case 'network':
- this.setData({
- typeImage: 'image/network.png',
- typeText: '糟糕!网络错误~'
- })
- break
- case 'address':
- this.setData({
- typeImage: 'image/address.png',
- typeText: '您暂时还没有地址哦~'
- })
- break
- case 'product':
- this.setData({
- typeImage: 'image/product.png',
- typeText: '暂时还没有商品哦~~'
- })
- break
- case 'data':
- this.setData({
- typeImage: 'image/data.png',
- typeText: '暂时还没有相关数据哦~~'
- })
- break
+ case 'success':
+ this.setData({
+ typeImage: 'image/success.png',
+ typeText: '操作成功~'
+ });
+ break;
+ case 'error':
+ this.setData({
+ typeImage: 'image/error.png',
+ typeText: '操作失败~'
+ });
+ break;
+ case 'cart':
+ this.setData({
+ typeImage: 'image/cart.png',
+ typeText: '购物车空空如也,去逛逛吧~'
+ });
+ break;
+ case 'order':
+ this.setData({
+ typeImage: 'image/order.png',
+ typeText: '您暂时还没有订单哦~'
+ });
+ break;
+ case 'network':
+ this.setData({
+ typeImage: 'image/network.png',
+ typeText: '糟糕!网络错误~'
+ });
+ break;
+ case 'address':
+ this.setData({
+ typeImage: 'image/address.png',
+ typeText: '您暂时还没有地址哦~'
+ });
+ break;
+ case 'product':
+ this.setData({
+ typeImage: 'image/product.png',
+ typeText: '暂时还没有商品哦~~'
+ });
+ break;
+ case 'data':
+ this.setData({
+ typeImage: 'image/data.png',
+ typeText: '暂时还没有相关数据哦~~'
+ });
+ break;
}
},
onBtn() {
- this.triggerEvent('lintap', {}, {});
- this.triggerEvent('lintapcatch', {}, { bubbles: true });
+ this.triggerEvent('lintap', {}, { bubbles: true, composed: true });
}
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/dist/tag/index.js b/dist/tag/index.js
index 819edb70..f32ccaae 100644
--- a/dist/tag/index.js
+++ b/dist/tag/index.js
@@ -4,6 +4,10 @@ Component({
// 标签名称
name: Object,
// 标签颜色
+ type:{
+ type: String,
+ value: 'touch'
+ },
bgColor: String,
fontColor: String,
disable: Boolean,
diff --git a/dist/tag/index.wxml b/dist/tag/index.wxml
index e592055c..84d5d340 100644
--- a/dist/tag/index.wxml
+++ b/dist/tag/index.wxml
@@ -1,4 +1,4 @@
-
diff --git a/dist/tag/index.wxss b/dist/tag/index.wxss
index 54bb03e3..d5b64042 100644
--- a/dist/tag/index.wxss
+++ b/dist/tag/index.wxss
@@ -1 +1 @@
-.l-tag{display:inline-flex;justify-content:center;align-items:center;color:#fff;background-color:#3963bc;border:2rpx solid #3963bc}.l-tag-mini{height:38rpx;font-size:20rpx;letter-spacing:1rpx}.l-tag-medium{height:46rpx;font-size:24rpx;min-width:60rpx;letter-spacing:2rpx}.l-tag-large{height:56rpx;font-size:24rpx;min-width:80rpx;letter-spacing:2rpx}.l-tag-mini-square{border-radius:2rpx;padding:0 18rpx}.l-tag-medium-square{border-radius:2rpx;padding:0 18rpx}.l-tag-large-square{border-radius:2rpx;padding:0 18rpx}.l-tag-mini-circle{border-radius:25rpx;padding:0 20rpx}.l-tag-medium-circle{border-radius:26rpx;padding:0 20rpx}.l-tag-large-circle{border-radius:30rpx;padding:0 20rpx}.l-tag-plain{background-color:#fff;color:#3963bc;border:2rpx solid #3963bc}.l-tag-disable{background-color:#dee2e6;color:#fff;border-color:#dee2e6}.select{background-color:#3963bc;color:#fff;border:2rpx solid #3963bc}.content{display:inline-flex;align-items:center;justify-content:center}.content-l{display:inline-flex;flex-direction:row-reverse;align-items:center;justify-content:center}.tag-image-mini{width:20rpx;height:20rpx}.tag-image-large{width:24rpx;height:24rpx}
\ No newline at end of file
+.l-tag{display:inline-flex;justify-content:center;align-items:center;color:#fff;background-color:#3963bc;border:2rpx solid #3963bc}.l-tag-touch{min-width:80rpx}.l-tag-super-mini{height:28rpx;font-size:20rpx}.l-tag-mini{height:38rpx;font-size:20rpx}.l-tag-medium{height:46rpx;font-size:24rpx;letter-spacing:2rpx}.l-tag-large{height:56rpx;font-size:24rpx;letter-spacing:2rpx}.l-tag-super-mini-square{border-radius:2rpx;padding:0 6rpx}.l-tag-mini-square{border-radius:2rpx;padding:0 12rpx}.l-tag-medium-square{border-radius:2rpx;padding:0 16rpx}.l-tag-large-square{border-radius:2rpx;padding:0 18rpx}.l-tag-super-mini-circle{border-radius:25rpx;padding:0 12rpx}.l-tag-mini-circle{border-radius:25rpx;padding:0 16rpx}.l-tag-medium-circle{border-radius:26rpx;padding:0 20rpx}.l-tag-large-circle{border-radius:30rpx;padding:0 24rpx}.l-tag-plain{background-color:#fff;color:#3963bc;border:2rpx solid #3963bc}.l-tag-disable{background-color:#dee2e6;color:#fff;border-color:#dee2e6}.select{background-color:#3963bc;color:#fff;border:2rpx solid #3963bc}.content{display:inline-flex;align-items:center;justify-content:center}.content-l{display:inline-flex;flex-direction:row-reverse;align-items:center;justify-content:center}.tag-image-mini{width:20rpx;height:20rpx}.tag-image-large{width:24rpx;height:24rpx}
\ No newline at end of file
diff --git a/dist/toast/index.js b/dist/toast/index.js
index 0b02ab09..50c3783e 100644
--- a/dist/toast/index.js
+++ b/dist/toast/index.js
@@ -218,7 +218,7 @@ Component({
onMaskTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
@@ -227,7 +227,7 @@ Component({
})
}
- this.triggerEvent('linTap', detail, option);
+ this.triggerEvent('lintap', detail, option);
}
}
})
\ No newline at end of file
diff --git a/dist/water-flow/index.js b/dist/water-flow/index.js
index 89ad1af1..3d804ee2 100644
--- a/dist/water-flow/index.js
+++ b/dist/water-flow/index.js
@@ -1,77 +1,81 @@
// pages/components/water/index.js
Component({
- /**
+ /**
* 组件的属性列表
*/
- properties: {
- columnGap: {
- type: String,
- value: '20rpx'
- }
- },
+ properties: {
+ columnGap: {
+ type: String,
+ value: '20rpx'
+ }
+ },
- /**
+ /**
* 组件的初始数据
*/
- data: {
- data: [],
- leftData: [],
- rightData: []
- },
+ data: {
+ data: [],
+ leftData: [],
+ rightData: []
+ },
- attached() {
- this._init()
- },
+ attached() {
+ this._init();
+ },
- /**
+ /**
* 组件的方法列表
*/
- methods: {
- _init() {
- wx.lin = wx.lin || {}
- wx.lin.renderWaterFlow = (data = [], success) => {
- if (Object.prototype.toString.call(data) !== '[object Array]') {
- console.error("[data]参数类型错误,渲染失败");
- return false;
- }
- this._select(data).then(() => {
- success && success()
- })
- }
- },
- _select(data) {
- const query = wx.createSelectorQuery().in(this)
- this.columnNodes = query.selectAll('#left, #right')
+ methods: {
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.renderWaterFlow = (data = [], refresh = false , success) => {
+ if (Object.prototype.toString.call(data) !== '[object Array]') {
+ console.error('[data]参数类型错误,渲染失败');
+ return false;
+ }
+ if(refresh){
+ this.data.leftData = [];
+ this.data.rightData = [];
+ }
+ this._select(data).then(() => {
+ success && success();
+ });
+ };
+ },
+ _select(data) {
+ const query = wx.createSelectorQuery().in(this);
+ this.columnNodes = query.selectAll('#left, #right');
- return new Promise((resolve, reject) => {
- this._render(data, 0, () => {
- resolve()
- })
- })
- },
- _render(data, i, success) {
- if (data.length > i) {
- this.columnNodes.boundingClientRect().exec(res => {
- const rects = res[0]
- const leftHeight = rects[0].height
- const rightHeight = rects[1].height
+ return new Promise((resolve) => {
+ this._render(data, 0, () => {
+ resolve();
+ });
+ });
+ },
+ _render(data, i, success) {
+ if (data.length > i) {
+ this.columnNodes.boundingClientRect().exec(res => {
+ const rects = res[0];
+ const leftHeight = rects[0].height;
+ const rightHeight = rects[1].height;
- if (leftHeight <= rightHeight) {
- this.data.leftData.push(data[i])
- } else {
- this.data.rightData.push(data[i])
- }
+ if (leftHeight <= rightHeight) {
+ this.data.leftData.push(data[i]);
+ } else {
+ this.data.rightData.push(data[i]);
+ }
- this.setData({
- leftData: this.data.leftData,
- rightData: this.data.rightData
- }, _ => {
- this._render(data, ++i, success)
- })
- })
- } else {
- success && success()
- }
- }
+ this.setData({
+ leftData: this.data.leftData,
+ rightData: this.data.rightData
+ }, () => {
+ this._render(data, ++i, success);
+ });
+ });
+ } else {
+ success && success();
+ }
}
-})
\ No newline at end of file
+ }
+});
\ No newline at end of file
diff --git a/examples/dist/action-sheet/index.js b/examples/dist/action-sheet/index.js
index 7ab61bcf..74f969e0 100644
--- a/examples/dist/action-sheet/index.js
+++ b/examples/dist/action-sheet/index.js
@@ -87,7 +87,7 @@ Component({
success
} = this.data;
success && success({ ...e.currentTarget.dataset });
- this.triggerEvent('linitemtap', { ...e.currentTarget.dataset });
+ this.triggerEvent('linitemtap', { ...e.currentTarget.dataset },{ bubbles: true, composed: true });
this._hideActionSheet();
},
@@ -112,7 +112,7 @@ Component({
});
this.triggerEvent('lincancel', {
errMsg: 'showactionsheet:fail cancel'
- });
+ },{ bubbles: true, composed: true });
this._hideActionSheet();
},
diff --git a/examples/dist/badge/index.js b/examples/dist/badge/index.js
index a1275d86..09721a18 100644
--- a/examples/dist/badge/index.js
+++ b/examples/dist/badge/index.js
@@ -1,5 +1,5 @@
Component({
- externalClasses: ['l-class','l-class-self'],
+ externalClasses: ['l-class', 'l-class-self'],
properties: {
// 红点模式
dot: {
@@ -32,32 +32,34 @@ Component({
// 最终数字
finalCount() {
switch (this.data.countType) {
- case 'overflow':
- this.setData({
- finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
- });
- break;
- case 'ellipsis':
- this.setData({
- finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
- });
- break;
- case 'limit':
- this.setData({
- finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
- })
- break;
- default:
- this.setData({
- finalCount: parseInt(this.data.count)
- })
- break;
+ case 'overflow':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
+ });
+ break;
+ case 'ellipsis':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
+ });
+ break;
+ case 'limit':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
+ });
+ break;
+ default:
+ this.setData({
+ finalCount: parseInt(this.data.count)
+ });
+ break;
}
},
// 点击事件
handleTap() {
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch', {}, { bubbles: true });
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
},
}
});
\ No newline at end of file
diff --git a/examples/dist/button/index.js b/examples/dist/button/index.js
index dfb4f0e2..5ed9c3a4 100644
--- a/examples/dist/button/index.js
+++ b/examples/dist/button/index.js
@@ -32,10 +32,11 @@ Component({
value: false,
},
// 微信原生接口
- width:Number,
- height:Number,
+ width: Number,
+ height: Number,
icon: String,
image: String,
+ bgColor: String,
iconStyle: {
type: String,
value: 'size:20;color:#3683D6'
@@ -68,8 +69,10 @@ Component({
// button点击事件
handleTap() {
if (this.data.disabled) return false;
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch',{},{ bubbles: true });
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
},
// 开放能力事件回调
openTypeEvent(data) {
diff --git a/examples/dist/button/index.wxml b/examples/dist/button/index.wxml
index 2a915345..7bfb7c5a 100644
--- a/examples/dist/button/index.wxml
+++ b/examples/dist/button/index.wxml
@@ -10,7 +10,7 @@
hover-stop-propagation="{{hoverStopPropagation}}"
hover-start-time="{{hoverStartTime}}"
hover-stay-time="{{hoverStayTime}}"
- style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0':''}}">
+ style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0;':''}} {{'background-color:'+bgColor}}">
diff --git a/examples/dist/card/index.js b/examples/dist/card/index.js
index 0f4226fe..b3d16fbe 100644
--- a/examples/dist/card/index.js
+++ b/examples/dist/card/index.js
@@ -35,4 +35,4 @@ Component({
methods: {
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/examples/dist/count-selector/index.js b/examples/dist/count-selector/index.js
index f7dfe4ac..4a5e110e 100644
--- a/examples/dist/count-selector/index.js
+++ b/examples/dist/count-selector/index.js
@@ -1,7 +1,7 @@
Component({
externalClasses: [
- 'l-class',
- 'l-symbol-class',
+ 'l-class',
+ 'l-symbol-class',
'l-count-class',
'l-disabled-class'
],
@@ -41,67 +41,76 @@ Component({
onBlur(e) {
let {
value
- } = e.detail
+ } = e.detail;
setTimeout(() => {
- this.blurCount(value)
- }, 50)
+ this.blurCount(value);
+ }, 50);
},
blurCount(value) {
if (value) {
if (value > this.properties.max) this.setData({
count: this.properties.max
- })
+ });
else if (value < this.properties.min) this.setData({
count: this.properties.min
- })
+ });
else this.setData({
count: value
- })
+ });
} else {
this.setData({
count: this.properties.count
- })
+ });
}
let detail = {
count: this.data.count,
type: 'blur'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
reduceTap() {
- let distance = this.data.count - this.properties.step
+ let distance = this.data.count - this.properties.step;
if (distance <= this.properties.min) {
- this.data.count = this.properties.min
+ this.data.count = this.properties.min;
} else {
- this.data.count -= this.properties.step
+ this.data.count -= this.properties.step;
}
this.setData({
count: this.data.count
- })
+ });
let detail = {
count: this.data.count,
type: 'reduce'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
addTap() {
let distance = this.data.count + this.properties.step;
if (distance >= this.properties.max) {
- this.data.count = this.properties.max
+ this.data.count = this.properties.max;
} else {
this.data.count += this.properties.step;
}
this.setData({
count: this.data.count
- })
+ });
let detail = {
count: this.data.count,
type: 'add'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/examples/dist/custom-tab-bar/index.js b/examples/dist/custom-tab-bar/index.js
index a3309a04..c4dd6580 100644
--- a/examples/dist/custom-tab-bar/index.js
+++ b/examples/dist/custom-tab-bar/index.js
@@ -90,7 +90,7 @@ Component({
idx,
path:this.route
};
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('lintap', detail, option);
},
showRedDot(idx) {
diff --git a/examples/dist/dialog/index.js b/examples/dist/dialog/index.js
index a87905c4..9cad9271 100644
--- a/examples/dist/dialog/index.js
+++ b/examples/dist/dialog/index.js
@@ -155,7 +155,7 @@ Component({
onCancelTap(e) {
let detail = 'cancel';
- let option = {};
+ let option = { bubbles: true, composed: true };
const {
success
@@ -175,7 +175,7 @@ Component({
// 背景点击事件
onDialogTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
diff --git a/examples/dist/grid-item/index.js b/examples/dist/grid-item/index.js
index ff43aec6..cb1e500d 100644
--- a/examples/dist/grid-item/index.js
+++ b/examples/dist/grid-item/index.js
@@ -22,9 +22,7 @@ Component({
tapGridItem(e) {
this.triggerEvent('lintap', {
...e
- }, {
- composed: true
- })
+ }, { bubbles: true, composed: true })
},
}
});
\ No newline at end of file
diff --git a/examples/dist/grid/index.js b/examples/dist/grid/index.js
index 7dd1f849..a303962f 100644
--- a/examples/dist/grid/index.js
+++ b/examples/dist/grid/index.js
@@ -70,7 +70,7 @@ Component({
tapGrid(e) {
this.triggerEvent('lintap', {
index:this.data.currentIndex
- })
+ },{ bubbles: true, composed: true })
}
}
});
\ No newline at end of file
diff --git a/examples/dist/list/index.js b/examples/dist/list/index.js
index 75728a45..e9e2ab42 100644
--- a/examples/dist/list/index.js
+++ b/examples/dist/list/index.js
@@ -77,7 +77,7 @@ Component({
}
this.triggerEvent('lintap', {
e
- }, {})
+ }, { bubbles: true, composed: true })
}
}
});
\ No newline at end of file
diff --git a/examples/dist/loading/index.js b/examples/dist/loading/index.js
index bd75066a..5deaf671 100644
--- a/examples/dist/loading/index.js
+++ b/examples/dist/loading/index.js
@@ -1,5 +1,5 @@
Component({
- externalClasses: ['l-container-class','l-class'],
+ externalClasses: ['l-container-class', 'l-class'],
properties: {
// 显示与隐藏
show: {
@@ -32,9 +32,39 @@ Component({
value: false,
}
},
+
+ attached() {
+ this._init();
+ },
+
methods: {
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.showLoading = (options) => {
+ const {
+ custom = false,
+ fullScreen = false,
+ color = '',
+ type = 'rotate',
+ size = 'default'
+ } = { ...options };
+ this.setData({
+ custom,
+ fullScreen,
+ color,
+ type,
+ size,
+ show: true
+ });
+ };
+ wx.lin.hideLoading = () => {
+ this.setData({
+ show: false
+ });
+ };
+ },
// 阻止滑动
- doNothingMove(e) {
+ doNothingMove() {
// do nothing……
},
}
diff --git a/examples/dist/loadmore/index.js b/examples/dist/loadmore/index.js
index 5a0c482e..d5163fd4 100644
--- a/examples/dist/loadmore/index.js
+++ b/examples/dist/loadmore/index.js
@@ -4,21 +4,21 @@ Component({
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
properties: {
- show:Boolean,
- custom:Boolean,
- line:Boolean,
- color:String,
- type:{
- type:String,
- value:'loading'
+ show: Boolean,
+ custom: Boolean,
+ line: Boolean,
+ color: String,
+ type: {
+ type: String,
+ value: 'loading'
},
- endText:{
- type:String,
- value:'我是有底线的~'
+ endText: {
+ type: String,
+ value: '我是有底线的~'
},
- loadingText:{
- type:String,
- value:'加载中...'
+ loadingText: {
+ type: String,
+ value: '加载中...'
}
},
@@ -26,13 +26,43 @@ Component({
},
- ready: function () {
-
+ attached() {
+ this._init();
},
+
methods: {
- onLoadmore(){
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch',{},{ bubbles: true });
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.showLoadmore = (options) => {
+ const {
+ custom = false,
+ line = false,
+ color = '',
+ type = 'loading',
+ endText = '我是有底线的',
+ loadingText = '加载中...'
+ } = { ...options };
+ this.setData({
+ custom,
+ line,
+ color,
+ type,
+ endText,
+ loadingText,
+ show: true
+ });
+ };
+ wx.lin.hideLoadmore = () => {
+ this.setData({
+ show: false
+ });
+ };
+ },
+ onLoadmore() {
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
}
}
});
diff --git a/examples/dist/mask/index.js b/examples/dist/mask/index.js
index c8040846..17637022 100644
--- a/examples/dist/mask/index.js
+++ b/examples/dist/mask/index.js
@@ -64,7 +64,7 @@ Component({
onMaskTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
diff --git a/examples/dist/message/index.js b/examples/dist/message/index.js
index 37467673..460dd7a7 100644
--- a/examples/dist/message/index.js
+++ b/examples/dist/message/index.js
@@ -35,7 +35,7 @@ Component({
observers: {
'show': function (show) {
- show && this.changeStatus()
+ show && this.changeStatus();
}
},
@@ -51,7 +51,7 @@ Component({
duration = 1500,
success = null
} = options;
- this.data.success = success
+ this.data.success = success;
this.setData({
content,
icon,
@@ -59,7 +59,7 @@ Component({
duration,
type
});
- this.changeStatus()
+ this.changeStatus();
return this;
};
},
@@ -67,15 +67,15 @@ Component({
changeStatus() {
this.setData({
status: true
- })
- if (this.data.timer) clearTimeout(this.data.timer)
+ });
+ if (this.data.timer) clearTimeout(this.data.timer);
this.data.timer = setTimeout(() => {
this.setData({
status: false
- })
- if (this.data.success) this.data.success()
- this.data.timer = null
- }, this.properties.duration)
+ });
+ if (this.data.success) this.data.success();
+ this.data.timer = null;
+ }, this.properties.duration);
}
}
});
\ No newline at end of file
diff --git a/examples/dist/notice-bar/index.js b/examples/dist/notice-bar/index.js
index 46953681..f6f5d2a0 100644
--- a/examples/dist/notice-bar/index.js
+++ b/examples/dist/notice-bar/index.js
@@ -17,9 +17,9 @@ Component({
type: Number,
value: 28
},
- frontIconColor:{
- type:String,
- value:'#3683D6'
+ frontIconColor: {
+ type: String,
+ value: '#3683D6'
},
endIconName: {
type: String,
@@ -29,9 +29,9 @@ Component({
type: Number,
value: 28
},
- endIconColor:{
- type:String,
- value:'#3683D6'
+ endIconColor: {
+ type: String,
+ value: '#3683D6'
},
// 背景颜色
backgroundcolor: {
@@ -83,7 +83,7 @@ Component({
const duration = rect.width / 40 * this.data.speed;
const animation = wx.createAnimation({
duration: duration,
- timingFunction: "linear",
+ timingFunction: 'linear',
});
this.setData({
wrapWidth: wrapRect.width,
@@ -126,20 +126,18 @@ Component({
}
},
handleTap() {
- this.triggerEvent('lintap');
- this.triggerEvent('lincatchtap', {}, { bubbles: true });
+ this.triggerEvent('lintap',{},{ bubbles: true, composed: true });
this.setData({
timer: null
});
},
- onSwip(e){
+ onSwip(e) {
this.triggerEvent('lintap', {
...e.currentTarget.dataset
- });
+ },{ bubbles: true, composed: true });
},
onIconTap(){
- this.triggerEvent('linicontap');
- this.triggerEvent('liniconcatchtap', {}, { bubbles: true });
+ this.triggerEvent('linicontap',{},{ bubbles: true, composed: true });
this.setData({
timer: null
});
diff --git a/examples/dist/popup/index.js b/examples/dist/popup/index.js
index 112a8b76..5fbfd543 100644
--- a/examples/dist/popup/index.js
+++ b/examples/dist/popup/index.js
@@ -54,7 +54,7 @@ Component({
// 点击事件
onPupopTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
show: !this.data.show
diff --git a/examples/dist/price/index.js b/examples/dist/price/index.js
index ab4bb540..cce91dec 100644
--- a/examples/dist/price/index.js
+++ b/examples/dist/price/index.js
@@ -2,7 +2,7 @@ Component({
/**
* 组件的属性列表
*/
- externalClasses: ['l-class', 'l-unit-class', 'l-count-class'],
+ externalClasses: ['l-deleted-class', 'l-unit-class', 'l-count-class', 'l-class'],
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
@@ -11,40 +11,31 @@ Component({
type: String,
value: '¥'
},
- unitColor: {
+ size: {
type: String,
- value: '#333'
+ value: '28'
},
- unitSize: {
- type: [String, Number],
- value: 28
- },
- unitBold: {
- type: String,
- value: 'normal'
- },
- count: {
- type: Number,
- value: 0.00,
- observer: 'reserveNumber'
- },
- countColor: {
+ color: {
type: String,
- value: '#333'
- },
- countSize: {
- type: [String, Number],
- value: 28
+ value: '#3963BC'
},
- countBold: {
+ bold: {
type: String,
- value: 'normal'
+ value: '500'
},
- delete: Boolean,
- delColor: {
+ unitColor: String,
+ unitSize: String,
+ unitBold: String,
+ count: {
type: String,
- value: '#777'
+ value: '0.00',
+ observer: 'reserveNumber'
},
+ countColor: String,
+ countSize: String,
+ countBold: String,
+ deleted: Boolean,
+ delColor: String,
reserveDigit: {
type: Number,
value: 2
@@ -63,21 +54,29 @@ Component({
* 组件的方法列表
*/
methods: {
- reserveNumber(value) {
- const strValue = value.toString();
+ reserveNumber() {
+ const strValue = this.data.count.toString();
+ const isNumber = !isNaN(Number(this.data.count));
const dotIndex = strValue.indexOf('.');
if (strValue.length - dotIndex - 1 > this.data.reserveDigit && dotIndex !== -1) {
this.setData({
- result: strValue.substring(0, dotIndex + this.data.reserveDigit)
+ result: isNumber ? strValue.substring(0, dotIndex + 1 + this.data.reserveDigit) : strValue
});
} else {
- this.addZero(strValue);
+ if (isNumber) {
+ this.addZero(strValue);
+ } else {
+ this.setData({
+ result: strValue
+ });
+ }
}
},
addZero(value) {
- const realLen = value.indexOf('.') + 1 + this.data.reserveDigit;
+ const dotIndex = value.indexOf('.') == -1 ? value.length - 1 : value.indexOf('.');
+ const realLen = dotIndex + 1 + this.data.reserveDigit;
if (value.length < realLen && this.data.autofix) {
- const result = value + '0'.repeat(realLen - value.length);
+ const result = dotIndex == value.indexOf('.') ? value + '0'.repeat(realLen - value.length) : value + '.' + '0'.repeat(realLen - value.length);
this.setData({
result
});
diff --git a/examples/dist/price/index.wxml b/examples/dist/price/index.wxml
index e35de0c8..4506ccfb 100644
--- a/examples/dist/price/index.wxml
+++ b/examples/dist/price/index.wxml
@@ -1,8 +1,8 @@
-
+
- {{unit}}
-
- {{result}}
+ {{unit}}
+
+ {{result}}
\ No newline at end of file
diff --git a/examples/dist/price/index.wxss b/examples/dist/price/index.wxss
index 9aeaeb87..892dfbdd 100644
--- a/examples/dist/price/index.wxss
+++ b/examples/dist/price/index.wxss
@@ -1 +1 @@
-.price-del{text-decoration:line-through!important}.price-container{display:inline-block;text-align:center}
\ No newline at end of file
+.price-del{text-decoration:line-through!important}.price-container{display:inline-block;text-align:center;color:#3963bc;font-size:28rpx}
\ No newline at end of file
diff --git a/examples/dist/search-bar/index.js b/examples/dist/search-bar/index.js
index 09c635ac..84199415 100644
--- a/examples/dist/search-bar/index.js
+++ b/examples/dist/search-bar/index.js
@@ -19,10 +19,6 @@ Component({
value: 'search'
},
placeholder: String,
- confirmType: {
- type: String,
- value: 'search'
- },
cancelText: {
type: String,
value: '取消'
@@ -92,7 +88,10 @@ Component({
*/
methods: {
onCancel() {
- this.triggerEvent('lincancel')
+ this.triggerEvent('lincancel', {}, {
+ bubbles: true,
+ composed: true
+ });
},
// input属性列表
handleInputChange(event) {
@@ -137,7 +136,10 @@ Component({
this.setData({
value: ''
});
- this.triggerEvent('linclear', event.detail);
+ this.triggerEvent('linclear', event.detail, {
+ bubbles: true,
+ composed: true
+ });
}
}
});
\ No newline at end of file
diff --git a/examples/dist/segment/index.wxml b/examples/dist/segment/index.wxml
index 93ea85b5..e2ae10e3 100644
--- a/examples/dist/segment/index.wxml
+++ b/examples/dist/segment/index.wxml
@@ -9,7 +9,7 @@
-
+
diff --git a/examples/dist/slide-view/index.js b/examples/dist/slide-view/index.js
index 698237f1..a3237484 100644
--- a/examples/dist/slide-view/index.js
+++ b/examples/dist/slide-view/index.js
@@ -156,7 +156,7 @@ Component({
// 点击 右边区域
onRightTap(e) {
let detail = 'click right';
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.properties.autoClose) {
this.setData({
popup: false,
@@ -171,7 +171,7 @@ Component({
// 打开后触发
onOpenTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('slideopen', detail, option);
},
@@ -179,7 +179,7 @@ Component({
// 关闭后触发
onCloseTap(e) {
let detail = false;
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('slideclose', detail, option);
}
diff --git a/examples/dist/status-show/index.js b/examples/dist/status-show/index.js
index 80e5cd1e..e7311525 100644
--- a/examples/dist/status-show/index.js
+++ b/examples/dist/status-show/index.js
@@ -28,7 +28,7 @@ Component({
},
ready() {
- this._changeStatus()
+ this._changeStatus();
},
/**
@@ -37,60 +37,59 @@ Component({
methods: {
_changeStatus() {
switch (this.properties.type) {
- case 'success':
- this.setData({
- typeImage: 'image/success.png',
- typeText: '操作成功~'
- })
- break
- case 'error':
- this.setData({
- typeImage: 'image/error.png',
- typeText: '操作失败~'
- })
- break
- case 'cart':
- this.setData({
- typeImage: 'image/cart.png',
- typeText: '购物车空空如也,去逛逛吧~'
- })
- break
- case 'order':
- this.setData({
- typeImage: 'image/order.png',
- typeText: '您暂时还没有订单哦~'
- })
- break
- case 'network':
- this.setData({
- typeImage: 'image/network.png',
- typeText: '糟糕!网络错误~'
- })
- break
- case 'address':
- this.setData({
- typeImage: 'image/address.png',
- typeText: '您暂时还没有地址哦~'
- })
- break
- case 'product':
- this.setData({
- typeImage: 'image/product.png',
- typeText: '暂时还没有商品哦~~'
- })
- break
- case 'data':
- this.setData({
- typeImage: 'image/data.png',
- typeText: '暂时还没有相关数据哦~~'
- })
- break
+ case 'success':
+ this.setData({
+ typeImage: 'image/success.png',
+ typeText: '操作成功~'
+ });
+ break;
+ case 'error':
+ this.setData({
+ typeImage: 'image/error.png',
+ typeText: '操作失败~'
+ });
+ break;
+ case 'cart':
+ this.setData({
+ typeImage: 'image/cart.png',
+ typeText: '购物车空空如也,去逛逛吧~'
+ });
+ break;
+ case 'order':
+ this.setData({
+ typeImage: 'image/order.png',
+ typeText: '您暂时还没有订单哦~'
+ });
+ break;
+ case 'network':
+ this.setData({
+ typeImage: 'image/network.png',
+ typeText: '糟糕!网络错误~'
+ });
+ break;
+ case 'address':
+ this.setData({
+ typeImage: 'image/address.png',
+ typeText: '您暂时还没有地址哦~'
+ });
+ break;
+ case 'product':
+ this.setData({
+ typeImage: 'image/product.png',
+ typeText: '暂时还没有商品哦~~'
+ });
+ break;
+ case 'data':
+ this.setData({
+ typeImage: 'image/data.png',
+ typeText: '暂时还没有相关数据哦~~'
+ });
+ break;
}
},
onBtn() {
- this.triggerEvent('lintap', {}, {});
- this.triggerEvent('lintapcatch', {}, { bubbles: true });
+ this.triggerEvent('lintap', {}, { bubbles: true, composed: true });
}
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/examples/dist/tag/index.js b/examples/dist/tag/index.js
index 819edb70..f32ccaae 100644
--- a/examples/dist/tag/index.js
+++ b/examples/dist/tag/index.js
@@ -4,6 +4,10 @@ Component({
// 标签名称
name: Object,
// 标签颜色
+ type:{
+ type: String,
+ value: 'touch'
+ },
bgColor: String,
fontColor: String,
disable: Boolean,
diff --git a/examples/dist/tag/index.wxml b/examples/dist/tag/index.wxml
index e592055c..84d5d340 100644
--- a/examples/dist/tag/index.wxml
+++ b/examples/dist/tag/index.wxml
@@ -1,4 +1,4 @@
-
diff --git a/examples/dist/tag/index.wxss b/examples/dist/tag/index.wxss
index 54bb03e3..d5b64042 100644
--- a/examples/dist/tag/index.wxss
+++ b/examples/dist/tag/index.wxss
@@ -1 +1 @@
-.l-tag{display:inline-flex;justify-content:center;align-items:center;color:#fff;background-color:#3963bc;border:2rpx solid #3963bc}.l-tag-mini{height:38rpx;font-size:20rpx;letter-spacing:1rpx}.l-tag-medium{height:46rpx;font-size:24rpx;min-width:60rpx;letter-spacing:2rpx}.l-tag-large{height:56rpx;font-size:24rpx;min-width:80rpx;letter-spacing:2rpx}.l-tag-mini-square{border-radius:2rpx;padding:0 18rpx}.l-tag-medium-square{border-radius:2rpx;padding:0 18rpx}.l-tag-large-square{border-radius:2rpx;padding:0 18rpx}.l-tag-mini-circle{border-radius:25rpx;padding:0 20rpx}.l-tag-medium-circle{border-radius:26rpx;padding:0 20rpx}.l-tag-large-circle{border-radius:30rpx;padding:0 20rpx}.l-tag-plain{background-color:#fff;color:#3963bc;border:2rpx solid #3963bc}.l-tag-disable{background-color:#dee2e6;color:#fff;border-color:#dee2e6}.select{background-color:#3963bc;color:#fff;border:2rpx solid #3963bc}.content{display:inline-flex;align-items:center;justify-content:center}.content-l{display:inline-flex;flex-direction:row-reverse;align-items:center;justify-content:center}.tag-image-mini{width:20rpx;height:20rpx}.tag-image-large{width:24rpx;height:24rpx}
\ No newline at end of file
+.l-tag{display:inline-flex;justify-content:center;align-items:center;color:#fff;background-color:#3963bc;border:2rpx solid #3963bc}.l-tag-touch{min-width:80rpx}.l-tag-super-mini{height:28rpx;font-size:20rpx}.l-tag-mini{height:38rpx;font-size:20rpx}.l-tag-medium{height:46rpx;font-size:24rpx;letter-spacing:2rpx}.l-tag-large{height:56rpx;font-size:24rpx;letter-spacing:2rpx}.l-tag-super-mini-square{border-radius:2rpx;padding:0 6rpx}.l-tag-mini-square{border-radius:2rpx;padding:0 12rpx}.l-tag-medium-square{border-radius:2rpx;padding:0 16rpx}.l-tag-large-square{border-radius:2rpx;padding:0 18rpx}.l-tag-super-mini-circle{border-radius:25rpx;padding:0 12rpx}.l-tag-mini-circle{border-radius:25rpx;padding:0 16rpx}.l-tag-medium-circle{border-radius:26rpx;padding:0 20rpx}.l-tag-large-circle{border-radius:30rpx;padding:0 24rpx}.l-tag-plain{background-color:#fff;color:#3963bc;border:2rpx solid #3963bc}.l-tag-disable{background-color:#dee2e6;color:#fff;border-color:#dee2e6}.select{background-color:#3963bc;color:#fff;border:2rpx solid #3963bc}.content{display:inline-flex;align-items:center;justify-content:center}.content-l{display:inline-flex;flex-direction:row-reverse;align-items:center;justify-content:center}.tag-image-mini{width:20rpx;height:20rpx}.tag-image-large{width:24rpx;height:24rpx}
\ No newline at end of file
diff --git a/examples/dist/toast/index.js b/examples/dist/toast/index.js
index 0b02ab09..50c3783e 100644
--- a/examples/dist/toast/index.js
+++ b/examples/dist/toast/index.js
@@ -218,7 +218,7 @@ Component({
onMaskTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
@@ -227,7 +227,7 @@ Component({
})
}
- this.triggerEvent('linTap', detail, option);
+ this.triggerEvent('lintap', detail, option);
}
}
})
\ No newline at end of file
diff --git a/examples/dist/water-flow/index.js b/examples/dist/water-flow/index.js
index 89ad1af1..3d804ee2 100644
--- a/examples/dist/water-flow/index.js
+++ b/examples/dist/water-flow/index.js
@@ -1,77 +1,81 @@
// pages/components/water/index.js
Component({
- /**
+ /**
* 组件的属性列表
*/
- properties: {
- columnGap: {
- type: String,
- value: '20rpx'
- }
- },
+ properties: {
+ columnGap: {
+ type: String,
+ value: '20rpx'
+ }
+ },
- /**
+ /**
* 组件的初始数据
*/
- data: {
- data: [],
- leftData: [],
- rightData: []
- },
+ data: {
+ data: [],
+ leftData: [],
+ rightData: []
+ },
- attached() {
- this._init()
- },
+ attached() {
+ this._init();
+ },
- /**
+ /**
* 组件的方法列表
*/
- methods: {
- _init() {
- wx.lin = wx.lin || {}
- wx.lin.renderWaterFlow = (data = [], success) => {
- if (Object.prototype.toString.call(data) !== '[object Array]') {
- console.error("[data]参数类型错误,渲染失败");
- return false;
- }
- this._select(data).then(() => {
- success && success()
- })
- }
- },
- _select(data) {
- const query = wx.createSelectorQuery().in(this)
- this.columnNodes = query.selectAll('#left, #right')
+ methods: {
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.renderWaterFlow = (data = [], refresh = false , success) => {
+ if (Object.prototype.toString.call(data) !== '[object Array]') {
+ console.error('[data]参数类型错误,渲染失败');
+ return false;
+ }
+ if(refresh){
+ this.data.leftData = [];
+ this.data.rightData = [];
+ }
+ this._select(data).then(() => {
+ success && success();
+ });
+ };
+ },
+ _select(data) {
+ const query = wx.createSelectorQuery().in(this);
+ this.columnNodes = query.selectAll('#left, #right');
- return new Promise((resolve, reject) => {
- this._render(data, 0, () => {
- resolve()
- })
- })
- },
- _render(data, i, success) {
- if (data.length > i) {
- this.columnNodes.boundingClientRect().exec(res => {
- const rects = res[0]
- const leftHeight = rects[0].height
- const rightHeight = rects[1].height
+ return new Promise((resolve) => {
+ this._render(data, 0, () => {
+ resolve();
+ });
+ });
+ },
+ _render(data, i, success) {
+ if (data.length > i) {
+ this.columnNodes.boundingClientRect().exec(res => {
+ const rects = res[0];
+ const leftHeight = rects[0].height;
+ const rightHeight = rects[1].height;
- if (leftHeight <= rightHeight) {
- this.data.leftData.push(data[i])
- } else {
- this.data.rightData.push(data[i])
- }
+ if (leftHeight <= rightHeight) {
+ this.data.leftData.push(data[i]);
+ } else {
+ this.data.rightData.push(data[i]);
+ }
- this.setData({
- leftData: this.data.leftData,
- rightData: this.data.rightData
- }, _ => {
- this._render(data, ++i, success)
- })
- })
- } else {
- success && success()
- }
- }
+ this.setData({
+ leftData: this.data.leftData,
+ rightData: this.data.rightData
+ }, () => {
+ this._render(data, ++i, success);
+ });
+ });
+ } else {
+ success && success();
+ }
}
-})
\ No newline at end of file
+ }
+});
\ No newline at end of file
diff --git a/examples/pages/components/shopping/pages/price/index.js b/examples/pages/components/shopping/pages/price/index.js
index 3174ab62..a5f2350d 100644
--- a/examples/pages/components/shopping/pages/price/index.js
+++ b/examples/pages/components/shopping/pages/price/index.js
@@ -6,7 +6,8 @@ Page({
* 页面的初始数据
*/
data: {
- priceConfig
+ priceConfig,
+ a:666
},
/**
diff --git a/examples/pages/components/shopping/pages/price/index.wxml b/examples/pages/components/shopping/pages/price/index.wxml
index ed8d7585..799d4fb4 100644
--- a/examples/pages/components/shopping/pages/price/index.wxml
+++ b/examples/pages/components/shopping/pages/price/index.wxml
@@ -13,8 +13,8 @@
count-color="{{price.countColor}}"
unit-size="{{price.unitSize}}"
count-size="{{price.countSize}}"
- count-blod="{{price.countBlod}}"
- unit-blod="{{price.unitBlod}}"
+ count-bold="{{price.countBlod}}"
+ unit-bold="{{price.unitBlod}}"
delete="{{price.delete}}"
del-color="{{price.delColor}}" />
@@ -40,7 +40,7 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/examples/pages/components/view/pages/tag/tag-nav.js b/examples/pages/components/view/pages/tag/tag-nav.js
index b9d7cd3e..7ed7b4bc 100644
--- a/examples/pages/components/view/pages/tag/tag-nav.js
+++ b/examples/pages/components/view/pages/tag/tag-nav.js
@@ -1,307 +1,319 @@
const tagNaviConfigs = [{
- title: "标签大小",
- config: [{
- content: '欺负我小',
- size: 'mini',
- bgColor: '',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '20',
- iconColor: '#fff',
- location: 'r'
- },
- {
- content: '唉 我也不大',
- text: "标签",
- size: 'medium',
- bgColor: '',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- },
- {
- content: '我最大',
- text: "标签",
- size: 'large',
- bgColor: '',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }
- ]
+ title: '标签大小',
+ config: [{
+ content: '我超级小',
+ size: 'super-mini',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '20',
+ iconColor: '#fff',
+ location: 'r'
+ }, {
+ content: '欺负我小',
+ size: 'mini',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '20',
+ iconColor: '#fff',
+ location: 'r'
},
{
- title: "标签形状",
- config: [{
- content: '我方了',
- size: 'large',
- bgColor: '',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- },
- {
- content: '我比较圆润',
- size: 'large',
- bgColor: '',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'circle',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }
- ]
+ content: '唉 我也不大',
+ text: '标签',
+ size: 'medium',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
},
{
- title: "镂空标签",
- config: [{
- content: '右边是大佬->',
- size: 'large',
- bgColor: '',
- fontColor: '',
- plain: true,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- },
- {
- content: '七月:低调低调',
- size: 'large',
- bgColor: '',
- fontColor: '',
- plain: true,
- select: false,
- shape: 'circle',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }
- ]
+ content: '我最大',
+ text: '标签',
+ size: 'large',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }
+ ]
+},
+{
+ title: '标签形状',
+ config: [{
+ content: '我方了',
+ size: 'large',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
},
{
- title: "自定义颜色",
- config: [{
- content: '丐帮',
- size: 'large',
- bgColor: '#a2b86d',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '明教',
- size: 'large',
- bgColor: '#b95551',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '五毒教',
- size: 'large',
- bgColor: '#7f6c9e',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '唐家堡',
- size: 'large',
- bgColor: '#5b7fbe',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '天策府',
- size: 'large',
- bgColor: '#8e2c35',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '藏剑山庄',
- size: 'large',
- bgColor: '#e4c374',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '少林寺',
- size: 'large',
- bgColor: '#a48735',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '纯阳宫',
- size: 'large',
- bgColor: '#4f4e55',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '万花谷',
- size: 'large',
- bgColor: '#35323a',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '七秀坊',
- size: 'large',
- bgColor: '#f5c5d5',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '蓬莱岛',
- size: 'large',
- bgColor: '#4a5570',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '霸刀山庄',
- size: 'large',
- bgColor: '#574a7f',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '长歌门',
- size: 'large',
- bgColor: '#82cebe',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }, {
- content: '苍云军',
- size: 'large',
- bgColor: '#8e7a50',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '',
- iconColor: ''
- }]
+ content: '我比较圆润',
+ size: 'large',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'circle',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }
+ ]
+},
+{
+ title: '镂空标签',
+ config: [{
+ content: '右边是大佬->',
+ size: 'large',
+ bgColor: '',
+ fontColor: '',
+ plain: true,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
},
{
- title: "禁用标签",
- config: [{
- content: '别碰我,我会生气的',
- size: 'large',
- bgColor: '',
- disable: true,
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: '',
- iconSize: '20',
- iconColor: '#fff',
- location: 'left'
- }]
+ content: '七月:低调低调',
+ size: 'large',
+ bgColor: '',
+ fontColor: '',
+ plain: true,
+ select: false,
+ shape: 'circle',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }
+ ]
+},
+{
+ title: '自定义颜色',
+ config: [{
+ content: '丐帮',
+ size: 'large',
+ bgColor: '#a2b86d',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '明教',
+ size: 'large',
+ bgColor: '#b95551',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '五毒教',
+ size: 'large',
+ bgColor: '#7f6c9e',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '唐家堡',
+ size: 'large',
+ bgColor: '#5b7fbe',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '天策府',
+ size: 'large',
+ bgColor: '#8e2c35',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '藏剑山庄',
+ size: 'large',
+ bgColor: '#e4c374',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '少林寺',
+ size: 'large',
+ bgColor: '#a48735',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '纯阳宫',
+ size: 'large',
+ bgColor: '#4f4e55',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '万花谷',
+ size: 'large',
+ bgColor: '#35323a',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '七秀坊',
+ size: 'large',
+ bgColor: '#f5c5d5',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '蓬莱岛',
+ size: 'large',
+ bgColor: '#4a5570',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '霸刀山庄',
+ size: 'large',
+ bgColor: '#574a7f',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '长歌门',
+ size: 'large',
+ bgColor: '#82cebe',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }, {
+ content: '苍云军',
+ size: 'large',
+ bgColor: '#8e7a50',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '',
+ iconColor: ''
+ }]
+},
+{
+ title: '禁用标签',
+ config: [{
+ content: '别碰我,我会生气的',
+ size: 'large',
+ bgColor: '',
+ disable: true,
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: '',
+ iconSize: '20',
+ iconColor: '#fff',
+ location: 'left'
+ }]
+},
+{
+ title: '图标标签',
+ config: [{
+ content: '标签',
+ size: 'large',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: 'warning',
+ iconSize: '20',
+ iconColor: '#fff',
+ location: 'left'
},
{
- title: "图标标签",
- config: [{
- content: '标签',
- size: 'large',
- bgColor: '',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: 'warning',
- iconSize: '20',
- iconColor: '#fff',
- location: 'left'
- },
- {
- content: '标签',
- size: 'large',
- bgColor: '',
- fontColor: '',
- plain: false,
- select: false,
- shape: 'square',
- iconName: 'warning',
- iconSize: '20',
- iconColor: '#fff',
- location: 'right'
- }
- ]
+ content: '标签',
+ size: 'large',
+ bgColor: '',
+ fontColor: '',
+ plain: false,
+ select: false,
+ shape: 'square',
+ iconName: 'warning',
+ iconSize: '20',
+ iconColor: '#fff',
+ location: 'right'
}
-]
+ ]
+}
+];
export default tagNaviConfigs;
\ No newline at end of file
diff --git a/package.json b/package.json
index 94acad0e..9280d690 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "lin-ui",
- "version": "0.5.12",
+ "version": "0.5.13",
"description": "A high quality UI components library with MiniProgram",
"main": "app.js",
"directories": {
diff --git a/src/action-sheet/index.js b/src/action-sheet/index.js
index 7ab61bcf..74f969e0 100644
--- a/src/action-sheet/index.js
+++ b/src/action-sheet/index.js
@@ -87,7 +87,7 @@ Component({
success
} = this.data;
success && success({ ...e.currentTarget.dataset });
- this.triggerEvent('linitemtap', { ...e.currentTarget.dataset });
+ this.triggerEvent('linitemtap', { ...e.currentTarget.dataset },{ bubbles: true, composed: true });
this._hideActionSheet();
},
@@ -112,7 +112,7 @@ Component({
});
this.triggerEvent('lincancel', {
errMsg: 'showactionsheet:fail cancel'
- });
+ },{ bubbles: true, composed: true });
this._hideActionSheet();
},
diff --git a/src/badge/index.js b/src/badge/index.js
index a1275d86..09721a18 100644
--- a/src/badge/index.js
+++ b/src/badge/index.js
@@ -1,5 +1,5 @@
Component({
- externalClasses: ['l-class','l-class-self'],
+ externalClasses: ['l-class', 'l-class-self'],
properties: {
// 红点模式
dot: {
@@ -32,32 +32,34 @@ Component({
// 最终数字
finalCount() {
switch (this.data.countType) {
- case 'overflow':
- this.setData({
- finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
- });
- break;
- case 'ellipsis':
- this.setData({
- finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
- });
- break;
- case 'limit':
- this.setData({
- finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
- })
- break;
- default:
- this.setData({
- finalCount: parseInt(this.data.count)
- })
- break;
+ case 'overflow':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
+ });
+ break;
+ case 'ellipsis':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
+ });
+ break;
+ case 'limit':
+ this.setData({
+ finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
+ });
+ break;
+ default:
+ this.setData({
+ finalCount: parseInt(this.data.count)
+ });
+ break;
}
},
// 点击事件
handleTap() {
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch', {}, { bubbles: true });
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
},
}
});
\ No newline at end of file
diff --git a/src/button/index.js b/src/button/index.js
index dfb4f0e2..5ed9c3a4 100644
--- a/src/button/index.js
+++ b/src/button/index.js
@@ -32,10 +32,11 @@ Component({
value: false,
},
// 微信原生接口
- width:Number,
- height:Number,
+ width: Number,
+ height: Number,
icon: String,
image: String,
+ bgColor: String,
iconStyle: {
type: String,
value: 'size:20;color:#3683D6'
@@ -68,8 +69,10 @@ Component({
// button点击事件
handleTap() {
if (this.data.disabled) return false;
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch',{},{ bubbles: true });
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
},
// 开放能力事件回调
openTypeEvent(data) {
diff --git a/src/button/index.wxml b/src/button/index.wxml
index 2a915345..7bfb7c5a 100644
--- a/src/button/index.wxml
+++ b/src/button/index.wxml
@@ -10,7 +10,7 @@
hover-stop-propagation="{{hoverStopPropagation}}"
hover-start-time="{{hoverStartTime}}"
hover-stay-time="{{hoverStayTime}}"
- style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0':''}}">
+ style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0;':''}} {{'background-color:'+bgColor}}">
diff --git a/src/card/index.js b/src/card/index.js
index 0f4226fe..b3d16fbe 100644
--- a/src/card/index.js
+++ b/src/card/index.js
@@ -35,4 +35,4 @@ Component({
methods: {
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/src/count-selector/index.js b/src/count-selector/index.js
index f7dfe4ac..4a5e110e 100644
--- a/src/count-selector/index.js
+++ b/src/count-selector/index.js
@@ -1,7 +1,7 @@
Component({
externalClasses: [
- 'l-class',
- 'l-symbol-class',
+ 'l-class',
+ 'l-symbol-class',
'l-count-class',
'l-disabled-class'
],
@@ -41,67 +41,76 @@ Component({
onBlur(e) {
let {
value
- } = e.detail
+ } = e.detail;
setTimeout(() => {
- this.blurCount(value)
- }, 50)
+ this.blurCount(value);
+ }, 50);
},
blurCount(value) {
if (value) {
if (value > this.properties.max) this.setData({
count: this.properties.max
- })
+ });
else if (value < this.properties.min) this.setData({
count: this.properties.min
- })
+ });
else this.setData({
count: value
- })
+ });
} else {
this.setData({
count: this.properties.count
- })
+ });
}
let detail = {
count: this.data.count,
type: 'blur'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
reduceTap() {
- let distance = this.data.count - this.properties.step
+ let distance = this.data.count - this.properties.step;
if (distance <= this.properties.min) {
- this.data.count = this.properties.min
+ this.data.count = this.properties.min;
} else {
- this.data.count -= this.properties.step
+ this.data.count -= this.properties.step;
}
this.setData({
count: this.data.count
- })
+ });
let detail = {
count: this.data.count,
type: 'reduce'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
addTap() {
let distance = this.data.count + this.properties.step;
if (distance >= this.properties.max) {
- this.data.count = this.properties.max
+ this.data.count = this.properties.max;
} else {
this.data.count += this.properties.step;
}
this.setData({
count: this.data.count
- })
+ });
let detail = {
count: this.data.count,
type: 'add'
- }
- this.triggerEvent('lintap', detail)
+ };
+ this.triggerEvent('lintap', detail, {
+ bubbles: true,
+ composed: true
+ });
},
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/src/custom-tab-bar/index.js b/src/custom-tab-bar/index.js
index a3309a04..c4dd6580 100644
--- a/src/custom-tab-bar/index.js
+++ b/src/custom-tab-bar/index.js
@@ -90,7 +90,7 @@ Component({
idx,
path:this.route
};
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('lintap', detail, option);
},
showRedDot(idx) {
diff --git a/src/dialog/index.js b/src/dialog/index.js
index a87905c4..9cad9271 100644
--- a/src/dialog/index.js
+++ b/src/dialog/index.js
@@ -155,7 +155,7 @@ Component({
onCancelTap(e) {
let detail = 'cancel';
- let option = {};
+ let option = { bubbles: true, composed: true };
const {
success
@@ -175,7 +175,7 @@ Component({
// 背景点击事件
onDialogTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
diff --git a/src/grid-item/index.js b/src/grid-item/index.js
index ff43aec6..cb1e500d 100644
--- a/src/grid-item/index.js
+++ b/src/grid-item/index.js
@@ -22,9 +22,7 @@ Component({
tapGridItem(e) {
this.triggerEvent('lintap', {
...e
- }, {
- composed: true
- })
+ }, { bubbles: true, composed: true })
},
}
});
\ No newline at end of file
diff --git a/src/grid/index.js b/src/grid/index.js
index 7dd1f849..a303962f 100644
--- a/src/grid/index.js
+++ b/src/grid/index.js
@@ -70,7 +70,7 @@ Component({
tapGrid(e) {
this.triggerEvent('lintap', {
index:this.data.currentIndex
- })
+ },{ bubbles: true, composed: true })
}
}
});
\ No newline at end of file
diff --git a/src/list/index.js b/src/list/index.js
index 75728a45..e9e2ab42 100644
--- a/src/list/index.js
+++ b/src/list/index.js
@@ -77,7 +77,7 @@ Component({
}
this.triggerEvent('lintap', {
e
- }, {})
+ }, { bubbles: true, composed: true })
}
}
});
\ No newline at end of file
diff --git a/src/loading/index.js b/src/loading/index.js
index bd75066a..5deaf671 100644
--- a/src/loading/index.js
+++ b/src/loading/index.js
@@ -1,5 +1,5 @@
Component({
- externalClasses: ['l-container-class','l-class'],
+ externalClasses: ['l-container-class', 'l-class'],
properties: {
// 显示与隐藏
show: {
@@ -32,9 +32,39 @@ Component({
value: false,
}
},
+
+ attached() {
+ this._init();
+ },
+
methods: {
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.showLoading = (options) => {
+ const {
+ custom = false,
+ fullScreen = false,
+ color = '',
+ type = 'rotate',
+ size = 'default'
+ } = { ...options };
+ this.setData({
+ custom,
+ fullScreen,
+ color,
+ type,
+ size,
+ show: true
+ });
+ };
+ wx.lin.hideLoading = () => {
+ this.setData({
+ show: false
+ });
+ };
+ },
// 阻止滑动
- doNothingMove(e) {
+ doNothingMove() {
// do nothing……
},
}
diff --git a/src/loadmore/index.js b/src/loadmore/index.js
index 5a0c482e..d5163fd4 100644
--- a/src/loadmore/index.js
+++ b/src/loadmore/index.js
@@ -4,21 +4,21 @@ Component({
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
properties: {
- show:Boolean,
- custom:Boolean,
- line:Boolean,
- color:String,
- type:{
- type:String,
- value:'loading'
+ show: Boolean,
+ custom: Boolean,
+ line: Boolean,
+ color: String,
+ type: {
+ type: String,
+ value: 'loading'
},
- endText:{
- type:String,
- value:'我是有底线的~'
+ endText: {
+ type: String,
+ value: '我是有底线的~'
},
- loadingText:{
- type:String,
- value:'加载中...'
+ loadingText: {
+ type: String,
+ value: '加载中...'
}
},
@@ -26,13 +26,43 @@ Component({
},
- ready: function () {
-
+ attached() {
+ this._init();
},
+
methods: {
- onLoadmore(){
- this.triggerEvent('lintap');
- this.triggerEvent('lintapcatch',{},{ bubbles: true });
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.showLoadmore = (options) => {
+ const {
+ custom = false,
+ line = false,
+ color = '',
+ type = 'loading',
+ endText = '我是有底线的',
+ loadingText = '加载中...'
+ } = { ...options };
+ this.setData({
+ custom,
+ line,
+ color,
+ type,
+ endText,
+ loadingText,
+ show: true
+ });
+ };
+ wx.lin.hideLoadmore = () => {
+ this.setData({
+ show: false
+ });
+ };
+ },
+ onLoadmore() {
+ this.triggerEvent('lintap', {}, {
+ bubbles: true,
+ composed: true
+ });
}
}
});
diff --git a/src/mask/index.js b/src/mask/index.js
index c8040846..17637022 100644
--- a/src/mask/index.js
+++ b/src/mask/index.js
@@ -64,7 +64,7 @@ Component({
onMaskTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
diff --git a/src/message/index.js b/src/message/index.js
index 37467673..460dd7a7 100644
--- a/src/message/index.js
+++ b/src/message/index.js
@@ -35,7 +35,7 @@ Component({
observers: {
'show': function (show) {
- show && this.changeStatus()
+ show && this.changeStatus();
}
},
@@ -51,7 +51,7 @@ Component({
duration = 1500,
success = null
} = options;
- this.data.success = success
+ this.data.success = success;
this.setData({
content,
icon,
@@ -59,7 +59,7 @@ Component({
duration,
type
});
- this.changeStatus()
+ this.changeStatus();
return this;
};
},
@@ -67,15 +67,15 @@ Component({
changeStatus() {
this.setData({
status: true
- })
- if (this.data.timer) clearTimeout(this.data.timer)
+ });
+ if (this.data.timer) clearTimeout(this.data.timer);
this.data.timer = setTimeout(() => {
this.setData({
status: false
- })
- if (this.data.success) this.data.success()
- this.data.timer = null
- }, this.properties.duration)
+ });
+ if (this.data.success) this.data.success();
+ this.data.timer = null;
+ }, this.properties.duration);
}
}
});
\ No newline at end of file
diff --git a/src/notice-bar/index.js b/src/notice-bar/index.js
index 46953681..f6f5d2a0 100644
--- a/src/notice-bar/index.js
+++ b/src/notice-bar/index.js
@@ -17,9 +17,9 @@ Component({
type: Number,
value: 28
},
- frontIconColor:{
- type:String,
- value:'#3683D6'
+ frontIconColor: {
+ type: String,
+ value: '#3683D6'
},
endIconName: {
type: String,
@@ -29,9 +29,9 @@ Component({
type: Number,
value: 28
},
- endIconColor:{
- type:String,
- value:'#3683D6'
+ endIconColor: {
+ type: String,
+ value: '#3683D6'
},
// 背景颜色
backgroundcolor: {
@@ -83,7 +83,7 @@ Component({
const duration = rect.width / 40 * this.data.speed;
const animation = wx.createAnimation({
duration: duration,
- timingFunction: "linear",
+ timingFunction: 'linear',
});
this.setData({
wrapWidth: wrapRect.width,
@@ -126,20 +126,18 @@ Component({
}
},
handleTap() {
- this.triggerEvent('lintap');
- this.triggerEvent('lincatchtap', {}, { bubbles: true });
+ this.triggerEvent('lintap',{},{ bubbles: true, composed: true });
this.setData({
timer: null
});
},
- onSwip(e){
+ onSwip(e) {
this.triggerEvent('lintap', {
...e.currentTarget.dataset
- });
+ },{ bubbles: true, composed: true });
},
onIconTap(){
- this.triggerEvent('linicontap');
- this.triggerEvent('liniconcatchtap', {}, { bubbles: true });
+ this.triggerEvent('linicontap',{},{ bubbles: true, composed: true });
this.setData({
timer: null
});
diff --git a/src/popup/index.js b/src/popup/index.js
index 112a8b76..5fbfd543 100644
--- a/src/popup/index.js
+++ b/src/popup/index.js
@@ -54,7 +54,7 @@ Component({
// 点击事件
onPupopTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
show: !this.data.show
diff --git a/src/price/index.js b/src/price/index.js
index ab4bb540..cce91dec 100644
--- a/src/price/index.js
+++ b/src/price/index.js
@@ -2,7 +2,7 @@ Component({
/**
* 组件的属性列表
*/
- externalClasses: ['l-class', 'l-unit-class', 'l-count-class'],
+ externalClasses: ['l-deleted-class', 'l-unit-class', 'l-count-class', 'l-class'],
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
@@ -11,40 +11,31 @@ Component({
type: String,
value: '¥'
},
- unitColor: {
+ size: {
type: String,
- value: '#333'
+ value: '28'
},
- unitSize: {
- type: [String, Number],
- value: 28
- },
- unitBold: {
- type: String,
- value: 'normal'
- },
- count: {
- type: Number,
- value: 0.00,
- observer: 'reserveNumber'
- },
- countColor: {
+ color: {
type: String,
- value: '#333'
- },
- countSize: {
- type: [String, Number],
- value: 28
+ value: '#3963BC'
},
- countBold: {
+ bold: {
type: String,
- value: 'normal'
+ value: '500'
},
- delete: Boolean,
- delColor: {
+ unitColor: String,
+ unitSize: String,
+ unitBold: String,
+ count: {
type: String,
- value: '#777'
+ value: '0.00',
+ observer: 'reserveNumber'
},
+ countColor: String,
+ countSize: String,
+ countBold: String,
+ deleted: Boolean,
+ delColor: String,
reserveDigit: {
type: Number,
value: 2
@@ -63,21 +54,29 @@ Component({
* 组件的方法列表
*/
methods: {
- reserveNumber(value) {
- const strValue = value.toString();
+ reserveNumber() {
+ const strValue = this.data.count.toString();
+ const isNumber = !isNaN(Number(this.data.count));
const dotIndex = strValue.indexOf('.');
if (strValue.length - dotIndex - 1 > this.data.reserveDigit && dotIndex !== -1) {
this.setData({
- result: strValue.substring(0, dotIndex + this.data.reserveDigit)
+ result: isNumber ? strValue.substring(0, dotIndex + 1 + this.data.reserveDigit) : strValue
});
} else {
- this.addZero(strValue);
+ if (isNumber) {
+ this.addZero(strValue);
+ } else {
+ this.setData({
+ result: strValue
+ });
+ }
}
},
addZero(value) {
- const realLen = value.indexOf('.') + 1 + this.data.reserveDigit;
+ const dotIndex = value.indexOf('.') == -1 ? value.length - 1 : value.indexOf('.');
+ const realLen = dotIndex + 1 + this.data.reserveDigit;
if (value.length < realLen && this.data.autofix) {
- const result = value + '0'.repeat(realLen - value.length);
+ const result = dotIndex == value.indexOf('.') ? value + '0'.repeat(realLen - value.length) : value + '.' + '0'.repeat(realLen - value.length);
this.setData({
result
});
diff --git a/src/price/index.less b/src/price/index.less
index 82b14e49..9a715a83 100644
--- a/src/price/index.less
+++ b/src/price/index.less
@@ -1,3 +1,5 @@
+@import "../../config/styles/_base.less";
+
.price-del{
text-decoration: line-through !important;
}
@@ -5,4 +7,6 @@
.price-container{
display: inline-block;
text-align: center;
+ color: @theme-color;
+ font-size: 28rpx;
}
\ No newline at end of file
diff --git a/src/price/index.wxml b/src/price/index.wxml
index e35de0c8..4506ccfb 100644
--- a/src/price/index.wxml
+++ b/src/price/index.wxml
@@ -1,8 +1,8 @@
-
+
- {{unit}}
-
- {{result}}
+ {{unit}}
+
+ {{result}}
\ No newline at end of file
diff --git a/src/search-bar/index.js b/src/search-bar/index.js
index 09c635ac..84199415 100644
--- a/src/search-bar/index.js
+++ b/src/search-bar/index.js
@@ -19,10 +19,6 @@ Component({
value: 'search'
},
placeholder: String,
- confirmType: {
- type: String,
- value: 'search'
- },
cancelText: {
type: String,
value: '取消'
@@ -92,7 +88,10 @@ Component({
*/
methods: {
onCancel() {
- this.triggerEvent('lincancel')
+ this.triggerEvent('lincancel', {}, {
+ bubbles: true,
+ composed: true
+ });
},
// input属性列表
handleInputChange(event) {
@@ -137,7 +136,10 @@ Component({
this.setData({
value: ''
});
- this.triggerEvent('linclear', event.detail);
+ this.triggerEvent('linclear', event.detail, {
+ bubbles: true,
+ composed: true
+ });
}
}
});
\ No newline at end of file
diff --git a/src/segment/index.wxml b/src/segment/index.wxml
index 93ea85b5..e2ae10e3 100644
--- a/src/segment/index.wxml
+++ b/src/segment/index.wxml
@@ -9,7 +9,7 @@
-
+
diff --git a/src/slide-view/index.js b/src/slide-view/index.js
index 698237f1..a3237484 100644
--- a/src/slide-view/index.js
+++ b/src/slide-view/index.js
@@ -156,7 +156,7 @@ Component({
// 点击 右边区域
onRightTap(e) {
let detail = 'click right';
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.properties.autoClose) {
this.setData({
popup: false,
@@ -171,7 +171,7 @@ Component({
// 打开后触发
onOpenTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('slideopen', detail, option);
},
@@ -179,7 +179,7 @@ Component({
// 关闭后触发
onCloseTap(e) {
let detail = false;
- let option = {};
+ let option = { bubbles: true, composed: true };
this.triggerEvent('slideclose', detail, option);
}
diff --git a/src/status-show/index.js b/src/status-show/index.js
index 80e5cd1e..e7311525 100644
--- a/src/status-show/index.js
+++ b/src/status-show/index.js
@@ -28,7 +28,7 @@ Component({
},
ready() {
- this._changeStatus()
+ this._changeStatus();
},
/**
@@ -37,60 +37,59 @@ Component({
methods: {
_changeStatus() {
switch (this.properties.type) {
- case 'success':
- this.setData({
- typeImage: 'image/success.png',
- typeText: '操作成功~'
- })
- break
- case 'error':
- this.setData({
- typeImage: 'image/error.png',
- typeText: '操作失败~'
- })
- break
- case 'cart':
- this.setData({
- typeImage: 'image/cart.png',
- typeText: '购物车空空如也,去逛逛吧~'
- })
- break
- case 'order':
- this.setData({
- typeImage: 'image/order.png',
- typeText: '您暂时还没有订单哦~'
- })
- break
- case 'network':
- this.setData({
- typeImage: 'image/network.png',
- typeText: '糟糕!网络错误~'
- })
- break
- case 'address':
- this.setData({
- typeImage: 'image/address.png',
- typeText: '您暂时还没有地址哦~'
- })
- break
- case 'product':
- this.setData({
- typeImage: 'image/product.png',
- typeText: '暂时还没有商品哦~~'
- })
- break
- case 'data':
- this.setData({
- typeImage: 'image/data.png',
- typeText: '暂时还没有相关数据哦~~'
- })
- break
+ case 'success':
+ this.setData({
+ typeImage: 'image/success.png',
+ typeText: '操作成功~'
+ });
+ break;
+ case 'error':
+ this.setData({
+ typeImage: 'image/error.png',
+ typeText: '操作失败~'
+ });
+ break;
+ case 'cart':
+ this.setData({
+ typeImage: 'image/cart.png',
+ typeText: '购物车空空如也,去逛逛吧~'
+ });
+ break;
+ case 'order':
+ this.setData({
+ typeImage: 'image/order.png',
+ typeText: '您暂时还没有订单哦~'
+ });
+ break;
+ case 'network':
+ this.setData({
+ typeImage: 'image/network.png',
+ typeText: '糟糕!网络错误~'
+ });
+ break;
+ case 'address':
+ this.setData({
+ typeImage: 'image/address.png',
+ typeText: '您暂时还没有地址哦~'
+ });
+ break;
+ case 'product':
+ this.setData({
+ typeImage: 'image/product.png',
+ typeText: '暂时还没有商品哦~~'
+ });
+ break;
+ case 'data':
+ this.setData({
+ typeImage: 'image/data.png',
+ typeText: '暂时还没有相关数据哦~~'
+ });
+ break;
}
},
onBtn() {
- this.triggerEvent('lintap', {}, {});
- this.triggerEvent('lintapcatch', {}, { bubbles: true });
+ this.triggerEvent('lintap', {}, { bubbles: true, composed: true });
}
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/src/tag/index.js b/src/tag/index.js
index 819edb70..f32ccaae 100644
--- a/src/tag/index.js
+++ b/src/tag/index.js
@@ -4,6 +4,10 @@ Component({
// 标签名称
name: Object,
// 标签颜色
+ type:{
+ type: String,
+ value: 'touch'
+ },
bgColor: String,
fontColor: String,
disable: Boolean,
diff --git a/src/tag/index.less b/src/tag/index.less
index cf0b94c9..cbef9c0b 100644
--- a/src/tag/index.less
+++ b/src/tag/index.less
@@ -8,36 +8,47 @@
background-color: #3963bc;
border: 2rpx solid #3963bc;
+ &-touch{
+ min-width: 80rpx;
+ }
+
+ &-super-mini{
+ height: 28rpx;
+ font-size: 20rpx;
+ }
+
// Size
&-mini{
height: 38rpx;
font-size: 20rpx;
- letter-spacing: 1rpx;
}
&-medium{
height: 46rpx;
font-size: 24rpx;
- min-width: 60rpx;
letter-spacing: 2rpx;
}
&-large{
height: 56rpx;
font-size: 24rpx;
- min-width: 80rpx;
letter-spacing: 2rpx;
}
// Shape
+ &-super-mini-square{
+ border-radius: 2rpx;
+ padding: 0 6rpx;
+ }
+
&-mini-square{
border-radius: 2rpx;
- padding: 0 18rpx;
+ padding: 0 12rpx;
}
&-medium-square{
border-radius: 2rpx;
- padding: 0 18rpx;
+ padding: 0 16rpx;
}
&-large-square{
@@ -45,9 +56,14 @@
padding: 0 18rpx;
}
+ &-super-mini-circle{
+ border-radius: 25rpx;
+ padding: 0 12rpx;
+ }
+
&-mini-circle{
border-radius: 25rpx;
- padding: 0 20rpx;
+ padding: 0 16rpx;
}
&-medium-circle{
@@ -57,7 +73,7 @@
&-large-circle{
border-radius: 30rpx;
- padding: 0 20rpx;
+ padding: 0 24rpx;
}
&-plain{
diff --git a/src/tag/index.wxml b/src/tag/index.wxml
index e592055c..84d5d340 100644
--- a/src/tag/index.wxml
+++ b/src/tag/index.wxml
@@ -1,4 +1,4 @@
-
diff --git a/src/toast/index.js b/src/toast/index.js
index 0b02ab09..50c3783e 100644
--- a/src/toast/index.js
+++ b/src/toast/index.js
@@ -218,7 +218,7 @@ Component({
onMaskTap(e) {
let detail = true;
- let option = {};
+ let option = { bubbles: true, composed: true };
if (this.data.locked !== true) {
this.setData({
@@ -227,7 +227,7 @@ Component({
})
}
- this.triggerEvent('linTap', detail, option);
+ this.triggerEvent('lintap', detail, option);
}
}
})
\ No newline at end of file
diff --git a/src/water-flow/index.js b/src/water-flow/index.js
index 89ad1af1..3d804ee2 100644
--- a/src/water-flow/index.js
+++ b/src/water-flow/index.js
@@ -1,77 +1,81 @@
// pages/components/water/index.js
Component({
- /**
+ /**
* 组件的属性列表
*/
- properties: {
- columnGap: {
- type: String,
- value: '20rpx'
- }
- },
+ properties: {
+ columnGap: {
+ type: String,
+ value: '20rpx'
+ }
+ },
- /**
+ /**
* 组件的初始数据
*/
- data: {
- data: [],
- leftData: [],
- rightData: []
- },
+ data: {
+ data: [],
+ leftData: [],
+ rightData: []
+ },
- attached() {
- this._init()
- },
+ attached() {
+ this._init();
+ },
- /**
+ /**
* 组件的方法列表
*/
- methods: {
- _init() {
- wx.lin = wx.lin || {}
- wx.lin.renderWaterFlow = (data = [], success) => {
- if (Object.prototype.toString.call(data) !== '[object Array]') {
- console.error("[data]参数类型错误,渲染失败");
- return false;
- }
- this._select(data).then(() => {
- success && success()
- })
- }
- },
- _select(data) {
- const query = wx.createSelectorQuery().in(this)
- this.columnNodes = query.selectAll('#left, #right')
+ methods: {
+ _init() {
+ wx.lin = wx.lin || {};
+ wx.lin.renderWaterFlow = (data = [], refresh = false , success) => {
+ if (Object.prototype.toString.call(data) !== '[object Array]') {
+ console.error('[data]参数类型错误,渲染失败');
+ return false;
+ }
+ if(refresh){
+ this.data.leftData = [];
+ this.data.rightData = [];
+ }
+ this._select(data).then(() => {
+ success && success();
+ });
+ };
+ },
+ _select(data) {
+ const query = wx.createSelectorQuery().in(this);
+ this.columnNodes = query.selectAll('#left, #right');
- return new Promise((resolve, reject) => {
- this._render(data, 0, () => {
- resolve()
- })
- })
- },
- _render(data, i, success) {
- if (data.length > i) {
- this.columnNodes.boundingClientRect().exec(res => {
- const rects = res[0]
- const leftHeight = rects[0].height
- const rightHeight = rects[1].height
+ return new Promise((resolve) => {
+ this._render(data, 0, () => {
+ resolve();
+ });
+ });
+ },
+ _render(data, i, success) {
+ if (data.length > i) {
+ this.columnNodes.boundingClientRect().exec(res => {
+ const rects = res[0];
+ const leftHeight = rects[0].height;
+ const rightHeight = rects[1].height;
- if (leftHeight <= rightHeight) {
- this.data.leftData.push(data[i])
- } else {
- this.data.rightData.push(data[i])
- }
+ if (leftHeight <= rightHeight) {
+ this.data.leftData.push(data[i]);
+ } else {
+ this.data.rightData.push(data[i]);
+ }
- this.setData({
- leftData: this.data.leftData,
- rightData: this.data.rightData
- }, _ => {
- this._render(data, ++i, success)
- })
- })
- } else {
- success && success()
- }
- }
+ this.setData({
+ leftData: this.data.leftData,
+ rightData: this.data.rightData
+ }, () => {
+ this._render(data, ++i, success);
+ });
+ });
+ } else {
+ success && success();
+ }
}
-})
\ No newline at end of file
+ }
+});
\ No newline at end of file