index.js 410 B

12345678910111213141516171819202122232425262728
  1. // index.js
  2. // 获取应用实例
  3. const app = getApp();
  4. Page({
  5. data: {
  6. type: 'map'
  7. },
  8. onLoad() {
  9. },
  10. onShow(){
  11. wx.setKeepScreenOn({
  12. keepScreenOn: true,
  13. success(){
  14. console.log('1111111');
  15. },
  16. fail(){}
  17. })
  18. },
  19. switchType(e) {
  20. let type = e.target.dataset && e.target.dataset.type || 'map';
  21. this.setData({
  22. type
  23. })
  24. },
  25. onUnload() {
  26. }
  27. })