wxml
<view class="title">手机状态</view>
<view class="demo-box">
<view class="title">长时间震动</view>
<button type="primary" bindtap="vibrateLong">开始震动</button>
</view>
<view class="demo-box">
<view class="title">短时间震动</view>
<button type="primary" bindtap="vibrateShort">开始震动</button>
</view>
js
Page({
data: {
},
vibrateLong:function(){
wx.vibrateLong()
},
vibrateShort:function(){
wx.vibrateShort()
},
)}