Browse Source

支持换行存储

luyanan 7 years ago
parent
commit
6b1f996b97

+ 1 - 1
app/js/discoverNew.js

714
							liStr.innerHTML = '<div class="madiaInfo">' +
714
							liStr.innerHTML = '<div class="madiaInfo">' +
715
								'<p class="h1Font mui-ellipsis-2 qa-question"></p>'+
715
								'<p class="h1Font mui-ellipsis-2 qa-question"></p>'+
716
								'<div class="flexCenter qa-owner"></div>' +
716
								'<div class="flexCenter qa-owner"></div>' +
717
								'<p class="qa-con mui-ellipsis-5">' + $data[i].cnt + '</p>' +
717
								'<p class="qa-con mui-ellipsis-5">' + ($data[i].cnt).replace(/\n/g,"<br />") + '</p>' +
718
								'<div class="showli mui-ellipsis">' +
718
								'<div class="showli mui-ellipsis">' +
719
								'<span>' + commenTime($data[i].createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' +
719
								'<span>' + commenTime($data[i].createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' +
720
								'</div>' +
720
								'</div>' +

+ 1 - 1
app/js/needShow.js

382
					proid: demandId,
382
					proid: demandId,
383
					name: "demand",
383
					name: "demand",
384
					data: {
384
					data: {
385
						content: document.getElementById("demandDesp").innerHTML.substring(0, 40),
385
						content: document.getElementById("demandDesp").innerHTML.substring(0, 70),
386
						title: document.getElementById("demandTit").innerHTML,
386
						title: document.getElementById("demandTit").innerHTML,
387
						href: baseUrl + "/e/d.html?id=" + demandId,
387
						href: baseUrl + "/e/d.html?id=" + demandId,
388
						thumbs: [oUrl]
388
						thumbs: [oUrl]

+ 1 - 1
app/js/paperShow.js

589
				proid: paperId,
589
				proid: paperId,
590
				name: "paper",
590
				name: "paper",
591
				data: {
591
				data: {
592
					content: document.getElementById("paperAbstract").innerHTML.substring(0, 40),
592
					content: document.getElementById("paperAbstract").innerHTML.substring(0, 70),
593
					title: document.getElementById("paperName").innerHTML,
593
					title: document.getElementById("paperName").innerHTML,
594
					href: baseUrl + "/e/l.html?id=" + paperId,
594
					href: baseUrl + "/e/l.html?id=" + paperId,
595
					thumbs: [oUrl]
595
					thumbs: [oUrl]

+ 1 - 1
app/js/patentShow.js

581
			proid: patentId,
581
			proid: patentId,
582
			name:"patent",
582
			name:"patent",
583
			data:{
583
			data:{
584
					content: document.getElementById("patentAbstract").innerHTML.substring(0,40),
584
					content: document.getElementById("patentAbstract").innerHTML.substring(0,70),
585
					title: document.getElementById("patentName").innerHTML,
585
					title: document.getElementById("patentName").innerHTML,
586
					href: baseUrl + "/e/z.html?id=" + patentId ,
586
					href: baseUrl + "/e/z.html?id=" + patentId ,
587
					thumbs: [oUrl]
587
					thumbs: [oUrl]

+ 107 - 2
app/js/qa-answer-show.js

34
					document.getElementById("answerTime").innerHTML = commenTime($da.createTime);
34
					document.getElementById("answerTime").innerHTML = commenTime($da.createTime);
35
					document.getElementById("snum").innerHTML = $da.agree;
35
					document.getElementById("snum").innerHTML = $da.agree;
36
					if($da.cnt) {
36
					if($da.cnt) {
37
						document.getElementById("answerCnt").innerHTML = $da.cnt;
37
						document.getElementById("answerCnt").innerHTML = ($da.cnt).replace(/\n/g,"<br />");
38
					}
38
					}
39
					if(userid != $da.uid) {
39
					if(userid != $da.uid) {
40
						oattenSpan.style.display="block";
40
						oattenSpan.style.display="block";
110
						flag:flag,
110
						flag:flag,
111
						name: "answer",
111
						name: "answer",
112
						data: {
112
						data: {
113
							content: document.getElementById("answerCnt").innerHTML.substring(0, 40),
113
							content: document.getElementById("answerCnt").innerHTML.substring(0, 70),
114
							title: document.getElementById("questTit").innerHTML,
114
							title: document.getElementById("questTit").innerHTML,
115
							href: baseUrl + "/e/da.html?id=" + answerId,
115
							href: baseUrl + "/e/da.html?id=" + answerId,
116
							thumbs: [oUrl]
116
							thumbs: [oUrl]
221
			}
221
			}
222
		})
222
		})
223
		
223
		
224
		/*微信及微信朋友圈分享专家*/
225
		var auths, shares;
226
		plus.oauth.getServices(function(services) {
227
			auths = {};
228
			for(var i in services) {
229
				var t = services[i];
230
				auths[t.id] = t;
231
	
232
			}
233
		}, function(e) {
234
			alert("获取登录服务列表失败:" + e.message + " - " + e.code);
235
		});
236
		plus.share.getServices(function(services) {
237
	
238
			shares = {};
239
			for(var i in services) {
240
	
241
				var t = services[i];
242
	
243
				shares[t.id] = t;
244
	
245
			}
246
		}, function(e) {
247
			alert("获取分享服务列表失败:" + e.message + " - " + e.code);
248
		});
249
		
250
		mui("#shareBlock").on("tap", "li", function() {
251
			document.getElementById("shareBlock").style.display = "none";
252
			document.getElementById("maskBlack").style.display = "none";
253
			var oFen = this.getElementsByTagName("span")[0].innerHTML;
254
	
255
			var oUrl = baseUrl + "/images/logo180.png";
256
	
257
			if(oFen == "微信好友") {
258
				if(!weixinClient()) {
259
					return;
260
				}
261
				var share = buildShareService("weixin");
262
				if(share) {
263
					shareMessage(share, "WXSceneSession", {
264
						content: document.getElementById("answerCnt").innerHTML.substring(0, 70),
265
						title:  document.getElementById("questTit").innerHTML,
266
						href: baseUrl + "/e/da.html?id=" + answerId,
267
						thumbs: [oUrl]
268
					});
269
				}
270
			} else if(oFen == "微信朋友圈") {
271
				if(!weixinClient()) {
272
					return;
273
				}
274
				var share = buildShareService("weixin");
275
				if(share) {
276
					shareMessage(share, "WXSceneTimeline", {
277
						content: document.getElementById("answerCnt").innerHTML.substring(0, 70),
278
						title:  document.getElementById("questTit").innerHTML,
279
						href: baseUrl + "/e/da.html?id=" + answerId,
280
						thumbs: [oUrl]
281
					});
282
				}
283
			} else if(oFen == "新浪微博") {
284
				var share = buildShareService("sinaweibo");
285
				if(share) {
286
					shareMessage(share, "sinaweibo", {
287
						content:  document.getElementById("questTit").innerHTML + baseUrl + "/e/da.html?id=" + answerId,
288
					});
289
				}
290
			}
291
	
292
		})
293
	
294
		function buildShareService(ttt) {
295
			var share = shares[ttt];
296
			if(share) {
297
				if(share.authenticated) {
298
					console.log("---已授权---");
299
				} else {
300
					console.log("---未授权---");
301
					share.authorize(function() {
302
						console.log('授权成功...')
303
					}, function(e) {
304
						return null;
305
					});
306
				}
307
				return share;
308
			} else {
309
				alert("没有获取微信分享服务");
310
				return null;
311
			}
312
	
313
		}
314
	
315
		function shareMessage(share, ex, msg) {
316
			msg.extra = {
317
				scene: ex
318
			};
319
			share.send(msg, function() {
320
				plus.nativeUI.closeWaiting();
321
				plus.nativeUI.toast("成功分享需求信息", toastStyle);
322
			}, function(e) {
323
				plus.nativeUI.closeWaiting();
324
				if(e.code == -2) {
325
					
326
				}
327
			});
328
		}
224
	})
329
	})
225
330
226
});
331
});

