修改
This commit is contained in:
parent
3d7dbddefd
commit
b52a960592
12
pages.json
12
pages.json
@ -47,8 +47,8 @@
|
||||
{
|
||||
"path": "pages/homepage/homepage",
|
||||
"style": {
|
||||
// "navigationBarTitleText": "工单",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "",
|
||||
// "navigationStyle": "custom",
|
||||
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px
|
||||
"enablePullDownRefresh": true //设置参数为true
|
||||
}
|
||||
@ -56,8 +56,8 @@
|
||||
{
|
||||
"path": "pages/quanyi/quanyi",
|
||||
"style": {
|
||||
// "navigationBarTitleText": "工单",
|
||||
"navigationStyle": "custom",
|
||||
// "navigationBarTitleText": "消息列表",
|
||||
// "navigationStyle": "custom",
|
||||
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px
|
||||
"enablePullDownRefresh": true //设置参数为true
|
||||
}
|
||||
@ -105,9 +105,7 @@
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view class="app">
|
||||
<!-- 泉医到家 -->
|
||||
<view class="" v-if="status==2">
|
||||
<uni-nav-bar title="工单" background-color="#18CBB3" color="white"></uni-nav-bar>
|
||||
<!-- <uni-nav-bar title="工单" background-color="#18CBB3" color="white"></uni-nav-bar> -->
|
||||
<u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange"
|
||||
inactive-color='#fff' active-color='#fff'></u-tabs>
|
||||
<view class="top" v-if="tabscurrent==0">
|
||||
@ -183,15 +183,22 @@
|
||||
},
|
||||
listinfo: [],
|
||||
listtotal: 0,
|
||||
status: '',
|
||||
}
|
||||
},
|
||||
onReady() { //更改导航栏文字
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.title,
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
this.status = uni.getStorageSync("status")
|
||||
if (this.status == 2) {
|
||||
this.title = '工单'
|
||||
this.info();
|
||||
|
||||
} else {
|
||||
this.title = '消息列表'
|
||||
}
|
||||
this.status = uni.getStorageSync("status", )
|
||||
// console.log(this.status, '555')
|
||||
},
|
||||
methods: {
|
||||
//前往聊天
|
||||
@ -286,16 +293,13 @@
|
||||
this.query.pageNum++
|
||||
getList(this.query).then(
|
||||
res => {
|
||||
console.log(res, '77')
|
||||
res.rows.forEach(e => {
|
||||
console.log(e, '787')
|
||||
e.sex = getSex(e.cardNo)
|
||||
this.missionlist.push(e)
|
||||
})
|
||||
})
|
||||
}
|
||||
// }
|
||||
|
||||
},
|
||||
onPullDownRefresh() { //下拉刷新
|
||||
if (this.status == 2) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<uni-nav-bar title="消息列表" background-color="#18CBB3" color="white"></uni-nav-bar>
|
||||
<!-- <uni-nav-bar title="消息列表" background-color="#18CBB3" color="white"></uni-nav-bar> -->
|
||||
<u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange" inactive-color='#fff'
|
||||
active-color='#fff'></u-tabs>
|
||||
<view class="inputs" style="width: 90%;height: 60rpx;transform: none;margin: 20rpx auto;">
|
||||
@ -73,20 +73,84 @@
|
||||
listinfo: [],
|
||||
listtotal: 0,
|
||||
status: '',
|
||||
SOCKETURL: '',
|
||||
socketOpen: false,
|
||||
timeoutObj: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.SOCKETURL = 'ws://192.168.16.212:8088/webSocket/' + uni.getStorageSync("id")
|
||||
this.status = uni.getStorageInfoSync('status')
|
||||
this.info()
|
||||
this.socket();
|
||||
},
|
||||
watch: {
|
||||
Refresh(newvalue, oldvalue) {
|
||||
console.log(newvalue, oldvalue, '55')
|
||||
this.info();
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
socket() {
|
||||
let that = this
|
||||
console.log(that.SOCKETURL)
|
||||
try {
|
||||
uni.connectSocket({
|
||||
url: that.SOCKETURL
|
||||
})
|
||||
uni.onSocketOpen(res => {
|
||||
console.log('webScoket连接已打开', res);
|
||||
that.socketOpen = true
|
||||
that.reset()
|
||||
})
|
||||
uni.onSocketError(err => {
|
||||
console.log('webScoket连接打开失败', err);
|
||||
if (err && err.code != 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: that.SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
uni.onSocketClose(err => {
|
||||
console.log('webScoket连接关闭', err);
|
||||
if (err && err.code !== 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: that.SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
uni.onSocketMessage(res => {
|
||||
console.log("webScoket监听收到的信息", res);
|
||||
that.info();
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
let that = this
|
||||
clearInterval(that.timeoutObj);
|
||||
that.timeoutObj = setInterval(() => {
|
||||
uni.sendSocketMessage({
|
||||
data: 'ping',
|
||||
success(res) {
|
||||
console.log('正在发送心跳');
|
||||
},
|
||||
fail(err) {
|
||||
console.log('心跳发送失败,重新连接...');
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: that.SOCKETURL
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 180000)
|
||||
},
|
||||
//前往聊天
|
||||
goseekadvicefrom(item) {
|
||||
console.log(item, '854')
|
||||
|
||||
@ -212,14 +212,11 @@
|
||||
})
|
||||
},
|
||||
Read() {
|
||||
console.log(this.currentItem.doctorId, '888888888')
|
||||
let markReadData = {
|
||||
consultationId: this.currentItem.id,
|
||||
recipientId: Number(this.currentItem.doctorId),
|
||||
}
|
||||
console.log(markReadData, '6')
|
||||
markRead(markReadData)
|
||||
|
||||
},
|
||||
//键盘发送
|
||||
sendconfirm(value) {
|
||||
@ -456,36 +453,36 @@
|
||||
const that = this
|
||||
this.socketOpen = false
|
||||
try {
|
||||
uni.connectSocket({
|
||||
url: that.SOCKETURL
|
||||
})
|
||||
uni.onSocketOpen(res => {
|
||||
console.log('webScoket连接已打开', res);
|
||||
that.socketOpen = true
|
||||
that.reset()
|
||||
})
|
||||
uni.onSocketError(err => {
|
||||
console.log('webScoket连接打开失败', err);
|
||||
if (err && err.code != 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: that.SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
uni.onSocketClose(err => {
|
||||
console.log('webScoket连接关闭', err);
|
||||
if (err && err.code !== 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: that.SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
// uni.connectSocket({
|
||||
// url: that.SOCKETURL
|
||||
// })
|
||||
// uni.onSocketOpen(res => {
|
||||
// console.log('webScoket连接已打开', res);
|
||||
// that.socketOpen = true
|
||||
// that.reset()
|
||||
// })
|
||||
// uni.onSocketError(err => {
|
||||
// console.log('webScoket连接打开失败', err);
|
||||
// if (err && err.code != 1000) {
|
||||
// setTimeout(() => {
|
||||
// that.socketOpen = true
|
||||
// uni.connectSocket({
|
||||
// url: that.SOCKETURL
|
||||
// })
|
||||
// }, 3 * 1000)
|
||||
// }
|
||||
// })
|
||||
// uni.onSocketClose(err => {
|
||||
// console.log('webScoket连接关闭', err);
|
||||
// if (err && err.code !== 1000) {
|
||||
// setTimeout(() => {
|
||||
// that.socketOpen = true
|
||||
// uni.connectSocket({
|
||||
// url: that.SOCKETURL
|
||||
// })
|
||||
// }, 3 * 1000)
|
||||
// }
|
||||
// })
|
||||
uni.onSocketMessage(res => {
|
||||
console.log("webScoket监听收到的信息", res);
|
||||
that.newsList.push({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user