|
@ -7,12 +7,15 @@
|
7
|
7
|
<link href="../css/mui.min.css" rel="stylesheet" />
|
8
|
8
|
<link href="../css/iconfont.css" rel="stylesheet" />
|
9
|
9
|
<link href="../css/app.css" rel="stylesheet" />
|
|
10
|
|
10
|
11
|
</head>
|
11
|
12
|
|
12
|
13
|
<body>
|
13
|
14
|
<header class="mui-bar mui-bar-nav toptitbox">
|
14
|
15
|
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
|
15
|
16
|
<h1 class="mui-title toptit" id="professorName"></h1>
|
|
17
|
<a class="mui-icon iconfont icon-share mui-pull-right button topmore" onclick="shareShow()" id="shareBtn"></a>
|
|
18
|
|
16
|
19
|
<!--<a class="mui-icon iconfont icon-moreandroid mui-pull-right topmore" id="professorName"></a>-->
|
17
|
20
|
<!--<a class="mui-icon iconfont icon-share mui-pull-right topmore" id="shareBtn">
|
18
|
21
|
<ul class="sharebox" id="shareBox" style="display:none; color: #000000;">
|
|
@ -54,7 +57,7 @@
|
54
|
57
|
<img class="headimg headRadius" src="" />
|
55
|
58
|
<div class="listtit"><span class="personalMaterial"></span><em class="mui-icon iconfont" style="margin-top:5px;" id="nameli"></em></div>
|
56
|
59
|
<p class="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span></p>
|
57
|
|
<p cauthwordlass="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span> <span class="personalMaterial"></span></p>
|
|
60
|
<p class="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span> <span class="personalMaterial"></span></p>
|
58
|
61
|
</a>
|
59
|
62
|
</div>
|
60
|
63
|
</div>
|
|
@ -64,7 +67,7 @@
|
64
|
67
|
<div class="mui-pull-left peocountbox">
|
65
|
68
|
<div class="peocount mui-clearfix">
|
66
|
69
|
<em class="mui-icon iconfont icon-community actionicon dialogicon mui-pull-left "></em>
|
67
|
|
<span class="mui-pull-left">已完成咨询<em class="consultCount"></em>人次</span>
|
|
70
|
<span class="mui-pull-left">已完成咨询<em class="consultCount"></em>次</span>
|
68
|
71
|
</div>
|
69
|
72
|
</div>
|
70
|
73
|
<div class="rightword levelbox ">
|
|
@ -182,6 +185,185 @@
|
182
|
185
|
<script src="../js/public/mui.min.js"></script>
|
183
|
186
|
<script src="../js/public/base.js"></script>
|
184
|
187
|
<script src="../js/proinfobrow.js"></script>
|
|
188
|
<script type="text/javascript">
|
|
189
|
var shareBtn=document.getElementById("shareBtn");
|
|
190
|
// shareBtn.addEventListener('tap', function() {
|
|
191
|
// mui.openWindow({
|
|
192
|
// url: '../html/shareProinfor.html',
|
|
193
|
// id: 'html/shareProinfor.html',
|
|
194
|
//
|
|
195
|
// });
|
|
196
|
// });
|
|
197
|
var shares=null;
|
|
198
|
var Intent=null,File=null,Uri=null,main=null;
|
|
199
|
// H5 plus事件处理
|
|
200
|
function plusReady(){
|
|
201
|
updateSerivces();
|
|
202
|
if(plus.os.name=="Android"){
|
|
203
|
main = plus.android.runtimeMainActivity();
|
|
204
|
Intent = plus.android.importClass("android.content.Intent");
|
|
205
|
File = plus.android.importClass("java.io.File");
|
|
206
|
Uri = plus.android.importClass("android.net.Uri");
|
|
207
|
}
|
|
208
|
}
|
|
209
|
if(window.plus){
|
|
210
|
plusReady();
|
|
211
|
}else{
|
|
212
|
document.addEventListener("plusready",plusReady,false);
|
|
213
|
}
|
|
214
|
/**
|
|
215
|
* 更新分享服务
|
|
216
|
*/
|
|
217
|
function updateSerivces(){
|
|
218
|
plus.share.getServices( function(s){
|
|
219
|
shares={};
|
|
220
|
for(var i in s){
|
|
221
|
var t=s[i];
|
|
222
|
shares[t.id]=t;
|
|
223
|
}
|
|
224
|
}, function(e){
|
|
225
|
outSet( "获取分享服务列表失败:"+e.message );
|
|
226
|
} );
|
|
227
|
}
|
|
228
|
/**
|
|
229
|
* 调用系统分享
|
|
230
|
* 调用
|
|
231
|
*/
|
|
232
|
function shareSystem() {
|
|
233
|
if(plus.os.name!=="Android"){
|
|
234
|
plus.nativeUI.alert("此平台暂不支持系统分享功能!");
|
|
235
|
return;
|
|
236
|
}
|
|
237
|
var intent=new Intent(Intent.ACTION_SEND);
|
|
238
|
var p = "";
|
|
239
|
if(pic&&pic.realUrl){
|
|
240
|
p = pic.realUrl;
|
|
241
|
if(p.substr(0,7)==="file://"){
|
|
242
|
p=p.substr(7);
|
|
243
|
}else if(p.sub(0)!=="/"){
|
|
244
|
p=plus.io.convertLocalFileSystemURL(p);
|
|
245
|
}
|
|
246
|
}
|
|
247
|
var f = new File(p);
|
|
248
|
var uri = Uri.fromFile(f);
|
|
249
|
if(f.exists()&&f.isFile()){
|
|
250
|
console.log("image/*");
|
|
251
|
intent.setType("image/*");
|
|
252
|
intent.putExtra(Intent.EXTRA_STREAM,uri);
|
|
253
|
}else{
|
|
254
|
console.log("text/plain");
|
|
255
|
intent.setType("text/plain");
|
|
256
|
}
|
|
257
|
intent.putExtra(Intent.EXTRA_SUBJECT,"HBuilder");
|
|
258
|
intent.putExtra(Intent.EXTRA_TEXT,sharecontent.value);
|
|
259
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
260
|
main.startActivity(Intent.createChooser(intent,"系统分享"));
|
|
261
|
}
|
|
262
|
/**
|
|
263
|
* 分享操作
|
|
264
|
* @param {JSON} sb 分享操作对象s.s为分享通道对象(plus.share.ShareService)
|
|
265
|
* @param {Boolean} bh 是否分享链接
|
|
266
|
*/
|
|
267
|
function shareAction(sb,bh) {
|
|
268
|
outSet( "分享操作:" );
|
|
269
|
if(!sb||!sb.s){
|
|
270
|
outLine( "无效的分享服务!" );
|
|
271
|
return;
|
|
272
|
}
|
|
273
|
var msg={content:sharecontent.value,extra:{scene:sb.x}};
|
|
274
|
if(bh){
|
|
275
|
msg.href=sharehref.value;
|
|
276
|
if(sharehrefTitle&&sharehrefTitle.value!=""){
|
|
277
|
msg.title=sharehrefTitle.value;
|
|
278
|
}
|
|
279
|
if(sharehrefDes&&sharehrefDes.value!=""){
|
|
280
|
msg.content=sharehrefDes.value;
|
|
281
|
}
|
|
282
|
msg.thumbs=["_www/logo.png"];
|
|
283
|
msg.pictures=["_www/logo.png"];
|
|
284
|
}else{
|
|
285
|
if(pic&&pic.realUrl){
|
|
286
|
msg.pictures=[pic.realUrl];
|
|
287
|
}
|
|
288
|
}
|
|
289
|
// 发送分享
|
|
290
|
if ( sb.s.authenticated ) {
|
|
291
|
outLine( "---已授权---" );
|
|
292
|
shareMessage(msg,sb.s);
|
|
293
|
} else {
|
|
294
|
outLine( "---未授权---" );
|
|
295
|
sb.s.authorize( function(){
|
|
296
|
shareMessage(msg,sb.s);
|
|
297
|
},function(e){
|
|
298
|
outLine( "认证授权失败:"+e.code+" - "+e.message );
|
|
299
|
});
|
|
300
|
}
|
|
301
|
}
|
|
302
|
/**
|
|
303
|
* 发送分享消息
|
|
304
|
* @param {JSON} msg
|
|
305
|
* @param {plus.share.ShareService} s
|
|
306
|
*/
|
|
307
|
function shareMessage(msg,s){
|
|
308
|
outLine(JSON.stringify(msg));
|
|
309
|
s.send( msg, function(){
|
|
310
|
outLine( "分享到\""+s.description+"\"成功! " );
|
|
311
|
}, function(e){
|
|
312
|
outLine( "分享到\""+s.description+"\"失败: "+JSON.stringify(e) );
|
|
313
|
} );
|
|
314
|
}
|
|
315
|
/**
|
|
316
|
* 解除所有分享服务的授权
|
|
317
|
*/
|
|
318
|
function cancelAuth(){try{
|
|
319
|
outSet( "解除授权:" );
|
|
320
|
for ( var i in shares ) {
|
|
321
|
var s = shares[i];
|
|
322
|
if ( s.authenticated ) {
|
|
323
|
outLine( "取消\""+s.description+"\"");
|
|
324
|
}
|
|
325
|
s.forbid();
|
|
326
|
}
|
|
327
|
// 取消授权后需要更新服务列表
|
|
328
|
updateSerivces();
|
|
329
|
outLine( "操作成功!" );}catch(e){alert(e);}
|
|
330
|
}
|
|
331
|
|
|
332
|
// 打开分享
|
|
333
|
function shareShow(){
|
|
334
|
var shareBts=[];
|
|
335
|
// 更新分享列表
|
|
336
|
var ss=shares['weixin'];
|
|
337
|
if(navigator.userAgent.indexOf('StreamApp')<0&&navigator.userAgent.indexOf('qihoo')<0){ //在360流应用中微信不支持分享图片
|
|
338
|
ss&&ss.nativeClient&&(shareBts.push({title:'微信朋友圈',s:ss,x:'WXSceneTimeline'}),
|
|
339
|
shareBts.push({title:'微信好友',s:ss,x:'WXSceneSession'}));
|
|
340
|
}
|
|
341
|
// ss=shares['sinaweibo'];
|
|
342
|
// ss&&shareBts.push({title:'新浪微博',s:ss});
|
|
343
|
// ss=shares['qq'];
|
|
344
|
// ss&&ss.nativeClient&&shareBts.push({title:'QQ',s:ss});
|
|
345
|
// 弹出分享列表
|
|
346
|
shareBts.length>0?plus.nativeUI.actionSheet({title:'分享',cancel:'取消',buttons:shareBts},function(e){
|
|
347
|
(e.index>0)&&shareAction(shareBts[e.index-1],false);
|
|
348
|
}):plus.nativeUI.alert('当前环境无法支持分享操作!');
|
|
349
|
|
|
350
|
|
|
351
|
}
|
|
352
|
// 分析链接
|
|
353
|
function shareHref(){
|
|
354
|
var shareBts=[];
|
|
355
|
// 更新分享列表
|
|
356
|
var ss=shares['weixin'];
|
|
357
|
ss&&ss.nativeClient&&(shareBts.push({title:'微信朋友圈',s:ss,x:'WXSceneTimeline'}),
|
|
358
|
shareBts.push({title:'微信好友',s:ss,x:'WXSceneSession'}));
|
|
359
|
// ss=shares['qq'];
|
|
360
|
// ss&&ss.nativeClient&&shareBts.push({title:'QQ',s:ss});
|
|
361
|
// 弹出分享列表
|
|
362
|
shareBts.length>0?plus.nativeUI.actionSheet({title:'分享链接',cancel:'取消',buttons:shareBts},function(e){
|
|
363
|
(e.index>0)&&shareAction(shareBts[e.index-1],true);
|
|
364
|
}):plus.nativeUI.alert('当前环境无法支持分享链接操作!');
|
|
365
|
}
|
|
366
|
</script>
|
185
|
367
|
</body>
|
186
|
368
|
|
187
|
369
|
</html>
|