index.js 503 B

12345678910111213141516171819202122232425262728293031323334
  1. // index.js
  2. // 获取应用实例
  3. const app = getApp();
  4. Page({
  5. data: {
  6. type: 'map',
  7. navList:[{
  8. id:'list',
  9. name:'列表'
  10. },{
  11. id:'big-pic',
  12. name:'大图'
  13. },{
  14. id:'map',
  15. name:'地图'
  16. }]
  17. },
  18. onShow(){
  19. wx.setKeepScreenOn({
  20. keepScreenOn: true,
  21. success(){},
  22. fail(){}
  23. })
  24. },
  25. onLoad() {
  26. },
  27. switchType(e) {
  28. let type = e.target.dataset && e.target.dataset.type || 'map';
  29. this.setData({
  30. type
  31. })
  32. }
  33. })