Compare commits
2
Commits
8e3da13d52
...
00394bf8c4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00394bf8c4 | ||
|
|
e595ff9f64 |
@@ -130,17 +130,17 @@ Page({
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('[connectedDevice] bindDevice 失败:', err)
|
||||
this._resetAfterBindFail()
|
||||
this._resetAfterBindFail(err)
|
||||
})
|
||||
},
|
||||
|
||||
/** bindDevice 失败后的清理重置:断开连接、清缓存、重置页面状态 */
|
||||
_resetAfterBindFail() {
|
||||
_resetAfterBindFail(err?: any) {
|
||||
leFuService.disconnect()
|
||||
wx.removeStorageSync('connectDeviceInfo')
|
||||
scannedDevices = []
|
||||
this.setData({ status: 'idle', deviceList: [] })
|
||||
wx.showToast({ title: '绑定失败,请重试', icon: 'none' })
|
||||
wx.showToast({ title: err?.msg || err?.message || '绑定失败,请重试', icon: 'none' })
|
||||
},
|
||||
|
||||
/** 将所有卡片置为未连接 */
|
||||
|
||||
@@ -95,7 +95,8 @@ Page({
|
||||
groups: [] as GroupItem[],
|
||||
syncShow: false,
|
||||
syncPercent: 0,
|
||||
syncStatus: ''
|
||||
syncStatus: '',
|
||||
isOps: false
|
||||
},
|
||||
|
||||
onLoad(options: Record<string, string>) {
|
||||
@@ -111,6 +112,7 @@ Page({
|
||||
'device.deviceId': targetDevice.deviceId,
|
||||
'device.sn': targetDevice.sn,
|
||||
'device.status': targetDevice.connected,
|
||||
isOps: getApp<IAppOption>().globalData.operationsEngineer ?? false,
|
||||
})
|
||||
this._subscribeDeviceState()
|
||||
this._loadMembers()
|
||||
@@ -258,7 +260,7 @@ Page({
|
||||
/** 同步完成后的统一处理:上报后刷新列表 + 关闭弹框 */
|
||||
_finishSync(reportUsers: SyncUser[] | null, successText: string) {
|
||||
this.setData({ syncPercent: 100, syncStatus: '同步完成' })
|
||||
wx.showToast({ title: successText, icon: 'success' })
|
||||
// wx.showToast({ title: successText, icon: 'success' })
|
||||
if (reportUsers && reportUsers.length && targetDevice?.sn) {
|
||||
const syncedIds = reportUsers.map(u => u.userId).filter(Boolean)
|
||||
if (syncedIds.length) {
|
||||
@@ -271,7 +273,7 @@ Page({
|
||||
syncCloseTimer = setTimeout(() => {
|
||||
syncCloseTimer = null
|
||||
this.setData({ syncShow: false })
|
||||
}, 1000)
|
||||
}, 1500)
|
||||
},
|
||||
|
||||
/** 同步用户至设备:有删除标记则清空重下发,否则只下发「待同步」 */
|
||||
|
||||
@@ -54,12 +54,12 @@
|
||||
<view>{{ self.sync }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:if="{{ self.delFlag !== 1 }}">
|
||||
<!-- <block wx:if="{{ self.delFlag !== 1 }}">
|
||||
<view class="member-divider"></view>
|
||||
<view class="member-ops">
|
||||
<view class="op-delete" bind:tap="onTapDelete" data-item="{{ self }}">删除</view>
|
||||
</view>
|
||||
</block>
|
||||
</block> -->
|
||||
</view>
|
||||
</block>
|
||||
|
||||
@@ -108,7 +108,9 @@
|
||||
<view class="btn-primary" bind:tap="onTapAddUser">添加用户(最多10位)</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<block wx:if="{{ !isOps }}">
|
||||
<view class="btn-primary" bind:tap="onTapAddSelf">一键添加本人</view>
|
||||
</block>
|
||||
<view class="btn-cancel" bind:tap="onTapAddNew">添加新用户</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user