This commit is contained in:
2024-03-19 10:19:11 +08:00
parent 401572a446
commit b054214766
2 changed files with 23 additions and 11 deletions

View File

@ -123,6 +123,9 @@
import { import {
detail, detail,
} from '@/api/pages/homepage/homepage.js' } from '@/api/pages/homepage/homepage.js'
import {
mapMutations
} from "vuex";
export default { export default {
data() { data() {
return { return {
@ -160,6 +163,7 @@
}; };
}, },
methods: { methods: {
...mapMutations(['scoket']),
// //
rescindapplysaveinfo() { rescindapplysaveinfo() {
rescindapplysave(this.list).then(res => { rescindapplysave(this.list).then(res => {
@ -245,7 +249,12 @@
this.formdata.cardNo = uni.getStorageSync('userinfo').cardNo this.formdata.cardNo = uni.getStorageSync('userinfo').cardNo
this.formdata.phone = uni.getStorageSync('userinfo').phone this.formdata.phone = uni.getStorageSync('userinfo').phone
this.detailinfo(); this.detailinfo();
} },
onShow() {
if (uni.getStorageSync('patientId') && !this.$store.state.socketOpen) {
this.scoket();
}
},
} }
</script> </script>

View File

@ -83,6 +83,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
@ -434,12 +435,13 @@
chooseImage(sourceType) { chooseImage(sourceType) {
var that = this var that = this
if (this.$store.state.socketOpen == false) { if (this.$store.state.socketOpen == false) {
this.$refs.uToast.show({ // this.$refs.uToast.show({
title: '聊天连接异常,正在重连', // title: '',
type: 'warning', // type: 'warning',
}) // })
this.scoket() this.scoket()
return this.messagescoket()
// return
} }
uni.chooseImage({ uni.chooseImage({
sourceType, sourceType,
@ -508,12 +510,13 @@
const that = this const that = this
var content = JSON.parse(JSON.stringify(that.formData.content)) var content = JSON.parse(JSON.stringify(that.formData.content))
if (this.$store.state.socketOpen == false) { if (this.$store.state.socketOpen == false) {
this.$refs.uToast.show({ // this.$refs.uToast.show({
title: '聊天连接异常,正在重连', // title: '',
type: 'warning', // type: 'warning',
}) // })
this.scoket(); this.scoket();
return this.messagescoket()
// return
} }
let obj = { let obj = {
consultationId: that.currentItem.id, consultationId: that.currentItem.id,