Browse Source

添加咨询对话界面

luyanan 8 years ago
parent
commit
6a7904f1b5

+ 36 - 8
app/css/app.css

@ -47,6 +47,7 @@ body{ color: #666666; font-size:14px;}
47 47
}
48 48
.topsave{color: #FFFFFF; line-height: 42px; cursor: pointer;}
49 49
.toptit{color: #FFFFFF; font-size: 20px;}
50
.personhead{color: #FFFFFF;}
50 51
/*底部导航栏*/
51 52
.footbox{ background: #FFFFFF;}
52 53
.footbox .mui-tab-item.mui-active{ color: #FF9900;}
@ -57,10 +58,10 @@ body{ color: #666666; font-size:14px;}
57 58
.frmtype{ width: 100%; margin: auto; padding:2%;font-size: 14px;}
58 59
.frmbtn{margin:4% 0;  font-size: 16px; padding:2%;border:1px solid #FF9900; border-radius: 6px; color:#FF9900 ;}
59 60
/*.frmbtn:hover{border:1px solid #FF9900; color:#FFFFFF;background-color:#FF9900;}*/
60
.frmbox{ border:none; width: 90%; height: 100%; }
61
.frmactive{color:#fff;background-color:#FF9900;}
61
.frmbox{ border:none; width: 90%; height: 100%; } 
62 62
.frmactive2{color:#fff;background-color:#ccc; border:1px solid #ccc;}
63

63
.frmactive{color:#fff;background-color:#FF9900; border:1px solid #FF9900;}
64
.frmactiveok{color:#fff;background-color:#FF9900; border:1px solid #FF9900;}
64 65
.exitbtn{ border:none; margin: 0; color:#FF0000; border-radius: 0;}
65 66
/*///////////////common公共样式///////////////////////*/
66 67

@ -175,9 +176,12 @@ body{ color: #666666; font-size:14px;}
175 176
.gotonext2{ width: 110px;}
176 177
.gotonext em{display: block; width: 20px; height: 20px; margin-left:6px ; background:url(../images/goto.png) center center no-repeat; background-size:100% 100% ; }
177 178

178
.dialogbtn{margin: auto; overflow: hidden; width: 130px;padding: 12px;}
179
.dialogbtn{ overflow: hidden; width:80%;padding: 12px;}
180
.dialogbtn div{ width: 100px;overflow: hidden;margin: auto; }
179 181
.dialogbtn span{font-size: 14px; line-height: 24px; padding: 0 3px; color: #FF9900; font-weight: 600;}
180 182
.dialogbtn em{display: block; width: 24px; height: 24px; background: url(../images/dialogue.png) center center no-repeat; background-size:100% 100% ; margin-right:6px;}
183
.attentbtn{margin: auto; overflow: hidden; width:20%;padding: 12px; border-left:1px solid #F0F0F0;}
184
.attentbtn em{display: block; margin: auto; width: 22px; height: 22px; background: url(../images/attenticon.png) center center no-repeat; background-size:100% 100% ;}
181 185

182 186
.listitembox{ position: static;width: 108%;}
183 187
.listitembox .listitem{ position: static;padding:10px; margin-right: 2%;}
@ -201,6 +205,7 @@ body{ color: #666666; font-size:14px;}
201 205
.wallteicon{background: url(../images/wallter.png) center center no-repeat;background-size:100% 100% ;}
202 206
.addicon{background: url(../images/personadd.png) center center no-repeat;background-size:100% 100% ;}
203 207
.seticon{background: url(../images/set.png) center center no-repeat;background-size:100% 100% ;}
208
.attenticon{background: url(../images/attenticon.png) center center no-repeat;background-size:100% 100% ;}
204 209
.rightword{ position: absolute; right:40px; font-size:13px;}
205 210
/*已认证*/
206 211
.verified{ color: #FF9900;}
@ -272,10 +277,10 @@ body{ color: #666666; font-size:14px;}
272 277
.consultbox{ padding:20px 0px 60px 0px;}
273 278

274 279
.consultaim{ text-align: center; margin: auto; }
275
.consultaim ul{padding: 0; margin: 0; width:96%; overflow: hidden; margin:1% auto;}
276
.consultaim ul li{ list-style: none;float: left; padding:1% 4%;border:#CCCCCC 1px solid;border-radius: 6px; margin:1%; font-size: 13px;}
277
.consultaim ul .liactive{ border:1px solid #6CA8FF;padding:1% 2%;padding-left:6%; color: #6CA8FF;position: relative;}
278
.consultaim ul .liactive em{ display:block;position: absolute; left:5%; top:50%;margin-top: -8px; width:16px; height:16px;background: url(../images/selected.png) center center no-repeat; background-size:100% 100% ;}
280
.consultaim ul{padding: 0; margin: 0; overflow: hidden; margin:1% auto; padding:0 4%; }
281
.consultaim ul li{ list-style: none;float: left; padding:2px 16px;border:#CCCCCC 1px solid;border-radius: 6px; margin:1%; font-size: 13px;}
282
.consultaim ul .liactive{ border:1px solid #6CA8FF;padding-left:28px; color: #6CA8FF;position: relative;}
283
.consultaim ul .liactive em{ display:block;position: absolute; left:10px; top:50%;margin-top: -8px; width:16px; height:16px;background: url(../images/selected.png) center center no-repeat; background-size:100% 100% ;}
279 284
.divline{border-top:1px solid #F0F0F0; width: 100%; height: 1px;} 
280 285

281 286
.consultinfo{ width: 96%; margin: auto; margin-top:6px;}
@ -286,4 +291,27 @@ body{ color: #666666; font-size:14px;}
286 291
.consultinfo tr td.sendbox{text-align: right;position: relative;}
287 292
.consultinfo tr td .sendbtn{width: 20%;font-size: 13px; padding: 4px 10px;margin:0;position:absolute;right:0; top:0; }
288 293

294
.operatebox{ width:100%;background: #FFFFFF;overflow: hidden; padding:10px;position: relative;}
295
.themespan{ width: 54%;}
296
.operatebtnbox{width:44%;position:absolute; top:50%; right:1%;margin-top:-14px;}
297
.operatebtn{padding:1% 4%; margin: 0; position: absolute;right:0;}
298

299
.filterbox2{}
300
.filterblock2{padding:0; margin: 0; margin-top:2px ; background:#FFFFFF;overflow: hidden;}
301
.filterblock2 li{list-style:none; position: relative; float: left; border-right:1px solid #F0F0F0;} 
302
.filterblock2 li select{  margin:0 2px;}
303
.filterlist2{ padding:0; margin: 0; border:none; border-radius:0;padding:6px 6px 6px 12px;font-size: 14px;}
304

305
.coutopicbox{ position: relative; background: #F0F0F0; margin-bottom: 10px; width:110%; margin-left:-16px; padding:4%; overflow: hidden;}
306
.coutopicbox .coutheme{ max-width: 60%;}
307

308
.coutopicbox .coustatus span{ font-size: 12px; padding:4px 10px; color: #FFFFFF; border-radius: 6px;}
309
.coutopicbox .aimlabel{background:#6CA8FF;}
310
.coutopicbox .status-1{background:#FF9900;}/*咨询状态*/
311
.coutopicbox .status-2{background:#dd524d;}
312
.coutopicbox .status-3{background:#4cd964;}
313

314
.thistime{ position: absolute; right:2px; font-size: 12px; color: #999999;}
315

316
.mui-table-view-cell>.proinfor>.mui-badge{top: 20px;left:10px; right:auto;}
289 317
/*********************** 咨询*******************/

+ 123 - 0
app/css/mui.imageviewer.css

@ -0,0 +1,123 @@
1
.mui-imageviewer {
2
	position: absolute;
3
	position: fixed;
4
	background-color: rgba(0, 0, 0, 0.9);
5
	width: 100%;
6
	height: 100%;
7
	z-index: 99;
8
	left: 0px;
9
	top: 0px;
10
	display: none;
11
	opacity: 0;
12
	-webkit-transition: all 0.6s ease-in-out;
13
	transition: all 0.6s ease-in-out;
14
	-webkit-transform-style: preserve-3d;
15
	-webkit-backface-visibility: hidden;
16
	overflow: hidden;
17
	margin: 0px;
18
	padding: 0px;
19
	box-sizing: border-box;
20
}
21
.mui-imageviewer-mask {
22
	position: absolute;
23
	z-index: 11;
24
	width: 100%;
25
	height: 100%;
26
	left: 0px;
27
	top: 0px;
28
	display: none;
29
}
30
.mui-imageviewer .mui-imageviewer-header {
31
	position: absolute;
32
	height: 45px;
33
	width: 100%;
34
	left: 0px;
35
	top: 0px;
36
	z-index: 10;
37
	background-color: rgba(0, 0, 0, 0.5);
38
	margin: 0px;
39
	padding: 0px;
40
	box-sizing: border-box;
41
}
42
.mui-imageviewer .mui-imageviewer-state {
43
	display: block;
44
	width: 100%;
45
	height: 100%;
46
	line-height: 100%;
47
	color: #eee;
48
	text-align: center;
49
	font-size: 16px;
50
	padding: 15px;
51
}
52
.mui-imageviewer .mui-imageviewer-header .mui-imageviewer-close {
53
	position: absolute;
54
	top: 5px;
55
	right: 5px;
56
	font-size: 32px;
57
	color: #aaa;
58
}
59
.mui-imageviewer .mui-imageviewer-header .mui-imageviewer-close:active {
60
	color: #FF5053;
61
}
62
.mui-imageviewer .mui-imageviewer-item {
63
	width: 100%;
64
	height: 100%;
65
	left: 0px;
66
	top: 0px;
67
	position: absolute;
68
	z-index: 0;
69
	margin: 0px;
70
	padding: 0px;
71
	box-sizing: border-box;
72
	-webkit-transition: -webkit-transform 500ms ease-in-out;
73
	transition: transform 500ms ease-in-out;
74
	display: table;
75
	overflow: hidden;
76
}
77
.mui-imageviewer .mui-imageviewer-item-center {
78
	-webkit-transform: translateX(0);
79
	transform: translateX(0);
80
}
81
.mui-imageviewer .mui-imageviewer-item-left {
82
	-webkit-transform: translateX(-100%);
83
	transform: translateX(-100%);
84
}
85
.mui-imageviewer .mui-imageviewer-item-right {
86
	-webkit-transform: translateX(100%);
87
	transform: translateX(100%);
88
}
89
.mui-imageviewer .mui-imageviewer-item span {
90
	display: table-cell;
91
	text-align: center;
92
	vertical-align: middle;
93
	line-height: 100%;
94
	font-size: 100%;
95
	margin: 0px;
96
	padding: 0px;
97
	box-sizing: border-box;
98
	overflow: auto;
99
}
100
.mui-imageviewer .mui-imageviewer-item img {
101
	backface-visibility: hidden;
102
	transform-origin: 50% 50% 0px;
103
	max-width: 100%;
104
}
105
.mui-imageviewer-left,
106
.mui-imageviewer-right {
107
	position: absolute;
108
	z-index: 2;
109
	color: #aaa;
110
	top: 50%;
111
	margin-top: -18px;
112
	font-size: 36px;
113
}
114
.mui-imageviewer-left {
115
	left: 5px;
116
}
117
.mui-imageviewer-right {
118
	right: 5px;
119
}
120
.mui-imageviewer-left:active,
121
.mui-imageviewer-right:active {
122
	color: #fff;
123
}

+ 358 - 0
app/html/chatover.html

@ -0,0 +1,358 @@
1
<!DOCTYPE html>
2
<html>
3
	<head>
4
		<meta charset="utf-8">
5
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
6
		<title></title>
7
		<link href="../css/mui.min.css" rel="stylesheet" />
8
		<link rel="stylesheet" type="text/css" href="../css/app.css" />
9
		<link href="../css/mui.imageviewer.css" rel="stylesheet" />
10
		<style>
11
			html,
12
			body {
13
				height: 100%;
14
				margin: 0px;
15
				padding: 0px;
16
				overflow: hidden;
17
				-webkit-touch-callout: none;
18
				-webkit-user-select: none;
19
			}
20
			footer {
21
				position: fixed;
22
				width: 100%;
23
				height: 50px;
24
				min-height: 50px;
25
				border-top: solid 1px #bbb;
26
				left: 0px;
27
				bottom: 0px;
28
				overflow: hidden;
29
				padding: 0px 50px;
30
				background-color: #fafafa;
31
			}
32
			.footer-left {
33
				position: absolute;
34
				width: 50px;
35
				height: 50px;
36
				left: 0px;
37
				bottom: 0px;
38
				text-align: center;
39
				vertical-align: middle;
40
				line-height: 100%;
41
 				padding: 12px 4px;
42
 			}
43
 			.footer-right {
44
 				position: absolute;
45
 				width: 50px;
46
 				height: 50px;
47
 				right: 0px;
48
 				bottom: 0px;
49
 				text-align: center;
50
 				vertical-align: middle;
51
 				line-height: 100%;
52
 				padding: 12px 5px;
53
 				display: inline-block;
54
 			}
55
 			.footer-center {
56
 				height: 100%;
57
 				padding: 5px 0px;
58
 			}
59
 			.footer-center [class*=input] {
60
 				width: 100%;
61
 				height: 100%;
62
 				border-radius: 5px;
63
 			}
64
 			.footer-center .input-text {
65
 				background: #fff;
66
 				border: solid 1px #ddd;
67
 				padding: 10px !important;
68
 				font-size: 16px !important;
69
 				line-height: 18px !important;
70
 				font-family: verdana !important;
71
 				overflow: hidden;
72
 			}
73
 			.footer-center .input-sound {
74
 				background-color: #eee;
75
 			}
76
 			.mui-content {
77
 				height: 100%;
78
 				padding: 44px 0px 50px 0px;
79
 				overflow: auto;
80
 				background-color: #eaeaea;
81
 			}
82
 			#msg-list {
83
 				height: 100%;
84
 				overflow: auto;
85
 				-webkit-overflow-scrolling: touch;
86
 			}
87
 			.msg-item {
88
 				padding: 8px;
89
 				clear: both;
90
 			}
91
 			.msg-item .mui-item-clear {
92
 				clear: both;
93
 			}
94
 			.msg-item .msg-user {
95
 				width: 38px;
96
 				height: 38px;
97
 				border: solid 1px #d3d3d3;
98
 				display: inline-block;
99
 				background: #fff;
100
 				border-radius: 3px;
101
 				vertical-align: top;
102
 				text-align: center;
103
 				float: left;
104
 				padding: 3px;
105
 				color: #ddd;
106
 			}
107
 			
108
 			.msg-item .msg-user-img{
109
 				width: 38px;
110
 				height: 38px;
111
 				display: inline-block;
112
 				border-radius: 3px;
113
 				vertical-align: top;
114
 				text-align: center;
115
 				float: left;
116
 				color: #ddd;
117
 			}
118
 			
119
 			.msg-item .msg-content {
120
 				display: inline-block;
121
 				border-radius: 5px;
122
 				border: solid 1px #d3d3d3;
123
 				background-color: #FFFFFF;
124
 				color: #333;
125
 				padding: 8px;
126
 				vertical-align: top;
127
 				font-size: 15px;
128
 				position: relative;
129
 				margin: 0px 8px;
130
 				max-width: 75%;
131
 				min-width: 35px;
132
 				float: left;
133
 			}
134
 			.msg-item .msg-content .msg-content-inner {
135
 				overflow-x: hidden;
136
 			}
137
 			.msg-item .msg-content .msg-content-arrow {
138
 				position: absolute;
139
 				border: solid 1px #d3d3d3;
140
 				border-right: none;
141
 				border-top: none;
142
 				background-color: #FFFFFF;
143
 				width: 10px;
144
 				height: 10px;
145
 				left: -5px;
146
 				top: 12px;
147
 				-webkit-transform: rotateZ(45deg);
148
 				transform: rotateZ(45deg);
149
 			}
150
 			.msg-item-self .msg-user,
151
 			.msg-item-self .msg-content {
152
 				float: right;
153
 			}
154
 			.msg-item-self .msg-content .msg-content-arrow {
155
 				left: auto;
156
 				right: -5px;
157
 				-webkit-transform: rotateZ(225deg);
158
 				transform: rotateZ(225deg);
159
 			}
160
 			.msg-item-self .msg-content,
161
 			.msg-item-self .msg-content .msg-content-arrow {
162
 				background-color: #4CD964;
163
 				color: #fff;
164
 				border-color: #2AC845;
165
 			}
166
 			footer .mui-icon {
167
 				color: #999999;
168
 			}
169
 			footer .mui-icon:active {
170
 				color: #FF9900 !important;
171
 			}/*#007AFF*/
172
 			footer .mui-icon-paperplane:before {
173
 				content: "发送";
174
 			}
175
 			footer .mui-icon-paperplane {
176
 				/*-webkit-transform: rotateZ(45deg);
177
 				transform: rotateZ(45deg);*/
178
 				
179
 				font-size: 16px;
180
 				word-break: keep-all;
181
 				line-height: 100%;
182
 				padding-top: 6px;
183
 				color: rgba(0, 135, 250, 1);
184
 			}
185
 			#msg-sound {
186
 				-webkit-user-select: none !important;
187
 				user-select: none !important;
188
 			}
189
 			.rprogress {
190
 				position: absolute;
191
 				left: 50%;
192
 				top: 50%;
193
 				width: 140px;
194
 				height: 140px;
195
 				margin-left: -70px;
196
 				margin-top: -70px;
197
 				background-image: url(../images/arecord.png);
198
 				background-repeat: no-repeat;
199
 				background-position: center center;
200
 				background-size: 30px 30px;
201
 				background-color: rgba(0, 0, 0, 0.7);
202
 				border-radius: 5px;
203
 				display: none;
204
 				-webkit-transition: .15s;
205
 			}
206
 			.rschedule {
207
 				background-color: rgba(0, 0, 0, 0);
208
 				border: 5px solid rgba(0, 183, 229, 0.9);
209
 				opacity: .9;
210
 				border-left: 5px solid rgba(0, 0, 0, 0);
211
 				border-right: 5px solid rgba(0, 0, 0, 0);
212
 				border-radius: 50px;
213
 				box-shadow: 0 0 15px #2187e7;
214
 				width: 46px;
215
 				height: 46px;
216
 				position: absolute;
217
 				left: 50%;
218
 				top: 50%;
219
 				margin-left: -23px;
220
 				margin-top: -23px;
221
 				-webkit-animation: spin 1s infinite linear;
222
 				animation: spin 1s infinite linear;
223
 			}
224
 			.r-sigh{
225
 				display: none;
226
 				border-radius: 50px;
227
 				box-shadow: 0 0 15px #2187e7;
228
 				width: 46px;
229
 				height: 46px;
230
 				position: absolute;
231
 				left: 50%;
232
 				top: 50%;
233
 				margin-left: -23px;
234
 				margin-top: -23px;
235
 				text-align: center;
236
 				line-height: 46px;
237
 				font-size: 40px;
238
 				font-weight: bold;
239
 				color: #2187e7;
240
 			}
241
 			.rprogress-sigh{
242
 				background-image: none !important;
243
 			}
244
 			.rprogress-sigh .rschedule{
245
 				display: none !important;
246
 			}
247
 			.rprogress-sigh .r-sigh{
248
 				display: block !important;
249
 			}
250
 			.rsalert {
251
 				font-size: 12px;
252
 				color: #bbb;
253
 				text-align: center;
254
 				position: absolute;
255
 				border-radius: 5px;
256
 				width: 130px;
257
 				margin: 5px 5px;
258
 				padding: 5px;
259
 				left: 0px;
260
 				bottom: 0px;
261
 			}
262
 			@-webkit-keyframes spin {
263
 				0% {
264
 					-webkit-transform: rotate(0deg);
265
 				}
266
 				100% {
267
 					-webkit-transform: rotate(360deg);
268
 				}
269
 			}
270
 			@keyframes spin {
271
 				0% {
272
 					transform: rotate(0deg);
273
 				}
274
 				100% {
275
 					transform: rotate(360deg);
276
 				}
277
 			}
278
 			#h {
279
 				background: #fff;
280
 				border: solid 1px #ddd;
281
 				padding: 10px !important;
282
 				font-size: 16px !important;
283
 				font-family: verdana !important;
284
 				line-height: 18px !important;
285
 				overflow: visible;
286
 				position: absolute;
287
 				left: -1000px;
288
 				right: 0px;
289
 				word-break: break-all;
290
 				word-wrap: break-word;
291
 			}
292
 			.cancel {
293
 				background-color: darkred;
294
 			}
295
 		</style>
296
 	</head>
297
  	<body contextmenu="return false;">
298
 		<header class="mui-bar mui-bar-nav toptitbox">
299
 			<span class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></span>
300
 			<h1 class="mui-title toptit">对方姓名</h1>
301
 			<span class="mui-icon mui-icon-contact mui-pull-right personhead"></span>
302
 		</header>
303
 		<pre id='h'></pre>
304
 		<script id='msg-template' type="text/template">
305
 			<% for(var i in record){ var item=record[i]; %>
306
 				<div class="msg-item <%= (item.sender=='self'?' msg-item-self':'') %>" msg-type='<%=(item.type)%>' msg-content='<%=(item.content)%>'>
307
 					<% if(item.sender=='self' ) { %>
308
 						<i class="msg-user mui-icon mui-icon-person"></i>
309
 					<% } else { %>
310
 						<img class="msg-user-img" src="../images/logo.png" alt="" />
311
 					<% } %>
312
 					<div class="msg-content">
313
 						<div class="msg-content-inner">
314
 							<% if(item.type=='text' ) { %>
315
 								<%=( item.content|| '&nbsp;&nbsp;') %>
316
 							<% } else if(item.type=='image' ) { %>
317
 								<img class="msg-content-image" src="<%=(item.content)%>" style="max-width: 100px;" />
318
 							<% } else if(item.type=='sound' ) { %>
319
 								<span class="mui-icon mui-icon-mic" style="font-size: 18px;font-weight: bold;"></span>
320
 								<span class="play-state">点击播放</span>
321
 							<% } %>
322
 						</div>
323
 						<div class="msg-content-arrow"></div>
324
 					</div>
325
 					<div class="mui-item-clear"></div>
326
 				</div>
327
 			<% } %>
328
 		</script>
329
 		<div class="mui-content">
330
 			<div class="operatebox">
331
 				<div class="themespan mui-pull-left" style="width:70%;">
332
 					<span class="">关于XXXXXX的咨询</span>
333
 				</div>
334
 				
335
 				<div class="operatebtnbox mui-pull-right">
336
 					<!--未评价-->
337
	                <button class="mui-btn mui-btn-block mui-btn-outlined frmbtn operatebtn" style="width:80px;">去评价</button>
338
 					<!--已评价-->
339
 					<div class="">
340
 						<span></span>
341
 						<div>
342
 							
343
 						</div>
344
 					</div>
345
 				</div>
346
 			</div>
347
 			<div id='msg-list'>
348
 			</div>
349
 		</div>
350
 				
351
 		<script src="../js/public/mui.min.js"></script>
352
 		<script src="../js/public/mui.imageViewer.js"></script>
353
 		<script src="../js/public/arttmpl.js"></script>
354
 		<script type="text/javascript" charset="utf-8">
355

356
		</script>
357
	</body>
358
</html>

+ 689 - 0
app/html/chats.html

@ -0,0 +1,689 @@
1
<!DOCTYPE html>
2
<html>
3
	<head>
4
		<meta charset="utf-8">
5
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
6
		<title></title>
7
		<link href="../css/mui.min.css" rel="stylesheet" />
8
		<link rel="stylesheet" type="text/css" href="../css/app.css" />
9
		<link href="../css/mui.imageviewer.css" rel="stylesheet" />
10
		<style>
11
			html,
12
			body {
13
				height: 100%;
14
				margin: 0px;
15
				padding: 0px;
16
				overflow: hidden;
17
				-webkit-touch-callout: none;
18
				-webkit-user-select: none;
19
			}
20
			footer {
21
				position: fixed;
22
				width: 100%;
23
				height: 50px;
24
				min-height: 50px;
25
				border-top: solid 1px #bbb;
26
				left: 0px;
27
				bottom: 0px;
28
				overflow: hidden;
29
				padding: 0px 50px;
30
				background-color: #fafafa;
31
			}
32
			.footer-left {
33
				position: absolute;
34
				width: 50px;
35
				height: 50px;
36
				left: 0px;
37
				bottom: 0px;
38
				text-align: center;
39
				vertical-align: middle;
40
				line-height: 100%;
41
 				padding: 12px 4px;
42
 			}
43
 			.footer-right {
44
 				position: absolute;
45
 				width: 50px;
46
 				height: 50px;
47
 				right: 0px;
48
 				bottom: 0px;
49
 				text-align: center;
50
 				vertical-align: middle;
51
 				line-height: 100%;
52
 				padding: 12px 5px;
53
 				display: inline-block;
54
 			}
55
 			.footer-center {
56
 				height: 100%;
57
 				padding: 5px 0px;
58
 			}
59
 			.footer-center [class*=input] {
60
 				width: 100%;
61
 				height: 100%;
62
 				border-radius: 5px;
63
 			}
64
 			.footer-center .input-text {
65
 				background: #fff;
66
 				border: solid 1px #ddd;
67
 				padding: 10px !important;
68
 				font-size: 16px !important;
69
 				line-height: 18px !important;
70
 				font-family: verdana !important;
71
 				overflow: hidden;
72
 			}
73
 			.footer-center .input-sound {
74
 				background-color: #eee;
75
 			}
76
 			.mui-content {
77
 				height: 100%;
78
 				padding: 44px 0px 50px 0px;
79
 				overflow: auto;
80
 				background-color: #eaeaea;
81
 			}
82
 			#msg-list {
83
 				height: 100%;
84
 				overflow: auto;
85
 				-webkit-overflow-scrolling: touch;
86
 			}
87
 			.msg-item {
88
 				padding: 8px;
89
 				clear: both;
90
 			}
91
 			.msg-item .mui-item-clear {
92
 				clear: both;
93
 			}
94
 			.msg-item .msg-user {
95
 				width: 38px;
96
 				height: 38px;
97
 				border: solid 1px #d3d3d3;
98
 				display: inline-block;
99
 				background: #fff;
100
 				border-radius: 3px;
101
 				vertical-align: top;
102
 				text-align: center;
103
 				float: left;
104
 				padding: 3px;
105
 				color: #ddd;
106
 			}
107
 			
108
 			.msg-item .msg-user-img{
109
 				width: 38px;
110
 				height: 38px;
111
 				display: inline-block;
112
 				border-radius: 3px;
113
 				vertical-align: top;
114
 				text-align: center;
115
 				float: left;
116
 				color: #ddd;
117
 			}
118
 			
119
 			.msg-item .msg-content {
120
 				display: inline-block;
121
 				border-radius: 5px;
122
 				border: solid 1px #d3d3d3;
123
 				background-color: #FFFFFF;
124
 				color: #333;
125
 				padding: 8px;
126
 				vertical-align: top;
127
 				font-size: 15px;
128
 				position: relative;
129
 				margin: 0px 8px;
130
 				max-width: 75%;
131
 				min-width: 35px;
132
 				float: left;
133
 			}
134
 			.msg-item .msg-content .msg-content-inner {
135
 				overflow-x: hidden;
136
 			}
137
 			.msg-item .msg-content .msg-content-arrow {
138
 				position: absolute;
139
 				border: solid 1px #d3d3d3;
140
 				border-right: none;
141
 				border-top: none;
142
 				background-color: #FFFFFF;
143
 				width: 10px;
144
 				height: 10px;
145
 				left: -5px;
146
 				top: 12px;
147
 				-webkit-transform: rotateZ(45deg);
148
 				transform: rotateZ(45deg);
149
 			}
150
 			.msg-item-self .msg-user,
151
 			.msg-item-self .msg-content {
152
 				float: right;
153
 			}
154
 			.msg-item-self .msg-content .msg-content-arrow {
155
 				left: auto;
156
 				right: -5px;
157
 				-webkit-transform: rotateZ(225deg);
158
 				transform: rotateZ(225deg);
159
 			}
160
 			.msg-item-self .msg-content,
161
 			.msg-item-self .msg-content .msg-content-arrow {
162
 				background-color: #4CD964;
163
 				color: #fff;
164
 				border-color: #2AC845;
165
 			}
166
 			footer .mui-icon {
167
 				color: #999999;
168
 			}
169
 			footer .mui-icon:active {
170
 				color: #FF9900 !important;
171
 			}/*#007AFF*/
172
 			footer .mui-icon-paperplane:before {
173
 				content: "发送";
174
 			}
175
 			footer .mui-icon-paperplane {
176
 				/*-webkit-transform: rotateZ(45deg);
177
 				transform: rotateZ(45deg);*/
178
 				
179
 				font-size: 16px;
180
 				word-break: keep-all;
181
 				line-height: 100%;
182
 				padding-top: 6px;
183
 				color: rgba(0, 135, 250, 1);
184
 			}
185
 			#msg-sound {
186
 				-webkit-user-select: none !important;
187
 				user-select: none !important;
188
 			}
189
 			.rprogress {
190
 				position: absolute;
191
 				left: 50%;
192
 				top: 50%;
193
 				width: 140px;
194
 				height: 140px;
195
 				margin-left: -70px;
196
 				margin-top: -70px;
197
 				background-image: url(../images/arecord.png);
198
 				background-repeat: no-repeat;
199
 				background-position: center center;
200
 				background-size: 30px 30px;
201
 				background-color: rgba(0, 0, 0, 0.7);
202
 				border-radius: 5px;
203
 				display: none;
204
 				-webkit-transition: .15s;
205
 			}
206
 			.rschedule {
207
 				background-color: rgba(0, 0, 0, 0);
208
 				border: 5px solid rgba(0, 183, 229, 0.9);
209
 				opacity: .9;
210
 				border-left: 5px solid rgba(0, 0, 0, 0);
211
 				border-right: 5px solid rgba(0, 0, 0, 0);
212
 				border-radius: 50px;
213
 				box-shadow: 0 0 15px #2187e7;
214
 				width: 46px;
215
 				height: 46px;
216
 				position: absolute;
217
 				left: 50%;
218
 				top: 50%;
219
 				margin-left: -23px;
220
 				margin-top: -23px;
221
 				-webkit-animation: spin 1s infinite linear;
222
 				animation: spin 1s infinite linear;
223
 			}
224
 			.r-sigh{
225
 				display: none;
226
 				border-radius: 50px;
227
 				box-shadow: 0 0 15px #2187e7;
228
 				width: 46px;
229
 				height: 46px;
230
 				position: absolute;
231
 				left: 50%;
232
 				top: 50%;
233
 				margin-left: -23px;
234
 				margin-top: -23px;
235
 				text-align: center;
236
 				line-height: 46px;
237
 				font-size: 40px;
238
 				font-weight: bold;
239
 				color: #2187e7;
240
 			}
241
 			.rprogress-sigh{
242
 				background-image: none !important;
243
 			}
244
 			.rprogress-sigh .rschedule{
245
 				display: none !important;
246
 			}
247
 			.rprogress-sigh .r-sigh{
248
 				display: block !important;
249
 			}
250
 			.rsalert {
251
 				font-size: 12px;
252
 				color: #bbb;
253
 				text-align: center;
254
 				position: absolute;
255
 				border-radius: 5px;
256
 				width: 130px;
257
 				margin: 5px 5px;
258
 				padding: 5px;
259
 				left: 0px;
260
 				bottom: 0px;
261
 			}
262
 			@-webkit-keyframes spin {
263
 				0% {
264
 					-webkit-transform: rotate(0deg);
265
 				}
266
 				100% {
267
 					-webkit-transform: rotate(360deg);
268
 				}
269
 			}
270
 			@keyframes spin {
271
 				0% {
272
 					transform: rotate(0deg);
273
 				}
274
 				100% {
275
 					transform: rotate(360deg);
276
 				}
277
 			}
278
 			#h {
279
 				background: #fff;
280
 				border: solid 1px #ddd;
281
 				padding: 10px !important;
282
 				font-size: 16px !important;
283
 				font-family: verdana !important;
284
 				line-height: 18px !important;
285
 				overflow: visible;
286
 				position: absolute;
287
 				left: -1000px;
288
 				right: 0px;
289
 				word-break: break-all;
290
 				word-wrap: break-word;
291
 			}
292
 			.cancel {
293
 				background-color: darkred;
294
 			}
295
 		</style>
296
 	</head>
297
  	<body contextmenu="return false;">
298
 		<header class="mui-bar mui-bar-nav toptitbox">
299
 			<span class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></span>
300
 			<h1 class="mui-title toptit">对方姓名</h1>
301
 			<span class="mui-icon mui-icon-contact mui-pull-right personhead"></span>
302
 		</header>
303
 		<pre id='h'></pre>
304
 		<script id='msg-template' type="text/template">
305
 			<% for(var i in record){ var item=record[i]; %>
306
 				<div class="msg-item <%= (item.sender=='self'?' msg-item-self':'') %>" msg-type='<%=(item.type)%>' msg-content='<%=(item.content)%>'>
307
 					<% if(item.sender=='self' ) { %>
308
 						<i class="msg-user mui-icon mui-icon-person"></i>
309
 					<% } else { %>
310
 						<img class="msg-user-img" src="../images/logo.png" alt="" />
311
 					<% } %>
312
 					<div class="msg-content">
313
 						<div class="msg-content-inner">
314
 							<% if(item.type=='text' ) { %>
315
 								<%=( item.content|| '&nbsp;&nbsp;') %>
316
 							<% } else if(item.type=='image' ) { %>
317
 								<img class="msg-content-image" src="<%=(item.content)%>" style="max-width: 100px;" />
318
 							<% } else if(item.type=='sound' ) { %>
319
 								<span class="mui-icon mui-icon-mic" style="font-size: 18px;font-weight: bold;"></span>
320
 								<span class="play-state">点击播放</span>
321
 							<% } %>
322
 						</div>
323
 						<div class="msg-content-arrow"></div>
324
 					</div>
325
 					<div class="mui-item-clear"></div>
326
 				</div>
327
 			<% } %>
328
 		</script>
329
 		<div class="mui-content">
330
 			<div class="operatebox">
331
 				<div class="themespan mui-pull-left">
332
 					<span class="">关于XXXXXX的咨询关于XXXXXX的咨fhj</span>
333
 				</div>
334
 				<div class="operatebtnbox mui-pull-right">
335
 					<button class="mui-btn mui-btn-block mui-btn-outlined frmbtn operatebtn">点击确认完成咨询</button>
336
 				</div>
337
 			</div>
338
 			<div id='msg-list'>
339
 			</div>
340
 		</div>
341
 		<footer>
342
 			<div class="footer-left">
343
 				<i id='msg-image' class="mui-icon mui-icon-camera" style="font-size: 28px;"></i>
344
 			</div>
345
 			<div class="footer-center">
346
 				<textarea id='msg-text' type="text" class='input-text'></textarea>
347
 				<button id='msg-sound' type="button" class='input-sound' style="display: none;">按住说话</button>
348
 			</div>
349
 			<label for="" class="footer-right">
350
 				<i id='msg-type' class="mui-icon mui-icon-mic"></i>
351
 			</label>
352
 		</footer>
353
 		<div id='sound-alert' class="rprogress">
354
 			<div class="rschedule"></div>
355
 			<div class="r-sigh">!</div>
356
 			<div id="audio_tips" class="rsalert">手指上滑,取消发送</div>
357
 		</div>
358
 		<script src="../js/public/mui.min.js"></script>
359
 		<script src="../js/public/mui.imageViewer.js"></script>
360
 		<script src="../js/public/arttmpl.js"></script>
361
 		<script type="text/javascript" charset="utf-8">
362
 			(function($, doc) {
363
 				var MIN_SOUND_TIME = 800;
364
 				$.init({
365
 					gestureConfig: {
366
 						tap: true, //默认为true
367
 						doubletap: true, //默认为false
368
 						longtap: true, //默认为false
369
 						swipe: true, //默认为true
370
 						drag: true, //默认为true
371
 						hold: true, //默认为false,不监听
372
 						release: true //默认为false,不监听
373
 					}
374
 				});
375
 				template.config('escape', false);
376
 				//$.plusReady=function(fn){fn();};
377
 				$.plusReady(function() {
378
 					plus.webview.currentWebview().setStyle({
379
 						softinputMode: "adjustResize"
380
 					});
381
 					var showKeyboard = function() {
382
 						if ($.os.ios) {
383
 							var webView = plus.webview.currentWebview().nativeInstanceObject();
384
 							webView.plusCallMethod({
385
 								"setKeyboardDisplayRequiresUserAction": false
386
 							});
387
 						} else {
388
 							var Context = plus.android.importClass("android.content.Context");
389
 							var InputMethodManager = plus.android.importClass("android.view.inputmethod.InputMethodManager");
390
 							var main = plus.android.runtimeMainActivity();
391
 							var imm = main.getSystemService(Context.INPUT_METHOD_SERVICE);
392
 							imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
393
 							//var view = ((ViewGroup)main.findViewById(android.R.id.content)).getChildAt(0);
394
 							imm.showSoftInput(main.getWindow().getDecorView(), InputMethodManager.SHOW_IMPLICIT);
395
 							//alert("ll");
396
 						}
397
 					};
398
   					var record = [{
399
   						sender: 'zs',
400
   						type: 'text',
401
   						content: 'Hi,我是 科袖 小管家!'
402
   					}];
403
 					var ui = {
404
 						body: doc.querySelector('body'),
405
 						footer: doc.querySelector('footer'),
406
 						footerRight: doc.querySelector('.footer-right'),
407
 						footerLeft: doc.querySelector('.footer-left'),
408
 						btnMsgType: doc.querySelector('#msg-type'),
409
 						boxMsgText: doc.querySelector('#msg-text'),
410
 						boxMsgSound: doc.querySelector('#msg-sound'),
411
 						btnMsgImage: doc.querySelector('#msg-image'),
412
 						areaMsgList: doc.querySelector('#msg-list'),
413
 						boxSoundAlert: doc.querySelector('#sound-alert'),
414
 						h: doc.querySelector('#h'),
415
 						content: doc.querySelector('.mui-content')
416
 					};
417
 					ui.h.style.width = ui.boxMsgText.offsetWidth+'px';
418
 					//alert(ui.boxMsgText.offsetWidth );
419
 					var footerPadding = ui.footer.offsetHeight - ui.boxMsgText.offsetHeight;
420
 					var msgItemTap = function(msgItem, event) {
421
 						var msgType = msgItem.getAttribute('msg-type');
422
 						var msgContent = msgItem.getAttribute('msg-content')
423
 						if (msgType == 'sound') {
424
 							player = plus.audio.createPlayer(msgContent);
425
 							var playState = msgItem.querySelector('.play-state');
426
 							playState.innerText = '正在播放...';
427
 							player.play(function() {
428
 								playState.innerText = '点击播放';
429
 							}, function(e) {
430
 								playState.innerText = '点击播放';
431
 							});
432
 						}
433
 					};
434
 					var imageViewer = new $.ImageViewer('.msg-content-image', {
435
 						dbl: false
436
 					});
437
 					var bindMsgList = function() {
438
 						//绑定数据:
439
 						/*tp.bind({
440
 							template: 'msg-template',
441
 							element: 'msg-list',
442
 							model: record
443
 						});*/
444
 						ui.areaMsgList.innerHTML = template('msg-template', {
445
 							"record": record
446
 						});
447
 						var msgItems = ui.areaMsgList.querySelectorAll('.msg-item');
448
 						[].forEach.call(msgItems, function(item, index) {
449
 							item.addEventListener('tap', function(event) {
450
 								msgItemTap(item, event);
451
 							}, false);
452
 						});
453
 						imageViewer.findAllImage();
454
 						ui.areaMsgList.scrollTop = ui.areaMsgList.scrollHeight +  ui.areaMsgList.offsetHeight;
455
 					};
456
 					bindMsgList();
457
 					window.addEventListener('resize', function() {
458
 						ui.areaMsgList.scrollTop = ui.areaMsgList.scrollHeight +  ui.areaMsgList.offsetHeight;
459
 					}, false);
460
 					var send = function(msg) {
461
 						record.push(msg);
462
 						bindMsgList();
463
 						toRobot(msg.content);
464
 					};
465
 					var toRobot = function(info) {
466
 						var apiUrl = 'http://www.tuling123.com/openapi/api';
467
 						$.getJSON(apiUrl, {
468
 							"key": 'acfbca724ea1b5db96d2eef88ce677dc',
469
 							"info": info,
470
 							"userid": plus.device.uuid
471
 						}, function(data) {
472
 							//alert(JSON.stringify(data));
473
 							record.push({
474
 								sender: 'zs',
475
 								type: 'text',
476
 								content: data.text
477
 							});
478
 							bindMsgList();
479
 						});
480
 					};
481
  					function msgTextFocus() {
482
 							ui.boxMsgText.focus();
483
 							setTimeout(function() {
484
 								ui.boxMsgText.focus();
485
 							}, 150);
486
 						}
487
 						//解决长按“发送”按钮,导致键盘关闭的问题;
488
 					ui.footerRight.addEventListener('touchstart', function(event) {
489
 						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
490
 							msgTextFocus();
491
 							event.preventDefault();
492
 						}
493
 					});
494
 					//解决长按“发送”按钮,导致键盘关闭的问题;
495
 					ui.footerRight.addEventListener('touchmove', function(event) {
496
 						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
497
 							msgTextFocus();
498
 							event.preventDefault();
499
 						}
500
 					});
501
 					//					ui.footerRight.addEventListener('touchcancel', function(event) {
502
 					//						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
503
 					//							msgTextFocus();
504
 					//							event.preventDefault();
505
 					//						}
506
 					//					});
507
 					//					ui.footerRight.addEventListener('touchend', function(event) {
508
 					//						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
509
 					//							msgTextFocus();
510
 					//							event.preventDefault();
511
 					//						}
512
 					//					});
513
 					ui.footerRight.addEventListener('release', function(event) {
514
 						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
515
 							//showKeyboard();
516
 							ui.boxMsgText.focus();
517
 							setTimeout(function() {
518
 								ui.boxMsgText.focus();
519
 							}, 150);
520
 							//							event.detail.gesture.preventDefault();
521
 							send({
522
 								sender: 'self',
523
 								type: 'text',
524
 								content: ui.boxMsgText.value.replace(new RegExp('\n', 'gm'), '<br/>')
525
 							});
526
 							ui.boxMsgText.value = '';
527
 							$.trigger(ui.boxMsgText, 'input', null);
528
 						} else if (ui.btnMsgType.classList.contains('mui-icon-mic')) {
529
 							ui.btnMsgType.classList.add('mui-icon-compose');
530
 							ui.btnMsgType.classList.remove('mui-icon-mic');
531
 							ui.boxMsgText.style.display = 'none';
532
 							ui.boxMsgSound.style.display = 'block';
533
 							ui.boxMsgText.blur();
534
 							document.body.focus();
535
 						} else if (ui.btnMsgType.classList.contains('mui-icon-compose')) {
536
 							ui.btnMsgType.classList.add('mui-icon-mic');
537
 							ui.btnMsgType.classList.remove('mui-icon-compose');
538
 							ui.boxMsgSound.style.display = 'none';
539
 							ui.boxMsgText.style.display = 'block';
540
 							//--
541
 							//showKeyboard();
542
 							ui.boxMsgText.focus();
543
 							setTimeout(function() {
544
 								ui.boxMsgText.focus();
545
 							}, 150);
546
 						}
547
 					}, false);
548
 					ui.footerLeft.addEventListener('tap', function(event) {
549
 						var btnArray = [{
550
 							title: "拍照"
551
 						}, {
552
 							title: "从相册选择"
553
 						}];
554
 						plus.nativeUI.actionSheet({
555
 							title: "选择照片",
556
 							cancel: "取消",
557
 							buttons: btnArray
558
 						}, function(e) {
559
 							var index = e.index;
560
 							switch (index) {
561
 								case 0:
562
 									break;
563
 								case 1:
564
 									var cmr = plus.camera.getCamera();
565
 									cmr.captureImage(function(path) {
566
 										send({
567
 											sender: 'self',
568
 											type: 'image',
569
 											content: "file://" +  plus.io.convertLocalFileSystemURL(path)
570
 										});
571
 									}, function(err) {});
572
 									break;
573
 								case 2:
574
 									plus.gallery.pick(function(path) {
575
 										send({
576
 											sender: 'self',
577
 											type: 'image',
578
 											content: path
579
 										});
580
 									}, function(err) {}, null);
581
 									break;
582
 							}
583
 						});
584
 					}, false); 
585
 					var setSoundAlertVisable=function(show){
586
 						if(show){
587
 							ui.boxSoundAlert.style.display = 'block';
588
 							ui.boxSoundAlert.style.opacity = 1;
589
 						}else{
590
 							ui.boxSoundAlert.style.opacity = 0;
591
 							//fadeOut完成再真正隐藏
592
 							setTimeout(function(){
593
 								ui.boxSoundAlert.style.display = 'none';
594
 							},200);
595
 						}
596
 					};
597
 					var recordCancel = false;
598
 					var recorder = null;
599
 					var audio_tips = document.getElementById("audio_tips");
600
					var startTimestamp = null;
601
					var stopTimestamp = null;
602
					var stopTimer = null;
603
					ui.boxMsgSound.addEventListener('hold', function(event) {
604
						recordCancel = false;
605
						if(stopTimer)clearTimeout(stopTimer);
606
						audio_tips.innerHTML = "手指上划,取消发送";
607
						ui.boxSoundAlert.classList.remove('rprogress-sigh');
608
						setSoundAlertVisable(true);
609
						recorder = plus.audio.getRecorder();
610
						if (recorder == null) {
611
							plus.nativeUI.toast("不能获取录音对象");
612
							return;
613
						}
614
						startTimestamp = (new Date()).getTime();
615
						recorder.record({
616
							filename: "_doc/audio/"
617
						}, function(path) {
618
							if (recordCancel) return;
619
							send({
620
								sender: 'self',
621
								type: 'sound',
622
								content: path
623
							});
624
						}, function(e) {
625
							plus.nativeUI.toast("录音时出现异常: " +  e.message);
626
						});
627
					}, false);
628
					ui.body.addEventListener('drag', function(event) {
629
						//console.log('drag');
630
						if (Math.abs(event.detail.deltaY) > 50) {
631
							if (!recordCancel) {
632
								recordCancel = true;
633
								if (!audio_tips.classList.contains("cancel")) {
634
									audio_tips.classList.add("cancel");
635
								}
636
								audio_tips.innerHTML = "松开手指,取消发送";
637
							}
638
						} else {
639
							if (recordCancel) {
640
								recordCancel = false;
641
								if (audio_tips.classList.contains("cancel")) {
642
									audio_tips.classList.remove("cancel");
643
								}
644
								audio_tips.innerHTML = "手指上划,取消发送";
645
							}
646
						}
647
					}, false);
648
					ui.boxMsgSound.addEventListener('release', function(event) {
649
						//console.log('release');
650
						if (audio_tips.classList.contains("cancel")) {
651
							audio_tips.classList.remove("cancel");
652
							audio_tips.innerHTML = "手指上划,取消发送";
653
						}
654
						//
655
						stopTimestamp = (new Date()).getTime();
656
						if (stopTimestamp - startTimestamp < MIN_SOUND_TIME) {
657
							audio_tips.innerHTML = "录音时间太短";
658
							ui.boxSoundAlert.classList.add('rprogress-sigh');
659
							recordCancel = true;
660
							stopTimer=setTimeout(function(){
661
								setSoundAlertVisable(false);
662
							},800);
663
						}else{
664
							setSoundAlertVisable(false);
665
						}
666
						recorder.stop();
667
					}, false);
668
					ui.boxMsgSound.addEventListener("touchstart", function(e) {
669
						//console.log("start....");
670
						e.preventDefault();
671
					});
672
					ui.boxMsgText.addEventListener('input', function(event) {
673
						ui.btnMsgType.classList[ui.boxMsgText.value == '' ? 'remove' : 'add']('mui-icon-paperplane');
674
						ui.btnMsgType.setAttribute("for", ui.boxMsgText.value == '' ? '' : 'msg-text');
675
						ui.h.innerText = ui.boxMsgText.value.replace(new RegExp('\n', 'gm'), '\n-') || '-';
676
						ui.footer.style.height = (ui.h.offsetHeight +  footerPadding) +  'px';
677
						ui.content.style.paddingBottom = ui.footer.style.height;
678
					});
679
					ui.boxMsgText.addEventListener('tap', function(event) {
680
						ui.boxMsgText.focus();
681
						setTimeout(function() {
682
							ui.boxMsgText.focus();
683
						}, 0);
684
					}, false);
685
				});
686
			}(mui, document));
687
		</script>
688
	</body>
689
</html>

+ 0 - 1
app/html/consultapply.html

@ -52,7 +52,6 @@
52 52
					<ul class="aimclass">
53 53
						<li class="liactive"><em></em>技术咨询</li>
54 54
						<li><em></em>资源咨询</li>
55
						<li><em></em>会议邀请</li>
56 55
						<li><em></em>其他事务</li>
57 56
					</ul>
58 57
				</div>

+ 203 - 0
app/html/consultlist.html

@ -0,0 +1,203 @@
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8">
5
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
6
    <title></title>
7
    <link href="../css/mui.min.css" rel="stylesheet"/>
8
    <link href="../css/app.css" rel="stylesheet"/>
9
    
10
    <style>
11
    /*跨webview需要手动指定位置*/
12
			
13
			.mui-plus header.mui-bar {
14
				display: none!important;
15
			}
16
			.mui-plus .mui-bar-nav~.mui-content {
17
				padding: 0!important;
18
			}
19
			
20
			.mui-plus .plus{
21
				display: inline;
22
			}
23
			
24
			.plus{
25
				display: none;
26
			}
27
			
28
			#topPopover {
29
				position: fixed;
30
				top: 16px;
31
				right: 6px;
32
			}
33
			#topPopover .mui-popover-arrow {
34
				left: auto;
35
				right: 6px;
36
			}
37
			
38
			span.mui-icon {
39
				font-size: 14px;
40
				color: #007aff;
41
				margin-left: -15px;
42
				padding-right: 10px;
43
			}
44
			.mui-popover {
45
				height: 300px;
46
			}
47
    </style>
48
</head>
49
<body>
50
51
	<!-- 主页面标题 -->
52
	<header class="mui-bar mui-bar-nav toptitbox">
53
	    <h1 class="mui-title toptit">咨询</h1>
54
	</header>
55
	<!--主页面底部菜单-->
56
    <nav class="mui-bar mui-bar-tab footbox">
57
	    <a class="mui-tab-item mui-active" href="index.html">
58
	        <span class="mui-icon mui-icon-home"></span>
59
	    </a>
60
	    <a class="mui-tab-item">
61
	        <span class="mui-icon mui-icon-chat"></span>
62
	    </a>
63
	    <a class="mui-tab-item">
64
	        <span class="mui-icon mui-icon-email"></span>
65
	    </a>
66
	    <a class="mui-tab-item" href="html/myaccount.html">
67
	        <span class="mui-icon mui-icon-person"></span>
68
	    </a>
69
	</nav>
70
    <!-- 主页面内容容器 -->
71
    <div class="mui-content">
72
    	<!-- 主界面具体展示内容 -->
73
    	<div class="filterbox2">
74
			<ul class="filterblock2">
75
				<li>
76
					<select class="filterlist2">
77
						<option>全部</option>
78
						<option>我的需求</option>
79
						<option>向我咨询</option>
80
					</select>
81
					<span class="mui-icon mui-icon-arrowdown downarrow"></span>
82
				</li>
83
				<li>
84
					<a href="#middlePopover" class="mui-btn mui-btn-primary mui-btn-block mui-btn-outlined filterlist" >学术领域<em class="mui-icon mui-icon-arrowdown"></em></a>
85
				</li>
86
				<li>
87
					<button class="mui-btn mui-btn-block filterlist" type='button'>应用行业<em class="mui-icon mui-icon-arrowdown"></em></button>
88
				</li>
89
			</ul>
90
		</div>
91
        <!--图文列表-->
92
        <div class="mui-card-content conblock">
93
        	
94
	        <ul class="mui-table-view protable">
95
	            <li class="mui-table-view-cell mui-media">
96
	            	<div class="coutopicbox">
97
	            		<span class="coutheme mui-ellipsis mui-pull-left">关于某某技术的咨询某某技术的咨询某某技术的咨询某某技术的咨询</span>
98
	            		<div class="coustatus mui-pull-right">
99
	            			<span class="aimlabel">技术</span>
100
	            			<span class="status-1">进行中</span>
101
	            			<!--进行中"status-1"  待评价"status-2"  已完成"status-3"-->
102
	            		</div>
103
	            		
104
	            	</div>
105
	                <a class="proinfor" href="chats.html">
106
						<span class="mui-badge mui-badge-danger">45</span>
107
		                <img class="mui-media-object mui-pull-left headimg" src="../images/default-photo.jpg">
108
	                    <div class="mui-media-body">
109
	                        <span class="listtit">专家姓名<img class="smallicon authicon" src="../images/authicon.png"/><span class="thistime">今天 10:20</span></span>	
110
	                        <p class="listtit2"><span>职称</span>,<span>职务</span>,<span>所属机构</span> | <span>所在地</span></p>
111
	                    	<p class="listtit3">专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名专家姓名</p>
112
	                    </div>
113
	                </a>
114
	            </li>
115
	            <li class="mui-table-view-cell mui-media">
116
	            	<div class="coutopicbox">
117
	            		<span class="coutheme mui-ellipsis mui-pull-left"><span>回复:</span>关于某某技术的咨询某某技术的咨询某某技术的咨询某某技术的咨询</span>
118
	            		<div class="coustatus mui-pull-right">
119
	            			<span class="aimlabel">其它</span>
120
	            			<span class="status-2">待评价</span>
121
	            			<!--进行中"status-1"  待评价"status-2"  已完成"status-3"-->
122
	            		</div>
123
	            		
124
	            	</div>
125
	                <a class="proinfor" href="chats.html">
126
	                	<span class="mui-badge mui-badge-danger">1</span>
127
	                    <img class="mui-media-object mui-pull-left headimg" src="../images/default-photo.jpg">
128
	                    <div class="mui-media-body">
129
	                        <span class="listtit">专家姓名<img class="smallicon authicon" src="../images/authicon.png"/><span class="thistime">今天 10:20</span></span>	
130
	                        <p class="listtit2"><span>职称</span>,<span>职务</span>,<span>所属机构</span> | <span>所在地</span></p>
131
	                    	<p class="listtit3">专家姓名专家姓名专家姓名专家</p>
132
	                    </div>
133
	                </a>
134
	            </li>
135
				<li class="mui-table-view-cell mui-media">
136
	            	<div class="coutopicbox">
137
	            		<span class="coutheme mui-ellipsis mui-pull-left">关于某某技术的咨询某某技术的咨询某某技术的咨询某某技术的咨询</span>
138
	            		<div class="coustatus mui-pull-right">
139
	            			<span class="aimlabel">资源</span>
140
	            			<span class="status-3">已完成</span>
141
	            			<!--进行中"status-1"  待评价"status-2"  已完成"status-3"-->
142
	            		</div>
143
	            		
144
	            	</div>
145
	                <a class="proinfor" href="chats.html">
146
	                    <img class="mui-media-object mui-pull-left headimg" src="../images/default-photo.jpg">
147
	                    <div class="mui-media-body">
148
	                        <span class="listtit">专家姓名<img class="smallicon authicon" src="../images/authicon.png"/><span class="thistime">今天 10:20</span></span>	
149
	                        <p class="listtit2"><span>职称</span>,<span>职务</span>,<span>所属机构</span> | <span>所在地</span></p>
150
	                    	<p class="listtit3">专家姓名专姓名专家姓名专家姓名专姓名专家姓名专家姓名</p>
151
	                    </div>
152
	                </a>
153
	            </li>
154
	        </ul>
155
		</div>
156
    </div>
157
	
158
	<div id="middlePopover" class="mui-popover">
159
			<div class="mui-popover-arrow"></div>
160
			<div class="mui-scroll-wrapper">
161
				<div class="mui-scroll">
162
					<ul class="mui-table-view">
163
						<li class="mui-table-view-cell"><a href="#">Item1</a>
164
						</li>
165
						<li class="mui-table-view-cell"><a href="#">Item2</a>
166
						</li>
167
						<li class="mui-table-view-cell"><a href="#">Item3</a>
168
						</li>
169
						<li class="mui-table-view-cell"><a href="#">Item4</a>
170
						</li>
171
						<li class="mui-table-view-cell"><a href="#">Item5</a>
172
						</li>
173
						<li class="mui-table-view-cell"><a href="#">Item6</a>
174
						</li>
175
						<li class="mui-table-view-cell"><a href="#">Item7</a>
176
						</li>
177
						<li class="mui-table-view-cell"><a href="#">Item8</a>
178
						</li>
179
						<li class="mui-table-view-cell"><a href="#">Item9</a>
180
						</li>
181
						<li class="mui-table-view-cell"><a href="#">Item10</a>
182
						</li>
183
					</ul>
184
				</div>
185
			</div>
186

187
		</div>
188
	<script src="../js/public/mui.min.js"></script>
189
    <script type="text/javascript" charset="utf-8">
190
      	mui.init({
191
				swipeBack: true //启用右滑关闭功能
192
			});
193
			mui('.mui-scroll-wrapper').scroll();
194
			mui('body').on('shown', '.mui-popover', function(e) {
195
				//console.log('shown', e.detail.id);//detail为当前popover元素
196
			});
197
			mui('body').on('hidden', '.mui-popover', function(e) {
198
				//console.log('hidden', e.detail.id);//detail为当前popover元素
199
			});
200

201
    </script>	
202
</body>
203
</html>

+ 11 - 4
app/html/myaccount.html

@ -51,11 +51,17 @@
51 51
		    </div>
52 52
			<div class="mui-input-group  marginbox">
53 53
				<ul class="mui-table-view">
54
				    <!--<li class="mui-table-view-cell">
55
				        <a class="mui-navigate-right walltebox">
56
				        	<em class="actionicon wallteicon mui-pull-left"></em>
57
				        	<span class="mui-pull-left">我的钱包</span>
58
				        	<span class="rightword">¥0.00</span>
59
				        </a>
60
				    </li>-->
54 61
				    <li class="mui-table-view-cell">
55
				        <a class="mui-navigate-right walltebox">
56
				        	<em class="actionicon wallteicon mui-pull-left"></em>
57
				        	<span class="mui-pull-left">我的钱包</span>
58
				        	<span class="rightword">¥0.00</span>
62
				        <a class="mui-navigate-right" href="attentions.html">
63
				        	<em class="actionicon attenticon mui-pull-left"></em>
64
				        	<span class="mui-pull-left">我的关注</span>
59 65
				        </a>
60 66
				    </li>
61 67
				    <li class="mui-table-view-cell">
@ -64,6 +70,7 @@
64 70
				        	<span class="mui-pull-left">邀请新用户</span>
65 71
				        </a>
66 72
				    </li>
73
				    
67 74
				</ul>
68 75
		    </div>
69 76
		    <div class="mui-input-group  marginbox">

+ 9 - 4
app/html/proinforbrow-more.html

@ -16,10 +16,15 @@
16 16
		</header>
17 17
		
18 18
		<!--主页面底部菜单-->
19
	    <nav class="mui-bar mui-bar-tab footbox">
20
		    <div class="dialogbtn">
21
		    	<em class="mui-pull-left"></em>
22
				<span class="mui-pull-left">联系专家</span>
19
	    <nav class="mui-bar mui-bar-tab mui-clearfix footbox">
20
		    <div class="dialogbtn mui-pull-left btnactive">
21
		    	<div>
22
			    	<em class="mui-pull-left"></em>
23
					<span class="mui-pull-left">联系专家</span>
24
				</div>
25
			</div>
26
			<div class="attentbtn mui-pull-left">
27
				<em></em>
23 28
			</div>
24 29
		</nav>
25 30
		<!-- 主页面内容容器 -->

+ 9 - 4
app/html/proinforbrow.html

@ -16,10 +16,15 @@
16 16
		</header>
17 17
		
18 18
		<!--主页面底部菜单-->
19
	    <nav class="mui-bar mui-bar-tab footbox">
20
		    <div class="dialogbtn">
21
		    	<em class="mui-pull-left"></em>
22
				<span class="mui-pull-left">联系专家</span>
19
	    <nav class="mui-bar mui-bar-tab mui-clearfix footbox">
20
		    <div class="dialogbtn mui-pull-left btnactive">
21
		    	<div>
22
			    	<em class="mui-pull-left"></em>
23
					<span class="mui-pull-left">联系专家</span>
24
				</div>
25
			</div>
26
			<div class="attentbtn mui-pull-left">
27
				<em></em>
23 28
			</div>
24 29
		</nav>
25 30
		<!-- 主页面内容容器 -->

BIN
app/images/attenticon.png


+ 2 - 0
app/js/public/arttmpl.js

@ -0,0 +1,2 @@
1
/*!art-template - Template Engine | http://aui.github.com/artTemplate/*/
2
!function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(/<!--[\w\W]*?-->/g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(B){throw B.temp="function anonymous($data,$filename) {"+z+"}",B}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a,b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","&":"&#38;"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;d>c;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(j){return j.filename=h||"anonymous",j.name="Syntax Error",p(j)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;"function"==typeof define?define(function(){return d}):"undefined"!=typeof exports?module.exports=d:this.template=d}();

+ 268 - 0
app/js/public/mui.imageViewer.js

@ -0,0 +1,268 @@
1
/**
2
 * 图片预览组件
3
 * varstion 0.4.0
4
 * by Houfeng
5
 * Houfeng@DCloud.io
6
 */
7
8
(function($, document) {
9
10
	$.init({
11
		gestureConfig: {
12
			tap: true, //默认为true
13
			doubletap: true, //默认为false
14
			longtap: true, //默认为false
15
			swipe: true, //默认为true
16
			drag: true, //默认为true
17
			hold: true, //默认为false,不监听
18
			release: true //默认为false,不监听
19
		}
20
	});
21
22
	var touchSupport = ('ontouchstart' in document);
23
	var tapEventName = touchSupport ? 'tap' : 'click';
24
	var enterEventName = touchSupport ? 'tap' : 'click';
25
	var imageClassName = $.className('image');
26
27
28
	//创建DOM (此函数是否可放在 mui.js 中)
29
	$.dom = function(str) {
30
		if (!$.__create_dom_div__) {
31
			$.__create_dom_div__ = document.createElement('div');
32
		}
33
		$.__create_dom_div__.innerHTML = str;
34
		return $.__create_dom_div__.childNodes;
35
	};
36
37
	//图片预览组件类
38
	var ImageViewer = $.ImageViewer = $.Class.extend({
39
		//构造函数
40
		init: function(selector, options) {
41
			var self = this;
42
			self.options = options || {};
43
			self.selector = selector || 'img';
44
			if (self.options.dbl) {
45
				enterEventName = touchSupport ? 'doubletap' : 'dblclick';
46
			}
47
			self.findAllImage();
48
			self.createViewer();
49
			self.bindEvent();
50
		},
51
		//创建图片预览组件的整体 UI
52
		createViewer: function() {
53
			var self = this;
54
			self.viewer = $.dom("<div class='mui-imageviewer'><div class='mui-imageviewer-mask'></div><div class='mui-imageviewer-header'><i class='mui-icon mui-icon-closeempty mui-imageviewer-close'></i><span class='mui-imageviewer-state'></span></div><i class='mui-icon mui-icon-arrowleft  mui-imageviewer-left'></i><i class='mui-icon mui-icon-arrowright mui-imageviewer-right'></i></div>");
55
			self.viewer = self.viewer[0] || self.viewer;
56
			//self.viewer.style.height = screen.height;
57
			self.closeButton = self.viewer.querySelector('.mui-imageviewer-close');
58
			self.state = self.viewer.querySelector('.mui-imageviewer-state');
59
			self.leftButton = self.viewer.querySelector('.mui-imageviewer-left');
60
			self.rightButton = self.viewer.querySelector('.mui-imageviewer-right');
61
			self.mask = self.viewer.querySelector('.mui-imageviewer-mask');
62
			document.body.appendChild(self.viewer);
63
		},
64
		//查找所有符合的图片
65
		findAllImage: function() {
66
			var self = this;
67
			self.images = [].slice.call($(self.selector));
68
		},
69
		//检查图片是否为启动预览的图片
70
		checkImage: function(target) {
71
			var self = this;
72
			if (target.tagName !== 'IMG') return false;
73
			return self.images.some(function(image) {
74
				return image == target;
75
			});
76
		},
77
		//绑定事件
78
		bindEvent: function() {
79
			var self = this;
80
			//绑定图片 tap 事件
81
			document.addEventListener(enterEventName, function(event) {
82
				if (!self.viewer) return;
83
				var target = event.target;
84
				if (!self.checkImage(target)) return;
85
				self.viewer.style.display = 'block';
86
				setTimeout(function() {
87
					self.viewer.style.opacity = 1;
88
				}, 0);
89
				self.index = self.images.indexOf(target);
90
				self.currentItem = self.createImage(self.index);
91
			}, false);
92
			//关系按钮事件
93
			self.closeButton.addEventListener(tapEventName, function(event) {
94
				self.viewer.style.opacity = 0;
95
				setTimeout(function() {
96
					self.viewer.style.display = 'none';
97
					self.disposeImage(true);
98
				}, 600);
99
				event.preventDefault();
100
				event.cancelBubble = true;
101
			}, false);
102
			//处理左右按钮
103
			self.leftButton.addEventListener(tapEventName, function() {
104
				self.prev();
105
			}, false);
106
			self.rightButton.addEventListener(tapEventName, function() {
107
				self.next();
108
			}, false);
109
			//处理划动
110
			self.mask.addEventListener($.EVENT_MOVE, function(event) {
111
				event.preventDefault();
112
				event.cancelBubble = true;
113
			}, false);
114
			self.viewer.addEventListener('swipeleft', function(event) {
115
				if (self.scaleValue == 1) self.next();
116
				event.preventDefault();
117
				event.cancelBubble = true;
118
			}, false);
119
			self.viewer.addEventListener('swiperight', function(event) {
120
				if (self.scaleValue == 1) self.prev();
121
				event.preventDefault();
122
				event.cancelBubble = true;
123
			}, false);
124
			//处理缩放开始
125
			self.viewer.addEventListener($.EVENT_START, function(event) {
126
				var touches = event.touches;
127
				if (touches.length == 2) {
128
					var p1 = touches[0];
129
					var p2 = touches[1];
130
					var x = p1.pageX - p2.pageX; //x1-x2
131
					var y = p1.pageY - p2.pageY; //y1-y2
132
					self.scaleStart = Math.sqrt(x * x + y * y);
133
					self.isMultiTouch = true;
134
				} else if (touches.length = 1) {
135
					self.dragStart = touches[0];
136
				}
137
			}, false);
138
			self.viewer.addEventListener($.EVENT_MOVE, function(event) {
139
				var img = self.currentItem.querySelector('img');
140
				var touches = event.changedTouches;
141
				if (touches.length == 2) {
142
					event.preventDefault();
143
					event.cancelBubble = true;
144
					var p1 = touches[0];
145
					var p2 = touches[1];
146
					var x = p1.pageX - p2.pageX;
147
					var y = p1.pageY - p2.pageY;
148
					self.scaleEnd = Math.sqrt(x * x + y * y);
149
					self._scaleValue = (self.scaleValue * (self.scaleEnd / self.scaleStart));
150
					//self.state.innerText = self._scaleValue;
151
					img.style.webkitTransform = "scale(" + self._scaleValue + "," + self._scaleValue + ") "; // + " translate(" + self.dragX || 0 + "px," + self.dragY || 0 + "px)";
152
				} else if (!self.isMultiTouch && touches.length == 1 && self.scaleValue != 1) {
153
					event.preventDefault();
154
					event.cancelBubble = true;
155
					self.dragEnd = touches[0];
156
					self._dragX = self.dragX + (self.dragEnd.pageX - self.dragStart.pageX);
157
					self._dragY = self.dragY + (self.dragEnd.pageY - self.dragStart.pageY);
158
					img.style.marginLeft = self._dragX + 'px';
159
					img.style.marginTop = self._dragY + 'px';
160
					//img.style.transform = "translate(" + self._dragX + "px," + self._dragY + "px) " + " scale(" + self.scaleValue || 1 + "," + self.scaleValue || 1 + ")";
161
				}
162
			}, false);
163
			self.viewer.addEventListener($.EVENT_END, function() {
164
				self.scaleValue = self._scaleValue || self.scaleValue;
165
				self._scaleValue = null;
166
				self.dragX = self._dragX;
167
				self.dragY = self._dragY;
168
				self._dragX = null;
169
				self._dragY = null;
170
				var touches = event.touches;
171
				self.isMultiTouch = (touches.length != 0);
172
			});
173
			// doubletap 好像不能用
174
			self.viewer.addEventListener('doubletap', function() {
175
				var img = self.currentItem.querySelector('img');
176
				if (self.scaleValue === 1) {
177
					self.scaleValue = 2;
178
				} else {
179
					self.scaleValue = 1;
180
				}
181
				self.dragX = 0;
182
				self.dragY = 0;
183
				img.style.marginLeft = self.dragX + 'px';
184
				img.style.marginTop = self.dragY + 'px';
185
				img.style.webkitTransform = "scale(" + self.scaleValue + "," + self.scaleValue + ") "; //+ " translate(" + self.dragX || 0 + "px," + self.dragY || 0 + "px)";
186
				self.viewer.__tap_num = 0;
187
			}, false);
188
			//处理缩放结束
189
		},
190
		//下一张图片
191
		next: function() {
192
			var self = this;
193
			self.mask.style.display = 'block';
194
			self.index++;
195
			var newItem = self.createImage(self.index, 'right');
196
			setTimeout(function() {
197
				self.currentItem.classList.remove('mui-imageviewer-item-center');
198
				self.currentItem.classList.add('mui-imageviewer-item-left');
199
				newItem.classList.remove('mui-imageviewer-item-right');
200
				newItem.classList.add('mui-imageviewer-item-center');
201
				self.oldItem = self.currentItem;
202
				self.currentItem = newItem;
203
				// TODO: 临时,稍候将调整
204
				setTimeout(function() {
205
					self.disposeImage();
206
					self.mask.style.display = 'none';
207
				}, 600);
208
			}, 25);
209
		},
210
		//上一张图片
211
		prev: function() {
212
			var self = this;
213
			self.mask.style.display = 'block';
214
			self.index--;
215
			var newItem = self.createImage(self.index, 'left');
216
			setTimeout(function() {
217
				self.currentItem.classList.remove('mui-imageviewer-item-center');
218
				self.currentItem.classList.add('mui-imageviewer-item-right');
219
				newItem.classList.remove('mui-imageviewer-item-left');
220
				newItem.classList.add('mui-imageviewer-item-center');
221
				self.oldItem = self.currentItem;
222
				self.currentItem = newItem;
223
				// TODO: 临时,稍候将调整
224
				setTimeout(function() {
225
					self.disposeImage();
226
					self.mask.style.display = 'none';
227
				}, 600);
228
			}, 25);
229
		},
230
		//释放不显示的图片
231
		disposeImage: function(all) {
232
			var sel = '.mui-imageviewer-item-left,.mui-imageviewer-item-right';
233
			if (all) sel += ",.mui-imageviewer-item";
234
			var willdisposes = $(sel);
235
			willdisposes.each(function(i, item) {
236
				if (item.parentNode && item.parentNode.removeChild)
237
					item.parentNode.removeChild(item, true);
238
			});
239
		},
240
		//创建一个图片
241
		createImage: function(index, type) {
242
			var self = this;
243
			type = type || 'center';
244
			if (index < 0) index = self.images.length - 1;
245
			if (index > self.images.length - 1) index = 0;
246
			self.index = index;
247
			var item = $.dom("<div class='mui-imageviewer-item'></div>")[0];
248
			item.appendChild($.dom('<span><img src="' + self.images[self.index].src + '"/></span>')[0]);
249
			item.classList.add('mui-imageviewer-item-' + type);
250
			self.viewer.appendChild(item);
251
			self.state.innerText = (self.index + 1) + "/" + self.images.length;
252
			//重置初始缩放比例
253
			self.scaleValue = 1;
254
			self.dragX = 0;
255
			self.dragY = 0;
256
			return item;
257
		}
258
	});
259
260
	$.imageViewer = function(selector, options) {
261
		return new ImageViewer(selector, options);
262
	};
263
264
	$.ready(function() {
265
		$.imageViewer('.' + imageClassName);
266
	});
267
268
}(mui, document));