fix: 后端接口对接,问题修复。

This commit is contained in:
tianyongbao
2026-01-12 18:48:03 +08:00
parent 2e9609292e
commit 6d1a6ded2d
8 changed files with 281 additions and 55 deletions

View File

@@ -766,7 +766,7 @@ Taro.useUnload(() => {
// 查询公告
function getNotice(openType = 0) {
noticeList().then((res) => {
if (res.statusCode == 200) {
if (res.code == 200) {
const nList: any = [];
noticeRows.value = res.data.sort(sortByField("priority", false));
if (noticeRows.value.length > 0) {
@@ -860,9 +860,10 @@ function getWarnMsg() {
pageSize: 10,
pageNum: 1,
});
msgWarn(warnParams.value).then((res: any) => {
if (res.statusCode == 200) {
const unReadCount = Number(res.data.unReadCount);
const userId = Taro.getStorageSync("UserId");
msgWarn({ ...warnParams.value, userId }).then((res: any) => {
if (res.code == 200) {
const unReadCount = res.rows ? res.rows.filter(item => !item.isRead).length : 0;
if (unReadCount) {
Taro.setTabBarBadge({
index: 1, // tabBar的位置从0开始计数
@@ -921,10 +922,11 @@ function changeMode() {
}
// 塘口模式1
function pond1() {
const userId = Taro.getStorageSync("UserId");
getPond1().then((res: any) => {
if (res.code == 200) {
const pondIds = [];
const rows = res.rows || [];
const rows = res.data || [];
rows.forEach((item: any) => {
pondIds.push(item.id);
let num = 3;
@@ -988,9 +990,10 @@ function addDevice() {
}
// 加载设备列表
function loadDeviceList() {
const userId = Taro.getStorageSync("UserId");
const pondId = mode.value == 1 ? selPond.value : selPond_2.value;
allDeviceList({ type: 1 }).then((res) => {
if (res.statusCode == 200) {
allDeviceList({ type: 1 ,rootUserId:userId}).then((res) => {
if (res.code == 200) {
if (res.data.length > 0) {
res.data.forEach((r) => {
r.disabled = false;
@@ -1093,7 +1096,7 @@ function onconfirm(list) {
};
bandDeviceToPond(data)
.then((res) => {
if (res.statusCode == 200) {
if (res.code == 200) {
state.show = true;
state.msg = "操作成功";
pond2();
@@ -1129,7 +1132,7 @@ function goScan() {
success: (res) => {
const result = res.result;
deviceScan({ qrcode: result }).then((v) => {
if (v.statusCode == 200) {
if (v.code == 200) {
params.devType = String(v.data.deviceType);
params.devNum = v.data.serialNum;
@@ -1195,7 +1198,7 @@ function toLogin() {
// 查询设备到期
function getDeviceDead() {
deviceDead().then((res) => {
if (res.statusCode == 200) {
if (res.code == 200) {
deadList.value = res.data;
// if(res.data.length>0){
// Taro.showModal({