|
@ -1,62 +1,59 @@
|
1
|
1
|
/*是否登录,要显示的,mui-content*/
|
2
|
|
var content1 = document.getElementById('logined');
|
3
|
|
var content2 = document.getElementById('unlogin');
|
4
|
|
|
|
2
|
var content1 = document.getElementById('logined');
|
|
3
|
var content2 = document.getElementById('unlogin');
|
5
|
4
|
var pageIndex = 1; // 页数
|
6
|
5
|
var allPages = 1; // 总页数
|
7
|
|
var table = document.body.querySelector("#table");//咨询列表容器
|
|
6
|
var table = document.body.querySelector("#table"); //咨询列表容器
|
8
|
7
|
|
9
|
|
var oneedval = document.getElementById("needval");//咨询/需求
|
10
|
|
var otypeval = document.getElementById("typeval");//咨询类型
|
11
|
|
var ostateval = document.getElementById("stateval");//咨询状态
|
12
|
|
var osortval = document.getElementById("sortval");//时间排序
|
|
8
|
var oneedval = document.getElementById("needval"); //咨询/需求
|
|
9
|
var otypeval = document.getElementById("typeval"); //咨询类型
|
|
10
|
var ostateval = document.getElementById("stateval"); //咨询状态
|
|
11
|
var osortval = document.getElementById("sortval"); //时间排序
|
13
|
12
|
|
14
|
|
var ozixunpullrefresh = document.getElementById("zixunpullrefresh");//刷新容器,控制安卓和iOS容器到header距离不一样
|
|
13
|
var ozixunpullrefresh = document.getElementById("zixunpullrefresh"); //刷新容器,控制安卓和iOS容器到header距离不一样
|
15
|
14
|
|
16
|
15
|
//判断是否登录,显示数据或登录页面
|
17
|
16
|
function islogin() {
|
18
|
|
mui.plusReady(function(){
|
|
17
|
mui.plusReady(function() {
|
19
|
18
|
var userid = plus.storage.getItem('userid');
|
20
|
|
console.log('点击咨询,判断是否登录id=='+ userid);
|
21
|
|
if(userid == null || userid == 'null'){
|
22
|
|
content1.style.display = 'none';
|
23
|
|
}else {
|
24
|
|
content2.style.display = 'none';
|
25
|
|
getOnePage();
|
26
|
|
}
|
27
|
|
|
28
|
|
if(plus.nativeUI.showWaiting()){
|
29
|
|
plus.nativeUI.closeWaiting();//关闭等待框
|
30
|
|
|
|
19
|
console.log('点击咨询,判断是否登录id==' + userid);
|
|
20
|
if(userid == null || userid == 'null') {
|
|
21
|
content1.style.display = 'none';
|
|
22
|
} else {
|
|
23
|
content2.style.display = 'none';
|
|
24
|
getOnePage();
|
|
25
|
}
|
|
26
|
|
|
27
|
if(plus.nativeUI.showWaiting()) {
|
|
28
|
plus.nativeUI.closeWaiting(); //关闭等待框
|
|
29
|
|
31
|
30
|
}
|
32
|
|
|
|
31
|
|
33
|
32
|
})
|
34
|
33
|
}
|
35
|
34
|
islogin();
|
36
|
35
|
|
37
|
36
|
/*登陆*/
|
38
|
37
|
window.addEventListener('logined', function(event) {
|
39
|
|
var userId = event.detail.id;
|
|
38
|
var userId = event.detail.id;
|
40
|
39
|
content1.style.display = 'block';
|
41
|
40
|
content2.style.display = 'none';
|
42
|
|
console.log('点击登录ID=='+userId)
|
|
41
|
console.log('点击登录ID==' + userId)
|
43
|
42
|
table.innerHTML = '';
|
44
|
43
|
initData();
|
45
|
|
|
|
44
|
|
46
|
45
|
});
|
47
|
46
|
|
48
|
47
|
mui.plusReady(function() {
|
49
|
48
|
var self = plus.webview.currentWebview();
|
50
|
|
console.log('当前咨询列表页id==='+self.id);
|
|
49
|
console.log('当前咨询列表页id===' + self.id);
|
51
|
50
|
})
|
52
|
51
|
|
53
|
|
|
54
|
|
|
55
|
52
|
/*退出*/
|
56
|
53
|
window.addEventListener('exited', function(event) {
|
57
|
54
|
console.log('退出')
|
58
|
|
var userId = event.detail.id;
|
59
|
|
console.log('exited=='+userId)
|
|
55
|
var userId = event.detail.id;
|
|
56
|
console.log('exited==' + userId)
|
60
|
57
|
console.log(content2)
|
61
|
58
|
content1.style.display = 'none';
|
62
|
59
|
content2.style.display = 'block';
|
|
@ -67,8 +64,8 @@ window.addEventListener('exited', function(event) {
|
67
|
64
|
mui.plusReady(function() {
|
68
|
65
|
var regBtn = document.getElementById("regBtn");
|
69
|
66
|
var logBtn = document.getElementById("logBtn");
|
70
|
|
// 注册
|
71
|
|
regBtn.addEventListener('tap',function(){
|
|
67
|
// 注册
|
|
68
|
regBtn.addEventListener('tap', function() {
|
72
|
69
|
mui.openWindow({
|
73
|
70
|
url: '../html/reg.html',
|
74
|
71
|
id: '../html/reg.html',
|
|
@ -76,11 +73,11 @@ mui.plusReady(function() {
|
76
|
73
|
aniShow: "slide-in-right"
|
77
|
74
|
}
|
78
|
75
|
});
|
79
|
|
|
|
76
|
|
80
|
77
|
});
|
81
|
|
|
|
78
|
|
82
|
79
|
//登陆
|
83
|
|
logBtn.addEventListener('tap',function(){
|
|
80
|
logBtn.addEventListener('tap', function() {
|
84
|
81
|
mui.openWindow({
|
85
|
82
|
url: '../html/login.html',
|
86
|
83
|
id: '../html/login.html',
|
|
@ -88,7 +85,7 @@ mui.plusReady(function() {
|
88
|
85
|
aniShow: "slide-in-right"
|
89
|
86
|
}
|
90
|
87
|
});
|
91
|
|
|
|
88
|
|
92
|
89
|
});
|
93
|
90
|
|
94
|
91
|
});
|
|
@ -96,20 +93,20 @@ mui.plusReady(function() {
|
96
|
93
|
var u = navigator.userAgent;
|
97
|
94
|
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
98
|
95
|
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
|
99
|
|
if(isAndroid){
|
|
96
|
if(isAndroid) {
|
100
|
97
|
//父子页面,下拉刷新
|
101
|
98
|
mui.init({
|
102
|
99
|
pullRefresh: {
|
103
|
100
|
container: '#zixunpullrefresh',
|
104
|
101
|
down: {
|
105
|
|
height:190,
|
|
102
|
height: 190,
|
106
|
103
|
callback: pulldownRefresh
|
107
|
|
|
|
104
|
|
108
|
105
|
}
|
109
|
106
|
}
|
110
|
107
|
});
|
111
|
108
|
}
|
112
|
|
if(isiOS){
|
|
109
|
if(isiOS) {
|
113
|
110
|
//父子页面,下拉刷新
|
114
|
111
|
mui.init({
|
115
|
112
|
pullRefresh: {
|
|
@ -117,35 +114,33 @@ if(isiOS){
|
117
|
114
|
down: {
|
118
|
115
|
//height:190,
|
119
|
116
|
callback: pulldownRefresh
|
120
|
|
|
|
117
|
|
121
|
118
|
}
|
122
|
119
|
}
|
123
|
120
|
});
|
124
|
121
|
}
|
125
|
122
|
|
126
|
|
|
127
|
|
/* 父子页面,下拉刷新函数*/
|
|
123
|
/* 父子页面,下拉刷新函数*/
|
128
|
124
|
function pulldownRefresh() {
|
129
|
|
pageIndex = 1;
|
130
|
|
console.log('下拉刷新');
|
131
|
|
setTimeout(function() {
|
132
|
|
getOnePage();
|
133
|
|
|
134
|
|
}, 1000);
|
|
125
|
pageIndex = 1;
|
|
126
|
console.log('下拉刷新');
|
|
127
|
setTimeout(function() {
|
|
128
|
getOnePage();
|
|
129
|
|
|
130
|
}, 1000);
|
135
|
131
|
};
|
136
|
|
//if(mui.os.plus) {
|
137
|
|
// mui.plusReady(function() {
|
138
|
|
// setTimeout(function() {
|
139
|
|
// mui('#zixunpullrefresh').pullRefresh().pulldownLoading();
|
140
|
|
// }, 500);
|
141
|
|
// });
|
142
|
|
//} else {
|
143
|
|
// mui.ready(function() {
|
144
|
|
// mui('#zixunpullrefresh').pullRefresh().pulldownLoading();
|
145
|
|
// });
|
|
132
|
//if(mui.os.plus) {
|
|
133
|
// mui.plusReady(function() {
|
|
134
|
// setTimeout(function() {
|
|
135
|
// mui('#zixunpullrefresh').pullRefresh().pulldownLoading();
|
|
136
|
// }, 500);
|
|
137
|
// });
|
|
138
|
//} else {
|
|
139
|
// mui.ready(function() {
|
|
140
|
// mui('#zixunpullrefresh').pullRefresh().pulldownLoading();
|
|
141
|
// });
|
146
|
142
|
//}
|
147
|
143
|
|
148
|
|
|
149
|
144
|
//上拉加载
|
150
|
145
|
/*function pullupRefresh() {
|
151
|
146
|
pageIndex = ++pageIndex;
|
|
@ -157,291 +152,295 @@ function pulldownRefresh() {
|
157
|
152
|
*/
|
158
|
153
|
|
159
|
154
|
//初始化数据
|
160
|
|
function initData(){
|
161
|
|
mui.plusReady(function() {
|
|
155
|
function initData() {
|
|
156
|
mui.plusReady(function() {
|
162
|
157
|
var userid = plus.storage.getItem('userid');
|
163
|
|
plus.nativeUI.showWaiting('加载中...');//显示原生等待框
|
164
|
|
mui.ajax(baseUrl + '/ajax/consult/pq',{
|
165
|
|
data:{
|
166
|
|
"professorId":userid,
|
167
|
|
"consultOrNeed":oneedval.value ,
|
168
|
|
"consultType":otypeval.value,
|
169
|
|
"status":ostateval.value,
|
170
|
|
"timeType":osortval.value,
|
171
|
|
"pageSize":200,
|
172
|
|
"pageNo":1
|
|
158
|
plus.nativeUI.showWaiting('加载中...'); //显示原生等待框
|
|
159
|
mui.ajax(baseUrl + '/ajax/consult/pq', {
|
|
160
|
data: {
|
|
161
|
"professorId": userid,
|
|
162
|
"consultOrNeed": oneedval.value,
|
|
163
|
"consultType": otypeval.value,
|
|
164
|
"status": ostateval.value,
|
|
165
|
"timeType": osortval.value,
|
|
166
|
"pageSize": 200,
|
|
167
|
"pageNo": 1
|
173
|
168
|
},
|
174
|
|
dataType:'json',
|
175
|
|
type:'get',
|
176
|
|
timeout:10000,
|
177
|
|
success:function(data){
|
178
|
|
if (data.success) {
|
179
|
|
table.innerHTML = '';//下拉刷新,清空数据
|
180
|
|
var datalist = data.data.data;
|
181
|
|
eachData(userid,datalist);
|
182
|
|
// mui('#zixunpullrefresh').pullRefresh().refresh(true);//重置下拉加载
|
183
|
|
plus.nativeUI.closeWaiting();//关闭原生等待框
|
184
|
|
mui('#zixunpullrefresh').pullRefresh().scrollTo(0,0,100)//回到顶部
|
|
169
|
dataType: 'json',
|
|
170
|
type: 'get',
|
|
171
|
timeout: 10000,
|
|
172
|
success: function(data) {
|
|
173
|
if(data.success) {
|
|
174
|
table.innerHTML = ''; //下拉刷新,清空数据
|
|
175
|
var datalist = data.data.data;
|
|
176
|
eachData(userid, datalist);
|
|
177
|
// mui('#zixunpullrefresh').pullRefresh().refresh(true);//重置下拉加载
|
|
178
|
plus.nativeUI.closeWaiting(); //关闭原生等待框
|
|
179
|
mui('#zixunpullrefresh').pullRefresh().scrollTo(0, 0, 100) //回到顶部
|
185
|
180
|
|
186
|
181
|
//滚动条样式
|
187
|
|
var scrollEle = document.body.querySelectorAll('.mui-scrollbar-vertical');
|
188
|
|
console.log('滚动条个数=='+scrollEle.length)
|
189
|
|
if(scrollEle.length > 1){
|
190
|
|
for(var i = 0; i < scrollEle.length;i++){
|
191
|
|
scrollEle[i].style.display = 'none';
|
|
182
|
var scrollEle = document.body.querySelectorAll('.mui-scrollbar-vertical');
|
|
183
|
console.log('滚动条个数==' + scrollEle.length)
|
|
184
|
if(scrollEle.length > 1) {
|
|
185
|
for(var i = 0; i < scrollEle.length; i++) {
|
|
186
|
scrollEle[i].style.display = 'none';
|
192
|
187
|
scrollEle[0].style.display = 'block';
|
193
|
|
console.log(scrollEle[i].classList);
|
194
|
|
}
|
|
188
|
console.log(scrollEle[i].classList);
|
|
189
|
}
|
195
|
190
|
}
|
196
|
|
|
197
|
|
}
|
|
191
|
|
|
192
|
}
|
198
|
193
|
},
|
199
|
|
error:function(xhr,type,errorThrown){
|
200
|
|
mui.toast('网络异常,请稍候再试');
|
201
|
|
plus.nativeUI.closeWaiting();//关闭原生等待框
|
|
194
|
error: function(xhr, type, errorThrown) {
|
|
195
|
mui.toast('网络异常,请稍候再试');
|
|
196
|
plus.nativeUI.closeWaiting(); //关闭原生等待框
|
202
|
197
|
}
|
203
|
198
|
});
|
204
|
199
|
});
|
205
|
200
|
};
|
206
|
201
|
|
207
|
202
|
//加载第一页数据
|
208
|
|
function getOnePage(){
|
209
|
|
mui.plusReady(function() {
|
|
203
|
function getOnePage() {
|
|
204
|
mui.plusReady(function() {
|
210
|
205
|
var userid = plus.storage.getItem('userid');
|
211
|
|
var pageIndex = 1;
|
212
|
|
mui.ajax(baseUrl + '/ajax/consult/pq',{
|
213
|
|
data:{
|
214
|
|
"professorId":userid,
|
215
|
|
"consultOrNeed":oneedval.value ,
|
216
|
|
"consultType":otypeval.value,
|
217
|
|
"status":ostateval.value,
|
218
|
|
"timeType":osortval.value,
|
219
|
|
"pageSize":200,
|
220
|
|
"pageNo":pageIndex
|
|
206
|
var pageIndex = 1;
|
|
207
|
mui.ajax(baseUrl + '/ajax/consult/pq', {
|
|
208
|
data: {
|
|
209
|
"professorId": userid,
|
|
210
|
"consultOrNeed": oneedval.value,
|
|
211
|
"consultType": otypeval.value,
|
|
212
|
"status": ostateval.value,
|
|
213
|
"timeType": osortval.value,
|
|
214
|
"pageSize": 200,
|
|
215
|
"pageNo": pageIndex
|
221
|
216
|
},
|
222
|
|
dataType:'json',
|
223
|
|
type:'get',
|
224
|
|
timeout:10000,
|
225
|
|
|
226
|
|
success:function(data){
|
227
|
|
if (data.success) {
|
228
|
|
if(pageIndex == 1){
|
229
|
|
table.innerHTML = '';//下拉刷新,清空数据
|
230
|
|
var datalist = data.data.data;
|
231
|
|
|
232
|
|
eachData(userid,datalist);
|
|
217
|
dataType: 'json',
|
|
218
|
type: 'get',
|
|
219
|
timeout: 10000,
|
|
220
|
|
|
221
|
success: function(data) {
|
|
222
|
if(data.success) {
|
|
223
|
if(pageIndex == 1) {
|
|
224
|
table.innerHTML = ''; //下拉刷新,清空数据
|
|
225
|
var datalist = data.data.data;
|
|
226
|
|
|
227
|
eachData(userid, datalist);
|
233
|
228
|
|
234
|
229
|
var scrollEle = document.body.querySelectorAll('.mui-scrollbar-vertical');
|
235
|
|
console.log('滚动条个数=='+scrollEle.length)
|
236
|
|
if(scrollEle.length > 1){
|
237
|
|
for(var i = 0; i < scrollEle.length;i++){
|
|
230
|
console.log('滚动条个数==' + scrollEle.length)
|
|
231
|
if(scrollEle.length > 1) {
|
|
232
|
for(var i = 0; i < scrollEle.length; i++) {
|
238
|
233
|
scrollEle[i].style.display = 'none';
|
239
|
234
|
scrollEle[0].style.display = 'block';
|
240
|
235
|
console.log(scrollEle[i].classList);
|
241
|
236
|
}
|
242
|
237
|
}
|
243
|
|
mui('#zixunpullrefresh').pullRefresh().refresh(true);//重置下拉加载
|
244
|
|
mui('#zixunpullrefresh').pullRefresh().endPulldownToRefresh();
|
|
238
|
mui('#zixunpullrefresh').pullRefresh().refresh(true); //重置下拉加载
|
|
239
|
mui('#zixunpullrefresh').pullRefresh().endPulldownToRefresh();
|
245
|
240
|
}
|
246
|
241
|
};
|
247
|
242
|
},
|
248
|
|
error:function(xhr,type,errorThrown){
|
249
|
|
mui.toast('网络异常,请稍候再试');
|
|
243
|
error: function(xhr, type, errorThrown) {
|
|
244
|
mui.toast('网络异常,请稍候再试');
|
250
|
245
|
}
|
251
|
246
|
});
|
252
|
247
|
});
|
253
|
248
|
}
|
254
|
249
|
|
255
|
|
|
256
|
250
|
//父子页面的上拉加载ajax
|
257
|
251
|
function getaData() {
|
258
|
|
mui.plusReady(function() {
|
259
|
|
var userid = plus.storage.getItem('userid');
|
260
|
|
mui.ajax(baseUrl+'/ajax/consult/pq', {
|
261
|
|
data: {
|
262
|
|
"professorId":userid,
|
263
|
|
"consultOrNeed":oneedval.value ,
|
264
|
|
"consultType":otypeval.value,
|
265
|
|
"status":ostateval.value,
|
266
|
|
"timeType":osortval.value,
|
267
|
|
"pageSize":200,
|
268
|
|
"pageNo":pageIndex
|
269
|
|
},
|
270
|
|
async:false,
|
271
|
|
dataType: 'json',
|
272
|
|
type: 'get',
|
273
|
|
timeout: 10000,
|
274
|
|
success: function(data) {
|
275
|
|
if (data.success) {
|
276
|
|
var datalist = data.data.data;
|
277
|
|
var total = data.data.total;
|
278
|
|
var pageSize = data.data.pageSize;
|
279
|
|
allPages = Math.ceil(total / pageSize);/*获取总的分页数*/
|
280
|
|
|
281
|
|
if (allPages == 1) { //下拉刷新需要先清空数据
|
282
|
|
table.innerHTML = '';// 在这里清空可以防止刷新时白屏
|
283
|
|
}
|
284
|
|
console.log('第'+pageIndex+'页');
|
285
|
|
if(pageIndex == 1){
|
286
|
|
table.innerHTML = '';
|
287
|
|
}
|
288
|
|
eachData(userid,datalist);
|
289
|
|
if(pageIndex < allPages){
|
290
|
|
mui('#zixunpullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
|
291
|
|
}else{
|
292
|
|
mui('#zixunpullrefresh').pullRefresh().endPullupToRefresh(true);/*不能上拉*/
|
293
|
|
}
|
294
|
|
}
|
295
|
|
},
|
296
|
|
error: function(xhr, type, errerThrown) {
|
297
|
|
mui.toast('网络异常,请稍候再试');
|
298
|
|
mui('#zixunpullrefresh').pullRefresh().endPullupToRefresh(true);
|
299
|
|
}
|
300
|
|
});
|
301
|
|
});
|
|
252
|
mui.plusReady(function() {
|
|
253
|
var userid = plus.storage.getItem('userid');
|
|
254
|
mui.ajax(baseUrl + '/ajax/consult/pq', {
|
|
255
|
data: {
|
|
256
|
"professorId": userid,
|
|
257
|
"consultOrNeed": oneedval.value,
|
|
258
|
"consultType": otypeval.value,
|
|
259
|
"status": ostateval.value,
|
|
260
|
"timeType": osortval.value,
|
|
261
|
"pageSize": 200,
|
|
262
|
"pageNo": pageIndex
|
|
263
|
},
|
|
264
|
async: false,
|
|
265
|
dataType: 'json',
|
|
266
|
type: 'get',
|
|
267
|
timeout: 10000,
|
|
268
|
success: function(data) {
|
|
269
|
if(data.success) {
|
|
270
|
var datalist = data.data.data;
|
|
271
|
var total = data.data.total;
|
|
272
|
var pageSize = data.data.pageSize;
|
|
273
|
allPages = Math.ceil(total / pageSize); /*获取总的分页数*/
|
|
274
|
|
|
275
|
if(allPages == 1) { //下拉刷新需要先清空数据
|
|
276
|
table.innerHTML = ''; // 在这里清空可以防止刷新时白屏
|
|
277
|
}
|
|
278
|
console.log('第' + pageIndex + '页');
|
|
279
|
if(pageIndex == 1) {
|
|
280
|
table.innerHTML = '';
|
|
281
|
}
|
|
282
|
eachData(userid, datalist);
|
|
283
|
if(pageIndex < allPages) {
|
|
284
|
mui('#zixunpullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
|
|
285
|
} else {
|
|
286
|
mui('#zixunpullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
|
|
287
|
}
|
|
288
|
}
|
|
289
|
},
|
|
290
|
error: function(xhr, type, errerThrown) {
|
|
291
|
mui.toast('网络异常,请稍候再试');
|
|
292
|
mui('#zixunpullrefresh').pullRefresh().endPullupToRefresh(true);
|
|
293
|
}
|
|
294
|
});
|
|
295
|
});
|
302
|
296
|
};
|
303
|
297
|
|
304
|
|
|
305
|
|
|
306
|
|
|
307
|
298
|
//判断对方是否有聊天内容,加回复:。。。
|
308
|
|
function isChat(consultId,userid) {
|
|
299
|
function isChat(consultId, userid) {
|
309
|
300
|
var length = 0;
|
310
|
|
mui.ajax(baseUrl+'/ajax/tidings/qacon',{
|
311
|
|
data:{
|
312
|
|
"consultId":consultId
|
|
301
|
mui.ajax(baseUrl + '/ajax/tidings/qacon', {
|
|
302
|
data: {
|
|
303
|
"consultId": consultId
|
313
|
304
|
},
|
314
|
|
async:false,
|
315
|
|
dataType:'json',//服务器返回json格式数据
|
316
|
|
type:'get',//HTTP请求类型
|
317
|
|
timeout:10000,//超时时间设置为10秒;
|
318
|
|
success:function(data){
|
|
305
|
async: false,
|
|
306
|
dataType: 'json', //服务器返回json格式数据
|
|
307
|
type: 'get', //HTTP请求类型
|
|
308
|
timeout: 10000, //超时时间设置为10秒;
|
|
309
|
success: function(data) {
|
319
|
310
|
var myData = data.data;
|
320
|
|
for(var i = 0; i < myData.length; i++ ){
|
321
|
|
if(myData[i]['professor']['id'] !=userid){
|
|
311
|
for(var i = 0; i < myData.length; i++) {
|
|
312
|
if(myData[i]['professor']['id'] != userid) {
|
322
|
313
|
length++;
|
323
|
314
|
}
|
324
|
315
|
}
|
325
|
|
|
|
316
|
|
326
|
317
|
},
|
327
|
|
error:function(xhr,type,errorThrown){
|
|
318
|
error: function(xhr, type, errorThrown) {
|
328
|
319
|
//根据消息id查询消息失败
|
329
|
320
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
330
|
321
|
}
|
331
|
322
|
});
|
332
|
|
return length;
|
|
323
|
return length;
|
333
|
324
|
}
|
334
|
325
|
|
335
|
326
|
//更新读取状态
|
336
|
327
|
function setReadState(consultId) {
|
337
|
|
mui.ajax(baseUrl+'/ajax/consult/readStatus',{
|
338
|
|
data:{"consultId":consultId}, //咨询ID
|
339
|
|
dataType:'json',//服务器返回json格式数据
|
340
|
|
type:'post',//HTTP请求类型
|
341
|
|
timeout:10000,//超时时间设置为10秒;
|
342
|
|
success:function(data){
|
|
328
|
mui.ajax(baseUrl + '/ajax/consult/readStatus', {
|
|
329
|
data: {
|
|
330
|
"consultId": consultId
|
|
331
|
}, //咨询ID
|
|
332
|
dataType: 'json', //服务器返回json格式数据
|
|
333
|
type: 'post', //HTTP请求类型
|
|
334
|
timeout: 10000, //超时时间设置为10秒;
|
|
335
|
success: function(data) {
|
343
|
336
|
|
344
|
|
},
|
345
|
|
error:function(xhr,type,errorThrown){
|
346
|
|
|
347
|
|
}
|
348
|
|
});
|
|
337
|
},
|
|
338
|
error: function(xhr, type, errorThrown) {
|
|
339
|
|
|
340
|
}
|
|
341
|
});
|
349
|
342
|
}
|
350
|
343
|
|
351
|
344
|
//打开子页面
|
352
|
|
mui(".mui-table-view").on('tap','.itemBtn',function(){
|
|
345
|
mui(".mui-table-view").on('tap', '.itemBtn', function() {
|
353
|
346
|
var o_this = this;
|
354
|
|
|
|
347
|
|
355
|
348
|
mui.plusReady(function() {
|
356
|
|
|
357
|
|
var nwaiting = plus.nativeUI.showWaiting();//显示原生等待框
|
|
349
|
|
|
350
|
var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
|
358
|
351
|
//更新读取状态
|
359
|
352
|
setReadState(o_this.getAttribute("consultId"));
|
360
|
|
webviewShow = plus.webview.create("../html/chats.html",'chats.html',{},
|
361
|
|
{'consultId':o_this.getAttribute("consultId"),'consultantId':o_this.getAttribute("consultantId"),'readState':1});
|
|
353
|
webviewShow = plus.webview.create("../html/chats.html", 'chats.html', {}, {
|
|
354
|
'consultId': o_this.getAttribute("consultId"),
|
|
355
|
'consultantId': o_this.getAttribute("consultantId"),
|
|
356
|
'readState': 1
|
|
357
|
});
|
362
|
358
|
//当聊天页面加载完再打开
|
363
|
|
webviewShow.addEventListener("loaded", function() {
|
364
|
|
|
365
|
|
}, false);
|
366
|
|
|
|
359
|
webviewShow.addEventListener("loaded", function() {
|
|
360
|
|
|
361
|
}, false);
|
|
362
|
|
367
|
363
|
});
|
368
|
|
|
369
|
|
});
|
370
|
364
|
|
|
365
|
});
|
371
|
366
|
|
372
|
367
|
/*由聊天页面返回咨询列表,要更新咨询状态,和更新未读信息:::自定义事件*/
|
373
|
|
window.addEventListener('backlist',function(event){
|
374
|
|
var self = plus.webview.currentWebview();
|
375
|
|
var consultId = event.detail.consultId;
|
376
|
|
var status = event.detail.status;
|
377
|
|
//由聊天页返回咨询,改变咨询状态,和咨询状态样式
|
378
|
|
mui('.status').each(function(index,item){
|
|
368
|
window.addEventListener('backlist', function(event) {
|
|
369
|
var self = plus.webview.currentWebview();
|
|
370
|
var consultId = event.detail.consultId;
|
|
371
|
var status = event.detail.status;
|
|
372
|
//由聊天页返回咨询,改变咨询状态,和咨询状态样式
|
|
373
|
mui('.status').each(function(index, item) {
|
|
374
|
if(this.getAttribute('consultId') == consultId) {
|
|
375
|
console.log(status)
|
|
376
|
if(status == 'myNeedAssessStatus=0') {
|
|
377
|
this.classList.remove('status-1');
|
|
378
|
this.classList.add('status-2');
|
|
379
|
this.innerHTML = '待评价';
|
|
380
|
}else if(status == 'consultStatus=0') {
|
|
381
|
this.classList.remove('status-1');
|
|
382
|
this.classList.add('status-2');
|
|
383
|
this.innerHTML = '待评价';
|
|
384
|
}else if(status == 'myNeedAssessStatus=1') {
|
|
385
|
this.classList.remove('status-1');
|
|
386
|
this.classList.add('status-3');
|
|
387
|
this.innerHTML = '已完成';
|
|
388
|
}
|
|
389
|
};
|
|
390
|
});
|
|
391
|
|
|
392
|
//由聊天页返回咨询页,改变未读状态
|
|
393
|
mui('.readstate').each(function(index, item) {
|
|
394
|
if(this.getAttribute('class').indexOf('displayBlock') != -1) { //包含displayBlock
|
|
395
|
console.log(this.getAttribute('consultId'));
|
379
|
396
|
if(this.getAttribute('consultId') == consultId) {
|
380
|
|
if(status == 'myNeedAssessStatus=0'){
|
381
|
|
this.classList.remove('status-1');
|
382
|
|
this.classList.add('status-2');
|
383
|
|
this.innerHTML = '待评价';
|
384
|
|
}else if(status == 'myNeedAssessStatus=1'){
|
385
|
|
this.classList.remove('status-1');
|
386
|
|
this.classList.add('status-3');
|
387
|
|
this.innerHTML = '已完成';
|
388
|
|
}
|
389
|
|
};
|
390
|
|
});
|
391
|
|
|
392
|
|
//由聊天页返回咨询页,改变未读状态
|
393
|
|
mui('.readstate').each(function(index,item){
|
394
|
|
if(this.getAttribute('class').indexOf('displayBlock') != -1){//包含displayBlock
|
395
|
|
console.log(this.getAttribute('consultId'));
|
396
|
|
if(this.getAttribute('consultId') == consultId){
|
397
|
|
this.classList.remove('displayBlock');
|
398
|
|
this.classList.add('displayNone');
|
399
|
|
console.log(this.classList);
|
400
|
|
}
|
|
397
|
this.classList.remove('displayBlock');
|
|
398
|
this.classList.add('displayNone');
|
|
399
|
console.log(this.classList);
|
401
|
400
|
}
|
402
|
|
});
|
|
401
|
}
|
403
|
402
|
});
|
404
|
|
|
405
|
|
function eachData(userid,datalist) {
|
406
|
|
|
|
403
|
});
|
|
404
|
|
|
405
|
function eachData(userid, datalist) {
|
|
406
|
|
407
|
407
|
/*表格填充数据 mui.each是异步的*/
|
408
|
|
mui.each(datalist, function(index, item) {
|
409
|
|
var title,lastReply,status,statusStyle,lastReplyTime,lastReplyCon,
|
410
|
|
unreadCount,unreadStyle,proModify,photoUrl,consultType,
|
|
408
|
mui.each(datalist, function(index, item) {
|
|
409
|
var title, lastReply, status, statusStyle, lastReplyTime, lastReplyCon,
|
|
410
|
unreadCount, unreadStyle, proModify, photoUrl, consultType,
|
411
|
411
|
chatlength;
|
412
|
|
|
413
|
|
var modifyaddEle = '';//添加不同认证
|
414
|
|
|
|
412
|
|
|
413
|
var modifyaddEle = ''; //添加不同认证
|
|
414
|
|
415
|
415
|
//过滤professor为空
|
416
|
|
if(item["professor"]){
|
417
|
|
|
418
|
|
chatlength = isChat(item['consultId'],userid);//判断对方是否有发出消息
|
419
|
|
if(chatlength == 0){
|
420
|
|
title = item["consultTitle"];
|
421
|
|
}else{
|
|
416
|
if(item["professor"]) {
|
|
417
|
|
|
418
|
chatlength = isChat(item['consultId'], userid); //判断对方是否有发出消息
|
|
419
|
if(chatlength == 0) {
|
|
420
|
title = item["consultTitle"];
|
|
421
|
} else {
|
422
|
422
|
title = "回复:" + item["consultTitle"];
|
423
|
423
|
}
|
424
|
|
// console.log(title)
|
425
|
|
//咨询类型和状态
|
426
|
|
if(item["consultStatus"] == 0){//进行中,我的需求和收到咨询
|
427
|
|
status = "进行中";
|
|
424
|
// console.log(title)
|
|
425
|
//咨询类型和状态
|
|
426
|
if(item["consultStatus"] == 0) { //进行中,我的需求和收到咨询
|
|
427
|
status = "进行中";
|
428
|
428
|
statusStyle = 'status-1';
|
429
|
|
}else if(item["consultStatus"] == 1){
|
430
|
|
if(item['consultantId'] != userid){//收到咨询
|
431
|
|
status = "已完成";
|
|
429
|
} else if(item["consultStatus"] == 1) {
|
|
430
|
if(item['consultantId'] != userid) { //收到咨询
|
|
431
|
status = "已完成";
|
432
|
432
|
statusStyle = 'status-3';
|
433
|
|
}else {//我的需求
|
434
|
|
if(item["assessStatus"] == 0){
|
|
433
|
} else { //我的需求
|
|
434
|
if(item["assessStatus"] == 0) {
|
435
|
435
|
status = '待评价';
|
436
|
436
|
statusStyle = 'status-2';
|
437
|
|
}else {
|
|
437
|
} else {
|
438
|
438
|
status = '已完成';
|
439
|
439
|
statusStyle = 'status-3';
|
440
|
440
|
}
|
441
|
|
}
|
442
|
|
}
|
443
|
|
|
444
|
|
|
|
441
|
}
|
|
442
|
}
|
|
443
|
|
445
|
444
|
//认证
|
446
|
445
|
if(item["professor"].authType) {
|
447
|
446
|
proModify = 'icon-vip authicon-cu';
|
|
@ -449,181 +448,179 @@ function eachData(userid,datalist) {
|
449
|
448
|
if(item["professor"].authStatus) {
|
450
|
449
|
if(item["professor"].authentication == 1) {
|
451
|
450
|
proModify = 'icon-renzheng authicon-mana';
|
452
|
|
// modifyaddEle = "<span >科研</span>";
|
453
|
|
|
454
|
|
|
|
451
|
// modifyaddEle = "<span >科研</span>";
|
|
452
|
|
455
|
453
|
} else if(item["professor"].authentication == 2) {
|
456
|
454
|
proModify = 'icon-renzheng authicon-staff';
|
457
|
|
// modifyaddEle = "<span>企业</span>";
|
458
|
|
|
|
455
|
// modifyaddEle = "<span>企业</span>";
|
|
456
|
|
459
|
457
|
} else {
|
460
|
|
|
|
458
|
|
461
|
459
|
proModify = 'icon-renzheng authicon-stu';
|
462
|
|
// modifyaddEle = "<span>学生</span>";
|
463
|
|
|
|
460
|
// modifyaddEle = "<span>学生</span>";
|
|
461
|
|
464
|
462
|
}
|
465
|
463
|
}
|
466
|
464
|
}
|
467
|
|
|
468
|
|
(item["professor"]["hasHeadImage"] == 0) ? photoUrl = "../images/default-photo.jpg":photoUrl = baseUrl + "/images/head/" + item["professor"].id + "_l.jpg";
|
469
|
|
|
|
465
|
|
|
466
|
(item["professor"]["hasHeadImage"] == 0) ? photoUrl = "../images/default-photo.jpg": photoUrl = baseUrl + "/images/head/" + item["professor"].id + "_l.jpg";
|
|
467
|
|
470
|
468
|
//咨询类型,只取两个字
|
471
|
469
|
if(item["consultType"]) {
|
472
|
|
consultType = item["consultType"].substr(0,2);
|
|
470
|
consultType = item["consultType"].substr(0, 2);
|
473
|
471
|
}
|
474
|
|
|
|
472
|
|
475
|
473
|
//最后回复
|
476
|
|
lastReplyTime = lastReplyFn(userid,item["consultId"]).lastReplyTime;
|
477
|
|
lastReplyCon = lastReplyFn(userid,item["consultId"]).lastReplyCon;
|
478
|
|
|
479
|
|
if(lastReplyCon == undefined){
|
|
474
|
lastReplyTime = lastReplyFn(userid, item["consultId"]).lastReplyTime;
|
|
475
|
lastReplyCon = lastReplyFn(userid, item["consultId"]).lastReplyCon;
|
|
476
|
|
|
477
|
if(lastReplyCon == undefined) {
|
480
|
478
|
lastReplyCon = '';
|
481
|
479
|
}
|
482
|
|
if(lastReplyTime == undefined){
|
|
480
|
if(lastReplyTime == undefined) {
|
483
|
481
|
lastReplyTime = '';
|
484
|
482
|
}
|
485
|
483
|
//未读消息
|
486
|
|
unreadCount = unreadConsultFn(userid,item["consultId"],index).unreadCount;
|
487
|
|
unreadStyle = unreadConsultFn(userid,item["consultId"],index).style;
|
488
|
|
|
489
|
|
var li = document.createElement('li');
|
490
|
|
li.className = 'mui-table-view-cell mui-media';
|
491
|
|
|
492
|
|
var str = '';
|
493
|
|
str += '<div class="coutopicbox"><span class="coutheme mui-ellipsis mui-pull-left">'+title+'</span>'
|
494
|
|
+ '<div class="coustatus mui-pull-right"><span class="aimlabel">'+consultType+'</span>'
|
495
|
|
+ '<span class="'+statusStyle+' status" consultId="'+item["consultId"]+'">'+status+'</span></div></div>'
|
496
|
|
+ '<a class="proinfor itemBtn" consultId="'+item["consultId"]+'" consultantId="'+item["consultantId"]+'" >'
|
497
|
|
+ '<span class="mui-badge mui-badge-danger readstate '+unreadStyle+'" consultId="'+item["consultId"]+'">'+unreadCount+'</span>'
|
498
|
|
+ '<img class="mui-media-object mui-pull-left headimg headRadius" src="'+photoUrl+'">'
|
499
|
|
+ '<div class="mui-media-body">'
|
500
|
|
+ '<span class="listtit">'+item["professor"]["name"]+'<em id="nameli" class="mui-icon iconfont '+proModify+'">'+modifyaddEle+'</em><span class="thistime">'+lastReplyTime+'</span></span>';
|
501
|
|
str += '<p class="listtit2">';
|
502
|
|
if(item["professor"]["title"]){
|
503
|
|
str += '<span>'+item["professor"]["title"]+'</span>, ';
|
504
|
|
};
|
505
|
|
if(item["professor"]["office"]){
|
506
|
|
if(item["professor"]["orgName"]){
|
507
|
|
str += '<span>'+item["professor"]["office"]+'</span>, ';
|
508
|
|
}else {
|
509
|
|
str += '<span>'+item["professor"]["office"]+'</span>';
|
510
|
|
}
|
511
|
|
};
|
512
|
|
if(item["professor"]["orgName"]){
|
513
|
|
str += '<span>'+item["professor"]["orgName"]+'</span>';
|
514
|
|
};
|
515
|
|
if(item["professor"]["address"]){
|
516
|
|
str += '<span> | '+item["professor"]["address"]+'</span>';
|
517
|
|
};
|
518
|
|
|
519
|
|
str +='</p><p class="listtit3 onlyone">'+lastReplyCon+'</p></div></a>';
|
520
|
|
|
|
484
|
unreadCount = unreadConsultFn(userid, item["consultId"], index).unreadCount;
|
|
485
|
unreadStyle = unreadConsultFn(userid, item["consultId"], index).style;
|
|
486
|
|
|
487
|
var li = document.createElement('li');
|
|
488
|
li.className = 'mui-table-view-cell mui-media';
|
|
489
|
|
|
490
|
var str = '';
|
|
491
|
str += '<div class="coutopicbox"><span class="coutheme mui-ellipsis mui-pull-left">' + title + '</span>' +
|
|
492
|
'<div class="coustatus mui-pull-right"><span class="aimlabel">' + consultType + '</span>' +
|
|
493
|
'<span class="' + statusStyle + ' status" consultId="' + item["consultId"] + '">' + status + '</span></div></div>' +
|
|
494
|
'<a class="proinfor itemBtn" consultId="' + item["consultId"] + '" consultantId="' + item["consultantId"] + '" >' +
|
|
495
|
'<span class="mui-badge mui-badge-danger readstate ' + unreadStyle + '" consultId="' + item["consultId"] + '">' + unreadCount + '</span>' +
|
|
496
|
'<img class="mui-media-object mui-pull-left headimg headRadius" src="' + photoUrl + '">' +
|
|
497
|
'<div class="mui-media-body">' +
|
|
498
|
'<span class="listtit">' + item["professor"]["name"] + '<em id="nameli" class="mui-icon iconfont ' + proModify + '">' + modifyaddEle + '</em><span class="thistime">' + lastReplyTime + '</span></span>';
|
|
499
|
str += '<p class="listtit2">';
|
|
500
|
if(item["professor"]["title"]) {
|
|
501
|
str += '<span>' + item["professor"]["title"] + '</span>, ';
|
|
502
|
};
|
|
503
|
if(item["professor"]["office"]) {
|
|
504
|
if(item["professor"]["orgName"]) {
|
|
505
|
str += '<span>' + item["professor"]["office"] + '</span>, ';
|
|
506
|
} else {
|
|
507
|
str += '<span>' + item["professor"]["office"] + '</span>';
|
|
508
|
}
|
|
509
|
};
|
|
510
|
if(item["professor"]["orgName"]) {
|
|
511
|
str += '<span>' + item["professor"]["orgName"] + '</span>';
|
|
512
|
};
|
|
513
|
if(item["professor"]["address"]) {
|
|
514
|
str += '<span> | ' + item["professor"]["address"] + '</span>';
|
|
515
|
};
|
|
516
|
|
|
517
|
str += '</p><p class="listtit3 onlyone">' + lastReplyCon + '</p></div></a>';
|
|
518
|
|
521
|
519
|
li.innerHTML = str;
|
522
|
|
table.appendChild(li,table.firstChild);
|
523
|
|
}
|
524
|
|
});
|
525
|
|
|
|
520
|
table.appendChild(li, table.firstChild);
|
|
521
|
}
|
|
522
|
});
|
|
523
|
|
526
|
524
|
};
|
527
|
525
|
|
528
|
526
|
/*最后回复*/
|
529
|
|
function lastReplyFn(sendId,consultId){
|
530
|
|
var lastReplyTimeData,lastReplyTime,lastReplyCon;
|
531
|
|
mui.ajax(baseUrl + '/ajax/tidings/qaLastRevovery',{
|
532
|
|
data:{
|
533
|
|
"consultId":consultId, //咨询ID
|
534
|
|
"senderId":sendId //登录者ID
|
|
527
|
function lastReplyFn(sendId, consultId) {
|
|
528
|
var lastReplyTimeData, lastReplyTime, lastReplyCon;
|
|
529
|
mui.ajax(baseUrl + '/ajax/tidings/qaLastRevovery', {
|
|
530
|
data: {
|
|
531
|
"consultId": consultId, //咨询ID
|
|
532
|
"senderId": sendId //登录者ID
|
535
|
533
|
},
|
536
|
|
dataType:'json',
|
537
|
|
type:'get',
|
538
|
|
timeout:10000,
|
539
|
|
async:false,
|
540
|
|
success:function(data){
|
541
|
|
if(data["data"] == null || data["data"] == "" || data["data"] == undefined){
|
|
534
|
dataType: 'json',
|
|
535
|
type: 'get',
|
|
536
|
timeout: 10000,
|
|
537
|
async: false,
|
|
538
|
success: function(data) {
|
|
539
|
if(data["data"] == null || data["data"] == "" || data["data"] == undefined) {
|
542
|
540
|
lastReplyTimeData = '';
|
543
|
541
|
lastReplyTime = '';
|
544
|
542
|
lastReplyCon = '';
|
545
|
|
}
|
546
|
|
else{
|
|
543
|
} else {
|
547
|
544
|
lastReplyTimeData = data["data"]["createTime"];
|
548
|
|
lastReplyTime =lastReplyTimeData.substr(0,4) + "-" + lastReplyTimeData.substr(4,2) + "-" + lastReplyTimeData.substr(6,2) + " " + lastReplyTimeData.substr(8,2)+ ":" +lastReplyTimeData.substr(10,2);
|
|
545
|
lastReplyTime = lastReplyTimeData.substr(0, 4) + "-" + lastReplyTimeData.substr(4, 2) + "-" + lastReplyTimeData.substr(6, 2) + " " + lastReplyTimeData.substr(8, 2) + ":" + lastReplyTimeData.substr(10, 2);
|
549
|
546
|
lastReplyCon = data["data"]["tidingsContant"];
|
550
|
547
|
}
|
551
|
548
|
},
|
552
|
|
error:function(xhr,type,errorThrown){
|
553
|
|
|
|
549
|
error: function(xhr, type, errorThrown) {
|
|
550
|
|
554
|
551
|
}
|
555
|
552
|
});
|
556
|
|
return {
|
557
|
|
"lastReplyTime":lastReplyTime,
|
558
|
|
"lastReplyCon":lastReplyCon
|
|
553
|
return {
|
|
554
|
"lastReplyTime": lastReplyTime,
|
|
555
|
"lastReplyCon": lastReplyCon
|
559
|
556
|
};
|
560
|
557
|
};
|
561
|
558
|
|
562
|
559
|
/*未读消息*/
|
563
|
|
function unreadConsultFn (senderId,consultId,i){
|
564
|
|
var unreadCount,style;
|
565
|
|
mui.ajax(baseUrl +'/ajax/tidings/qaNotReadTidings',{
|
566
|
|
data:{
|
567
|
|
"senderId":senderId, //发送者ID
|
568
|
|
"consultId":consultId //咨询ID
|
|
560
|
function unreadConsultFn(senderId, consultId, i) {
|
|
561
|
var unreadCount, style;
|
|
562
|
mui.ajax(baseUrl + '/ajax/tidings/qaNotReadTidings', {
|
|
563
|
data: {
|
|
564
|
"senderId": senderId, //发送者ID
|
|
565
|
"consultId": consultId //咨询ID
|
569
|
566
|
},
|
570
|
|
dataType:'json',//服务器返回json格式数据
|
571
|
|
type:'get',//HTTP请求类型
|
572
|
|
timeout:10000,//超时时间设置为10秒;
|
573
|
|
async:false,
|
574
|
|
success:function(data){
|
|
567
|
dataType: 'json', //服务器返回json格式数据
|
|
568
|
type: 'get', //HTTP请求类型
|
|
569
|
timeout: 10000, //超时时间设置为10秒;
|
|
570
|
async: false,
|
|
571
|
success: function(data) {
|
575
|
572
|
unreadCount = data["data"];
|
576
|
|
if(unreadCount == 0){
|
|
573
|
if(unreadCount == 0) {
|
577
|
574
|
style = 'displayNone';
|
578
|
|
}else{
|
|
575
|
} else {
|
579
|
576
|
style = 'displayBlock';
|
580
|
|
|
|
577
|
|
581
|
578
|
}
|
582
|
579
|
},
|
583
|
|
error:function(xhr,type,errorThrown){
|
584
|
|
|
|
580
|
error: function(xhr, type, errorThrown) {
|
|
581
|
|
585
|
582
|
}
|
586
|
583
|
});
|
587
|
|
|
588
|
|
return {"unreadCount":unreadCount,
|
589
|
|
"style":style
|
|
584
|
|
|
585
|
return {
|
|
586
|
"unreadCount": unreadCount,
|
|
587
|
"style": style
|
590
|
588
|
}
|
591
|
589
|
};
|
592
|
590
|
|
593
|
591
|
//点击选择
|
594
|
|
function checkedFun(i){
|
595
|
|
mui.plusReady(function(){
|
596
|
|
mui("#middlePopover"+i).on('tap','.mui-navigate-right',function(e){
|
|
592
|
function checkedFun(i) {
|
|
593
|
mui.plusReady(function() {
|
|
594
|
mui("#middlePopover" + i).on('tap', '.mui-navigate-right', function(e) {
|
597
|
595
|
allPages = 1;
|
598
|
596
|
pageIndex = 1;
|
599
|
597
|
plus.nativeUI.showWaiting(); //显示等待框
|
600
|
|
document.getElementById("headck"+i).innerHTML = this.innerHTML;
|
601
|
|
var value = this.getAttribute("ck"+i);
|
602
|
|
document.getElementById("headck"+i).setAttribute('headck',value);
|
|
598
|
document.getElementById("headck" + i).innerHTML = this.innerHTML;
|
|
599
|
var value = this.getAttribute("ck" + i);
|
|
600
|
document.getElementById("headck" + i).setAttribute('headck', value);
|
603
|
601
|
document.querySelector('.mui-backdrop').style.display = 'none';
|
604
|
|
document.getElementById("middlePopover"+i).style.display = 'none';
|
605
|
|
|
|
602
|
document.getElementById("middlePopover" + i).style.display = 'none';
|
|
603
|
|
606
|
604
|
//去掉样式类mui-active,要不然会多点击一次
|
607
|
|
document.getElementById("middlePopover"+i).classList.remove('mui-active');
|
608
|
|
|
|
605
|
document.getElementById("middlePopover" + i).classList.remove('mui-active');
|
|
606
|
|
609
|
607
|
//咨询类型传值不同,传""(空),技术咨询、资源咨询、其他事务
|
610
|
608
|
otypeval.value = document.getElementById("headck2").getAttribute('headck');
|
611
|
609
|
if(otypeval.value == 0) {
|
612
|
610
|
otypeval.value = '';
|
613
|
|
}else {
|
|
611
|
} else {
|
614
|
612
|
otypeval.value = document.getElementById("headck2").innerHTML;
|
615
|
613
|
}
|
616
|
614
|
oneedval.value = document.getElementById("headck1").getAttribute('headck');
|
617
|
615
|
ostateval.value = document.getElementById("headck3").getAttribute('headck');
|
618
|
616
|
osortval.value = document.getElementById("headck4").getAttribute('headck');
|
619
|
|
|
620
|
|
initData();
|
621
|
|
|
622
|
|
|
623
|
|
// mui('#zixunpullrefresh').scroll().scrollTo(0,0,100);//100毫秒滚动到顶
|
624
|
|
plus.nativeUI.closeWaiting();//关闭等待框
|
|
617
|
|
|
618
|
initData();
|
|
619
|
|
|
620
|
// mui('#zixunpullrefresh').scroll().scrollTo(0,0,100);//100毫秒滚动到顶
|
|
621
|
plus.nativeUI.closeWaiting(); //关闭等待框
|
625
|
622
|
});
|
626
|
|
|
|
623
|
|
627
|
624
|
});
|
628
|
625
|
};
|
629
|
626
|
checkedFun(1);
|