|  |  |  | 
|---|
|  |  |  | isRefreshing_all: false | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | if (data.success && data.code === "0001") { | 
|---|
|  |  |  | if (!data.content || data.content.itemTotal === 0 || !data.content.obj || data.content.obj.length === 0) { | 
|---|
|  |  |  | let waterPoints = []; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 兼容新旧两种数据结构 | 
|---|
|  |  |  | if (data.content) { | 
|---|
|  |  |  | // 新数据结构:content直接包含取水口信息 | 
|---|
|  |  |  | if (data.content.intakeId) { | 
|---|
|  |  |  | waterPoints = [data.content]; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 旧数据结构:content包含obj数组 | 
|---|
|  |  |  | else if (data.content.obj && Array.isArray(data.content.obj) && data.content.obj.length > 0) { | 
|---|
|  |  |  | waterPoints = data.content.obj; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (waterPoints.length === 0) { | 
|---|
|  |  |  | wx.showToast({ | 
|---|
|  |  |  | title: '没有搜索到取水口', | 
|---|
|  |  |  | icon: 'error', | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | allWaterPoints: data.content.obj | 
|---|
|  |  |  | allWaterPoints: waterPoints | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|