feat(设备管理): 重构设备数据管理逻辑,统一使用deviceData对象

- 将分散的设备信息存储改为统一的deviceData对象
- 更新相关API请求参数传递方式
- 增加设备类型支持,动态构建API路径
- 修复设备信息初始化问题,确保数据一致性
This commit is contained in:
2025-06-25 12:43:31 +08:00
parent ea5ed7c9ce
commit fec4276cc8
7 changed files with 45 additions and 27 deletions

View File

@@ -18,7 +18,7 @@ Page({
*/
onLoad(options) {
var a = this;
e.request('/v2/miniprogram/index/balance', {}, !0).then(function (res) {
e.request('/v2/miniprogram/index/balance', getApp().globalData.deviceData, !0).then(function (res) {
if (!res.data || !res.data.progressorder) {
wx.showToast({
title: '没有进行中的订单',
@@ -116,7 +116,7 @@ Page({
content: '确定要结算此次洗车订单吗?',
success: (res) => {
if (res.confirm) {
e.request('/v2/miniprogram/machine/shutdown', {
e.request('/v2/miniprogram/' + getApp().globalData.deviceData.type + '/shutdown', {
orderid: this.data.orderid
}, true).then((res) => {
if (res.code === 200) {