Explorar el Código

咨询聊天默认头像

dell %!s(int64=8) %!d(string=hace) años
padre
commit
bf5685eebf
Se han modificado 4 ficheros con 68 adiciones y 59 borrados
  1. 2 2
      app/html/chats.html
  2. 12 16
      app/js/chats.js
  3. 44 40
      app/js/consult.js
  4. 10 1
      app/js/consultapply.js

+ 2 - 2
app/html/chats.html

@ -352,9 +352,9 @@
352 352
 					<!--对话内容渲染-->
353 353
 					<% if(item.sender=='self' ) { %>
354 354
 						<!--<i class="msg-user mui-icon mui-icon-person"></i>-->
355
 						<img class="msg-user msg-user-img" src="" alt="" id="selfImg"/>
355
 						<img class="msg-user msg-user-img" src="../images/default-photo.jpg" alt="" id="selfImg"/>
356 356
 					<% } else { %>
357
 						<img class="msg-user msg-user-img" src="" alt="" id="thatImg"/>
357
 						<img class="msg-user msg-user-img" src="../images/default-photo.jpg" alt="" id="thatImg"/>
358 358
 					<% } %>
359 359
 					<div class="msg-content">
360 360
 						<div class="msg-content-inner">

+ 12 - 16
app/js/chats.js

@ -195,15 +195,6 @@ mui.ready(function() {
195 195
		});
196 196
	};
197 197
	
198
	/*评价内容显示与隐藏
199
	 * starContainer:点击已评价/对方已评价显示评价 中的星星容器
200
	 */
201
	function openWin(){
202
	    myWindow=window.open('','','width=200,height=100');
203
	    myWindow.document.write("<p>这是我的窗口</p>");
204
	}
205
	
206
	
207 198
	/*更改咨询状态,进行中--完成*/
