<{import file="common.html" title='拼团分享'}>
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/share.css?t=<{$smarty.now}>"> 
<div class="cnav">
	<a class="back">&nbsp;</a>拼团分享<a href="javascript:;" class="thome">主页</a>
</div>
<div class="hot_box">
	<div class="tgurl">  
		<{uqcms m="goods_act" c="group_share:share_id=smarty.get.share_id" v="row"}>
		<{if $row.status == '1'}>
			<div class="time"><div class="time_box"><span>拼单成功</span></div></div> 
		<{else}>
			<{if $row.next_diff > 0}>
				<div class="time"><div class="time_box"><div class="djs_box" data-diff="<{$row.next_diff}>"></div></div></div>
				<div class="info"> 还差<{$row.num_cha}>人，人满才算拼单成功</div> 
				<!--推广链接-->
				<div class="link">
					<a href="javascript:;" data-link="<{$__HOST__}>wap.php?m=goods&a=share_goods&id=<{$row.gid}>&share_id=<{$row.link}>" class="share_user">邀请好友拼单</a>
				</div> 
			<{else}>
				<div class="time"><div class="time_box"><span>拼单超时&nbsp;&nbsp;&nbsp;订单取消</span></div></div>	
			<{/if}>
		<{/if}> 
	</div>
	<div class="ginfo">
		 <!--好友列表-->
		<div class="avatar">
			<div class="avatar_bar">
				<{foreach item=i from=$row.user}>
					<div class="avabox">
						<{if $i.uid != '0'}>
							<{if $i.avatar !=''}>
								<a href="javascript:;"><img src="<{$__IMG__}><{$i.avatar|img_size:30x30}>"/></a>
							<{else}>
								<a href="javascript:;"><img src="<{$__PUBLIC__}>images/avatar.png"/></a> 
							<{/if}>
							<i><{if $i.uid == $row.uid}>拼主<{/if}></i>
						<{else}>
							<a href="javascript:;"></a> 
						<{/if}> 
					</div>
				<{/foreach}>
			</div>
		</div>
		
		<!--拼单名称-->
		<div class="pinfo"> 
			<dl>
				<dt>商品名称</dt>
				<dd><{$row.goods.title}></dd> 
			</dl>
		</div>			
	</div>
</div>
<{import file="footer.html"}> 
<{if $UQCMS.browser == 'wchat'}>
<script type="text/javascript" charset="UTF-8" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<{/if}> 
<script type="text/javascript">
var PUBLIC_PATH	= '<{$__PUBLIC__}>';
var APP_PATH	= '<{$__APP__}>';
var IMG_HOST 	= '<{$__IMG__}>'; 
countDown('.djs_box'); 
$(function(){
	$("a.share_user").click(function(){
		html = '<div class="tipbg"><img src="'+APP_PATH+'public/images/tishi.png"/></div>';
		$("body").append(html);
	});
	$(document).on('click', '.tipbg', function(){ 
		$(this).remove();
	});	
});

var param_title 	= '<{$row.goods.title}>';
var param_desc 		= '';
var param_imgurl 	= '<{$__IMG__}><{$row.goods.images}>';
var param_link 		= '<{$__HOST__}>wap.php?m=goods&a=share_goods&id=<{$row.gid}>&share_id=<{$row.link}>';

function share_success(){
	
}
function share_cancel(){
 	
}
<{if $UQCMS.browser == 'wchat'}> 
// 只支持微信支付
function wxInit(){
	wx.config({
		//debug:true,
		appId:"<{$jscfg.appid}>",
		timestamp:"<{$jscfg.timestamp}>",
		nonceStr:"<{$jscfg.noncestr}>",
		signature:"<{$jscfg.signature}>",
		jsApiList:['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone']
	});
}

function runjs(){
	wxInit();
	wx.ready(function(){
		// 需要检测的JS接口列表，所有JS接口列表见附录2, 根据自己的情况测试  
		 wx.checkJsApi({ 
		   	jsApiList: ['chooseImage',"onMenuShareTimeline", "onMenuShareAppMessage"], 
		   	success: function (res) {  
			   	//alert(JSON.stringify(res)); 
		   	}  
	    });
		// 分享到朋友圈
		wx.onMenuShareTimeline({
			title: param_title, 		// 分享标题 
			link: param_link, 			// 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
			imgUrl: param_imgurl, 		// 分享图标
			success: function () {		// 用户确认分享后执行的回调函数
				share_success();
			},
			cancel:function() {			// 用户取消分享后执行的回调函数 
				share_cancel();
			}
			,fail:function (res) {  
            	alert(JSON.stringify(res));  
            } 
		}); 
		// 分享给朋友
		wx.onMenuShareAppMessage({
			title: param_title, 
			desc: param_desc, 
			link: param_link, 
			imgUrl: param_imgurl, 
			type: '', // 分享类型,music、video或link，不填默认为link
			dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			success: function () { 
				share_success();
			},
			cancel: function () { 
				share_cancel();
			}
		});
		// 分享到QQ
		wx.onMenuShareQQ({
			title: param_title, 
			desc: param_desc, 
			link: param_link, 
			imgUrl: param_imgurl, 
			success: function () { 	// 没分享也给你弹
			},
			cancel: function () {
				share_cancel();
			}
		});
		
		// 分享到腾讯微博
		wx.onMenuShareWeibo({
			title: param_title, 
			desc: param_desc, 
			link: param_link, 
			imgUrl: param_imgurl, 
			success: function () {
				share_success();
			},
			cancel: function () {
				share_cancel();
			}
		});

		// 分享到QQ空间
		wx.onMenuShareQZone({
			title: param_title, 
			desc: param_desc, 
			link: param_link, 
			imgUrl: param_imgurl, 
			success: function () { 
			},
			cancel: function () {
				share_cancel();
			}
		}); 
	});
}
runjs();
<{/if}>



 
</script>