This commit is contained in:
2026-01-04 15:33:01 +08:00
parent 245f3c07b8
commit d661432ab1
8 changed files with 84 additions and 12 deletions

View File

@@ -37,6 +37,7 @@
</template>
<script>
import {messageConfirm} from '@/utils/getData4.js'
export default {
data() {
return {
@@ -75,7 +76,9 @@
// }
// },
mounted() {
this.initWebSocket()
if (this.$store.getters.saveIssend == '2') {
this.initWebSocket()
}
},
methods: {
initWebSocket() {
@@ -128,11 +131,19 @@
},
handleWebSocketMessage(res) {
console.log(res, 'res')
// console.log(res, 'res')
console.log(res.msg.data, 'res.msg.data')
uni.showToast({
uni.showModal({
title: res.msg.data,
icon: 'none'
cancelText: '关闭',
confirmText: '稍后提醒',
success: res => {
if (res.confirm) {
this._messageConfirm('1')
} else if (res.cancel) {
this._messageConfirm('2')
}
}
})
},
@@ -156,6 +167,16 @@
this.initWebSocket()
}, 5000) // 5秒后重连
},
async _messageConfirm (type) {
try {
let res = await messageConfirm(type)
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
}
},
toPage1 (e) {
if (e.sonTree.length > 0) {
this.show = true