mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-06-07 10:22:38 +08:00
share
This commit is contained in:
@ -146,8 +146,7 @@
|
||||
|
||||
<!-- 分享 -->
|
||||
<div class="base-share {{if !isset($data['status']) or $data['status'] neq 1}}base-share-mobile{{/if}}">
|
||||
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_tieba" data-cmd="tieba" title="分享到百度贴吧"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a></div>
|
||||
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
|
||||
<div class="plugins-share-view"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -254,7 +253,7 @@
|
||||
|
||||
{{include file="public/footer" /}}
|
||||
|
||||
{{if isset($data['user_id']) and $data['user_id'] gt 0}}
|
||||
{{if !empty($data['lose_lng']) and !empty($data['lose_lat']) and $data['lose_lng'] gt 0 and $data['lose_lat'] gt 0 and isset($data['status']) and $data['status'] eq 1}}
|
||||
<!-- map -->
|
||||
<script type="text/javascript" src="{{$Think.__MY_HTTP__}}://api.map.baidu.com/api?v=2.0&ak={{:MyC('common_baidu_map_ak')}}"></script>
|
||||
|
||||
@ -262,7 +261,7 @@
|
||||
$(function()
|
||||
{
|
||||
// 丢失地址-地图展示
|
||||
{{if !empty($data['lose_lng']) and !empty($data['lose_lat'])}}
|
||||
{{if $data['lose_lng'] gt 0 and $data['lose_lat'] gt 0}}
|
||||
var map = new BMap.Map("map-view", {enableMapClick:false});
|
||||
var level = $('#map-view').data('level') || 16;
|
||||
var point = new BMap.Point({{$data['lose_lng']}},{{$data['lose_lat']}});
|
||||
|
||||
@ -1,24 +1,27 @@
|
||||
<div class="plugins-share">
|
||||
<ul>
|
||||
<li class="share-qq" data-type="qq">
|
||||
<span class="icon iconfont icon-qq"></span>
|
||||
</li>
|
||||
<li class="share-qq-space" data-type="qq-space">
|
||||
<span class="icon iconfont icon-qq-space"></span>
|
||||
</li>
|
||||
<li class="share-weixin" data-type="weixin">
|
||||
<span class="icon iconfont icon-weixin"></span>
|
||||
</li>
|
||||
<li class="share-sian" data-type="sian">
|
||||
<span class="icon iconfont icon-sina"></span>
|
||||
</li>
|
||||
<li class="share-url" data-type="url">
|
||||
<span class="icon iconfont icon-url"></span>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- 分享组建 -->
|
||||
<div class="plugins-share-container">
|
||||
<div class="plugins-share">
|
||||
<ul>
|
||||
<li class="share-qq" data-type="qq">
|
||||
<span class="icon iconfont icon-qq"></span>
|
||||
</li>
|
||||
<li class="share-qq-space" data-type="qq-space">
|
||||
<span class="icon iconfont icon-qq-space"></span>
|
||||
</li>
|
||||
<li class="share-weixin" data-type="weixin">
|
||||
<span class="icon iconfont icon-weixin"></span>
|
||||
</li>
|
||||
<li class="share-sian" data-type="sian">
|
||||
<span class="icon iconfont icon-sina"></span>
|
||||
</li>
|
||||
<li class="share-url" data-type="url">
|
||||
<span class="icon iconfont icon-url"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 微信弹出框 -->
|
||||
<!-- 微信二维码弹出框 -->
|
||||
<div class="am-modal am-modal-no-btn" tabindex="-1" id="plugins-share-weixin-modal">
|
||||
<div class="am-modal-dialog">
|
||||
<div class="am-modal-hd">
|
||||
@ -32,13 +35,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 微信环境中提示分享 -->
|
||||
<div id="plugins-share-weixin-layer">
|
||||
<img src="{{$attachment_host}}/static/plugins/images/share/weixin-layer.png" />
|
||||
<!-- 弹层提示分享 -->
|
||||
<div id="plugins-share-layer">
|
||||
<img src="{{$attachment_host}}/static/plugins/images/share/share-layer.png" />
|
||||
</div>
|
||||
|
||||
<!-- url复制 -->
|
||||
<div class="am-modal am-modal-no-btn" tabindex="-1" id="plugins-share-url-modal">
|
||||
<!-- 复制 -->
|
||||
<div class="am-modal am-modal-no-btn" tabindex="-1" id="plugins-share-copy-modal">
|
||||
<div class="am-modal-dialog">
|
||||
<div class="am-modal-hd">
|
||||
<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>×</a>
|
||||
|
||||
20
application/plugins/view/share/index/share.html
Normal file
20
application/plugins/view/share/index/share.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!-- 分享组建 -->
|
||||
<div class="plugins-share">
|
||||
<ul>
|
||||
<li class="share-qq" data-type="qq">
|
||||
<span class="icon iconfont icon-qq"></span>
|
||||
</li>
|
||||
<li class="share-qq-space" data-type="qq-space">
|
||||
<span class="icon iconfont icon-qq-space"></span>
|
||||
</li>
|
||||
<li class="share-weixin" data-type="weixin">
|
||||
<span class="icon iconfont icon-weixin"></span>
|
||||
</li>
|
||||
<li class="share-sian" data-type="sian">
|
||||
<span class="icon iconfont icon-sina"></span>
|
||||
</li>
|
||||
<li class="share-url" data-type="url">
|
||||
<span class="icon iconfont icon-url"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -1150,17 +1150,28 @@ function UrlFieldReplace(field, value, url)
|
||||
*/
|
||||
function MobileBrowserEnvironment()
|
||||
{
|
||||
// 浏览器标识
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
|
||||
// 微信
|
||||
if(ua.match(/MicroMessenger/i) == 'micromessenger')
|
||||
{
|
||||
return 'weixin';
|
||||
}
|
||||
|
||||
// 新浪微博
|
||||
if(ua.match(/WeiBo/i) == 'weibo')
|
||||
{
|
||||
return 'weibo';
|
||||
}
|
||||
|
||||
// QQ空间
|
||||
if(ua.match(/qzone/i) == 'qzone')
|
||||
{
|
||||
return 'qzone';
|
||||
}
|
||||
|
||||
// QQ
|
||||
if(ua.match(/QQ/i) == 'qq')
|
||||
{
|
||||
return 'qq';
|
||||
|
||||
@ -270,10 +270,18 @@ form.form-validation #map {
|
||||
.base-share-mobile {
|
||||
background: #9bddff;
|
||||
}
|
||||
.base-share-mobile a {
|
||||
padding-left: 0 !important;
|
||||
width: 24px !important;
|
||||
margin: 6px calc(12.5% - 32px) !important;
|
||||
.base-share-mobile .plugins-share ul {
|
||||
padding: 5px;
|
||||
}
|
||||
.base-share-mobile .plugins-share ul li {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
margin-right: calc(10% - 12.5px);
|
||||
margin-left: calc(10% - 12.5px);
|
||||
}
|
||||
.base-share-mobile .plugins-share ul li .iconfont {
|
||||
font-size: 16px;
|
||||
}
|
||||
.am-footer {
|
||||
padding-bottom: 35px;
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
/**
|
||||
* 分享
|
||||
*/
|
||||
.plugins-share {
|
||||
|
||||
.plugins-share-container, #plugins-share-layer {
|
||||
display: none;
|
||||
}
|
||||
.plugins-share ul {
|
||||
padding: 10px;
|
||||
background: #333;
|
||||
overflow: hidden;
|
||||
}
|
||||
.plugins-share ul li {
|
||||
@ -44,12 +42,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* 微信
|
||||
* 微信二维码
|
||||
*/
|
||||
#plugins-share-weixin-modal .weixin-qrcode {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#plugins-share-weixin-layer {
|
||||
|
||||
/**
|
||||
* 弹层
|
||||
*/
|
||||
#plugins-share-layer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@ -58,15 +60,14 @@
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 10000;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
#plugins-share-weixin-layer img {
|
||||
#plugins-share-layer img {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
/**
|
||||
* url
|
||||
* 复制
|
||||
*/
|
||||
#plugins-share-url-modal .am-input-group {
|
||||
#plugins-share-copy-modal .am-input-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@ -27,31 +27,47 @@ $(function()
|
||||
|
||||
// 平台地址
|
||||
var platform_url = null;
|
||||
|
||||
// 当前环境
|
||||
var env = MobileBrowserEnvironment();
|
||||
|
||||
// 关闭弹层
|
||||
$('#plugins-share-layer').hide();
|
||||
|
||||
// 根据分享类型处理
|
||||
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
|
||||
if(env == 'qq' || env == 'weixin' || env == 'qzone' || env == 'weibo')
|
||||
{
|
||||
$('#plugins-share-layer').show();
|
||||
} else {
|
||||
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;
|
||||
if(env == 'qq' || env == 'weibo')
|
||||
{
|
||||
$('#plugins-share-layer').show();
|
||||
} else {
|
||||
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' :
|
||||
// 是否微信环境中
|
||||
if(MobileBrowserEnvironment() == 'weixin')
|
||||
if(env == 'qq' || env == 'weixin' || env == 'qzone' || env == 'weibo')
|
||||
{
|
||||
$('#plugins-share-weixin-layer').show();
|
||||
$('#plugins-share-layer').show();
|
||||
} else {
|
||||
$('#plugins-share-weixin-layer').hide();
|
||||
var $modal = $('#plugins-share-weixin-modal');
|
||||
$modal.find('.weixin-qrcode').empty().qrcode({
|
||||
text: decodeURIComponent(url),
|
||||
@ -65,7 +81,7 @@ $(function()
|
||||
|
||||
// url
|
||||
case 'url' :
|
||||
var $modal = $('#plugins-share-url-modal');
|
||||
var $modal = $('#plugins-share-copy-modal');
|
||||
$modal.find('.am-input-group input').val(decodeURIComponent(url));
|
||||
$modal.modal({width: 300});
|
||||
$modal.modal('open');
|
||||
@ -80,11 +96,11 @@ $(function()
|
||||
});
|
||||
|
||||
// url复制
|
||||
var clipboard = new ClipboardJS('#plugins-share-url-modal .am-input-group button.am-btn',
|
||||
var clipboard = new ClipboardJS('#plugins-share-copy-modal .am-input-group button.am-btn',
|
||||
{
|
||||
text: function()
|
||||
{
|
||||
return $('#plugins-share-url-modal .am-input-group input').val();
|
||||
return $('#plugins-share-copy-modal .am-input-group input').val();
|
||||
}
|
||||
});
|
||||
clipboard.on('success', function(e)
|
||||
@ -96,9 +112,21 @@ $(function()
|
||||
Prompt('复制失败,请手动复制!');
|
||||
});
|
||||
|
||||
// 微信分享提示弹层关闭
|
||||
$('#plugins-share-weixin-layer').on('click', function()
|
||||
// 分享提示弹层关闭
|
||||
$('#plugins-share-layer').on('click', function()
|
||||
{
|
||||
$('#plugins-share-weixin-layer').hide();
|
||||
$('#plugins-share-layer').hide();
|
||||
});
|
||||
|
||||
|
||||
// 初始化
|
||||
if($('.plugins-share-container').length > 0)
|
||||
{
|
||||
// 标签初始化
|
||||
if($('.plugins-share-view').length > 0)
|
||||
{
|
||||
$('.plugins-share-view').html($('.plugins-share-container').html());
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user