-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshare.html
115 lines (108 loc) · 3.38 KB
/
share.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>分享</title>
<link rel="stylesheet" href="css/sta.css">
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<link href="css/mui.css" rel="stylesheet" type="text/css">
<script src="js/mui.js"></script>
</head>
<body style="background:#f0f0f0;">
<div class="index_box" style="margin-top:90px;" id="app">
<div class="nearby_top">
<h1>我的二维码</h1>
<a class="index_back mui-action-back"><img src="img/back.png" alt="" width="100%" height="100%"></a>
<a href="share_list.html" class="index_empty">我的分享</a>
</div>
<div class="share_box">
<div class="share_top">
<img :src="avatar" alt="" width="50" height="50">
<h6>{{nickname}}</h6>
<div class="clr"></div>
</div>
<!-- 二维码图片 -->
<div class="share_erweima">
<img :src="img" alt="">
</div>
<div class="share_bm">
<h5>新会员扫码注册下载</h5>
</div>
<!-- <div class="share_bm_list">
<ul id="share-btn-list">
<li data-share="weixin" data-scene="WXSceneSession">
<a href="#"><img src="img/weixin.png" alt="" width="48" height="42"></a>
</li>
<li data-share="weixin" data-scene="WXSceneTimeline">
<a href="#"><img src="img/fex.png" alt="" width="48" height="42"></a>
</li>
<li data-share="qq">
<a href="#"><img src="img/qq.png" alt="" width="48" height="42"></a>
</li>
<li data-share="qq">
<a href="#"><img src="img/kong.png" alt="" width="48" height="42"></a>
</li>
</ul>
</div> -->
</div>
</div>
<script src="js/vue.js"></script>
<script src="js/config.js"></script>
<script src="js/common.js"></script>
<script type="text/javascript">
var vm = new Vue({
el: '#app',
data: {
img: null,
nickname: '',
avatar: ''
},
created: function() {
var userinfo = storage.getItem('userinfo');
userinfo = JSON.parse(userinfo);
this.img = config.host + 'qrcode/' + userinfo.phone + '.png';
this.nickname = userinfo.nickname;
this.avatar = userinfo.avatar;
}
})
mui.init()
mui.ready(function(){
if (window.plus) {
updateSerivces();
}
})
var shares = [];
function updateSerivces(){
plus.share.getServices(function(s){
shares={};
for(var i in s){
var t=s[i];
shares[t.id]=t;
}
}, function(e){
mui.toast('获取分享服务列表失败:'+e.message);
});
}
mui('#share-btn-list').on('tap', 'li', function() {
var share = this.getAttribute('data-share');
var scene = this.getAttribute('data-scene');
console.log(scene);
var msg = {
title: 'labake',
content: 'welcome to labake',
thumbs: ['img/dd.png'],
pictures: ['img/dd.png'],
href: 'http://www.baidu.com',
extra: {
scene: scene
}
}
shares[share] && shares[share].send(msg)
})
</script>
</body>
</html>