uploadData.js 804 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const APP = getApp();
  2. Page({
  3. data: {
  4. setInfo: null //设置信息
  5. },
  6. /**
  7. * 生命周期函数--监听页面加载
  8. */
  9. onLoad: function (options) {
  10. this.getSetInfo(APP.getCurrentDevice().deviceId);
  11. },
  12. /**
  13. * 获取设备设置信息
  14. */
  15. getSetInfo: function (deviceId) {
  16. const param = {
  17. deviceId: deviceId
  18. }
  19. APP.Get(APP.Url.getOther, param, false).then(res => {
  20. this.setData({
  21. setInfo: res.data
  22. })
  23. })
  24. },
  25. /**
  26. * 设置定位频率
  27. */
  28. setGpsRate: function (form) {
  29. const param = {
  30. deviceId: this.data.setInfo.deviceId,
  31. gpsRate: form.detail.value.gpsRate
  32. }
  33. APP.Post(APP.Url.setGpsRate, param).then(res => {
  34. APP.Modal.tips("设置成功");
  35. this.getSetInfo(param.deviceId);
  36. })
  37. }
  38. })