diff --git a/application/plugins/view/share/index/content.html b/application/plugins/view/share/index/content.html index 6af4e537d0f93b57ce977fc4e09b5a40da296200..a7094bb3274287483b2ed991e3362c4373fcc9a5 100755 --- a/application/plugins/view/share/index/content.html +++ b/application/plugins/view/share/index/content.html @@ -1,19 +1,33 @@
+
+ + +
+
+
+ × +
+
+
+

打开微信,点击底部的“发现”

+

使用“扫一扫”即可将网页分享至朋友圈

+
+
\ No newline at end of file diff --git a/public/static/plugins/css/share/style.css b/public/static/plugins/css/share/style.css index aa43f477d7edec8f3457e14dcbf78b9a68b293cf..978f7c43eca56fd85095c6c11ea9422989078fb4 100644 --- a/public/static/plugins/css/share/style.css +++ b/public/static/plugins/css/share/style.css @@ -8,8 +8,33 @@ } .plugins-share ul li { float: left; + width: 35px; + height: 35px; + text-align: center; + line-height: 35px; + border-radius: 50px; + margin-right: 10px; + cursor: pointer; +} +.plugins-share ul li:last-child { + margin-right: 0; } .plugins-share ul li .iconfont { font-size: 20px; color: #fff; } +.plugins-share ul li.share-qq { + background: #d82d0e; +} +.plugins-share ul li.share-qq-space { + background: #0da6e4; +} +.plugins-share ul li.share-weixin { + background: #3eab0f; +} +.plugins-share ul li.share-sian { + background: #e71f2d; +} +.plugins-share ul li.share-url { + background: #607d8b; +} diff --git a/public/static/plugins/js/share/style.js b/public/static/plugins/js/share/style.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a8415a2e4bd2eb99c6b3cd7fe441cb21f060a38e 100644 --- a/public/static/plugins/js/share/style.js +++ b/public/static/plugins/js/share/style.js @@ -0,0 +1,71 @@ +$(function() +{ + // 分享事件 + $(document).on('click', '.plugins-share ul li', function() + { + // 分享类型 + var type = $(this).data('type'); + + // 来源站点 + var site = 'shopxo'; + + // url + var url = $(this).parents('.plugins-share').data('url') || window.location.href; + url = encodeURIComponent(url); + + // 标题 + var title = $(this).parents('.plugins-share').data('title') || $('title').text() || null; + title = title == null ? '' : encodeURIComponent(title); + + // 描述 + var desc = $(this).parents('.plugins-share').data('desc') || $('meta[name="description"]').attr('content') || null; + desc = desc == null ? '' : encodeURIComponent(desc); + + // 封面图 + var pic = $(this).parents('.plugins-share').data('pic') || null; + pic = pic == null ? '' : encodeURIComponent(pic); + + // 平台地址 + var platform_url = null; + switch(type) + { + // QQ + case 'qq' : + platform_url = 'https://connect.qq.com/widget/shareqq/index.html?url='+url+'&utm_medium=qqim&title='+title+'&desc='+desc+'&pics='+pic+'&site='+site + break; + + // QQ空间 + case 'qq-space' : + platform_url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+url+'&utm_medium=qzone&title='+title+'&desc='+desc+'&pics='+pic+'&summary='+desc+'&site='+site; + break; + + // 新浪 + case 'sian' : + platform_url = 'http://service.weibo.com/share/share.php?url='+url+'&utm_medium=sian&title='+title+'&desc='+desc+'&pics='+pic+'&site='+site; + break; + + // 微信 + case 'weixin' : + var $modal = $('#plugins-share-weixin-modal'); + $('#plugins-share-modal-weixin-qrcode').empty().qrcode({ + text: decodeURIComponent(url), + width: 200, + height: 200 + }); + $modal.modal({width: 260}); + $modal.modal('open'); + break; + + // url + case 'url' : + alert("已复制好,可贴粘。"); + break; + } + + // 跳转 + if(platform_url != null) + { + window.open(platform_url); + } + }); +}); \ No newline at end of file