1234567891011121314151617181920212223242526272829303132333435363738394041 |
- const APP = getApp();
- Page({
- data: {
- device: null //设置信息
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.getDefaultDevice();
- },
- getDefaultDevice: function () {
- const param = {
- openId: APP.globalData.openId
- }
- APP.Get(APP.Url.getDefaultDevice, param).then(res => {
- this.setData({
- device: res.data
- })
- })
- },
- /**
- * 设置名称
- */
- updateName: function (form) {
- const param = {
- openNum: APP.globalData.openNum,
- deviceName: form.detail.value.deviceName
- }
- APP.Post(APP.Url.updateName, param).then(res => {
- APP.Modal.tips("设置成功");
- this.getDefaultDevice();
- })
- }
- })
|