|
|
@@ -205,42 +205,83 @@
|
|
|
// if (typeof WebSocket === "undefined") {
|
|
|
// console.log('您的浏览器不支持sooket')
|
|
|
// } else {
|
|
|
- uni.getStorage({
|
|
|
- key: 'session_key',
|
|
|
- success: function(res) {
|
|
|
- console.log(res.data)
|
|
|
- uni.connectSocket({
|
|
|
- url: that.urlData + "&token=" + res.data,
|
|
|
- // data() {
|
|
|
- // return {
|
|
|
- // token: res.data
|
|
|
- // }
|
|
|
- // },
|
|
|
- header: {
|
|
|
- 'content-type': 'application/json'
|
|
|
- },
|
|
|
- protocols: ['protocol1'],
|
|
|
- method: 'GET',
|
|
|
- success: function(res) {
|
|
|
- console.log(res)
|
|
|
- },
|
|
|
- fail: function(err) {
|
|
|
- console.log(err)
|
|
|
- },
|
|
|
- })
|
|
|
-
|
|
|
- // 监听WebSocket连接打开成功事件
|
|
|
- uni.onSocketOpen(function(res) {
|
|
|
- console.log('WebSocket连接已打开!');
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- // 监听WebSocket连接打开失败事件
|
|
|
- uni.onSocketError(function(res) {
|
|
|
- console.log('WebSocket连接打开失败,请检查!');
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ uni.getStorage({
|
|
|
+ key: 'session_key',
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res.data)
|
|
|
+ uni.connectSocket({
|
|
|
+ url: that.urlData + "&token=" + res.data,
|
|
|
+ // data() {
|
|
|
+ // return {
|
|
|
+ // token: res.data
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/json'
|
|
|
+ },
|
|
|
+ protocols: ['protocol1'],
|
|
|
+ method: 'GET',
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res)
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ console.log(err)
|
|
|
+ },
|
|
|
+ })
|
|
|
+
|
|
|
+ // 监听WebSocket连接打开成功事件
|
|
|
+ // uni.onSocketOpen(function(res) {
|
|
|
+ // console.log('WebSocket连接已打开!');
|
|
|
+ // // uni.sendSocketMessage({
|
|
|
+ // // data: obj,
|
|
|
+ // // success: function (res) {
|
|
|
+ // // console.log(res)
|
|
|
+ // // },
|
|
|
+ // // fail: function (err) {
|
|
|
+ // // console.log(err)
|
|
|
+ // // },
|
|
|
+ // // });
|
|
|
+
|
|
|
+ // })
|
|
|
+
|
|
|
+ // // 监听WebSocket连接打开失败事件
|
|
|
+ // uni.onSocketError(function(res) {
|
|
|
+ // console.log(res)
|
|
|
+ // console.log('WebSocket连接打开失败,请检查!');
|
|
|
+ // });
|
|
|
+
|
|
|
+ //监听socket打开
|
|
|
+ uni.onSocketOpen(() => {
|
|
|
+ // this.isSocketOpen = true
|
|
|
+ console.log('WebSocket连接已打开!');
|
|
|
+ })
|
|
|
+ //监听socket关闭
|
|
|
+ uni.onSocketClose(() => {
|
|
|
+ // this.isSocketOpen = false
|
|
|
+ console.log('WebSocket连接已关闭!');
|
|
|
+ })
|
|
|
+ //监听socket错误
|
|
|
+ uni.onSocketError(() => {
|
|
|
+ this.isSocketOpen = false
|
|
|
+ console.log('WebSocket连接打开失败');
|
|
|
+ })
|
|
|
+
|
|
|
+ var obj = {};
|
|
|
+ obj = {
|
|
|
+ action: "list",
|
|
|
+ recv_user_id: '167',
|
|
|
+ data: {
|
|
|
+ msg_status: false,
|
|
|
+ msg_info: ""
|
|
|
+ }
|
|
|
+ };
|
|
|
+ console.log('222222')
|
|
|
+ uni.onSocketMessage((res) => {
|
|
|
+ console.log(res)
|
|
|
+ console.log(('-------------------------------'))
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
// }
|
|
|
},
|
|
|
|
|
|
@@ -248,8 +289,8 @@
|
|
|
defail(data) {
|
|
|
console.log(data)
|
|
|
uni.navigateTo({
|
|
|
- // url: '/pages/details/details?id=' + id + '&signboard=1'
|
|
|
- url: '/pages/response/details'
|
|
|
+ url: '/pages/response/details?name=' + data.name
|
|
|
+ // url: '/pages/response/details'
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
@@ -269,6 +310,9 @@
|
|
|
// await this.setup()
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 下拉刷新
|
|
|
onPullDownRefresh() {
|
|
|
console.log('刷新了')
|
|
|
@@ -293,11 +337,13 @@
|
|
|
|
|
|
.response_box {
|
|
|
background: #f7f7f7;
|
|
|
+
|
|
|
.response_ul {
|
|
|
// border: 1px solid #000;
|
|
|
overflow-y: auto;
|
|
|
// height: 1550rpx;
|
|
|
height: 1450rpx;
|
|
|
+
|
|
|
.response_list {
|
|
|
position: relative;
|
|
|
background: #FFF;
|