2021-12-31 23:31:45 +08:00

60 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import router from '@system.router'
import app from '@system.app'
import brightness from '@system.brightness';
import vibrator from '@system.vibrator';
import prompt from '@system.prompt';
export default {
onInit() {
brightness.setKeepScreenOn({keepScreenOn: true,});
brightness.setMode({mode: 1,});
},
onSwipe(e) {
switch (e.direction) {
case 'left':
break;
case 'right':
break;
case 'up':
break;
case 'down':
break;
}
},
ToStart(){
vibrator.vibrate({
mode: 'short',
success: function(ret) {
console.log('tzx vibrate is successful');
},
fail: function(ret) {
console.log('tzx vibrate is failed');
},
complete: function(ret) {
console.log('tzx vibrate is completed');
}
});
prompt.showToast({
message: '开始成功By Xcl!',
duration: 3579,
});
router.replace({
uri: "pages/index/index",
});
},
ToClose(){
vibrator.vibrate({
mode: 'short',
success: function(ret) {
console.log('tzx vibrate is successful');
},
fail: function(ret) {
console.log('tzx vibrate is failed');
},
complete: function(ret) {
console.log('tzx vibrate is completed');
}
});
app.terminate();
},
}