index.js 644 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // index.js
  2. // 获取应用实例
  3. const app = getApp()
  4. const {
  5. formatTime
  6. } = require('../../utils/util')
  7. function add(x, y) {
  8. return x + y
  9. }
  10. console.log('page index')
  11. Page({
  12. data: {
  13. x: 1,
  14. y: 1,
  15. address: {
  16. province: '黑龙江',
  17. city: '哈尔滨',
  18. district: '松北',
  19. community: '地中海'
  20. },
  21. color: 'hotpink',
  22. fontSize: '20px',
  23. time: formatTime(new Date()),
  24. // total: add(x, y)
  25. },
  26. onLoad() {
  27. // var newTime = formatTime(new Date())
  28. // console.log(newTime)
  29. // this.setData({
  30. // time: newTime
  31. // })、
  32. console.log(app.globalData.shareData)
  33. },
  34. })