[首页]
[文章]
[教程]
首页
Web开发
Windows开发
编程语言
数据库技术
移动平台
系统服务
微信
设计
布布扣
其他
数据分析
首页
>
微信
> 详细
微信JS分享实战代码
时间:
2015-11-12 14:54:59
阅读:
434
评论:
0
收藏:
0
[点我收藏+]
#set($version=‘?v=1.0.7‘)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
<meta name="msapplication-tap-highlight" content="no">
<title>$!{bargain.actName}</title>
<link href="../content/bargain/css/global.css$!{version}" rel="stylesheet" type="text/css">
<link href="../content/bargain/css/popup.css$!{version}" type="text/css" rel="stylesheet"/>
<script src="../content/bargain/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="../content/bargain/js/jquery.form.js" type="text/javascript"></script>
<script src="../content/bargain/js/static-page.js$!{version}" type="text/javascript"></script>
<script src="../content/bargain/js/common.js$!{version}" type="text/javascript"></script>
<script src="../content/bargain/js/wxcheck.js$!{version}" type="text/javascript"></script>
</head>
<script type="text/javascript">
$(window).bind(‘resize load‘, function(){
$("body").css("zoom", $(window).width() / 750);
$("body").css("display" , "block");
});
</script>
<body style="width:100%; margin:0 auto;">
<!--头图-->
<div class="top_img"></div>
<!--领取门票-->
<div class="top_txt">
<table border="0" cellspacing="0" cellpadding="0">
#if($bargain.productRemainNum>0)
<tr>
<td>还剩</td>
<td><div>$!{dictTool.getProductRateNum($!{bargain.productRemainNum},$!{bargain.showRate})}</div></td>
<td>张门票<span style="font-size:25px; margin-left:10px;">等您领取</span></td>
</tr>
#else
<tr>
<td></td>
<td><font color="red">门票已抢光,请继续关注下次活动。</font></td>
<td></td>
</tr>
#end
</table>
</div>
<!--砍价说明-->
<div class="info" id="bargain_desc">
#if($bargainRegistration.awardsStatus==‘1‘)
<p>您已经成功领到了免费门票,快快邀请小伙伴儿,一起嗨翻东海音乐节!您的门票将于$!{postTimeStr}统一寄出,请耐心等待哦~</p>
#else
<p>已经有$!{recordListCount}位小伙伴儿,帮助我砍价了,当前价格是$!{bargainRegistration.productNewPrice}元,门票原价$!{bargainRegistration.productPrice}元,再去邀请好友帮我砍价。</p>
#end
</div>
<!--砍价按钮-->
<div class="but_box01">
<ul><li style="margin-right:40px;"><a href="javascript:popup(‘share-pop-up‘);"><img src="../content/bargain/images/but04.png" width="316" height="86" alt="请好友帮砍"/></a></li><li><a href="#act_rule"><img src="../content/bargain/images/but05.png" width="316" height="86" alt="活动规则"/></a></li></ul>
</div>
#if($dictTool.isLteZero($bargainRegistration.productNewPrice))
<div class="but_box02"><a id="goReceivePrizeButton" href="javascript:goReceivePrize();"><img src="../content/bargain/images/but03.png" width="656" height="86" alt="领取门票"/></a></div>
#end
<!--亲友团列表-->
<div class="qyt_box">
<div class="qut_th">
<table id="recordtableheader" width="100%" height="70" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30.3%">亲友团</td>
<td width="30.3%">砍掉价格</td>
<td width="30.3%">砍后价格</td>
</tr>
</table>
</div>
<table id="recordtable" class="qut_sj" width="100%" border="0" cellspacing="0" cellpadding="0">
#foreach($item in $recordList)
<tr>
<td width="30.3%">$!{dictTool.subText($!{item.nickname},6,‘...‘)}</td>
<td width="30.3%"><s>¥$!item.cutPrice</s></td>
<td width="30.3%">¥$!item.currPrice</td>
</tr>
#end
</table>
<table class="qut_sj" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a id="prev" href="#recordtableheader">上一页</a></td>
<td><span id="current_page">1</span>/<span id="total"></span></td>
<td><a id="next" href="#recordtableheader">下一页</a></td>
</tr>
</table>
</div>
<!--活动详情-->
<div class="title01"></div>
<p class="hd_txt">$!{bargain.actDetail}</p>
<div class="hd_photo">
<a href="#"><img src="../content/bargain/images/hdxq_img01.jpg" max-width="100%" width="90%" height="auto" alt=""/></a>
<a href="#"><img src="../content/bargain/images/hdxq_img02.jpg" max-width="100%" width="90%" height="auto" alt=""/></a>
</div>
<!--青山舞台-->
<div class="qswt_box">
<a><img class="img1" src="../content/bargain/images/qswt.png" width="90%" alt=""/></a>
</div>
<!--演出阵容-->
<div class="title02"></div>
<div class="yc_img">
<a href="#"><img class="img1" src="../content/bargain/images/yachu_img01.jpg" width="90%" alt=""/></a>
<a class="alt1" href="#">窦唯</a>
<a href="#"><img class="img1" src="../content/bargain/images/yachu_img02.jpg" width="90%" alt=""/></a>
<a class="alt1" href="#">小野丽莎</a>
<a href="#"><img class="img1" src="../content/bargain/images/yachu_img03.jpg" width="90%" alt=""/></a>
<a class="alt1" href="#">LENKA(AU)</a>
<a href="#"><img class="img1" src="../content/bargain/images/yachu_img04.jpg" width="90%" alt=""/></a>
<a class="alt1" href="#">李志</a>
<a class="alt2" href="#">(摄影:忍花草)</a>
<a href="#"><img class="img1" src="../content/bargain/images/yachu_img05.jpg" width="90%" alt=""/></a>
<a class="alt1" href="#">周云蓬</a>
<a class="alt2" href="#">(摄影:大象)</a>
<a href="#"><img class="img1" src="../content/bargain/images/yachu_img06.jpg" width="90%" alt=""/></a>
<a class="alt1" href="#">常石磊</a>
</div>
<div id="act_rule" class="title03"></div>
<p class="hd_txt" style="padding-bottom:40px;">
1. 邀请好友来砍价,每个好友可帮忙砍掉1~3元(金额随机)的门票价格哦!</br>
2. 前$!{dictTool.getProductRateNum($!{bargain.productNum},$!{bargain.showRate})}名成功砍到0元的幸运用户,即可免费获得原价$!{dictTool.priceNoZero($!{bargainRegistration.productPrice})}元的东海音乐节门票一张!</br>
</br>兑换说明:</br>
获得免费门票的用户,请在活动领取门票页面输入您真实有效的姓名、手机号码和地址,工作人员会在$!{postTimeStr}按您填写的信息统一寄出门票。</br>
大咖闪耀,热力开唱,窦唯、Lenka东海音乐节陪你不嗨不归!
</p>
<div class="dmw_ewm">
<img src="../content/bargain/images/ewm0.png" width="234" height="234" alt=""/><p>大麦网二维码</p></div>
<div id="receive_prize" class="cd-popup is-visible" role="alert" style="display:none">
<div class="cd-popup-container">
<form id="receivePrizeForm" name="receivePrizeForm" action="../bargain/receivePrize.do" method="post">
<input type="hidden" name="id" id="receive_prize_id" value=""/>
<input type="hidden" name="actId" id="receive_prize_actId" value="$!{bargain.id}"/>
<input type="hidden" name="openid" id="receive_prize_openid" value="$!{bargainDto.openid}"/>
<input type="hidden" name="nickname" id="receive_prize_nickname" value="$!{bargainDto.nickname}"/>
<input type="hidden" name="subscribe" id="receive_prize_subscribe" value="$!{bargainDto.subscribe}"/>
<p class="cd-popup-linqujptitle">
请输入真实有效的姓名、手机号码和地址,工作人员会在$!{postTimeStr}为您寄出门票,请耐心等待哦~
</p>
<div class="inputFormIpt showPlaceholder">
<input type="text" class="formIpt" id="receive_prize_realName" name="realName" placeholder="请输入您的真实姓名"/>
</div>
<div class="inputFormIpt showPlaceholder">
<input type="text" class="formIpt" id="receive_prize_mobile" name="mobile" placeholder="请输入您真实有效的手机号码"/>
</div>
<div class="inputFormIpt showPlaceholder" id="address">
<textarea class="formIpt addressinput" id="receive_prize_address" name="address" placeholder="输入您的详细地址"></textarea>
</div>
<input class="guanzhubtn" type="button" id="receivePrizeButton" onclick="receivePrize();" value="提交" />
</form>
</div> <!-- cd-popup-container -->
</div> <!-- cd-popup -->
<div id="receive_prize_success" class="cd-popup is-visible" role="alert" style="display:none">
<div class="cd-popup-container">
<p class="cd-popup-title">恭喜您!</p>
<p class="cd-popup-content">您已成功申请领取门票!</p>
<input class="btn" type="button" onclick="popuphide(‘receive_prize_success‘)" value="确定">
</div> <!-- cd-popup-container -->
</div> <!-- cd-popup -->
<div id="tip_msg" class="cd-popup is-visible" role="alert" style="display:none">
<div class="cd-popup-container">
<p class="cd-popup-title">提示:</p>
<p class="cd-popup-content" id="tip_msg_content"></p>
<input class="btn" type="button" onclick="popuphide(‘tip_msg‘)" value="确定">
</div> <!-- cd-popup-container -->
</div> <!-- cd-popup -->
<div id="share-pop-up" style="display:none;" onclick="popuphide(‘share-pop-up‘);">
<div class="pop"></div>
</div>
</body>
<!-- 微信分享功能 -->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: ‘$!{appId}‘, // 必填,公众号的唯一标识
timestamp: $!{timestamp}, // 必填,生成签名的时间戳
nonceStr: ‘$!{nonceStr}‘, // 必填,生成签名的随机串
signature: ‘$!{signature}‘,// 必填,签名,见附录1【必填:通过提供接口获取】
jsApiList: [
‘checkJsApi‘,
‘onMenuShareTimeline‘,
‘onMenuShareAppMessage‘
]
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
var newHdUrl = ‘$!{hdUrl}‘+ ‘&fxOpenid=$!{bargainDto.openid}‘;
wx.onMenuShareTimeline({
title: ‘$!{bargain.actName}‘, // 分享标题【必填】
link: newHdUrl, // 分享链接【必填】
imgUrl: ‘http://www.jeewx.com/P3-Web/content/bargain/images/top_01.png‘, // 分享图标【必填】
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
});
wx.onMenuShareAppMessage({
title: ‘$!{bargain.actName}‘, // 分享标题【必填】
desc: ‘东海音乐节起源于2011年,经过4年的持续举办,我们已经成为长三角地区最吸引人的户外音乐节之一。我们致力于将最好的音乐现场良性的融入城市生态,与观众共同创造一年一度的海洋音乐狂欢。‘, // 分享描述【必填】
link: newHdUrl, // 分享链接【必填】
imgUrl: ‘http://www.jeewx.com/P3-Web/content/bargain/images/top_01.png‘, // 分享图标【必填】
type: ‘link‘, // 分享类型,music、video或link,不填默认为link【必填】
dataUrl: ‘‘, // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
// 用户确认分享后执行的回调函数
alert(‘已分享‘);
},
cancel: function () {
// 用户取消分享后执行的回调函数
alert(‘已取消‘);
}
});
});
</script>
</html>
版权声明:本文为博主原创文章,未经博主允许不得转载。
微信JS分享实战代码
原文:http://blog.csdn.net/zhangdaiscott/article/details/49798107
踩
(
0
)
赞
(
0
)
举报
评论
一句话评论(
0
)
登录后才能评论!
分享档案
更多>
2021年09月23日 (328)
2021年09月24日 (313)
2021年09月17日 (191)
2021年09月15日 (369)
2021年09月16日 (411)
2021年09月13日 (439)
2021年09月11日 (398)
2021年09月12日 (393)
2021年09月10日 (160)
2021年09月08日 (222)
最新文章
更多>
2021/09/28 scripts
2022-05-27
vue自定义全局指令v-emoji限制input输入表情和特殊字符
2022-05-27
9.26学习总结
2022-05-27
vim操作
2022-05-27
深入理解计算机基础 第三章
2022-05-27
C++ string 作为形参与引用传递(转)
2022-05-27
python 加解密
2022-05-27
JavaScript-对象数组里根据id获取name,对象可能有children属性
2022-05-27
SQL语句——保持现有内容在后面增加内容
2022-05-27
virsh命令文档
2022-05-27
教程昨日排行
更多>
1.
list.reverse()
2.
Django Admin 管理工具
3.
AppML 案例模型
4.
HTML 标签列表(功能排序)
5.
HTML 颜色名
6.
HTML 语言代码
7.
jQuery 事件
8.
jEasyUI 创建分割按钮
9.
jEasyUI 创建复杂布局
10.
jEasyUI 创建简单窗口
友情链接
汇智网
PHP教程
插件网
关于我们
-
联系我们
-
留言反馈
- 联系我们:wmxa8@hotmail.com
© 2014
bubuko.com
版权所有
打开技术之扣,分享程序人生!