luyanan 7 years ago
parent
commit
789d37a27e

+ 8 - 7
app/css/app.css

@ -1245,17 +1245,18 @@ ul.tagList>li .h2Font{color: #666; -webkit-user-select:text;}
1245 1245
.list-hold-count>ul>li.active>span{background: #ff9900;color:#fff;border-color: #ff9900}
1246 1246
.list-hold .qa-owner{margin: 0;}
1247 1247
.item_detail .h1Font{font-weight:normal;font-size:18px;line-height:24px;color:#000}
1248
.item_detail .list_con{font-size: 15px;color: #333;line-height: 24px;margin: 6px 0;}
1249
.list_image ul li,.item-btn ul li{display: inline-block; overflow: hidden; width: 33.3%; -webkit-box-sizing: border-box;box-sizing: border-box;position: relative;}
1250
.list_image ul li>.imgspan{display: block;width: 98%;height:90px;background-size: cover;background-position: center;}
1248
.item_detail .list_con{font-size: 15px;color: #333;line-height: 24px;margin: 6px 0;text-align:justify}
1249
.list_image,.item-btn{overflow: hidden;}
1250
.list_image li,.item-btn li{display: inline-block; overflow: hidden; width: 33.3%; -webkit-box-sizing: border-box;box-sizing: border-box;position: relative;}
1251
.list_image li>.imgspan{display: block;width: 98%;height:90px;background-size: cover;background-position: center;}
1251 1252
@media only screen and (min-width:640px) and (max-width:980px)  {
1252
	.list_image ul li>.imgspan{height:140px;width: 96%;}
1253
	.list_image li>.imgspan{height:140px;width: 96%;}
1253 1254
}
1254 1255
@media only screen and (min-width:980px) {
1255
	.list_image ul li>.imgspan{height:200px;width: 96%;}
1256
	.list_image li>.imgspan{height:200px;width: 96%;}
1256 1257
}
1257 1258
.item-btn{margin:6px -16px -15px -15px;}
1258
.item-btn ul li{border-top:1px solid #e5e5e5;border-right:1px solid #e5e5e5}
1259
.item-btn ul li>span{display: inline-block;width: 100%;text-align: center;color:#666;font-size:14px;padding:8px 0;}
1259
.item-btn li{border-top:1px solid #e5e5e5;border-right:1px solid #e5e5e5}
1260
.item-btn li>span{display: inline-block;width: 100%;text-align: center;color:#666;font-size:14px;padding:8px 0;}
1260 1261

1261 1262


+ 3 - 7
app/html/qa-answer-q.html

@ -11,7 +11,6 @@
11 11
		<style>
12 12
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;}
13 13
			.mui-content{height:100%;overflow: auto;}
14
			#title{width:82%;border-top-right-radius: 0px;border-bottom-right-radius: 0px;}
15 14
		</style>
16 15
	</head>
17 16
@ -19,22 +18,19 @@
19 18
		<header class="mui-bar mui-bar-nav toptitbox">
20 19
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
21 20
		    <h1 class="mui-title toptit">回答:紫外可见漫反射光谱怎么表示?</h1>
22
		    <span id="submit" class="mui-pull-right topsave">发布</span>
21
		    <span class="mui-pull-right topsave">发布</span>
23 22
		</header>
24 23
		<div class="mui-content">
25 24
			<div class="littip-top">使用电脑登录科袖网 www.ekexiu.com<br />可以获得更好的回答体验</div>
26 25
			<div class="mui-input-group mainbox">
27 26
				<div class="infocon">
28
					<textarea class="textareabox simulation" id="question" maxlength="50" placeholder="请填写回答内容"></textarea>
27
					<textarea class="textareabox simulation" id="question" placeholder="请填写回答内容"></textarea>
29 28
				</div>
30 29
		    </div>
31 30
		</div>
32 31
		<script src="../js/public/mui.min.js"></script>
33
		<script src="../js/public/zepto.min.js"></script>
34
		<script src="../js/public/mui.picker.min.js"></script>
35
		<script src="../js/public/city.data.js"></script>
36 32
		<script src="../js/public/base.js"></script>
37
		<script type="text/javascript" src="../js/updateAcad.js"></script>		
33
		<script type="text/javascript" src="../js/qa-answer-q.js"></script>		
38 34
		<script type="text/javascript"> 
39 35
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
40 36
		    iosheader();

+ 1 - 1
app/html/qa-my-wenda.html

@ -19,7 +19,7 @@
19 19
		<div class="mui-content searchTab">
20 20
			<div class="qa-count">
21 21
				<span></span>
22
				<p>回答共获得<em id="allAgreeNum"> N </em>次赞同</p>
22
				<p>回答共获得 <em id="allAgreeNum"></em> 次赞同</p>
23 23
			</div>
24 24
			<div id="slider" class="mui-slider mui-fullscreen" style="top:98px;">
25 25
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">

+ 17 - 55
app/html/qa-question-show.html

@ -20,72 +20,34 @@
20 20
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21 21
			<div class="mui-scroll list-main">
22 22
				<section class="list_content">
23
					<ul class="tagList">
24
						<li>
25
							<span class="h2Font">金属材料工程与腐</span>
26
						</li>
27
						<li>
28
							<span class="h2Font">金属材料工程与腐蚀</span>
29
						</li>
30
						<li>
31
							<span class="h2Font">金属材</span>
32
						</li>
33
						<li>
34
							<span class="h2Font">金属材料工程与</span>
35
						</li>
36
						<li>
37
							<span class="h2Font">金属材料</span>
38
						</li>
39
					</ul>
40
					<div class="item_detail">
41
						<h3 class="h1Font">那些年农村的老牛槽,如今陈列在聊城的古城街道里,身价暴增</h3>
42
						<div class="list_con">些年农村的老牛槽,如今陈列在聊城的古城街道里些年农村的老牛槽,如今陈列在聊城的古城街道里些年农村的老牛槽,如今陈列在聊城的古城街道里</div>
43
						<div class="list_image">
44
							<ul class="mui-clearfix">
45
								<li><span class="imgspan" style="background-image: url(https://p3.pstatp.com/list/50ac0001f8c98237aa71);"></span></li>
46
								<li><span class="imgspan" style="background-image: url(https://p3.pstatp.com/list/50ac0001f8c98237aa71);"></span></li>
47
								<li><span class="imgspan" style="background-image: url(https://p3.pstatp.com/list/50ac0001f8c98237aa71);"></span></li>
48
							</ul>
49
						</div>
23
					<ul class="tagList"></ul>
24
					<div class="item_detail" id="questionId">
25
						<h3 class="h1Font" id="questionTit"></h3>
26
						<div class="list_con" id="questionCnt"></div>
27
						<ul class="list_image">
28
							<li><span class="imgspan" style="background-image: url(https://p3.pstatp.com/list/50ac0001f8c98237aa71);"></span></li>
29
							<li><span class="imgspan" style="background-image: url(https://p3.pstatp.com/list/50ac0001f8c98237aa71);"></span></li>
30
							<li><span class="imgspan" style="background-image: url(https://p3.pstatp.com/list/50ac0001f8c98237aa71);"></span></li>
31
						</ul>
50 32
						<div class="item_info">
51
							<span class="time h3Font">发布于5月8日 18:00</span>
52
						</div>
53
						<div class="item-btn">
54
							<ul class="mui-clearfix">
55
								<li><span>回答</span></li>
56
								<li><span>邀请回答</span></li>
57
								<li><span>关注</span></li>
58
							</ul>
33
							<span class="time h3Font" id="questionTime"></span>
59 34
						</div>
35
						<ul class="item-btn">
36
							<li class="go-answer"><span>回答</span></li>
37
							<li class="invite-answer"><span>邀请回答</span></li>
38
							<li class="collectBtn"><span>关注</span></li>
39
						</ul>
60 40
					</div>
61 41
				</section>
62 42
				<section class="list-hold">
63 43
					<div class="list-hold-count">
64
						<span>全部<em> N </em>个回答</span>
44
						<span>全部 <em id="replyCount"></em> 个回答</span>
65 45
						<ul>
66 46
							<li class="active"><span>默认</span></li>
67 47
							<li><span>最新</span></li>
68 48
						</ul>
69 49
					</div>
70
					<ul class="mui-table-view myAllneeds partLine">
71
						<li class="mui-table-view-cell">
72
							<div class="madiaInfo">
73
								<div class="flexCenter qa-owner">
74
									<div class="owner-head useHead"></div>
75
									<div class="owner-info">
76
										<div class="owner-name"><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></div>
77
										<div class="owner-tit mui-ellipsis h2Font">职称/职位,所在机构职称/职位,所在机构职称/职位,所在机构</div>
78
									</div>
79
								</div>
80
								<p class="qa-con mui-ellipsis-5">我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进, 想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出产品的三维模型,用于展示以及为后续生产做准备我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进, 想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出
81
								</p>
82
								<div class="showli mui-ellipsis">
83
									<span>5月8日 18:00</span>
84
									<span>N 赞</span>
85
									<span>N 留言</span>
86
								</div>
87
							</div>
88
						</li>
50
					<ul class="mui-table-view myAllneeds partLine" id="curAnswers">
89 51
						<li class="mui-table-view-cell">
90 52
							<div class="madiaInfo">
91 53
								<div class="flexCenter qa-owner">

+ 12 - 12
app/html/qa-request-q&a.html

@ -35,24 +35,24 @@
35 35
			            </div>
36 36
			            <span class="yaoqing">邀请</span>
37 37
			        </li>
38
					<li class="mui-table-view-cell">
39
			            <div class="flexCenter flex-pright">
40
			                <div class="madiaHead useHead"></div>
41
							<div class="madiaInfo">
42
								<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
43
								<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
44
								<p class="mui-ellipsis h3Font">研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;</p>
45
							</div>
46
			            </div>
47
			            <span class="yaoqing yiyaoqing">已邀请</span>
48
			        </li>
38
					<!--<li class="mui-table-view-cell">
39
			            <div class="flexCenter flex-pright">
40
			                <div class="madiaHead useHead"></div>
41
							<div class="madiaInfo">
42
								<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
43
								<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
44
								<p class="mui-ellipsis h3Font">研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;</p>
45
							</div>
46
			            </div>
47
			            <span class="yaoqing yiyaoqing">已邀请</span>
48
			        </li>-->
49 49
				</ul>
50 50
			</div>
51 51
		</div>
52 52
53 53
		<script src="../js/public/mui.min.js"></script>
54 54
		<script src="../js/public/base.js"></script>
55
		<script src="../js/needList.js"></script>
55
		<script src="../js/qa-request-da.js"></script>
56 56
	</body>
57 57
58 58
</html>

+ 24 - 24
app/html/qa-waiting-a.html

@ -20,30 +20,30 @@
20 20
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21 21
			<div class="mui-scroll">
22 22
				<ul class="mui-table-view madiaBlock" id="questList">
23
					<li class="mui-table-view-cell">
24
						<div class="flexCenter OflexCenter mui-clearfix">
25
							<div class="madiaHead qa-Head"></div>
26
							<div class="madiaInfo OmadiaInfo">
27
								<p class="mui-ellipsis-2 h1Font">文章名称章名称文章名称</p>
28
								<p class="show-item mui-ellipsis h2Font">
29
									<span>N 回答</span>
30
									<span>N 关注</span>
31
								</p>
32
							</div>
33
						</div>
34
					</li>
35
					<li class="mui-table-view-cell">
36
						<div class="flexCenter OflexCenter mui-clearfix">
37
							<div class="madiaHead qa-Head"></div>
38
							<div class="madiaInfo OmadiaInfo">
39
								<p class="mui-ellipsis-2 h1Font">文章名称章名称文章名称</p>
40
								<p class="show-item mui-ellipsis h2Font">
41
									<span>N 回答</span>
42
									<span>N 关注</span>
43
								</p>
44
							</div>
45
						</div>
46
					</li>
23
					<!--<li class="mui-table-view-cell">
24
						<div class="flexCenter OflexCenter mui-clearfix">
25
							<div class="madiaHead qa-Head"></div>
26
							<div class="madiaInfo OmadiaInfo">
27
								<p class="mui-ellipsis-2 h1Font">文章名称章名称文章名称</p>
28
								<p class="show-item mui-ellipsis h2Font">
29
									<span>N 回答</span>
30
									<span>N 关注</span>
31
								</p>
32
							</div>
33
						</div>
34
					</li>
35
					<li class="mui-table-view-cell">
36
						<div class="flexCenter OflexCenter mui-clearfix">
37
							<div class="madiaHead qa-Head"></div>
38
							<div class="madiaInfo OmadiaInfo">
39
								<p class="mui-ellipsis-2 h1Font">文章名称章名称文章名称</p>
40
								<p class="show-item mui-ellipsis h2Font">
41
									<span>N 回答</span>
42
									<span>N 关注</span>
43
								</p>
44
							</div>
45
						</div>
46
					</li>-->
47 47
				</ul>
48 48
			</div>
49 49
		</div>

+ 1 - 6
app/js/qa-going-q-03.js

@ -91,20 +91,15 @@ mui.ready(function() {
91 91
				dataType: 'json', //数据格式类型
92 92
				async: false,
93 93
				type: 'POST', //http请求类型
94
				timeout: 10000, //超时设置
95 94
				success: function(data) {
96 95
					if(data.success) {
97 96
						//console.log(JSON.stringify(data))
98 97
						plus.nativeUI.showWaiting();
99 98
						plus.nativeUI.toast("问题发布成功", toastStyle);
100 99
						plus.webview.create("../html/qa-question-show.html", 'qa-question-show.html', {}, {
101
							qid: data.data
100
							quid: data.data
102 101
						});
103 102
					}
104
				},
105
				error: function() {
106
					plus.nativeUI.toast("服务器链接超时", toastStyle);
107
					return;
108 103
				}
109 104
			});
110 105
		});

+ 150 - 261
app/js/qa-my-wenda.js

@ -8,23 +8,21 @@ mui('.mui-scroll-wrapper').scroll({
8 8
var key1 = [],
9 9
	key2 = [1, 1, 1, 1, 1],
10 10
	ifkong=[1, 1, 1, 1, 1],
11
	rows=1,
11
	rows=2,
12 12
	pageSize=2,
13 13
	pageNo=1;
14 14
	
15 15
mui.ready(function() {
16 16
	mui.plusReady(function() {
17 17
		var userid = plus.storage.getItem('userid');
18
		var webview = plus.webview.currentWebview();
19
		var tabFlag = webview.qiFlag;
20 18
		var search = {
21 19
			oAjaxGet: function(url, obj, oType, oFun) {
20
				var urlStr = baseUrl + url;
22 21
				mui.plusReady(function() {
23
					mui.ajax(url, {
22
					mui.ajax(urlStr, {
24 23
						data: obj,
25
						dataType: 'json', //服务器返回json格式数据
26
						type: oType, //HTTP请求类型
27
						timeout: 10000, //超时时间设置为10秒;
24
						dataType: 'json',
25
						type: oType, 
28 26
						traditional: true,
29 27
						async: false,
30 28
						success: function(res) {
@ -35,135 +33,76 @@ mui.ready(function() {
35 33
						}
36 34
					});
37 35
				})
38

39 36
			},
40
			oMyQ: function(res) {
41
				var time = "",id = "",aimId="myQ",$_index=0;
42
				if(res.data.length>0){
43
					time = res.data[res.data.length-1].createTime;
44
					id = res.data[res.data.length-1].id;
37
			dataO:{time:"",id:""},
38
			listData: [{
39
					type:1,
40
					aimid:"myQ",
41
					url:"/ajax/question/my",
42
					notip:"您还没有提过问题",
43
				},
44
				{
45
					type:2,
46
					aimid:"myA",
47
					url:"/ajax/question/answer/bySelf",
48
					notip:"您还没有回答问题",
49
				},
50
				{
51
					type:3,
52
					aimid:"watchPro",
53
					url:"/ajax/watch/qaPro",
54
					notip:"您还没有关注的人",
55
				},
56
				{
57
					type:4,
58
					aimid:"watchQ",
59
					url:"/ajax/question/watch",
60
					notip:"您还没有关注的问题",
61
				},
62
				{
63
					type:5,
64
					aimid:"watchA",
65
					url:"/ajax/question/answer/byWatch",
66
					notip:"您还没有收藏的回答",
67
				},
68
			],
69
			comPull:function(dataStr,$_index,reStr){
70
				var that=search,
71
					type=that.listData[$_index].type,
72
					url=that.listData[$_index].url,
73
					aimId=that.listData[$_index].aimid,
74
					newStr=that.listData[$_index].notip;
75
				if(dataStr.length>0){
76
					that.dataO.time = dataStr[dataStr.length-1].createTime;
77
					that.dataO.id = dataStr[dataStr.length-1].id;
45 78
					if(!ifkong[$_index]){
46
						search.removeAfter(aimId)
79
						that.removeAfter(aimId)
47 80
					}
48
					for(var i = 0; i < res.data.length; i++) {
49
						var dataStr = res.data[i]
81
					for(var i = 0; i < dataStr.length; i++) {
50 82
						var liStr = document.createElement("li");
51
						liStr.setAttribute("data-id", dataStr.id);
52 83
						document.getElementById(aimId).appendChild(liStr);
53
						search.questionModule(dataStr, liStr);
54
					}
55
				}else{
56
					if(ifkong[$_index]){
57
						var newStr="您还没有提过问题";
58
						search.insertAfter(newStr,aimId);
59
						ifkong[$_index]=0
60
					}
61
					key1[$_index].endPullUpToRefresh(true);
62
					return;
63
				}
64
				if(key2[$_index]) {
65
					plus.nativeUI.closeWaiting();
66
					plus.webview.currentWebview().show("slide-in-right", 150);
67
					//循环初始化所有下拉刷新,上拉加载。
68
					mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
69
						if(index == $_index) {
70
							key1[index] = mui(pullRefreshEl).pullToRefresh({
71
								up: {
72
									callback: function() {
73
										var self = this;
74
										setTimeout(function() {
75
											var ul = self.element.querySelector('.mui-table-view')
76
											if(index == $_index) {
77
												search.oAjaxGet(baseUrl + "/ajax/question/my", {
78
													"uid": userid,
79
													"rows":rows,
80
													"time":time,
81
													"id":id
82
												}, "get", search.oMyQ, self);
83
											}
84
										}, 1000);
85
									}
86
								}
87
							});
84
						if(type==1 || type==4){
85
							that.questionModule(dataStr[i], liStr);
86
						}else if(type==2 || type==5){
87
							that.answerModule(dataStr[i], liStr);
88
						}else if(type==3){
89
							that.proModule(dataStr[i], liStr);
88 90
						}
89
					});
90
					
91
					key1[$_index].endPullUpToRefresh(false);
92
					if(res.data.length==0){
93
						key2[$_index] = 0;
94
						key1[$_index].endPullUpToRefresh(true);
95
					}
96
				}
97
			},
98
			oMyA: function(res) {
99
				var time = "",id = "",aimId="myA",$_index=1;
100
				if(res.data.length>0){
101
					time = res.data[res.data.length-1].createTime;
102
					id = res.data[res.data.length-1].id;
103
					if(!ifkong[$_index]){
104
						search.removeAfter(aimId)
105 91
					}
106
					for(var i = 0; i < res.data.length; i++) {
107
						var dataStr = res.data[i]
108
						var liStr = document.createElement("li");
109
						liStr.setAttribute("data-id", dataStr.id);
110
						document.getElementById(aimId).appendChild(liStr);
111
						search.answerModule(dataStr, liStr);
112
					}
113
				}else{
114
					if(ifkong[$_index]){
115
						var newStr="您还没有回答问题";
116
						search.insertAfter(newStr,aimId);
117
						ifkong[$_index]=0
118
					}
119
					return;
120
				}
121
				if(key2[$_index]) {
122
					plus.nativeUI.closeWaiting();
123
					plus.webview.currentWebview().show("slide-in-right", 150);
124
					//循环初始化所有下拉刷新,上拉加载。
125
					mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
126
						if(index == $_index) {
127
							key1[index] = mui(pullRefreshEl).pullToRefresh({
128
								up: {
129
									callback: function() {
130
										var self = this;
131
										setTimeout(function() {
132
											var ul = self.element.querySelector('.mui-table-view')
133
											if(index == $_index) {
134
												search.oAjaxGet(baseUrl + "/ajax/question/answer/bySelf", {
135
													"uid": userid,
136
													"rows":rows,
137
													"time":time,
138
													"id":id
139
												}, "get", search.oMyA, self);
140
											}
141
										}, 1000);
142
									}
143
								}
144
							});
92
					if(type==3){
93
						if(pageNo < Math.ceil(reStr.total / reStr.pageSize)) {
94
							key1[$_index].endPullUpToRefresh(false);
95
						} else {
96
							key1[$_index].endPullUpToRefresh(true);
97
						}
98
					}else{
99
						if(dataStr.length<rows){
100
							key1[$_index].endPullUpToRefresh(true);
145 101
						}
146
					});
147
					key2[$_index] = 0;
148
				}
149
			},
150
			oWatchPro:function(res){
151
				var aimId="watchPro",$_index=2;
152
				if(res.data.data.length>0){
153
					if(!ifkong[$_index]){
154
						search.removeAfter(aimId)
155
					}
156
					for(var i = 0; i < res.data.data.length; i++) {
157
						var dataStr = res.data.data[i]
158
						var liStr = document.createElement("li");
159
						liStr.setAttribute("data-id", dataStr.id);
160
						document.getElementById(aimId).appendChild(liStr);
161
						search.proModule(dataStr, liStr);
162 102
					}
163 103
				}else{
164 104
					if(ifkong[$_index]){
165
						var newStr="您还没有关注的人";
166
						search.insertAfter(newStr,aimId);
105
						that.insertAfter(newStr,aimId);
167 106
						ifkong[$_index]=0
168 107
					}
169 108
					key1[$_index].endPullUpToRefresh(true);
@ -172,142 +111,73 @@ mui.ready(function() {
172 111
				if(key2[$_index]) {
173 112
					plus.nativeUI.closeWaiting();
174 113
					plus.webview.currentWebview().show("slide-in-right", 150);
175
					//循环初始化所有下拉刷新,上拉加载。
176
					mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
177
						if(index == $_index) {
178
							key1[index] = mui(pullRefreshEl).pullToRefresh({
179
								up: {
180
									callback: function() {
181
										var self = this;
182
										setTimeout(function() {
183
											var ul = self.element.querySelector('.mui-table-view')
184
											alert(pageNo+"88888888888")
185
											if(index == $_index) {
186
												search.oAjaxGet(baseUrl + "/ajax/watch/qaPro", {
187
													"professorId": userid,
188
													"watchType":1,
189
													"pageSize":pageSize,
190
													"pageNo":++pageNo
191
												}, "get", search.oWatchPro,self);
192
											}
193
										}, 1000);
114
					mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function($_index, pullRefreshEl) {
115
						key1[$_index] =mui(pullRefreshEl).pullToRefresh({
116
							up: {
117
								callback: function() {
118
									var self = this;
119
									setTimeout(function() {
120
										var ul = self.element.querySelector('.mui-table-view');
194 121
										
195
									}
122
										if(type==3){
123
											alert(222)
124
											console.log(pageNo)
125
											var rs={
126
												"professorId": userid,
127
												"watchType":1,
128
												"pageSize":pageSize,
129
												"pageNo":++pageNo
130
											};
131
											search.oAjaxGet(url, rs, "get",that.oWatchPro,self);
132
										}else{
133
											alert(888)
134
											var rs={
135
												"uid": userid,
136
												"rows":rows,
137
												"time":that.dataO.time,
138
												"id":that.dataO.id
139
											};
140
											
141
											if(type==1){
142
												search.oAjaxGet(url, rs, "get",that.oMyQ,self);
143
											}else if(type==2){
144
												search.oAjaxGet(url, rs, "get",that.oMyA,self);
145
											}else if(type==4){
146
												search.oAjaxGet(url, rs, "get",that.oWatchQ,self);
147
											}else if(type==5){
148
												search.oAjaxGet(url, rs, "get",that.oWatchA,self);
149
											}
150
										}
151
										self.endPullUpToRefresh();
152
									}, 1000);
196 153
								}
197
							});
198
						}
154
							}
155
						});
199 156
					});
200
					key2[$_index] = 0;
201
				}
202
				if(pageNo < Math.ceil(res.data.total / res.data.pageSize)) {
203 157
					key1[$_index].endPullUpToRefresh(false);
204
				} else {
205
					key1[$_index].endPullUpToRefresh(true);
158
					key2[$_index] = 0;
206 159
				}
160
				
161
			},
162
			oMyQ: function(res) {
163
				var that=search,$_index=0;
164
				that.comPull(res.data,$_index);
165
			},
166
			oMyA: function(res) {
167
				var that=search,$_index=1;
168
				that.comPull(res.data,$_index);
169
			},
170
			oWatchPro: function(res) {
171
				var that=search,$_index=2;
172
				that.comPull(res.data.data,$_index,res.data);
207 173
			},
208 174
			oWatchQ: function(res) {
209
				var time = "",id = "",aimId="watchQ",$_index=3;
210
				if(res.data.length>0){
211
					time = res.data[res.data.length-1].createTime;
212
					id = res.data[res.data.length-1].id;
213
					if(!ifkong[$_index]){
214
						search.removeAfter(aimId)
215
					}
216
					for(var i = 0; i < res.data.length; i++) {
217
						var dataStr = res.data[i]
218
						var liStr = document.createElement("li");
219
						liStr.setAttribute("data-id", dataStr.id);
220
						document.getElementById(aimId).appendChild(liStr);
221
						search.questionModule(dataStr, liStr)
222
					}
223
				}else{
224
					if(ifkong[$_index]){
225
						var newStr="您还没有关注的问题";
226
						search.insertAfter(newStr,aimId);
227
						ifkong[$_index]=0
228
					}
229
					return;
230
				}
231
				if(key2[$_index]) {
232
					plus.nativeUI.closeWaiting();
233
					plus.webview.currentWebview().show("slide-in-right", 150);
234
					//循环初始化所有下拉刷新,上拉加载。
235
					mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
236
						if(index == $_index) {
237
							key1[index] = mui(pullRefreshEl).pullToRefresh({
238
								up: {
239
									callback: function() {
240
										var self = this;
241
										setTimeout(function() {
242
											var ul = self.element.querySelector('.mui-table-view')
243
											if(index == $_index) {
244
												search.oAjaxGet(baseUrl + "/ajax/question/watch", {
245
													"uid": userid,
246
													"rows":rows,
247
													"time":time,
248
													"id":id
249
												}, "get", search.oWatchQ, self);
250
											}
251
										}, 1000);
252
									}
253
								}
254
							});
255
						}
256
					});
257
					key2[$_index] = 0;
258
				}
175
				var that=search,$_index=3;
176
				that.comPull(res.data,$_index);
259 177
			},
260 178
			oWatchA: function(res) {
261
				var time = "",id = "",aimId="watchA",$_index=4;
262
				if(res.data.length>0){
263
					time = res.data[res.data.length-1].createTime;
264
					id = res.data[res.data.length-1].id;
265
					if(!ifkong[$_index]){
266
						search.removeAfter(aimId)
267
					}
268
					for(var i = 0; i < res.data.length; i++) {
269
						var dataStr = res.data[i]
270
						var liStr = document.createElement("li");
271
						liStr.setAttribute("data-id", dataStr.id);
272
						document.getElementById(aimId).appendChild(liStr);
273
						search.answerModule(dataStr, liStr);
274
					}
275
				}else{
276
					if(ifkong[$_index]){
277
						var newStr="您还没有收藏的回答";
278
						search.insertAfter(newStr,aimId);
279
						ifkong[$_index]=0
280
					}
281
					return;
282
				}
283
				if(key2[$_index]) {
284
					plus.nativeUI.closeWaiting();
285
					plus.webview.currentWebview().show("slide-in-right", 150);
286
					//循环初始化所有下拉刷新,上拉加载。
287
					mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
288
						if(index == $_index) {
289
							key1[index] = mui(pullRefreshEl).pullToRefresh({
290
								up: {
291
									callback: function() {
292
										var self = this;
293
										setTimeout(function() {
294
											var ul = self.element.querySelector('.mui-table-view')
295
											if(index == $_index) {
296
												search.oAjaxGet(baseUrl + "/ajax/question/answer/byWatch", {
297
													"uid": userid,
298
													"rows":rows,
299
													"time":time,
300
													"id":id
301
												}, "get", search.oWatchA, self);
302
											}
303
										}, 1000);
304
									}
305
								}
306
							});
307
						}
308
					});
309
					key2[$_index] = 0;
310
				}
179
				var that=search,$_index=4;
180
				that.comPull(res.data,$_index);
311 181
			},
312 182
			proModule:function(dataStr, liStr){
313 183
				var dataStr=dataStr.professor
@ -349,7 +219,7 @@ mui.ready(function() {
349 219
					liStr.className = "mui-table-view-cell flexCenter";
350 220
					liStr.innerHTML = ' <div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
351 221
						'<div class="madiaInfo">' +
352
						'<p><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>' +
222
						'<p><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + '" title="' + userType.title + '"></em></p>' +
353 223
						'<p class="mui-ellipsis h2Font">' + os + '</p>' +
354 224
						'<p class="mui-ellipsis h2Font">' + oSub + '</p>' +
355 225
						'</div>'
@ -363,6 +233,7 @@ mui.ready(function() {
363 233
				if(dataStr.replyCount > 0) {
364 234
					hd = '<span>' + dataStr.replyCount + ' 回答</span>'
365 235
				}
236
				liStr.setAttribute("data-id", dataStr.id);
366 237
				liStr.className = "mui-table-view-cell";
367 238
				liStr.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
368 239
					'<div class="madiaHead qa-Head" style="background-image:url(' + baImg + ')"></div>' +
@ -402,6 +273,7 @@ mui.ready(function() {
402 273
				if(dataStr.replyCount > 0) {
403 274
					hd = '<span>' + dataStr.replyCount + ' 回答</span>'
404 275
				}
276
				liStr.setAttribute("data-id", dataStr.id);
405 277
				liStr.className = "mui-table-view-cell";
406 278
				liStr.innerHTML = '<div class="madiaInfo">'+
407 279
										'<p class="h1Font mui-ellipsis-2">'+dataStr.title+'</p>'+
@ -442,20 +314,20 @@ mui.ready(function() {
442 314
			slideFun:function($type){
443 315
				if($type == "1") {
444 316
					document.getElementById("myQ").innerHTML="";
445
					search.oAjaxGet(baseUrl + "/ajax/question/my", {
317
					search.oAjaxGet("/ajax/question/my", {
446 318
						"uid": userid,
447 319
						"rows":rows,
448 320
					}, "get", search.oMyQ);
449 321
				} else if($type == "2") {
450 322
					document.getElementById("myA").innerHTML="";
451
					search.oAjaxGet(baseUrl + "/ajax/question/answer/bySelf", {
323
					search.oAjaxGet("/ajax/question/answer/bySelf", {
452 324
						"uid": userid,
453 325
						"rows":rows,
454 326
					}, "get", search.oMyA);
455 327
				} else if($type == "3") {
456 328
					document.getElementById("watchPro").innerHTML="";
457 329
					pageNo=1
458
					search.oAjaxGet(baseUrl + "/ajax/watch/qaPro", {
330
					search.oAjaxGet("/ajax/watch/qaPro", {
459 331
						"professorId": userid,
460 332
						"watchType":1,
461 333
						"pageSize":pageSize,
@ -463,25 +335,41 @@ mui.ready(function() {
463 335
					}, "get", search.oWatchPro);
464 336
				} else if($type == "4") {
465 337
					document.getElementById("watchQ").innerHTML="";
466
					search.oAjaxGet(baseUrl + "/ajax/question/watch", {
338
					search.oAjaxGet("/ajax/question/watch", {
467 339
						"uid": userid,
468 340
						"rows":rows,
469 341
					}, "get", search.oWatchQ);
470 342
				} else if($type == "5") {
471 343
					document.getElementById("watchA").innerHTML="";
472
					search.oAjaxGet(baseUrl + "/ajax/question/answer/byWatch", {
344
					search.oAjaxGet("/ajax/question/answer/byWatch", {
473 345
						"uid": userid,
474 346
						"rows":rows,
475 347
					}, "get", search.oWatchA);
476 348
				}
477 349
			},
350
			allAgreeNum:function(){
351
				mui.ajax(baseUrl+"/ajax/question/answer/my/agree/count",{
352
					data: {"id":userid },
353
					dataType: 'json',
354
					type: "get",
355
					success: function(res) {
356
						if(res.success) {
357
							document.getElementById("allAgreeNum").innerHTML=res.data
358
						}
359
					}
360
				})
361
				
362
			},
363
		
478 364
		}
479 365
		
480
		search.oAjaxGet(baseUrl + "/ajax/question/my", {
366
		search.allAgreeNum();//总赞同数
367
		search.oAjaxGet("/ajax/question/my", {
481 368
			"uid": userid,
482 369
			"rows":rows,
483 370
		}, "get", search.oMyQ);
484 371
		
372
		
485 373
		//左滑及右滑
486 374
		document.querySelector('#slider').addEventListener('slide', function(event) {
487 375
			var $this = document.querySelector(".mui-scroll .mui-active");
@ -498,16 +386,17 @@ mui.ready(function() {
498 386
		
499 387
		mui("#myQ,#watchQ").on("tap", "li", function() {
500 388
			var id = this.getAttribute("data-id");
389
			console.log(JSON.stringify(id))
501 390
			plus.nativeUI.showWaiting();
502 391
			plus.webview.create("../html/qa-question-show.html", 'qa-question-show.html', {}, {
503
				"id": id
392
				"quid": id
504 393
			});
505 394
		})
506 395
		mui("#myA,#watchA").on("tap", "li", function() {
507 396
			var id = this.getAttribute("data-id");
508 397
			plus.nativeUI.showWaiting();
509 398
			plus.webview.create("../html/qa-answer-show.html", 'qa-answer-show.html', {}, {
510
				"id": id
399
				"anid": id
511 400
			});
512 401
		})
513 402
		mui("#watchPro").on("tap", "li", function() {

+ 253 - 596
app/js/qa-question-show.js

@ -1,88 +1,108 @@
1
var ocollectBtn = document.getElementById("collectBtn"); //收藏按钮
2
var paperId;
1
mui.init({
2
	pullRefresh: {
3
		container: '#pullrefresh',
4
		up: {
5
			height: 50,
6
			contentrefresh: '正在加载...',
7
			callback: pullupRefresh
8
		},
9
		down: {
10
			auto:true,
11
			callback: pulldownRefresh
12
		}
13
	}
14
});
15
var Num=1;
16
function pulldownRefresh() {
17
	setTimeout(function() {
18
//		demandOnePase();
19
		mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
20
	}, 1500);
21
}
22
function pullupRefresh() {
23
	setTimeout(function() {
24
//		Num = ++Num;
25
//		myDemandList(10,Num);
26
		mui('#pullrefresh').pullRefresh().endPullupToRefresh();
27
	}, 1500);
28
29
}
30
31
32
33
var ocollectBtn = document.getElementsByClassName("collectBtn")[0],
34
    oanswer = document.getElementsByClassName("go-answer")[0],
35
    yaoanswer = document.getElementsByClassName("invite-answer")[0];
3 36
mui.plusReady(function() {
4 37
	var userid = plus.storage.getItem('userid');
5
	console.log(userid)
6 38
	var self = plus.webview.currentWebview();
7
	var userName = plus.storage.getItem('name');
8
	paperId = self.paperId;
9
	//paperId="FF6EFFA4D7474CC7B808D9BC08E88E79";
10
	getRecourceMe(); /*获取资源信息*/
11
12
	//点击收藏按钮
13
	var oifCollect=document.getElementById("ifCollect")
14
	ifcollectionAbout(paperId,oifCollect, 5);
15
	ocollectBtn.addEventListener('tap', function() {
16
		if(userid && userid != null && userid != "null") {
17
			if(oifCollect.className == 'mui-icon iconfontnew icon-yishoucang') {
18
				cancelCollectionAbout(paperId,oifCollect, 5)
19
			} else {
20
				collectionAbout(paperId,oifCollect, 5);
21
			}
22
		} else {
23
			isLogin();
24
		}
25
	});
39
	var questionId=self.quid;
40
	plus.nativeUI.closeWaiting();
41
	plus.webview.currentWebview().show("slide-in-right", 150);
42
	getConmain();
43
	console.log(JSON.stringify(questionId))
26 44
45
	//关注按钮
46
//	var oifCollect=document.getElementById("ifCollect")
47
//	ifcollectionAbout(questionId,oifCollect, 5);
48
//	ocollectBtn.addEventListener('tap', function() {
49
//		if(userid && userid != null && userid != "null") {
50
//			if(oifCollect.className == 'mui-icon iconfontnew icon-yishoucang') {
51
//				cancelCollectionAbout(questionId,oifCollect, 5)
52
//			} else {
53
//				collectionAbout(questionId,oifCollect, 5);
54
//			}
55
//		} else {
56
//			isLogin();
57
//		}
58
//	});
27 59
	
60
	oanswer.addEventListener('tap', function() {
61
		var id =document.getElementById("questionId").getAttribute("data-id");
62
		plus.nativeUI.showWaiting();
63
		plus.webview.create("../html/qa-answer-q.html", 'qa-answer-q.html', {}, {
64
			"quid": id
65
		});
66
	})
67
	yaoanswer.addEventListener('tap', function() {
68
		var id =document.getElementById("questionId").getAttribute("data-id");
69
		plus.nativeUI.showWaiting();
70
		plus.webview.create("../html/qa-request-da.html", 'qa-request-da.html', {}, {
71
			"quid": id
72
		});
73
	})
28 74
29
	function getRecourceMe() {
30
		mui.plusReady(function() {
31
			mui.ajax(baseUrl + '/ajax/ppaper/qo', {
32
				data: {
33
					"id": paperId
34
				},
35
				dataType: 'json', //服务器返回json格式数据
36
				type: 'get', //HTTP请求类型
37
				timeout: 10000, //超时时间设置为10秒;
38
				success: function(data) {
39
					if(data.success) {
40
						console.log(JSON.stringify(data))
41
						paperHtml(data.data);
42
						getPaperAuthors(data.data.id)
43
44
						plus.nativeUI.closeWaiting();
45
						plus.webview.currentWebview().show("slide-in-right", 150);
46
					}
47
				},
48
				error: function(xhr, type, errorThrown) {
49
					plus.nativeUI.toast("服务器链接超时", toastStyle);
75
	function getConmain() {
76
		mui.ajax(baseUrl + '/ajax/question/qo', {
77
			data: {
78
				"id": questionId
79
			},
80
			dataType: 'json',
81
			type: 'get', 
82
			success: function(data) {
83
				if(data.success) {
84
					console.log(JSON.stringify(data))
85
					conHtml(data.data);
50 86
				}
51
			});
52
		})
87
			}
88
		});
53 89
	}
54
55
	function paperHtml($da) {
56
		document.getElementById("paperTit").innerHTML = $da.name;
57
		document.getElementById("paperName").innerHTML = $da.name; //名字
58
		document.getElementById("paperAbstract").innerHTML = $da.summary; //摘要内容
59
		if(!$da.cn4periodical) {
60
			$da.cn4periodical = ""
61
		}
62
		if(!$da.en4periodical) {
63
			$da.en4periodical = ""
64
		}
65
		if(!$da.cn4periodical && !$da.en4periodical) {
66
			document.getElementById("paperJournal").parentNode.parentNode.style.display = "none";
67
		} else {
68
			document.getElementById("paperJournal").innerHTML = $da.cn4periodical + " " + $da.en4periodical;
69
		}
70
71
		if(!$da.pubDay) {
72
			document.getElementById("paperVolume").parentNode.parentNode.style.display = "none";
73
		} else {
74
			document.getElementById("paperVolume").innerHTML = $da.pubDay;
75
		}
76
		if($da.keywords != undefined && $da.keywords.length != 0) {
90
	function conHtml($da) {
91
		document.getElementById("questionId").setAttribute("data-id",$da.id);
92
		document.getElementById("questionTit").innerHTML = $da.title;
93
		document.getElementById("questionCnt").innerHTML = $da.cnt;
94
		document.getElementById("questionTime").innerHTML = commenTime($da.createTime);
95
		document.getElementById("replyCount").innerHTML = $da.replyCount;
96
		
97
		if($da.keys != undefined && $da.keys.length != 0) {
77 98
			var subs = new Array();
78
			if($da.keywords.indexOf(',')) {
79
				subs = $da.keywords.split(',');
99
			if($da.keys.indexOf(',')) {
100
				subs = $da.keys.split(',');
80 101
			} else {
81
				subs[0] = $da.keywords;
102
				subs[0] = $da.keys;
82 103
			}
83 104
			var pstr = ""
84 105
			if(subs.length > 0) {
85
				patentRelatedList(subs)
86 106
				for(var i = 0; i < subs.length; i++) {
87 107
					pstr += '<li><span class="h2Font">' + subs[i] + '</span></li>'
88 108
				};
@ -92,275 +112,177 @@ mui.plusReady(function() {
92 112
			}
93 113
		}
94 114
	}
95
	
96
97
	
98
	window.addEventListener("newId", function(event) {
99
		userName = plus.storage.getItem('name');
100
		userid = plus.storage.getItem('userid');
101
		getRecourceMe();
102
		ifcollectionAbout(paperId,oifCollect, 5);
103
	});
104
105
	
106
	
107
	/*判断是否收藏资源文章或者是否关注专家*/
108
	function ifcollectionAbout1(watchObject,num) {
109
		var that=this;
110
		mui.ajax(baseUrl + '/ajax/watch/hasWatch', {
111
			data: {
112
				"professorId": userid,
113
				"watchObject": watchObject
114
			},
115
			dataType: 'json', //数据格式类型
116
			type: 'get', //http请求类型
117
			timeout: 10000,
118
			async: false,
119
			success: function(data) {
120
				if(data.success && data.data != null) {
121
					if(num=="1"){//已关注专家
122
						that.classList.add("attenedSpan");
123
						that.innerText="已关注";
124
					}else{//已收藏资源或文章
125
						document.getElementById("ifCollect").classList.remove("icon-shoucang");
126
						document.getElementById("ifCollect").classList.add("icon-yishoucang");
127
					}
128
				} else {
129
					if(num=="1"){//关注专家
130
						that.classList.remove("attenedSpan");
131
						that.innerText="关注";
132
					}else{//收藏资源或文章
133
						document.getElementById("ifCollect").classList.add("icon-shoucang");
134
						document.getElementById("ifCollect").classList.remove("icon-yishoucang");
135
					}
136
				}
137
			},
138
			error: function() {
139
				plus.nativeUI.toast("服务器链接超时", toastStyle);
140
			}
141
		});
142
	}
143
144
	var r64 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "-", "_"];
145
		var d64 = {
146
			"0": 0,
147
			"1": 1,
148
			"2": 2,
149
			"3": 3,
150
			"4": 4,
151
			"5": 5,
152
			"6": 6,
153
			"7": 7,
154
			"8": 8,
155
			"9": 9,
156
			"A": 10,
157
			"B": 11,
158
			"C": 12,
159
			"D": 13,
160
			"E": 14,
161
			"F": 15,
162
			"G": 16,
163
			"H": 17,
164
			"I": 18,
165
			"J": 19,
166
			"K": 20,
167
			"L": 21,
168
			"M": 22,
169
			"N": 23,
170
			"O": 24,
171
			"P": 25,
172
			"Q": 26,
173
			"R": 27,
174
			"S": 28,
175
			"T": 29,
176
			"U": 30,
177
			"V": 31,
178
			"W": 32,
179
			"X": 33,
180
			"Y": 34,
181
			"Z": 35,
182
			"a": 36,
183
			"b": 37,
184
			"c": 38,
185
			"d": 39,
186
			"e": 40,
187
			"f": 41,
188
			"g": 42,
189
			"h": 43,
190
			"i": 44,
191
			"j": 45,
192
			"k": 46,
193
			"l": 47,
194
			"m": 48,
195
			"n": 49,
196
			"o": 50,
197
			"p": 51,
198
			"q": 52,
199
			"r": 53,
200
			"s": 54,
201
			"t": 55,
202
			"u": 56,
203
			"v": 57,
204
			"w": 58,
205
			"x": 59,
206
			"y": 60,
207
			"z": 61,
208
			"-": 62,
209
			"_": 63
210
		};
211
		function s16to64(s) {
212
			var out, idx, n1, n2, n3;
213
			idx = s.length - 1;
214
			out = "";
215
			while(idx >= 0) {
216
				n1 = d64[s.charAt(idx--)];
217
				if(idx < 0) {
218
					out = r64[n1] + out;
219
					break;
220
				}
221
				n2 = d64[s.charAt(idx--)];
222
				if(idx < 0) {
223
					out = r64[(n2 >>> 2)] + r64[((n2 & 0x3) << 4) + n1] + out;
224
					break;
225
				}
226
				n3 = d64[s.charAt(idx--)];
227
				out = r64[(n2 >>> 2) + (n3 << 2)] + r64[((n2 & 0x3) << 4) + n1] + out;
228
			}
229
			return out;
230
		}
231
232
		function s64to16(s) {
233
			var out, idx, n1, n2;
234
			idx = s.length - 1;
235
			out = "";
236
			while(idx >= 0) {
237
				n1 = d64[s.charAt(idx--)];
238
				if(idx < 0) {
239
					out = r64[n1 >>> 4] + r64[n1 & 0xF] + out;
240
					break;
241
				}
242
				n2 = d64[s.charAt(idx--)];
243
				out = r64[(n2 >>> 2)] + r64[(n1 >>> 4) + ((n2 & 0x3) << 2)] + r64[n1 & 0xF] + out;
244
			}
245
			return out;
246
		}
247
	/*微信及微信朋友圈分享专家*/
248
	var auths, shares;
249
	plus.oauth.getServices(function(services) {
250
		auths = {};
251
		for(var i in services) {
252
			var t = services[i];
253
			auths[t.id] = t;
254
115
	function answerList(byway){
116
		if(byway==1){
117
			typeurl="/ajax/question/answer/qes/byScore"
118
		}else if(byway==2){
119
			typeurl="/ajax/question/answer/qes/byTime"
255 120
		}
256
	}, function(e) {
257
		alert("获取登录服务列表失败:" + e.message + " - " + e.code);
258
	});
259
	plus.share.getServices(function(services) {
260
261
		shares = {};
262
		for(var i in services) {
263
264
			var t = services[i];
265
266
			shares[t.id] = t;
267
268
		}
269
	}, function(e) {
270
		alert("获取分享服务列表失败:" + e.message + " - " + e.code);
271
	});
272
	mui("#shareBlock").on("tap", "li", function() {
273
		document.getElementById("shareBlock").style.display = "none";
274
		document.getElementById("maskBlack").style.display = "none";
275
		var oFen = this.getElementsByTagName("span")[0].innerHTML;
276
277
		var oUrl = baseUrl + "/images/logo180.png";
278
279
		if(oFen == "微信好友") {
280
			if(!weixinClient()) {
281
					return;
282
				}
283
			var share = buildShareService("weixin");
284
			if(share) {
285
				shareMessage(share, "WXSceneSession", {
286
					content: document.getElementById("paperAbstract").innerHTML.substring(0, 70),
287
					title: document.getElementById("paperName").innerHTML,
288
					href: baseUrl + "/e/l.html?id=" + paperId,
289
					thumbs: [oUrl]
290
				});
291
			}
292
		} else if(oFen == "微信朋友圈") {
293
			if(!weixinClient()) {
294
					return;
121
		mui.ajax(baseUrl + typeurl, {
122
			data: {
123
				"qid": questionId,
124
				"time": time,
125
				"id":id,
126
				"rows":rows
127
			},
128
			dataType: 'json',
129
			type: 'get', 
130
			success: function(data) {
131
				if(data.success) {
132
					console.log(JSON.stringify(data))
133
					for(var i = 0; i < data.data.length; i++) {
134
						var dataStr = data.data[i]
135
						var liStr = document.createElement("li");
136
						liStr.setAttribute("data-id", dataStr.id);
137
						document.getElementById(aimId).appendChild(liStr);
138
						answerHtml(dataStr,liStr);
139
					}
295 140
				}
296
			var share = buildShareService("weixin");
297
			if(share) {
298
				shareMessage(share, "WXSceneTimeline", {
299
					content: document.getElementById("paperAbstract").innerHTML.substring(0, 70),
300
					title: document.getElementById("paperName").innerHTML,
301
					href: baseUrl + "/e/l.html?id=" + paperId,
302
					thumbs: [oUrl]
303
				});
304 141
			}
305
		} else if(oFen == "新浪微博") {
306
			var share = buildShareService("sinaweibo");
307
			if(share) {
308
				shareMessage(share, "sinaweibo", {
309
					content: document.getElementById("paperName").innerHTML + baseUrl + "/e/l.html?id=" + paperId,
310
				});
142
		});
143
	}
144
	function answerHtml(dataStr,liStr) {
145
		document.getElementById("questionId").setAttribute("data-id",$da.id);
146
		document.getElementById("questionTit").innerHTML = $da.title;
147
		document.getElementById("questionCnt").innerHTML = $da.cnt;
148
		document.getElementById("questionTime").innerHTML = commenTime($da.createTime);
149
		document.getElementById("replyCount").innerHTML = $da.replyCount;
150
		
151
		if($da.keys != undefined && $da.keys.length != 0) {
152
			var subs = new Array();
153
			if($da.keys.indexOf(',')) {
154
				subs = $da.keys.split(',');
155
			} else {
156
				subs[0] = $da.keys;
311 157
			}
312
		}
313
314
	})
315
316
	function buildShareService(ttt) {
317
		var share = shares[ttt];
318
		if(share) {
319
			if(share.authenticated) {
320
				console.log("---已授权---");
158
			var pstr = ""
159
			if(subs.length > 0) {
160
				for(var i = 0; i < subs.length; i++) {
161
					pstr += '<li><span class="h2Font">' + subs[i] + '</span></li>'
162
				};
163
				document.getElementsByClassName("tagList")[0].innerHTML = pstr;
321 164
			} else {
322
				console.log("---未授权---");
323
				share.authorize(function() {
324
					console.log('授权成功...')
325
				}, function(e) {
326
					//alert("认证授权失败:" + e.code + " - " + e.message);
327
					return null;
328
				});
165
				document.getElementsByClassName("tagList")[0].style.display = "none";
329 166
			}
330
			return share;
331
		} else {
332
			alert("没有获取微信分享服务");
333
			return null;
334 167
		}
335
336
	}
337
338
	function shareMessage(share, ex, msg) {
339
		msg.extra = {
340
			scene: ex
341
		};
342
		share.send(msg, function() {
343
			plus.nativeUI.closeWaiting();
344
			if(plus.storage.getItem('userid')) {
345
				//shareAddIntegral(2);
346
				if(msg.content=="赶快认领,上千家企业正在期待与您合作") {
347
					shareAddIntegral(1);
348
				}else{
349
					shareAddIntegral(6);
350
				}
351
			}
352
		}, function(e) {
353
			plus.nativeUI.closeWaiting();
354
			if(e.code == -2) {
355
				
356
			}
357
		});
358 168
	}
169
	
359 170
360
	/*图像预览*/
361
	mui.previewImage();
362
	moreMes();
171
	/*微信及微信朋友圈分享专家*/
172
//	var auths, shares;
173
//	plus.oauth.getServices(function(services) {
174
//		auths = {};
175
//		for(var i in services) {
176
//			var t = services[i];
177
//			auths[t.id] = t;
178
//
179
//		}
180
//	}, function(e) {
181
//		alert("获取登录服务列表失败:" + e.message + " - " + e.code);
182
//	});
183
//	plus.share.getServices(function(services) {
184
//
185
//		shares = {};
186
//		for(var i in services) {
187
//
188
//			var t = services[i];
189
//
190
//			shares[t.id] = t;
191
//
192
//		}
193
//	}, function(e) {
194
//		alert("获取分享服务列表失败:" + e.message + " - " + e.code);
195
//	});
196
//	mui("#shareBlock").on("tap", "li", function() {
197
//		document.getElementById("shareBlock").style.display = "none";
198
//		document.getElementById("maskBlack").style.display = "none";
199
//		var oFen = this.getElementsByTagName("span")[0].innerHTML;
200
//
201
//		var oUrl = baseUrl + "/images/logo180.png";
202
//
203
//		if(oFen == "微信好友") {
204
//			if(!weixinClient()) {
205
//					return;
206
//				}
207
//			var share = buildShareService("weixin");
208
//			if(share) {
209
//				shareMessage(share, "WXSceneSession", {
210
//					content: document.getElementById("paperAbstract").innerHTML.substring(0, 70),
211
//					title: document.getElementById("paperName").innerHTML,
212
//					href: baseUrl + "/e/l.html?id=" + paperId,
213
//					thumbs: [oUrl]
214
//				});
215
//			}
216
//		} else if(oFen == "微信朋友圈") {
217
//			if(!weixinClient()) {
218
//					return;
219
//				}
220
//			var share = buildShareService("weixin");
221
//			if(share) {
222
//				shareMessage(share, "WXSceneTimeline", {
223
//					content: document.getElementById("paperAbstract").innerHTML.substring(0, 70),
224
//					title: document.getElementById("paperName").innerHTML,
225
//					href: baseUrl + "/e/l.html?id=" + paperId,
226
//					thumbs: [oUrl]
227
//				});
228
//			}
229
//		} else if(oFen == "新浪微博") {
230
//			var share = buildShareService("sinaweibo");
231
//			if(share) {
232
//				shareMessage(share, "sinaweibo", {
233
//					content: document.getElementById("paperName").innerHTML + baseUrl + "/e/l.html?id=" + paperId,
234
//				});
235
//			}
236
//		}
237
//
238
//	})
239
//
240
//	function buildShareService(ttt) {
241
//		var share = shares[ttt];
242
//		if(share) {
243
//			if(share.authenticated) {
244
//				console.log("---已授权---");
245
//			} else {
246
//				console.log("---未授权---");
247
//				share.authorize(function() {
248
//					console.log('授权成功...')
249
//				}, function(e) {
250
//					//alert("认证授权失败:" + e.code + " - " + e.message);
251
//					return null;
252
//				});
253
//			}
254
//			return share;
255
//		} else {
256
//			alert("没有获取微信分享服务");
257
//			return null;
258
//		}
259
//
260
//	}
261
//
262
//	function shareMessage(share, ex, msg) {
263
//		msg.extra = {
264
//			scene: ex
265
//		};
266
//		share.send(msg, function() {
267
//			plus.nativeUI.closeWaiting();
268
//			if(plus.storage.getItem('userid')) {
269
//				//shareAddIntegral(2);
270
//				if(msg.content=="赶快认领,上千家企业正在期待与您合作") {
271
//					shareAddIntegral(1);
272
//				}else{
273
//					shareAddIntegral(6);
274
//				}
275
//			}
276
//		}, function(e) {
277
//			plus.nativeUI.closeWaiting();
278
//			if(e.code == -2) {
279
//				
280
//			}
281
//		});
282
//	}
283
//
363 284
285
//	moreMes();
364 286
	function moreMes() {
365 287
		document.getElementById("BtnMore").addEventListener("tap", function() {
366 288
			var oUrl = baseUrl + "/images/logo180.png";
@ -380,270 +302,5 @@ mui.plusReady(function() {
380 302
			})
381 303
		})
382 304
	}
383
	mui(".artfoot").on("tap", ".inputShow", function() {
384
		if(!plus.storage.getItem('userid')) {
385
			mui.openWindow({
386
				url: '../html/login.html',
387
				id: '../html/login.html',
388
				show: {
389
					aniShow: "slide-in-right"
390
				},
391
				extras: {
392
					ourl: self.id
393
				}
394
			});
395
			return;
396
		}
397
		document.getElementById("textInput").style.display = "block";
398
		document.getElementById("operCol").style.display = "none";
399
		document.getElementById("textInputThis").focus();
400
	})
401
	isAgreeNum()
402
	function isAgreeNum() {
403
	var data = {"id": paperId}
404
	mui.ajax(baseUrl+"/ajax/ppaper/agreeCount",{		
405
		data:data,
406
		dataType: 'json', //数据格式类型
407
		type: 'get', //http请求类型
408
		timeout: 10000,
409
		async: true,
410
		success: function(data) {
411
			if(data.success){
412
					document.getElementById("snum").innerHTML=data.data;
413
			}
414
		},
415
		error: function() {
416
			plus.nativeUI.toast("服务器链接超时", toastStyle);
417
		}
418
	});
419
}
420
	if(userid && userid != "null" && userid != null) {
421
					isAgree() //文章点赞
422
				} 
423
	/*判断论文是否被赞*/
424
function isAgree() {
425
	var data = {"id": paperId,"uid":userid }
426
	mui.ajax(baseUrl+"/ajax/ppaper/agree",{	
427
		data:data,
428
		dataType: 'json', //数据格式类型
429
		type: 'get', //http请求类型
430
		timeout: 10000,
431
		async: true,
432
		success: function(data) {
433
			if(data.success){
434
				if(data.data){
435
					document.getElementsByClassName("thumbBtn")[0].classList.add("thumbedBtn");
436
				}
437
			}
438
		},
439
		error: function() {
440
			plus.nativeUI.toast("服务器链接超时", toastStyle);
441
		}
442
	});
443
}
444
mui('.thumbBlock').on("tap",".thumbBtn",function(){
445
	if (!isLogin()) {
446
		if(this.className=="thumbBtn thumbedBtn"){
447
			return;
448
		}
449
		addAgree();
450
	}
451
})
452
/*点赞*/
453
function addAgree() {
454
	var data = {"uid": userid,"id": paperId}
455
	mui.ajax(baseUrl+"/ajax/ppaper/agree",{		
456
		data:data,
457
		dataType: 'json', //数据格式类型
458
		type: 'POST', //http请求类型
459
		timeout: 10000,
460
		async: true,
461
		success: function(data) {
462
			if(data.success){
463
			document.getElementById("snum").innerHTML = Number(document.getElementById("snum").innerHTML) + 1;
464
			document.getElementsByClassName("thumbBtn")[0].classList.add("thumbedBtn");
465
			}
466
		},
467
		error: function() {
468
			plus.nativeUI.toast("服务器链接超时", toastStyle);
469
		}
470
	});
471
}
472
mui(".artfoot").on("tap", ".inputShow", function() {
473
	
474
		if(!isLogin()) {
475
			document.getElementById("textInput").style.display = "block";
476
			document.getElementById("operCol").style.display = "none";
477
			document.getElementById("textInputThis").focus();
478
		}
479
		
480
	})
481
leword();
482 305
483
function leword() {
484
		var data = {"paperId": paperId,"rows": 500}	
485
		mui.ajax(baseUrl + "/ajax/leaveWord/ql/paper", {
486
			data: data,
487
			dataType: 'json', //服务器返回json格式数据
488
			type: 'get', //HTTP请求类型
489
			timeout: 10000, //超时时间设置为10秒;
490
			traditional: true,
491
			success: function(data) {
492
				if(data.success) {
493
					document.getElementsByClassName('commentBlock')[0].innerHTML = ""
494
					if(data.data.length == 0) {
495
						return;
496
					}
497
					var id = plus.storage.getItem('userid');
498
					for(var i = 0; i < data.data.length; i++) {
499
						var oText = ""
500
						if(id == data.data[i].professor.id) {
501
							oText = "删除"
502
						}
503
						var userType = autho(data.data[i].professor.authType, data.data[i].professor.orgAuth, data.data[i].professor.authStatus);
504
						var baImg = "../images/default-photo.jpg";
505
						if(data.data[i].professor.hasHeadImage == 1) {
506
							baImg = baseUrl + "/images/head/" + data.data[i].professor.id + "_l.jpg";
507
						}
508
						var li = document.createElement("li");
509
						li.className = "mui-table-view-cell";
510
						li.innerHTML = '<div class="flexCenter mui-clearfix">' +
511
							'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')" data-id="' + data.data[i].professor.id + '"></div>' +
512
							'<div class="madiaInfo">' +
513
							'<p><span class="h1Font" data-id="' + data.data[i].professor.id + '">' + data.data[i].professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>' +
514
							'</div>' +
515
							'</div>' +
516
							'<div class="madiaInfo">' +
517
							'<p class="h2Font">' + data.data[i].content + '</p>' +
518
							'<p class="operateSpan">' +
519
							'<span class="commenttime">' + commenTime(data.data[i].createTime) + '</span>' +
520
							'<span data-id="' + data.data[i].id + '" class="dele">' + oText + '</span>' +
521
							'</p>' +
522
							'</div>'
523
						document.getElementsByClassName("commentBlock")[0].appendChild(li);
524
					}
525
526
				} else {
527
				}
528
			},
529
			error: function(xhr, type, errorThrown) {
530
				//异常处理;
531
				plus.nativeUI.toast("服务器链接超时", toastStyle);
532
			}
533
		});
534
}
535
lewordNum();
536
function lewordNum() {
537
		var data = {"paperId": paperId}	
538
		mui.ajax(baseUrl + "/ajax/leaveWord/lwCount/paper", {
539
			data: data,
540
			dataType: 'json', //服务器返回json格式数据
541
			type: 'get', //HTTP请求类型
542
			timeout: 10000, //超时时间设置为10秒;
543
			traditional: true,
544
			success: function(data) {
545
				if(data.success) {
546
					if(data.data > 0) {
547
						document.getElementsByClassName("mui-badge")[0].innerHTML = data.data;
548
					}
549
				}
550
551
				
552
			},
553
			error: function(xhr, type, errorThrown) {
554
				//异常处理;
555
				plus.nativeUI.toast("服务器链接超时", toastStyle);
556
			}
557
		});
558
}
559
function trim(str) { //删除左右两端的空格
560
		  
561
		return str.replace(/(^\s*)|(\s*$)/g, "");  
562
	}
563
document.getElementById("textInputThis").addEventListener("input", function() {
564
		var length = trim(this.value);
565
		if(length) {
566
			document.getElementsByClassName("mui-btn")[0].removeAttribute("disabled");
567
		} else {
568
			document.getElementsByClassName("mui-btn")[0].setAttribute("disabled", "true")
569
		}
570
	})
571
document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
572
	if(document.getElementById("textInputThis").value.length>200) {
573
				plus.nativeUI.toast("留言不得超过200个字", toastStyle);
574
				return;
575
			}
576
		mui.ajax(baseUrl + "/ajax/leaveWord/paper", {
577
			data: {
578
				"paperId": paperId,
579
				"sender": plus.storage.getItem('userid'),
580
				"content": document.getElementById("textInputThis").value
581
			},
582
			dataType: 'json', //服务器返回json格式数据
583
			type: 'post', //HTTP请求类型
584
			timeout: 10000, //超时时间设置为10秒;
585
			success: function(data) {
586
				if(data.success) {
587
					document.getElementById("textInputThis").value = "";
588
					document.getElementById('textInput').style.display = "none";
589
					document.getElementById('operCol').style.display = "block";
590
					leword();
591
					lewordNum();
592
				}
593
			},
594
			error: function() {
595
				//异常处理;
596
				plus.nativeUI.toast("服务器链接超时", toastStyle);
597
			}
598
		});
599
	})
600
mui(".commentBlock").on("tap", ".dele", function() {
601
		var $this = this;
602
		mui.ajax(baseUrl + "/ajax/leaveWord/delete", {
603
			data: {
604
				"id": this.getAttribute("data-id"),
605
			},
606
			dataType: 'json', //服务器返回json格式数据
607
			type: 'post', //HTTP请求类型
608
			timeout: 10000, //超时时间设置为10秒;
609
			success: function(data) {
610
				if(data.success) {
611
					document.getElementsByClassName("commentBlock")[0].removeChild($this.parentNode.parentNode.parentNode);
612
					leword();
613
					lewordNum();
614
				}
615
			},
616
			error: function(xhr, type, errorThrown) {
617
				//异常处理;
618
				plus.nativeUI.toast("服务器链接超时", toastStyle);
619
			}
620
		});
621
	})
622
623
		
624
	moreMes();
625
	function moreMes(){
626
		document.getElementById("BtnMore").addEventListener("tap",function(){
627
			var oUrl=baseUrl + "/images/logo180.png";
628
		if(imgFlag==1) {
629
			oUrl=firstImg.querySelectorAll("img")[0].getAttribute("src").replace(/.jpg/,"_s.jpg");
630
		}
631
			plus.nativeUI.showWaiting(); //显示原生等待框
632
		var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
633
			proid: resourceId,
634
			name:"resource",
635
			data:{
636
					content: oapplication.innerHTML,
637
					title: oresourceName.innerHTML,
638
					href: baseUrl + "/e/r.html?id=" + resourceId ,
639
					thumbs: [oUrl]
640
				},
641
			weiboData:{
642
					content: oresourceName.innerHTML+ baseUrl + "/e/r.html?id=" + resourceId,
643
				}
644
		})
645
		})
646
	}
647 306
});
648
649

+ 37 - 106
app/js/qa-waiting-a.js

@ -12,154 +12,85 @@
12 12
			}
13 13
		}
14 14
	});
15
	var Num=1;
15
	var Num=1,rows=2,time="",id="";
16 16
	function pulldownRefresh() {
17 17
		setTimeout(function() {
18
			demandOnePase();
18
//			demandOnePase();
19 19
			mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
20 20
		}, 1500);
21 21
	}
22 22
	function pullupRefresh() {
23
		
23 24
		setTimeout(function() {
24
			Num = ++Num;
25
			myDemandList(10,Num);
25
			myConList(time,id);
26 26
			mui('#pullrefresh').pullRefresh().endPullupToRefresh();
27 27
		}, 1500);
28 28
	
29 29
	}
30 30
	
31 31
	mui.plusReady(function() {
32
		myConList();
32 33
		mui("#questList").on("tap", "li", function() {
33
			var oDemandId = this.getAttribute("data-id");
34
			var id = this.getAttribute("data-id");
34 35
			plus.nativeUI.showWaiting();
35 36
			plus.webview.create("../html/qa-question-show.html", 'qa-question-show.html', {}, {
36
				demanid: oDemandId
37
				quid: id
37 38
			});
38 39
		})
39 40
	})
40
	function myDemandList(pageSize, pageNo) {
41
	function myConList(time,id) {
41 42
		mui.plusReady(function() {
42 43
			mui.ajax(baseUrl + '/ajax/question', {
43 44
				dataType: 'json', //数据格式类型
44 45
				type: 'GET', //http请求类型
45 46
				timeout: 10000, //超时设置
46 47
				data: {
47
					"uid": plus.storage.getItem('userid'),
48
					"pageNo": pageNo,
49
					"pageSize": pageSize
48
//					"time":time,
49
//					"id": id,
50
//					"rows": rows
50 51
				},
51 52
				success: function(data) {
52 53
					if(data.success) {
53
						var ws=plus.webview.getWebviewById("../html/needList.html");
54
						plus.nativeUI.closeWaiting();
55
						ws.show("slide-in-right", 150);
56
						if(pageNo!=data.data.pageNo) {
57
							data.data.data=[];
58
						}
59
						var $info = data.data.data;
54
						var $info = data.data;
60 55
						console.log(JSON.stringify(data))
61 56
						if($info.length > 0){
57
							time = res.data[res.data.length-1].createTime;
58
							id = res.data[res.data.length-1].id;
62 59
							for(var i = 0; i < $info.length; i++) {
63 60
								var liStr=document.createElement("li");
64
								liStr.className="mui-table-view-cell flexCenter";
61
								liStr.className="mui-table-view-cell";
65 62
								liStr.setAttribute( "data-id",$info[i].id);
66 63
								document.getElementById("questList").appendChild(liStr);
67
								demandHtml($info[i],liStr);
64
								myConHtml($info[i],liStr);
68 65
							}
69 66
						}
70
						if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
71
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
72
						} else {
73
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
74
						}
67
//						if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
68
//							mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
69
//						} else {
70
//							mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
71
//						}
75 72
					}
76
				},
77
				error: function() {
78
					plus.nativeUI.toast("服务器链接超时", toastStyle);
79
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
80
					return;
81 73
				}
82 74
			});
83 75
		})
84 76
	}
85
	function demandOnePase() {
86
		mui.plusReady(function() {
87
			Num=1;
88
			mui.ajax(baseUrl + '/ajax/demand/pq', {
89
				dataType: 'json', //数据格式类型
90
				type: 'GET', //http请求类型
91
				timeout: 10000, //超时设置
92
				data: {
93
					"uid": plus.storage.getItem('userid'),
94
					"pageNo": 1,
95
					"pageSize": 10
96
				},
97
				success: function(data) {
98
					if(data.success) {
99
						mui('#pullrefresh').pullRefresh().refresh(true);
100
						var ws=plus.webview.getWebviewById("../html/needList.html");
101
						plus.nativeUI.closeWaiting();
102
						ws.show("slide-in-right", 150);
103
						document.getElementById("questList").innerHTML="";
104
						var $info = data.data.data;
105
						console.log(JSON.stringify(data))
106
						if($info.length > 0){
107
							for(var i = 0; i < $info.length; i++) {
108
								var liStr=document.createElement("li");
109
								liStr.className="mui-table-view-cell flexCenter";
110
								liStr.setAttribute( "data-id",$info[i].id);
111
								document.getElementById("questList").appendChild(liStr);
112
								demandHtml($info[i],liStr);
113
							}
114
						}
115
						if(1 < Math.ceil(data.data.total / data.data.pageSize)) {
116
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
117
						} else {
118
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
119
						}
120
					}
121
				},
122
				error: function() {
123
					plus.nativeUI.toast("服务器链接超时", toastStyle);
124
					return;
125
				}
126
			});
127
		})
128
	}
129
	function demandHtml($data,liStr) {
130
		var statusU="";
131
		var dateGap = delayDay($data.invalidDay);
132
		if($data.state==1 && dateGap=="1"){
133
			statusU='<span class="draftLable">即将于 '+TimeTr($data.invalidDay)+' 过期</span>'
77
	function myConHtml($data,liStr) {
78
		var baImg = "../images/default-q&a.jpg";
79
		if(dataStr.img) {
80
			baImg = baseUrl + dataStr.img;
134 81
		}
135
		if($data.state==0){
136
			statusU='<span class="draftLable">已于 '+TimeTr($data.invalidDay)+' 过期</span>'
137
		}else if($data.state==2){
138
			statusU='<span class="overLable">已于 '+TimeTr($data.modifyTime)+' 完成</span>'
139
		}else if($data.state==3){
140
			statusU='<span>已于 '+TimeTr($data.modifyTime)+' 关闭</span>'
82
		var hd = "";
83
		if(dataStr.replyCount > 0) {
84
			hd = '<span>' + dataStr.replyCount + ' 回答</span>'
141 85
		}
142
		var strCon='';
143
			strCon+='<div class="madiaInfo">'
144
			strCon+='<p class="h1Font mui-ellipsis-2">'+ $data.title +'</p>'
145
			strCon+='<div class="showli mui-ellipsis">'
146
			strCon+='<span>发布于 '+TimeTr($data.createTime)+'</span>'
147
			strCon+= statusU
148
			strCon+='</div>'
149
		liStr.innerHTML=strCon;
150
	}
151
	function delayDay(startTime){
152
		var dateToday = new Date();
153
		var dateInvalid = new Date();
154
		dateInvalid.setFullYear(parseInt(startTime.substring(0, 4)));
155
		dateInvalid.setMonth(parseInt(startTime.substring(4, 6)) - 1);
156
		dateInvalid.setDate(parseInt(startTime.substring(6, 8)));
157
		
158
		var dateGap = Math.abs(dateToday.getTime() - dateInvalid.getTime());
159
		var ifDelay="0";
160
		if(dateGap < 604800000){
161
			ifDelay="1";
162
		}
163
		return ifDelay;
86
		liStr.className = "mui-table-view-cell";
87
		liStr.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
88
			'<div class="madiaHead qa-Head" style="background-image:url(' + baImg + ')"></div>' +
89
			'<div class="madiaInfo OmadiaInfo">' +
90
			'<p class="mui-ellipsis-2 h1Font">' + dataStr.title + '</p>' +
91
			'<p class="show-item mui-ellipsis h2Font">' + hd + '<span>N 关注</span></p>' +
92
			'</div></div>'
93
			
164 94
	}
165 95

96