app.js 892 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //app.js
  2. import util from './utils_sand/util.js';
  3. App({
  4. onError: function (err) {
  5. // wx.showToast({
  6. // title: '下单失败',
  7. // icon: 'none',
  8. // duration: 2000
  9. // })
  10. },
  11. onLaunch: function (e) {
  12. wx.login({
  13. success: res => {
  14. }
  15. })
  16. wx.getSetting({
  17. success: res => {
  18. if (res.authSetting['scope.userInfo']) {
  19. wx.getUserInfo({
  20. success: res => {
  21. this.globalData.userInfo = res.userInfo
  22. if (this.userInfoReadyCallback) {
  23. this.userInfoReadyCallback(res)
  24. }
  25. }
  26. })
  27. }
  28. }
  29. })
  30. },
  31. onShow:function(e){
  32. // wx.setStorageSync('info', e)
  33. var date = new Date();
  34. },
  35. globalData: {
  36. userInfo: null
  37. },
  38. Tips: function (opt, to_url) {
  39. return util.Tips(opt, to_url);
  40. },
  41. onHide: function () {
  42. }
  43. })