+ 2 - 2
app/js/qa-going-q-03.js

4
		var title = plus.webview.getWebviewById("qa-going-q-02.html").title;
4
		var title = plus.webview.getWebviewById("qa-going-q-02.html").title;
5
		var ws = plus.webview.currentWebview();
5
		var ws = plus.webview.currentWebview();
6
		var cnt = ws.cnt;
6
		var cnt = ws.cnt;
7
		var img = ws.img;	
7
			img = ws.img;	
8
			plus.nativeUI.closeWaiting();
8
			plus.nativeUI.closeWaiting();
9
			ws.show("slide-in-right", 150);
9
			ws.show("slide-in-right", 150);
10
		//查询学术领域
10
		//查询学术领域
79
				return;
79
				return;
80
			}
80
			}
81
			console.log(subjectAll);
81
			console.log(subjectAll);
82
			console.log(img);
82
			console.log(cnt+"++++++"+img);
83
			mui.ajax(baseUrl + '/ajax/question', {
83
			mui.ajax(baseUrl + '/ajax/question', {
84
				data: {
84
				data: {
85
					"title": title,
85
					"title": title,

+ 1 - 1
app/js/qa-my-wendaTT.js

272
                liStr.innerHTML = '<div class="madiaInfo">' +
272
                liStr.innerHTML = '<div class="madiaInfo">' +
273
                    '<p class="h1Font mui-ellipsis-2 qa-question"></p>' +
273
                    '<p class="h1Font mui-ellipsis-2 qa-question"></p>' +
274
                    '<div class="flexCenter qa-owner"></div>' +
274
                    '<div class="flexCenter qa-owner"></div>' +
275
                    '<p class="qa-con mui-ellipsis-5">' + dataStr.cnt + '</p>' +
275
                    '<p class="qa-con mui-ellipsis-5">' + (dataStr.cnt).replace(/\n/g,"<br />") + '</p>' +
276
                    '<div class="showli mui-ellipsis">' +
276
                    '<div class="showli mui-ellipsis">' +
277
                    '<span>' + commenTime(dataStr.createTime) + '</span>' + hd +'<span class="leaveMsgCount"></span>'+
277
                    '<span>' + commenTime(dataStr.createTime) + '</span>' + hd +'<span class="leaveMsgCount"></span>'+
278
                    '</div>' +
278
                    '</div>' +

+ 4 - 119
app/js/qa-question-show.js

79
					document.getElementById("questionTime").innerHTML = commenTime($da.createTime);
79
					document.getElementById("questionTime").innerHTML = commenTime($da.createTime);
80
					document.getElementById("replyCount").innerHTML = $da.replyCount;
80
					document.getElementById("replyCount").innerHTML = $da.replyCount;
81
					if($da.cnt) {
81
					if($da.cnt) {
82
						document.getElementById("questionCnt").innerHTML = $da.cnt;
82
						document.getElementById("questionCnt").innerHTML =($da.cnt).replace(/\n/g,"<br />");
83
					}
83
					}
84
					if($da.keys != undefined && $da.keys.length != 0) {
84
					if($da.keys != undefined && $da.keys.length != 0) {
85
						var subs = new Array();
85
						var subs = new Array();
224
				liStr.className = "mui-table-view-cell";
224
				liStr.className = "mui-table-view-cell";
225
				liStr.innerHTML = '<div class="madiaInfo">' +
225
				liStr.innerHTML = '<div class="madiaInfo">' +
226
					'<div class="flexCenter qa-owner"></div>' +
226
					'<div class="flexCenter qa-owner"></div>' +
227
					'<p class="qa-con mui-ellipsis-5">' + dataStr.cnt + '</p>' +
227
					'<p class="qa-con mui-ellipsis-5">' + (dataStr.cnt).replace(/\n/g,"<br />") + '</p>' +
228
					'<div class="showli mui-ellipsis">' +
228
					'<div class="showli mui-ellipsis">' +
229
					'<span>' + commenTime(dataStr.createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' +
229
					'<span>' + commenTime(dataStr.createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' +
230
					'</div>' +
230
					'</div>' +
292
			},
292
			},
293
			moreMes=function(){
293
			moreMes=function(){
294
				document.getElementById("BtnMore").addEventListener("tap", function() {
294
				document.getElementById("BtnMore").addEventListener("tap", function() {
295
					var oUrl = baseUrl + "/images/logo180.png";
295
					var oUrl = baseUrl + "/images/logo180.png";
296
					plus.nativeUI.showWaiting(); //显示原生等待框
296
					plus.nativeUI.showWaiting(); //显示原生等待框
297
					var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
297
					var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
298
						proid: questionId,
298
						proid: questionId,
299
						name: "question",
299
						name: "question",
300
						data: {
300
						data: {
301
							content: document.getElementById("questionCnt").innerHTML.substring(0, 40),
301
							content: document.getElementById("questionCnt").innerHTML.substring(0, 70),
302
							title: document.getElementById("questionTit").innerHTML,
302
							title: document.getElementById("questionTit").innerHTML,
303
							href: baseUrl + "/e/wen.html?id=" + questionId,
303
							href: baseUrl + "/e/wen.html?id=" + questionId,
304
							thumbs: [oUrl]
304
							thumbs: [oUrl]
381
			});
381
			});
382
		})
382
		})
383
383
384
		/*微信及微信朋友圈分享专家*/
385
			var auths, shares;
386
			plus.oauth.getServices(function(services) {
387
				auths = {};
388
				for(var i in services) {
389
					var t = services[i];
390
					auths[t.id] = t;
391
		
392
				}
393
			}, function(e) {
394
				alert("获取登录服务列表失败:" + e.message + " - " + e.code);
395
			});
396
			plus.share.getServices(function(services) {
397
		
398
				shares = {};
399
				for(var i in services) {
400
		
401
					var t = services[i];
402
		
403
					shares[t.id] = t;
404
		
405
				}
406
			}, function(e) {
407
				alert("获取分享服务列表失败:" + e.message + " - " + e.code);
408
			});
409
			mui("#shareBlock").on("tap", "li", function() {
410
				document.getElementById("shareBlock").style.display = "none";
411
				document.getElementById("maskBlack").style.display = "none";
412
				var oFen = this.getElementsByTagName("span")[0].innerHTML;
413
		
414
				var oUrl = baseUrl + "/images/logo180.png";
415
		
416
				if(oFen == "微信好友") {
417
					if(!weixinClient()) {
418
							return;
419
						}
420
					var share = buildShareService("weixin");
421
					if(share) {
422
						shareMessage(share, "WXSceneSession", {
423
							content: document.getElementById("questionCnt").innerHTML.substring(0, 70),
424
							title: document.getElementById("questionTit").innerHTML,
425
							href: baseUrl + "/e/wen.html?id=" + questionId,
426
							thumbs: [oUrl]
427
						});
428
					}
429
				} else if(oFen == "微信朋友圈") {
430
					if(!weixinClient()) {
431
							return;
432
						}
433
					var share = buildShareService("weixin");
434
					if(share) {
435
						shareMessage(share, "WXSceneTimeline", {
436
							content: document.getElementById("questionCnt").innerHTML.substring(0, 70),
437
							title: document.getElementById("questionTit").innerHTML,
438
							href: baseUrl + "/e/wen.html?id=" + questionId,
439
							thumbs: [oUrl]
440
						});
441
					}
442
				} else if(oFen == "新浪微博") {
443
					var share = buildShareService("sinaweibo");
444
					if(share) {
445
						shareMessage(share, "sinaweibo", {
446
							content: document.getElementById("questionTit").innerHTML + baseUrl + "/e/wen.html?id=" + questionId,
447
						});
448
					}
449
				}
450
		
451
			})
452
		
453
			function buildShareService(ttt) {
454
				var share = shares[ttt];
455
				if(share) {
456
					if(share.authenticated) {
457
						console.log("---已授权---");
458
					} else {
459
						console.log("---未授权---");
460
						share.authorize(function() {
461
							console.log('授权成功...')
462
						}, function(e) {
463
							//alert("认证授权失败:" + e.code + " - " + e.message);
464
							return null;
465
						});
466
					}
467
					return share;
468
				} else {
469
					alert("没有获取微信分享服务");
470
					return null;
471
				}
472
		
473
			}
474
		
475
			function shareMessage(share, ex, msg) {
476
				msg.extra = {
477
					scene: ex
478
				};
479
				share.send(msg, function() {
480
					plus.nativeUI.closeWaiting();
481
					if(plus.storage.getItem('userid')) {
482
						//shareAddIntegral(2);
483
						if(msg.content=="赶快认领,上千家企业正在期待与您合作") {
484
							shareAddIntegral(1);
485
						}else{
486
							shareAddIntegral(6);
487
						}
488
					}
489
				}, function(e) {
490
					plus.nativeUI.closeWaiting();
491
					if(e.code == -2) {
492
						
493
					}
494
				});
495
			}
496
		
497
498
499
	})
384
	})
500
})
385
})