From 41193d186d157937ba052e73dd04c12018e9ecab Mon Sep 17 00:00:00 2001 From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com> Date: 星期四, 07 八月 2025 10:38:42 +0800 Subject: [PATCH] 新增 --- pages/tabBar/current/current.js | 74 ++++++------------------------------- 1 files changed, 12 insertions(+), 62 deletions(-) diff --git a/pages/tabBar/current/current.js b/pages/tabBar/current/current.js index aa1a8ab..07d43cc 100644 --- a/pages/tabBar/current/current.js +++ b/pages/tabBar/current/current.js @@ -83,69 +83,19 @@ icon: 'none' }); } else { - // 云开发请求 - if(res.result.indexOf('SJ') >0){ - cloudApi.queryPost('hazmatList',{code: t.data.searchContent}).then(res=>{ - if(res.data.length>0){ - const hazmatId = cloudApi.changeKey(res.data[0]).id - wx.cloud.callFunction({ - name: 'getHazmatFlow', - data: { - hazmatId: hazmatId - } - }).then(res=>{ - if(res.result && Array.isArray(res.result.list) && res.result.list.length>0){ - t.setData({ - dataList: cloudApi.changeKey(res.result.list) - }) - } - }) - }else { - wx.showToast({ - title: '该二维码查询不到相关信息', - icon: 'error', - duration: 2000 - }); - } - }) - }else{ - cloudApi.queryPost('productList',{code: t.data.searchContent}).then(res=>{ - if(res.data.length>0){ - const productId = cloudApi.changeKey(res.data[0]).id - wx.cloud.callFunction({ - name: 'getProductFlow', - data: { - productId: productId - } - }).then(res=>{ - if(res.result && Array.isArray(res.result.list) && res.result.list.length>0){ - t.setData({ - dataList: cloudApi.changeKey(res.result.list) - }) - } - }) - }else { - wx.showToast({ - title: '该二维码查询不到相关信息', - icon: 'error', - duration: 2000 - }); - } - }) - } // api请求 - // api.getHazmatFlowByCode({code: t.data.searchContent}).then(re => { - // if(re.code == 200) { - // t.setData({ - // dataList: re.data ? re.data : [] - // }); - // } else { - // wx.showToast({ - // title: re.message, - // icon: 'none' - // }); - // } - // }); + api.getHazmatFlowByCode({code: t.data.searchContent}).then(re => { + if(re.code == 200) { + t.setData({ + dataList: re.data ? re.data : [] + }); + } else { + wx.showToast({ + title: re.message, + icon: 'none' + }); + } + }); } }, -- Gitblit v1.9.2