init
This commit is contained in:
0
xhs-mini-demos/api-case/vibrate/vibrate.css
Normal file
0
xhs-mini-demos/api-case/vibrate/vibrate.css
Normal file
36
xhs-mini-demos/api-case/vibrate/vibrate.js
Normal file
36
xhs-mini-demos/api-case/vibrate/vibrate.js
Normal file
@@ -0,0 +1,36 @@
|
||||
Page({
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: '振动',
|
||||
path: 'packageAPI/pages/vibrate/vibrate',
|
||||
};
|
||||
},
|
||||
|
||||
vibrateShort() {
|
||||
xhs.vibrateShort({
|
||||
success(res) {
|
||||
console.log(res);
|
||||
},
|
||||
fail(err) {
|
||||
console.error(err);
|
||||
},
|
||||
complete() {
|
||||
console.log('completed');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
vibrateLong() {
|
||||
xhs.vibrateLong({
|
||||
success(res) {
|
||||
console.log(res);
|
||||
},
|
||||
fail(err) {
|
||||
console.error(err);
|
||||
},
|
||||
complete() {
|
||||
console.log('completed');
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
3
xhs-mini-demos/api-case/vibrate/vibrate.json
Normal file
3
xhs-mini-demos/api-case/vibrate/vibrate.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "振动"
|
||||
}
|
||||
10
xhs-mini-demos/api-case/vibrate/vibrate.xhsml
Normal file
10
xhs-mini-demos/api-case/vibrate/vibrate.xhsml
Normal file
@@ -0,0 +1,10 @@
|
||||
<view class="container">
|
||||
<view class="page-body">
|
||||
<view class="page-section">
|
||||
<view class="btn-area">
|
||||
<button type="primary" bindtap="vibrateLong">长振动</button>
|
||||
<button type="default" bindtap="vibrateShort">短振动</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user