index.js 875 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const app = getApp()
  2. const httpUtils = require('../../utils/http.js')
  3. const ui = require('../../utils/ui.js')
  4. Page({
  5. data: {
  6. list: []
  7. },
  8. onLoad() {
  9. this.getList()
  10. },
  11. toUrl(e){
  12. console.log(e)
  13. let deviceid = e.currentTarget.dataset.deviceid
  14. let roomName = e.currentTarget.dataset.roomname
  15. let deviceCode = e.currentTarget.dataset.devicecode
  16. wx.navigateTo({
  17. url: '/pages/bill/index?deviceid=' + deviceid + '&roomName=' + roomName + '&deviceCode=' + deviceCode
  18. })
  19. },
  20. getList(){
  21. let obj = {
  22. url: '/api/erp/we/roomList',
  23. data: {
  24. phone: wx.getStorageSync('phone'),
  25. token: wx.getStorageSync('token'),
  26. }
  27. }
  28. httpUtils.request(obj).then(res=>{
  29. console.log(res)
  30. this.setData({
  31. list: res.data.data
  32. })
  33. }).catch(err=>{
  34. console.log('ERROR')
  35. });
  36. }
  37. })