refactor: migrate to Tencent Cloud backend
这个提交包含在:
@@ -5,13 +5,17 @@ Page({
|
||||
statusBarHeight: 44,
|
||||
scanning: true,
|
||||
scanProgress: 0,
|
||||
regions: 0x7F,
|
||||
regionData: [],
|
||||
error: ''
|
||||
},
|
||||
|
||||
onLoad: function () {
|
||||
onLoad: function (options) {
|
||||
var app = getApp()
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
regions: parseInt(options.regions) || 0x7F
|
||||
})
|
||||
this.startScan()
|
||||
},
|
||||
|
||||
@@ -38,6 +42,13 @@ Page({
|
||||
})
|
||||
|
||||
ble.queryStatus().catch(function () {})
|
||||
|
||||
setTimeout(function () {
|
||||
clearInterval(progressTimer)
|
||||
if (!self.data.scanning) return
|
||||
self.setData({ scanning: false, scanProgress: 100 })
|
||||
self.parseScanResults({ region_mask: self.data.regions })
|
||||
}, 5000)
|
||||
},
|
||||
|
||||
parseScanResults: function (status) {
|
||||
@@ -49,6 +60,21 @@ Page({
|
||||
},
|
||||
|
||||
onNext: function () {
|
||||
wx.navigateTo({ url: '/pages/treatment-setup/treatment-setup' })
|
||||
var mask = this.data.regions || 0x7F
|
||||
ble.setParams({
|
||||
region_mask: mask,
|
||||
wavelength: 2,
|
||||
brightness: 200,
|
||||
duration_ms: 600000,
|
||||
mode: 1
|
||||
}).then(function () {
|
||||
return ble.startTreatment(mask)
|
||||
}).then(function () {
|
||||
wx.redirectTo({
|
||||
url: '/pages/treating/treating?regions=' + mask + '&wavelength=2&duration=600000&mode=1'
|
||||
})
|
||||
}).catch(function (err) {
|
||||
wx.showToast({ title: err.error_msg || '启动失败', icon: 'none' })
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
在新工单中引用
屏蔽一个用户