Skip to content

Commit b3f660d

Browse files
committed
build: Travis CI automatic compilation
1 parent ff3e4f5 commit b3f660d

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

examples/dist/capsule-bar/index.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import deviceUtil from '../utils/device-util'
2-
import validator from '../behaviors/validator'
3-
import eventUtil from '../core/utils/event-util'
1+
import deviceUtil from '../utils/device-util';
2+
import validator from '../behaviors/validator';
3+
import eventUtil from '../core/utils/event-util';
44

55
Component({
66
behaviors: [validator],
@@ -77,7 +77,7 @@ Component({
7777
ready:function () {
7878
this.setData({
7979
capsuleButtonInfo: this.getCapsuleButtonInfo()
80-
})
80+
});
8181
}
8282
},
8383

@@ -87,55 +87,55 @@ Component({
8787
* 获取左侧胶囊按钮信息
8888
*/
8989
getCapsuleButtonInfo() {
90-
const screenWidth = wx.getSystemInfoSync().screenWidth
91-
const capsuleButtonInfo = wx.getMenuButtonBoundingClientRect()
92-
capsuleButtonInfo.left = screenWidth - capsuleButtonInfo.right
93-
capsuleButtonInfo.right = capsuleButtonInfo.left + capsuleButtonInfo.width
94-
return capsuleButtonInfo
90+
const screenWidth = wx.getSystemInfoSync().screenWidth;
91+
const capsuleButtonInfo = wx.getMenuButtonBoundingClientRect();
92+
capsuleButtonInfo.left = screenWidth - capsuleButtonInfo.right;
93+
capsuleButtonInfo.right = capsuleButtonInfo.left + capsuleButtonInfo.width;
94+
return capsuleButtonInfo;
9595
},
9696

9797
/**
9898
* 监听:点击左侧按钮
9999
*/
100100
onTapLeftButton() {
101-
eventUtil.emit(this, 'linlefttap')
101+
eventUtil.emit(this, 'linlefttap');
102102

103103
if (!this.data.disableBack) {
104-
wx.navigateBack()
104+
wx.navigateBack();
105105
}
106106
},
107107

108108
/**
109109
* 监听:长按左侧按钮
110110
*/
111111
onLongPressLeftButton() {
112-
eventUtil.emit(this, 'linleftlongpress')
112+
eventUtil.emit(this, 'linleftlongpress');
113113
},
114114

115115
/**
116116
* 监听:点击右侧按钮
117117
*/
118118
async onTapRightButton() {
119-
eventUtil.emit(this, 'linrighttap')
119+
eventUtil.emit(this, 'linrighttap');
120120

121-
const homePage = this.data.homePage
121+
const homePage = this.data.homePage;
122122
if (!this.data.disableHome) {
123123
wx.switchTab({
124124
url: homePage,
125125
fail() {
126126
wx.navigateTo({
127127
url: homePage
128-
})
128+
});
129129
}
130-
})
130+
});
131131
}
132132
},
133133

134134
/**
135135
* 监听:长按右侧按钮
136136
*/
137137
onLongPressRightButton() {
138-
eventUtil.emit(this, 'linrightlongpress')
138+
eventUtil.emit(this, 'linrightlongpress');
139139
}
140140
}
141-
})
141+
});

examples/dist/utils/device-util.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,54 @@ class DeviceUtil {
99
* @param systemInfo 设备信息
1010
*/
1111
constructor(systemInfo) {
12-
this.systemInfo = systemInfo
12+
this.systemInfo = systemInfo;
1313
}
1414

1515
/**
1616
* px 转 rpx
1717
* @param px 像素值
1818
*/
1919
px2rpx(px) {
20-
const windowWidth = this.systemInfo.windowWidth
21-
return 750 / windowWidth * px
20+
const windowWidth = this.systemInfo.windowWidth;
21+
return 750 / windowWidth * px;
2222
}
2323

2424
/**
2525
* rpx 转 px
2626
* @param rpx
2727
*/
2828
rpx2px(rpx) {
29-
const windowWidth = this.systemInfo.windowWidth
30-
return windowWidth / 750 * rpx
29+
const windowWidth = this.systemInfo.windowWidth;
30+
return windowWidth / 750 * rpx;
3131
}
3232

3333
/**
3434
* 获取导航栏高度(单位rpx)
3535
*/
3636
getNavigationBarHeight() {
37-
const titleBarHeight = this.getTitleBarHeight()
38-
const statusBarHeight = this.getStatusBarHeight()
39-
return titleBarHeight + statusBarHeight
37+
const titleBarHeight = this.getTitleBarHeight();
38+
const statusBarHeight = this.getStatusBarHeight();
39+
return titleBarHeight + statusBarHeight;
4040
}
4141

4242
/**
4343
* 获取状态栏高度(单位rpx)
4444
*/
4545
getStatusBarHeight() {
46-
return this.px2rpx(this.systemInfo.statusBarHeight)
46+
return this.px2rpx(this.systemInfo.statusBarHeight);
4747
}
4848

4949
/**
5050
* 获取标题栏高度(单位rpx)
5151
*/
5252
getTitleBarHeight() {
53-
const statusBarHeight = this.systemInfo.statusBarHeight
54-
const capsuleButtonInfo = wx.getMenuButtonBoundingClientRect()
55-
const gap = capsuleButtonInfo.top - statusBarHeight
56-
return this.px2rpx(gap * 2 + capsuleButtonInfo.height)
53+
const statusBarHeight = this.systemInfo.statusBarHeight;
54+
const capsuleButtonInfo = wx.getMenuButtonBoundingClientRect();
55+
const gap = capsuleButtonInfo.top - statusBarHeight;
56+
return this.px2rpx(gap * 2 + capsuleButtonInfo.height);
5757
}
5858

5959
}
6060

61-
const deviceUtil = new DeviceUtil(wx.getSystemInfoSync())
62-
export default deviceUtil
61+
const deviceUtil = new DeviceUtil(wx.getSystemInfoSync());
62+
export default deviceUtil;

0 commit comments

Comments
 (0)