1234567891011121314151617181920212223242526272829303132333435363738 |
- const app = getApp()
- const httpUtils = require('../../utils/http.js')
- const ui = require('../../utils/ui.js')
- Page({
- data: {
- list: [],
- deviceid: '',
- roomName: '',
- deviceCode: ''
- },
- onLoad(options) {
- console.log(options)
- this.setData({
- deviceid: options.deviceid,
- roomName: options.roomName,
- deviceCode: options.deviceCode
- })
- this.getList(options.deviceid)
- },
- getList(id){
- let obj = {
- url: '/chargeRecords',
- data: {
- deviceId: id,
- token: wx.getStorageSync('token'),
- }
- }
- httpUtils.request(obj).then(res=>{
- console.log(res)
- this.setData({
- list: res.data.data
- })
- }).catch(err=>{
- console.log('ERROR')
- });
- }
-
- })
|