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' ;
4
4
5
5
Component ( {
6
6
behaviors : [ validator ] ,
@@ -77,7 +77,7 @@ Component({
77
77
ready :function ( ) {
78
78
this . setData ( {
79
79
capsuleButtonInfo : this . getCapsuleButtonInfo ( )
80
- } )
80
+ } ) ;
81
81
}
82
82
} ,
83
83
@@ -87,55 +87,55 @@ Component({
87
87
* 获取左侧胶囊按钮信息
88
88
*/
89
89
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 ;
95
95
} ,
96
96
97
97
/**
98
98
* 监听:点击左侧按钮
99
99
*/
100
100
onTapLeftButton ( ) {
101
- eventUtil . emit ( this , 'linlefttap' )
101
+ eventUtil . emit ( this , 'linlefttap' ) ;
102
102
103
103
if ( ! this . data . disableBack ) {
104
- wx . navigateBack ( )
104
+ wx . navigateBack ( ) ;
105
105
}
106
106
} ,
107
107
108
108
/**
109
109
* 监听:长按左侧按钮
110
110
*/
111
111
onLongPressLeftButton ( ) {
112
- eventUtil . emit ( this , 'linleftlongpress' )
112
+ eventUtil . emit ( this , 'linleftlongpress' ) ;
113
113
} ,
114
114
115
115
/**
116
116
* 监听:点击右侧按钮
117
117
*/
118
118
async onTapRightButton ( ) {
119
- eventUtil . emit ( this , 'linrighttap' )
119
+ eventUtil . emit ( this , 'linrighttap' ) ;
120
120
121
- const homePage = this . data . homePage
121
+ const homePage = this . data . homePage ;
122
122
if ( ! this . data . disableHome ) {
123
123
wx . switchTab ( {
124
124
url : homePage ,
125
125
fail ( ) {
126
126
wx . navigateTo ( {
127
127
url : homePage
128
- } )
128
+ } ) ;
129
129
}
130
- } )
130
+ } ) ;
131
131
}
132
132
} ,
133
133
134
134
/**
135
135
* 监听:长按右侧按钮
136
136
*/
137
137
onLongPressRightButton ( ) {
138
- eventUtil . emit ( this , 'linrightlongpress' )
138
+ eventUtil . emit ( this , 'linrightlongpress' ) ;
139
139
}
140
140
}
141
- } )
141
+ } ) ;
0 commit comments