12345678910111213141516171819202122232425262728293031323334353637383940 |
- const APP = getApp();
- Page({
- data: {
- setInfo: null //设置信息
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.getSetInfo(APP.getCurrentDevice().deviceId);
- },
- /**
- * 获取设备设置信息
- */
- getSetInfo: function (deviceId) {
- const param = {
- deviceId: deviceId
- }
- APP.Get(APP.Url.getOther, param, false).then(res => {
- this.setData({
- setInfo: res.data
- })
- })
- },
- /**
- * 设置定位频率
- */
- setGpsRate: function (form) {
- const param = {
- deviceId: this.data.setInfo.deviceId,
- gpsRate: form.detail.value.gpsRate
- }
- APP.Post(APP.Url.setGpsRate, param).then(res => {
- APP.Modal.tips("设置成功");
- this.getSetInfo(param.deviceId);
- })
- }
- })
|