fix: index page — no loading flash on tab switch, subscription always tappable
- Loading animation only shows on first visit, subsequent onShow updates silently - Subscription row always navigates to plans page (was no-op when active) - Move devMode init to onLoad (only needs to run once)
这个提交包含在:
@@ -18,8 +18,11 @@ Page({
|
||||
loading: true
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
onLoad: function () {
|
||||
this.setData({ devMode: config.__DEV__ || false })
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.checkState()
|
||||
this._onStatus = this.onBleStatus.bind(this)
|
||||
ble.on('status', this._onStatus)
|
||||
@@ -48,7 +51,8 @@ Page({
|
||||
return
|
||||
}
|
||||
|
||||
self.setData({ connected: ble.isConnected(), loading: true })
|
||||
var isFirstLoad = self.data.loading
|
||||
self.setData({ connected: ble.isConnected() })
|
||||
|
||||
var p1 = api.getDevices().then(function (data) {
|
||||
var devices = data.devices || []
|
||||
@@ -74,7 +78,7 @@ Page({
|
||||
})
|
||||
|
||||
Promise.all([p1, p2]).then(function () {
|
||||
self.setData({ loading: false })
|
||||
if (isFirstLoad) self.setData({ loading: false })
|
||||
})
|
||||
},
|
||||
|
||||
@@ -180,8 +184,6 @@ Page({
|
||||
},
|
||||
|
||||
onViewSubscription: function () {
|
||||
if (!this.data.subscription || this.data.subscription.status !== 'active') {
|
||||
wx.navigateTo({ url: '/pages/subscribe-plans/subscribe-plans' })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
在新工单中引用
屏蔽一个用户