208 199
	function setState(consultId) {
209 200
		mui.ajax(baseUrl+'/ajax/consult/finishTime',{
@ -288,13 +279,12 @@ mui.ready(function() {
288 279
				success:function(data){
289 280
					var myData = data.data;
290 281
					for(var i = 0; i < myData.length; i++ ){
291
						console.log(myData[i]['tidingsContant']);
292 282
						if(myData[i]['professor']['id'] == userid){
293 283
							/*判断是否有头像*/
294 284
							/*if(myData[i]['professor']['hasHeadImage'] == 1){
295
								oselfImg.setAttribute('src',baseUrl + "/images/head/" + item["professor"].id + "_m.jpg")
285
								document.getElementById("selfImg").setAttribute('src',baseUrl + "/images/head/" + myData[i]["professor"].id + "_m.jpg")
296 286
							}else {
297
								oselfImg.setAttribute("src","../images/default-photo.jpg");
287
								document.getElementById("selfImg").setAttribute("src","../images/default-photo.jpg");
298 288
							}*/
299 289
							
300 290
							record.push({
@ -304,11 +294,17 @@ mui.ready(function() {
304 294
							});
305 295
						}else{
306 296
							/*判断是否有头像*/
307
							/*if(myData[i]['professor']['hasHeadImage'] == 1){
308
								othatImg.setAttribute('src',baseUrl + "/images/head/" + item["professor"].id + "_m.jpg")
309
							}else {
310
								othatImg.setAttribute("src","../images/default-photo.jpg");
297
							console.log(myData[i]['professor'].id);
298
							console.log(userid);
299
							/*if(myData[i]['professor'] != '' && myData[i]['professor'] != undefined){
300
								if(myData[i]['professor']['hasHeadImage'] == 1){
301
									document.getElementById("thatImg").setAttribute('src',baseUrl + "/images/head/" + myData[i]["professor"].id + "_m.jpg")
302
								}else {
303
									console.log(document.getElementById("thatImg"))
304
									document.getElementById("thatImg").setAttribute("src","../images/default-photo.jpg");
305
								}
311 306
							}*/
307
							
312 308
							record.push({
313 309
								sender: 'zs',
314 310
								type: 'text',

+ 44 - 40
app/js/consult.js

@ -39,7 +39,44 @@ if(mui.os.plus) {
39 39
	mui.ready(function() {
40 40
		mui('#zixunpullrefresh').pullRefresh().pulldownLoading();
41 41
	});
42
}
42
};
43
44
//点击选择
45
function checkedFun(i){
46
	mui("#middlePopover"+i).on('tap','.mui-navigate-right',function(e){
47
		allPages = 1;
48
		pageIndex = 1;
49
		plus.nativeUI.showWaiting(); //显示等待框
50
		document.getElementById("headck"+i).innerHTML = this.innerHTML;
51
		var value = this.getAttribute("ck"+i);
52
		document.getElementById("headck"+i).setAttribute('headck',value);
53
		document.querySelector('.mui-backdrop').style.display = 'none';
54
		document.getElementById("middlePopover"+i).style.display = 'none';
55
		
56
		//去掉样式类mui-active,要不然会多点击一次
57
		document.getElementById("middlePopover"+i).classList.remove('mui-active');
58
		
59
		//咨询类型传值不同,传""(空),技术咨询、资源咨询、其他事务
60
		otypeval.value = document.getElementById("headck2").getAttribute('headck');
61
		if(otypeval.value == 0) {
62
			otypeval.value = '';
63
		}else {
64
			otypeval.value = document.getElementById("headck2").innerHTML;
65
		}
66
		oneedval.value = document.getElementById("headck1").getAttribute('headck');
67
		ostateval.value = document.getElementById("headck3").getAttribute('headck');
68
		osortval.value = document.getElementById("headck4").getAttribute('headck');
69
		
70
		initdata();
71
		plus.nativeUI.closeWaiting();//关闭等待框
72
	});
73
	
74
};
75
checkedFun(1);
76
checkedFun(2);
77
checkedFun(3);
78
checkedFun(4);
79
43 80
44 81
function getaData() {
45 82
    mui.plusReady(function() {
@ -100,7 +137,10 @@ function initdata() {
100 137
    mui.plusReady(function() {
101 138
    	/*plus.nativeUI.showWaiting()//显示等待框*/
102 139
    	var userid = plus.storage.getItem('userid');
103
    	console.log('初始化传参'+'一:'+oneedval.value+'二'+otypeval.value+'三'+ostateval.value+'四'+osortval.value);
140
    	if(otypeval.value == 0){
141
    		otypeval.value ='';
142
    	}
143
    	console.log('初始化传参一:'+oneedval.value+'二'+otypeval.value+'三'+ostateval.value+'四'+osortval.value);
104 144
    	console.log()
105 145
    	plus.nativeUI.showWaiting();
106 146
        mui.ajax(baseUrl+'/ajax/consult/pq', {
@ -117,8 +157,10 @@ function initdata() {
117 157
            type: 'get',  
118 158
            timeout: 10000,
119 159
            success: function(data) {
160
            	
120 161
                if (data.success) {
121 162
                    var datalist = data.data.data;
163
                    console.log(datalist.length);
122 164
	                table.innerHTML = '';//清空容器
123 165
                    eachData(userid,datalist);
124 166
                    mui('#zixunpullrefresh').pullRefresh().refresh(true);//重置下拉加载
@ -209,45 +251,7 @@ window.addEventListener('backlist',function(event){
209 251
//		initdata();
210 252
		
211 253
	});
212
213
214
//点击选择
215
function checkedFun(i){
216
	
217
	mui("#middlePopover"+i).on('tap','.mui-navigate-right',function(e){
218
		allPages = 1;
219
		pageIndex = 1;
220
		plus.nativeUI.showWaiting(); //显示等待框
221
		document.getElementById("headck"+i).innerHTML = this.innerHTML;
222
		var value = this.getAttribute("ck"+i);
223
		document.getElementById("headck"+i).setAttribute('headck',value);
224
		document.querySelector('.mui-backdrop').style.display = 'none';
225
		document.getElementById("middlePopover"+i).style.display = 'none';
226
		
227
		//去掉样式类mui-active,要不然会多点击一次
228
		document.getElementById("middlePopover"+i).classList.remove('mui-active');
229
		
230
		//咨询类型传值不同,传""(空),技术咨询、资源咨询、其他事务
231
		otypeval.value = document.getElementById("headck2").getAttribute('headck');
232
		if(otypeval.value == 0) {
233
			otypeval.value = '';
234
		}else {
235
			otypeval.value = document.getElementById("headck2").innerHTML;
236
		}
237
		oneedval.value = document.getElementById("headck1").getAttribute('headck');
238
		ostateval.value = document.getElementById("headck3").getAttribute('headck');
239
		osortval.value = document.getElementById("headck4").getAttribute('headck');
240
		
241
		initdata();
242
		plus.nativeUI.closeWaiting();//关闭等待框
243
	});
244 254
	
245
};
246
checkedFun(1);
247
checkedFun(2);
248
checkedFun(3);
249
checkedFun(4);
250
251 255
function eachData(userid,datalist) {
252 256
	/*表格填充数据 mui.each是异步的*/
253 257
    mui.each(datalist, function(index, item) {

+ 10 - 1
app/js/consultapply.js

@ -195,7 +195,7 @@
195 195
		
196 196
		/*专家的历史和评价*/
197 197
		ofinished.addEventListener('tap', function() {
198
			mui.openWindow({
198
			/*mui.openWindow({
199 199
				url: '../html/coophistory-other.html',
200 200
				id: 'html/coophistory-other.html',
201 201
				show: {
@ -204,6 +204,15 @@
204 204
				extras: {
205 205
					professorId: proId
206 206
				}
207
			});*/
208
			mui.openWindow({
209
				url: '../html/coophistory.html',
210
				id: 'html/coophistory.html',
211
				show: {
212
					autoShow: false,
213
					aniShow: "slide-in-left"
214
				},
215
207 216
			});
208 217
		});
209 218
   	});