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