Browse Source

巡检点优化

maotao 1 month ago
parent
commit
90442805e4
2 changed files with 24 additions and 4 deletions
  1. 5 1
      pages/setPolling/selectPolling.vue
  2. 19 3
      pages/setPolling/setPolling.vue

+ 5 - 1
pages/setPolling/selectPolling.vue

@@ -20,7 +20,7 @@
20
 <script setup>
20
 <script setup>
21
   import { debounce } from 'lodash-es'
21
   import { debounce } from 'lodash-es'
22
   import { ref, reactive} from 'vue'
22
   import { ref, reactive} from 'vue'
23
-  import { onLoad } from '@dcloudio/uni-app'
23
+  import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
24
   import { api_inspectionNode } from "@/http/api.js"
24
   import { api_inspectionNode } from "@/http/api.js"
25
   import { defaultColor } from '@/static/js/theme.js'
25
   import { defaultColor } from '@/static/js/theme.js'
26
   import { useSetTitle } from '@/share/useSetTitle.js'
26
   import { useSetTitle } from '@/share/useSetTitle.js'
@@ -120,6 +120,10 @@
120
   onLoad((option) => {
120
   onLoad((option) => {
121
     getList(0);
121
     getList(0);
122
   })
122
   })
123
+	
124
+	onPullDownRefresh(()=>{
125
+		uni.stopPullDownRefresh()
126
+	})
123
 </script>
127
 </script>
124
 
128
 
125
 <style lang="scss" scoped>
129
 <style lang="scss" scoped>

+ 19 - 3
pages/setPolling/setPolling.vue

@@ -2,8 +2,8 @@
2
 	<view class="handler">
2
 	<view class="handler">
3
 		<view class="body">
3
 		<view class="body">
4
 			<view class="scan-box">
4
 			<view class="scan-box">
5
-				<view class="scan">
6
-					<text class="newicon newicon-saoma icon" @click="scanCodes"></text>
5
+				<view class="scan" @click="scanCodes">
6
+					<text class="newicon newicon-saoma icon"></text>
7
 				</view>
7
 				</view>
8
 			</view>
8
 			</view>
9
 			<view class="container">
9
 			<view class="container">
@@ -32,7 +32,7 @@
32
 <script setup>
32
 <script setup>
33
 	import { SM } from "@/http/http.js"
33
 	import { SM } from "@/http/http.js"
34
   import { ref, reactive, computed } from 'vue'
34
   import { ref, reactive, computed } from 'vue'
35
-  import { onLoad, onUnload } from '@dcloudio/uni-app'
35
+  import { onLoad, onUnload, onShow, onPullDownRefresh } from '@dcloudio/uni-app'
36
   import { api_inspectionNode, api_inspectionNodeEdit } from "@/http/api.js"
36
   import { api_inspectionNode, api_inspectionNodeEdit } from "@/http/api.js"
37
   import { defaultColor } from '@/static/js/theme.js'
37
   import { defaultColor } from '@/static/js/theme.js'
38
   import { useSetTitle } from '@/share/useSetTitle.js'
38
   import { useSetTitle } from '@/share/useSetTitle.js'
@@ -151,6 +151,9 @@
151
 					if(res2.list.length>0){
151
 					if(res2.list.length>0){
152
 						dataInfo.pollingData = res2.list[0].name
152
 						dataInfo.pollingData = res2.list[0].name
153
 						dataInfo.pollingId = res2.list[0].id
153
 						dataInfo.pollingId = res2.list[0].id
154
+					}else{
155
+						dataInfo.pollingData = '无'
156
+						dataInfo.pollingId = null
154
 					}
157
 					}
155
 					let data = {
158
 					let data = {
156
 						code: res,
159
 						code: res,
@@ -158,6 +161,9 @@
158
 						pollingId: dataInfo.pollingId,
161
 						pollingId: dataInfo.pollingId,
159
 					}
162
 					}
160
 					uni.setStorageSync('pollingCode',JSON.stringify(data))
163
 					uni.setStorageSync('pollingCode',JSON.stringify(data))
164
+					if(dataInfo.newPollingData){
165
+						dataInfo.content = `二维码绑定为“${dataInfo.newPollingData.name}”,原“${dataInfo.pollingData}”二维码被清空,您确认绑定吗?`
166
+					}
161
 					dataInfo.type = true
167
 					dataInfo.type = true
162
 			  } else {
168
 			  } else {
163
 			    uni.showToast({
169
 			    uni.showToast({
@@ -170,9 +176,11 @@
170
 	}
176
 	}
171
 	
177
 	
172
   onLoad((option) => {
178
   onLoad((option) => {
179
+		uni.hideLoading();
173
 		if(option && option.data){
180
 		if(option && option.data){
174
 			let data = JSON.parse(option.data)
181
 			let data = JSON.parse(option.data)
175
 			dataInfo.newPollingData = data
182
 			dataInfo.newPollingData = data
183
+			dataInfo.type = true
176
 			console.log(998,data)
184
 			console.log(998,data)
177
 		}
185
 		}
178
 		if(uni.getStorageSync('pollingCode')){
186
 		if(uni.getStorageSync('pollingCode')){
@@ -183,9 +191,17 @@
183
 		}
191
 		}
184
   })
192
   })
185
 	
193
 	
194
+	onShow(()=>{
195
+		uni.hideLoading();
196
+	})
197
+	
186
 	onUnload(()=>{
198
 	onUnload(()=>{
187
 		setInfoData()
199
 		setInfoData()
188
 	})
200
 	})
201
+	
202
+	onPullDownRefresh(()=>{
203
+		uni.stopPullDownRefresh()
204
+	})
189
 </script>
205
 </script>
190
 
206
 
191
 <style>
207
 <style>