From d8743368ffda9bc0fb2c6818f695a9a6b1079e57 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 19 九月 2025 18:22:15 +0800
Subject: [PATCH] laster
---
pages/index/backup.vue | 46 +++++++++++++++++++++++++---------------------
1 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/pages/index/backup.vue b/pages/index/backup.vue
index 6ca1706..acdc864 100644
--- a/pages/index/backup.vue
+++ b/pages/index/backup.vue
@@ -72,7 +72,8 @@
session,
showToast,
showModal,
- showInfo
+ showInfo,
+ showError
} from "@/comm/utils.js"
import {
getAllScene,
@@ -139,7 +140,7 @@
console.log(this.pageList[1].list)
} catch (ex) {
- this.showError(ex)
+ showError(ex)
}
},
async loadScene() {
@@ -148,7 +149,7 @@
const list = res?.sceneList || []
return list
} catch (ex) {
- this.showError(ex)
+ showError(ex)
return []
}
},
@@ -157,7 +158,7 @@
const list = session.getValue("scene_db") || []
return list
} catch (ex) {
- this.showError(ex)
+ showError(ex)
return []
}
},
@@ -211,6 +212,9 @@
this.setData({
loading: true
})
+ uni.showLoading({
+ title:"姝e湪涓婁紶鍦烘櫙"
+ })
const scene = this.pageList[0].list[index]
await handoffScene(this.ip, "", scene)
session.setValue("scene_db", [])
@@ -222,15 +226,16 @@
session.setValue("scene_db", list)
this.pageList[1].list = list
this.sceneIndex2 = -1
- this.setData({
- loading: false
- })
+ showToast(`涓婁紶鍦烘櫙[${scene}]鎴愬姛`)
} catch (ex) {
- showInfo(ex)
+ showError(ex)
+
+ }
+ finally {
this.setData({
loading: false
})
-
+ uni.hideLoading()
}
},
@@ -256,30 +261,29 @@
this.setData({
loading: true
})
- console.log(this.pageList[1].list[index])
+ uni.showLoading({
+ title:"姝e湪涓嬭浇鍦烘櫙"
+ })
+
const data = this.pageList[1].list[index].data
const scene = this.pageList[1].list[index].name
await saveDBData(this.ip, data)
this.pageList[0].list.push(scene)
- this.setData({
- loading: false
- })
+ showToast(`涓嬭浇鍦烘櫙[${scene}]鎴愬姛`)
+
} catch (ex) {
- showInfo(ex)
+ showError(ex)
+ }
+ finally {
this.setData({
loading: false
})
+ uni.hideLoading()
}
},
- showError(ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.msg == "string" ? ex.msg : exStr
- showModal(tip, "閿欒", false, "纭畾")
- },
+
}
}
</script>
--
Gitblit v1.9.1