|
|
$(function(){var o={get_coupon_list:"/activity/couponExp/couponList",receive_coupon:"/activity/couponExp/receiveCoupon",expand_one:"/activity/couponExp/expandOne",yh_login_success:"/activity/couponExp/yhLoginSuccess",get_login_url:"/user/getLoginUrl",clear_yh_login:"/activity/couponExp/clearYhLogin"};Object.keys(o).forEach(function(i){o[i]="https://action.yoho.cn"+o[i]}),{yoho:window.$coupon_exp_yoho,init:function(){this.bindEvents()},bindEvents:function(){var i=this,n={activity_id:"2033"};i.yoho.isApp&&(n.uid=i.yoho.getUid()||""),$.ajax({data:n,url:o.get_coupon_list,xhrFields:{withCredentials:!0}}),$(".join-btn").on("click",function(){if(i.yoho.isApp){var n=+i.yoho.isLogin();n?$.ajax({method:"POST",url:o.receive_coupon,xhrFields:{withCredentials:!0},data:{uid:n,isApp:!0}}).then(function(o){301===o.code&&o.data.url&&(window.location.href=o.data.url)}):i.yoho.goLogin("//huodong.yoho.cn/coupon-expansion/index.html")}else $.ajax({url:"//m.yohobuy.com/passport/login/user",jsonp:"callback",dataType:"jsonp"}).then(function(i){if(!i.data)return $.ajax({method:"POST",url:o.clear_yh_login,xhrFields:{withCredentials:!0}})}).then(function(){$.ajax({method:"POST",url:o.receive_coupon,xhrFields:{withCredentials:!0}}).then(function(i){if(200===i.code)return window.location.href="/coupon-expansion/progress.html",{};if(401===i.code){var n="?url="+o.yh_login_success;return $.ajax({url:o.get_login_url+n})}}).then(function(o){200===o.code&&(window.location.href=o.loginUrl)})})}),$(".rule-btn").on("click",function(){$(".rules-popup").show()}),$(".rules-popup").on("click",function(){$(".rules-popup").hide()}),i.bindTip()},bindTip:function(){$(".tip-box").on("click",function(){$(this).hide()}),$(".tip-switch").on("click",function(){var o=$(this).data("idx");$(".tip-box.id_"+o).show()})}}.init()}); |
|
|
\ No newline at end of file |
|
|
$(function(){var n={get_coupon_list:"/activity/couponExp/couponList",receive_coupon:"/activity/couponExp/receiveCoupon",expand_one:"/activity/couponExp/expandOne",yh_login_success:"/activity/couponExp/yhLoginSuccess",get_login_url:"/user/getLoginUrl",clear_yh_login:"/activity/couponExp/clearYhLogin"};Object.keys(n).forEach(function(o){n[o]="https://action.yoho.cn"+n[o]}),{yoho:window.$coupon_exp_yoho,init:function(){this.bindEvents()},bindEvents:function(){var o=this,i={activity_id:"2033"};o.yoho.isApp&&(i.uid=o.yoho.getUid()||""),$.ajax({data:i,url:n.get_coupon_list,xhrFields:{withCredentials:!0}}),$(".join-btn").on("click",function(){if(o.yoho.isApp){var i=+o.yoho.isLogin();i?$.ajax({method:"POST",url:n.receive_coupon,xhrFields:{withCredentials:!0},data:{uid:i,isApp:!0}}).then(function(n){301===n.code&&n.data.url&&(window.location.href=n.data.url)}):o.yoho.goLogin("//huodong.yoho.cn/coupon-expansion/index.html")}else $.ajax({url:"//m.yohobuy.com/passport/login/user",jsonp:"callback",dataType:"jsonp"}).then(function(o){if(!o.data)return $.ajax({method:"POST",url:n.clear_yh_login,xhrFields:{withCredentials:!0}})}).then(function(){$.ajax({method:"POST",url:n.receive_coupon,xhrFields:{withCredentials:!0}}).then(function(o){if(200===o.code)return window.location.href="/coupon-expansion/progress.html",{};if(401===o.code){var i="?url="+n.yh_login_success;return $.ajax({url:n.get_login_url+i})}}).then(function(n){200===n.code&&(window.location.href=n.loginUrl)})})}),$(".rule-btn").on("click",function(){$(".rules-popup").show()}),$(".rules-popup").on("click",function(){$(".rules-popup").hide()}),o.bindTip(),o.setShareInfo()},bindTip:function(){$(".tip-box").on("click",function(){$(this).hide()}),$(".tip-switch").on("click",function(){var n=$(this).data("idx");$(".tip-box.id_"+n).show()})},setShareInfo:function(){var n={title:"11.11潮这看!为了【199减100】和【50元现金券】~快来为我助力吧!!",desc:"呼朋引伴来赚钱!来【有货】助力好友,立赢199减100券和50元现金券!",imgUrl:"https://huodong.yoho.cn/coupon-expansion/image/share-new-logo.jpg",link:"https://huodong.yoho.cn/coupon-expansion/index.html"};/QQ/i.test(navigator.userAgent)&&$.ajax({url:"//qzonestyle.gtimg.cn/qzone/qzact/common/share/share.js",dataType:"script",cache:!0,success:function(){window.setShareInfo&&window.setShareInfo({title:n.title,summary:n.desc,pic:n.imgUrl,url:n.link})}}),/MicroMessenger/i.test(navigator.userAgent)&&$.ajax({url:"//res.wx.qq.com/open/js/jweixin-1.1.0.js",dataType:"script",cache:!0,success:function(){if(window.wx){$.getJSON("//www.yohoshow.com/api/wechat/getSignPackage?pageurl="+encodeURIComponent(location.href.split("#")[0])+"&callback=?",function(o){if(void 0!==o&&""!==o){var i=o.appId.toString(),e=o.timestamp,t=o.nonceStr.toString(),c=o.signature.toString();window.wx.config({debug:!1,appId:i,timestamp:e,nonceStr:t,signature:c,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","onMenuShareQZone"]}),window.wx.ready(function(){window.wx.onMenuShareTimeline(n),window.wx.onMenuShareAppMessage(n),window.wx.onMenuShareQQ(n),window.wx.onMenuShareQZone(n),window.wx.onMenuShareWeibo(n)})}})}}})}}.init()}); |
|
|
\ No newline at end of file |
...
|
...
|
|