scan.js 927 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. const { default: api } = require("../../js/api");
  2. Page({
  3. data: {
  4. isLoggedIn: false,
  5. userInfo: null,
  6. scanTitle:'扫码加油',
  7. scanTip:'请扫描加油机键盘上的二维码'
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad(options) {
  13. var wxChatID = wx.getStorageSync("WachatID")
  14. console.log("wxchatid",wxChatID);
  15. if(wxChatID) {
  16. api.request_GetSiteInfo().then(res => {
  17. console.log(res)
  18. })
  19. this.setData({
  20. isLoggedIn: true,
  21. userInfo: null,
  22. scanTitle:'扫码加油',
  23. scanTip:'请扫码加油机键盘上的二维码'
  24. })
  25. }
  26. },
  27. toLoginOrOrderPage: function() {
  28. if(!this.data.isLoggedIn) {
  29. wx.redirectTo({
  30. url: '../login/login'
  31. })
  32. } else {
  33. wx.navigateTo({
  34. url: '../historyOrder/historyOrder',
  35. })
  36. }
  37. }
  38. });