@@ -121,15 +121,47 @@ export default {
121
121
isALIPAY: env === ENV_TYPE .ALIPAY ,
122
122
}
123
123
},
124
+ mounted (){
125
+ console .log (' this.onGetPhoneNumber' , this .onGetPhoneNumber )
126
+ },
124
127
methods: {
125
128
hanldeClick (event ) {
126
129
if (! this .disabled ) {
127
130
this .onClick && this .onClick (event )
128
131
}
129
132
},
130
- handleGetUserInfo () {
131
- this .onGetUserInfo ()
132
- }
133
+ handleGetUserInfo (event ) {
134
+ this .onGetUserInfo && this .onGetUserInfo (event )
135
+ },
136
+ handleGetPhoneNumber (event ) {
137
+ this .onGetPhoneNumber && this .onGetPhoneNumber (event )
138
+ },
139
+ handleOpenSetting (event ) {
140
+ this .onOpenSetting && this .onOpenSetting (event )
141
+ },
142
+ handleError (event ) {
143
+ this .onError && this .onError (event )
144
+ },
145
+ handleContact (event ) {
146
+ this .onContact && this .onContact (event )
147
+ },
148
+ handleSubmit (event ) {
149
+ if (this .isWEAPP || this .isWEB ) {
150
+ this .$scope .triggerEvent (' submit' , event .detail , {
151
+ bubbles: true ,
152
+ composed: true
153
+ })
154
+ }
155
+ },
156
+ handleReset (event ) {
157
+ if (this .isWEAPP || this .isWEB ) {
158
+ this .$scope .triggerEvent (' reset' , event .detail , {
159
+ bubbles: true ,
160
+ composed: true
161
+ })
162
+ }
163
+ },
164
+
133
165
},
134
166
render () {
135
167
// props
@@ -188,7 +220,7 @@ export default {
188
220
)
189
221
190
222
const button = (
191
- < Button
223
+ < button
192
224
className= ' at-button__wxbutton'
193
225
formType= {formType}
194
226
openType= {openType}
@@ -199,13 +231,13 @@ export default {
199
231
sendMessageImg= {sendMessageImg}
200
232
showMessageCard= {showMessageCard}
201
233
appParameter= {appParameter}
202
- onGetUserInfo = {this .handleGetUserInfo }
203
- onGetPhoneNumber= {this .hanldeClick }
204
- onOpenSetting= {this .hanldeClick }
205
- onError= {this .hanldeClick }
206
- onContact= {this .hanldeClick }
234
+ ongetUserInfo = {this .handleGetUserInfo }
235
+ onGetPhoneNumber= {this .hanldeGetPhoneNumber }
236
+ onOpenSetting= {this .hanldeSetting }
237
+ onError= {this .hanldeError }
238
+ onContact= {this .hanldeContact }
207
239
>
208
- < / Button >
240
+ < / button >
209
241
)
210
242
return (
211
243
< view
@@ -216,8 +248,8 @@ export default {
216
248
{isWEB && ! disabled && webButton}
217
249
{isWEAPP && ! disabled && (
218
250
< form
219
- onSubmit= {this .hanldeClick }
220
- onReset= {this .hanldeClick }
251
+ onSubmit= {this .handleSubmit }
252
+ onReset= {this .handleReset }
221
253
>
222
254
{button}
223
255
< / form>
0 commit comments