Skip to content

Commit f697d00

Browse files
authored
feat:发布0.5.7版本
2 parents 922cbb0 + 45d44a4 commit f697d00

File tree

60 files changed

+1085
-967
lines changed

Some content is hidden

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

60 files changed

+1085
-967
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div align="center">
1818

1919
![](https://img.shields.io/badge/build-passing-00d508.svg)
20-
![](https://img.shields.io/badge/version-0.5.6-3963bc.svg)
20+
![](https://img.shields.io/badge/version-0.5.7-3963bc.svg)
2121
![](https://img.shields.io/badge/license-MIT-3963bc.svg)
2222

2323
</div>
@@ -39,7 +39,7 @@ Lin UI 是基于 **微信小程序原生语法** 实现的组件库。遵循简
3939

4040
## 最新版本
4141

42-
核心库:0.5.6
42+
核心库:0.5.7
4343

4444
示例工程:0.0.1-alpha.2
4545

dist/action-sheet/index.js

Lines changed: 113 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,125 @@
11
Component({
2-
externalClasses: ['l-class-title', 'l-class-item', 'l-class-cancel'],
3-
properties: {
4-
locked: Boolean,
5-
showCancel: Boolean,
6-
show: Boolean,
7-
itemList: Array,
8-
cancelText: {
9-
type: String,
10-
value: '取消'
11-
},
12-
title: String,
13-
openApi: {
14-
type: Boolean,
15-
value: true,
16-
}
17-
},
18-
data: {
19-
success: '',
20-
fail: '',
21-
isIphoneX: false
22-
},
23-
attached() {
24-
if (this.data.openApi) {
25-
this.initActionSheet();
26-
}
27-
this.initUIAdapter();
2+
externalClasses: ['l-class-title', 'l-class-item', 'l-class-cancel'],
3+
properties: {
4+
locked: Boolean,
5+
showCancel: Boolean,
6+
show: Boolean,
7+
itemList: Array,
8+
cancelText: {
9+
type: String,
10+
value: '取消'
2811
},
12+
title: String,
13+
openApi: {
14+
type: Boolean,
15+
value: true,
16+
}
17+
},
18+
data: {
19+
success: '',
20+
fail: '',
21+
isIphoneX: false
22+
},
23+
attached() {
24+
if (this.data.openApi) {
25+
this.initActionSheet();
26+
}
27+
this.initUIAdapter();
28+
},
2929

30-
lifetimes: {
31-
show() {
32-
if (this.data.openApi) {
33-
this.initActionSheet();
34-
}
30+
lifetimes: {
31+
show() {
32+
if (this.data.openApi) {
33+
this.initActionSheet();
34+
}
3535

36-
},
3736
},
38-
methods: {
39-
/**
37+
},
38+
methods: {
39+
/**
4040
* 区分UI尺寸
4141
*/
42-
initUIAdapter() {
43-
wx.getSystemInfo({
44-
success: (res) => {
45-
this.setData({
46-
isIphoneX: res.model == "iPhone X" ? true : false,
47-
})
48-
}
49-
})
50-
},
51-
initActionSheet() {
52-
const config = {
53-
itemList: [],
54-
success: null,
55-
fail: null,
56-
title: '',
57-
locked: true,
58-
cancelText: '取消',
59-
showCancel: false
60-
}
61-
wx.lin = wx.lin || {};
62-
wx.lin.showActionSheet = (options={}) => {
63-
const {
64-
itemList = config.itemList,
65-
success = config.success,
66-
fail = config.fail,
67-
title = config.title,
68-
locked = config.locked,
69-
cancelText = config.cancelText,
70-
showCancel = config.showCancel,
71-
} = options;
72-
this.setData({
73-
itemList: itemList.slice(0, 10),
74-
success,
75-
fail,
76-
title,
77-
locked,
78-
cancelText,
79-
showCancel,
80-
show: true,
81-
});
82-
return this;
83-
};
84-
},
85-
handleClickItem(e) {
86-
const {
87-
success
88-
} = this.data;
89-
success && success({ ...e.currentTarget.dataset });
90-
this.triggerEvent('linitemtap', { ...e.currentTarget.dataset });
91-
this._hideActionSheet();
92-
},
42+
initUIAdapter() {
43+
wx.getSystemInfo({
44+
success: (res) => {
45+
this.setData({
46+
isIphoneX: res.model == 'iPhone X' ? true : false,
47+
});
48+
}
49+
});
50+
},
51+
initActionSheet() {
52+
const config = {
53+
itemList: [],
54+
success: null,
55+
fail: null,
56+
title: '',
57+
locked: true,
58+
cancelText: '取消',
59+
showCancel: false
60+
};
61+
wx.lin = wx.lin || {};
62+
wx.lin.showActionSheet = (options={}) => {
63+
const {
64+
itemList = config.itemList,
65+
success = config.success,
66+
fail = config.fail,
67+
title = config.title,
68+
locked = config.locked,
69+
cancelText = config.cancelText,
70+
showCancel = config.showCancel,
71+
} = options;
72+
this.setData({
73+
itemList: itemList.slice(0, 10),
74+
success,
75+
fail,
76+
title,
77+
locked,
78+
cancelText,
79+
showCancel,
80+
show: true,
81+
});
82+
return this;
83+
};
84+
},
85+
handleClickItem(e) {
86+
const {
87+
success
88+
} = this.data;
89+
success && success({ ...e.currentTarget.dataset });
90+
this.triggerEvent('linitemtap', { ...e.currentTarget.dataset });
91+
this._hideActionSheet();
92+
},
9393

94-
_showActionSheet() {
95-
this.setData({
96-
show: true
97-
})
98-
},
94+
_showActionSheet() {
95+
this.setData({
96+
show: true
97+
});
98+
},
9999

100-
_hideActionSheet() {
101-
this.setData({
102-
show: false
103-
})
104-
},
100+
_hideActionSheet() {
101+
this.setData({
102+
show: false
103+
});
104+
},
105105

106-
handleClickCancel() {
107-
const {
108-
fail
109-
} = this.data;
110-
fail && fail({
111-
errMsg: 'showactionsheet:fail cancel'
112-
});
113-
this.triggerEvent('lincancel', {
114-
errMsg: 'showactionsheet:fail cancel'
115-
})
116-
this._hideActionSheet();
117-
},
106+
handleClickCancel() {
107+
const {
108+
fail
109+
} = this.data;
110+
fail && fail({
111+
errMsg: 'showactionsheet:fail cancel'
112+
});
113+
this.triggerEvent('lincancel', {
114+
errMsg: 'showactionsheet:fail cancel'
115+
});
116+
this._hideActionSheet();
117+
},
118118

119-
handleClickPopUp() {
120-
if (!this.data.locked) {
121-
this.handleClickCancel();
122-
}
123-
},
124-
}
119+
handleClickPopUp() {
120+
if (!this.data.locked) {
121+
this.handleClickCancel();
122+
}
123+
},
124+
}
125125
});

0 commit comments

Comments
 (0)