浏览代码

支持换行存储

luyanan 7 年之前
父节点
当前提交
6b1f996b97
共有 8 个文件被更改,包括 118 次插入128 次删除
  1. 1 1
      app/js/discoverNew.js
  2. 1 1
      app/js/needShow.js
  3. 1 1
      app/js/paperShow.js
  4. 1 1
      app/js/patentShow.js
  5. 107 2
      app/js/qa-answer-show.js
  6. 2 2
      app/js/qa-going-q-03.js
  7. 1 1
      app/js/qa-my-wendaTT.js
  8. 4 119
      app/js/qa-question-show.js

+ 1 - 1
app/js/discoverNew.js

@ -714,7 +714,7 @@
714 714
							liStr.innerHTML = '<div class="madiaInfo">' +
715 715
								'<p class="h1Font mui-ellipsis-2 qa-question"></p>'+
716 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 718
								'<div class="showli mui-ellipsis">' +
719 719
								'<span>' + commenTime($data[i].createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' +
720 720
								'</div>' +

+ 1 - 1
app/js/needShow.js

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

+ 1 - 1
app/js/paperShow.js

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

+ 1 - 1
app/js/patentShow.js

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

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

@ -34,7 +34,7 @@ mui.ready(function() {
34 34
					document.getElementById("answerTime").innerHTML = commenTime($da.createTime);
35 35
					document.getElementById("snum").innerHTML = $da.agree;
36 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 39
					if(userid != $da.uid) {
40 40
						oattenSpan.style.display="block";
@ -110,7 +110,7 @@ mui.ready(function() {
110 110
						flag:flag,
111 111
						name: "answer",
112 112
						data: {
113
							content: document.getElementById("answerCnt").innerHTML.substring(0, 40),
113
							content: document.getElementById("answerCnt").innerHTML.substring(0, 70),
114 114
							title: document.getElementById("questTit").innerHTML,
115 115
							href: baseUrl + "/e/da.html?id=" + answerId,
116 116
							thumbs: [oUrl]
@ -221,6 +221,111 @@ mui.ready(function() {
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,7 +4,7 @@ mui.ready(function() {
4 4
		var title = plus.webview.getWebviewById("qa-going-q-02.html").title;
5 5
		var ws = plus.webview.currentWebview();
6 6
		var cnt = ws.cnt;
7
		var img = ws.img;	
7
			img = ws.img;	
8 8
			plus.nativeUI.closeWaiting();
9 9
			ws.show("slide-in-right", 150);
10 10
		//查询学术领域
@ -79,7 +79,7 @@ mui.ready(function() {
79 79
				return;
80 80
			}
81 81
			console.log(subjectAll);
82
			console.log(img);
82
			console.log(cnt+"++++++"+img);
83 83
			mui.ajax(baseUrl + '/ajax/question', {
84 84
				data: {
85 85
					"title": title,

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

@ -272,7 +272,7 @@ mui.ready(function () {
272 272
                liStr.innerHTML = '<div class="madiaInfo">' +
273 273
                    '<p class="h1Font mui-ellipsis-2 qa-question"></p>' +
274 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 276
                    '<div class="showli mui-ellipsis">' +
277 277
                    '<span>' + commenTime(dataStr.createTime) + '</span>' + hd +'<span class="leaveMsgCount"></span>'+
278 278
                    '</div>' +

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

@ -79,7 +79,7 @@ mui.ready(function() {
79 79
					document.getElementById("questionTime").innerHTML = commenTime($da.createTime);
80 80
					document.getElementById("replyCount").innerHTML = $da.replyCount;
81 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 84
					if($da.keys != undefined && $da.keys.length != 0) {
85 85
						var subs = new Array();
@ -224,7 +224,7 @@ mui.ready(function() {
224 224
				liStr.className = "mui-table-view-cell";
225 225
				liStr.innerHTML = '<div class="madiaInfo">' +
226 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 228
					'<div class="showli mui-ellipsis">' +
229 229
					'<span>' + commenTime(dataStr.createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' +
230 230
					'</div>' +
@ -292,13 +292,13 @@ mui.ready(function() {
292 292
			},
293 293
			moreMes=function(){
294 294
				document.getElementById("BtnMore").addEventListener("tap", function() {
295
					var oUrl = baseUrl + "/images/logo180.png";
295
					var oUrl = baseUrl + "/images/logo180.png";
296 296
					plus.nativeUI.showWaiting(); //显示原生等待框
297 297
					var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
298 298
						proid: questionId,
299 299
						name: "question",
300 300
						data: {
301
							content: document.getElementById("questionCnt").innerHTML.substring(0, 40),
301
							content: document.getElementById("questionCnt").innerHTML.substring(0, 70),
302 302
							title: document.getElementById("questionTit").innerHTML,
303 303
							href: baseUrl + "/e/wen.html?id=" + questionId,
304 304
							thumbs: [oUrl]
@ -381,120 +381,5 @@ mui.ready(function() {
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
})