<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>优协喊你来收礼</title> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> <meta name="format-detection" content="telephone=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> <link rel="stylesheet" href="<?php echo base_url('assets/shiyue/css/scss/index.css');?>"> <style> *{ -webkit-appearance: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-touch-callout: none; box-sizing: border-box;} body{ -webkit-text-size-adjust: 100%; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; -webkit-user-select: none;} </style> <script src="<?php echo base_url('assets/shiyue/js/adaptation.js');?>"></script> </head> <body> <div class="wrap2"> <div class="prize"> <?php if($giftid == 1){?> <img src="<?php echo base_url('assets/shiyue/pic/active/prize_pic.png');?>" alt="" class="prize_pic1"> <?php }else{?> <img src="<?php echo base_url('assets/shiyue/pic/active/prize_pic2.png');?>" alt="" class="prize_pic2 prize_pic1"> <?php }?> </div> <p class="wrap2_tip"> *请填写您的详细地址,我们会在5个工作日内 将奖品派送给你。 </p> <form class="wrap2_form" οnsubmit="return validateForm();"> <div> <input type="text" id="city" readonly="" name="city" class="active_input" value="" placeholder="省-市-区"> <input type="hidden" id="value1"> </div> <input type="text" value="" class="active_input" id="address" name="address" maxlength="50" placeholder="请填写详细地址"> <div class="wrap2_user"> <input type="text" class="active_input" value="<?php echo $linkman?>" id="linkman" name="linkman" maxlength="6" placeholder="联系人"> <!-- <span>联系人:</span>--> </div> <div class="wrap2_tel"> <input type="number" class="active_input" value="<?php echo $linkphone?>" id="linkphone" name="linkphone" maxlength="11" placeholder="联系方式"> <!--<span>联系方式:</span>--> </div> <input type="hidden" name="companyid" id="companyid" value="<?php echo $companyid;?>"> <input type="hidden" name="giftid" id="giftid" value="<?php echo $giftid;?>"> <input type="submit" class="active_input" value="提交"> </form> <section class="active_tip"> <ul> <li><span>1.</span><p>活动期限:2016年10月1日至2016年10月15日。</p></li> <li><span>2.</span><p>仅限安装优协并且注册用户参与本活动。</p></li> <li><span>3.</span><p>奖品将在活动结束后的5个工作日内,按照领取顺序派送。</p></li> <li><span>4.</span><p>本活动最终解释权,归优协事业部所有。</p></li> <li><span>5.</span><p>其他未尽事宜,请咨询客服。</p></li> </ul> </section> </div> <span id="arrow"></span> <a href="javascript:void(0);" class="active_btn">打开APP查看更多订单</a> <!--弹窗--> <div class="pop_wrap"> <section class="pop-ups"> <h4>温馨提示</h4> <p class="pop_txt">您还没有完善工厂信息,完善后才可领取奖品哦!</p> <div class="pop_btn" id="pop_btn"> <a href="javascript:void(0);" class="pop_true">确定</a> </div> </section> </div> <!--去完善--> <div class="pop_wrap3"> <section class="pop-ups3"> <h4>温馨提示</h4> <p class="pop_txt3">您还没有完善工厂信息,完善后才可领取奖品哦!</p> <div class="pop_btn3" id="pop_btn3"> <a href="javascript:void(0);" class="pop_true3">确定</a> </div> </section> </div> <!--弹窗share--> <div class="pop_wrap2"> <section class="pop-ups2"> <h4>领取成功,分享给好友</h4> <div class="pop-con"> <a href="javascript:void(0);"> <img src="<?php echo base_url('assets/shiyue/pic/active/weixin_pic.png');?>" alt=""> <span>微信</span> </a><a href="javascript:void(0);"> <img src="<?php echo base_url('assets/shiyue/pic/active/pyq_pic.png');?>" alt=""> <span>朋友圈</span> </a> </div> <div class="pop_btn2"> <a href="javascript:void(0);" class="pop_true2">取消分享</a> </div> </section> </div> <script src="<?php echo base_url('assets/shiyue/js/LAreaData1.js');?>"></script> <script src="<?php echo base_url('assets/shiyue/js/LAreaData2.js');?>"></script> <script src="<?php echo base_url('assets/shiyue/js/LArea.js');?>"></script> <script src="<?php echo base_url('assets/shiyue/js/showbox.js');?>"></script> <script> var baseurl = '<?php echo base_url();?>'; (function(){ wx.config({ debug: false, appId: '<?php echo $signPackage["appId"];?>', timestamp: '<?php echo $signPackage["timestamp"];?>', nonceStr: '<?php echo $signPackage["nonceStr"];?>', signature: '<?php echo $signPackage["signature"];?>', jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage', // 所有要调用的 API 都要加到这个列表中 ] }); wx.ready(function () { shareWeixin(); }); })(); function shareWeixin(){ wx.onMenuShareTimeline({ title: '优协喊你来收礼', link: baseurl+'Cshiyue/index', imgUrl: baseurl+'assets/shiyue/images/active/bg3.jpg' }); wx.onMenuShareAppMessage({ title: '优协喊你来收礼', desc: '10月1日至15日,完善工厂资料即可领取奖品,500份奖品等你来领。', link: baseurl+'Cshiyue/index', imgUrl: baseurl+'assets/shiyue/images/active/bg3.jpg', type: '', dataUrl: '' }); } </script> <script> var baseurl = '<?php echo base_url()?>'; var companyId="<?php echo $companyid?>"; var pop_btn2=getId("pop_btn").children; var sharebtn=document.querySelector(".pop-con"); function isWeiXin(){ var ua = window.navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i) == 'micromessenger'){ return true; }else{ return false; } } if(window.navigator.userAgent.match(/uhelper/ig)=="uhelper"){ sharebtn.addEventListener("click",function(){ var title='优协喊你来收礼', url=baseurl+'Cshiyue/index'; discrimination='10月1日至15日,完善工厂资料即可领取奖品,500份奖品等你来领。'; if(window.AndroidWebView){ window.AndroidWebView.showInfoFromJs(title,url,discrimination); // android }else{ window.location.href="uhelpershare://shareClick?"+title+"?"+url.split("://")[1]+"?"+discrimination; //ios } },false); } var txt=document.querySelector(".pop_true"); var owrap2=document.querySelector(".pop_wrap"); var txt3=document.querySelector(".pop_true3"); var owrap3=document.querySelector(".pop_wrap3"); if(!Number(companyId)){ txt3.innerHTML="去完善"; owrap3.style.display="block"; txt3.addEventListener("click",function(){ if(window.navigator.userAgent.match(/uhelper/ig)=="uhelper"){ if(window.AndroidWebView){ window.AndroidWebView.showInfoFromJs(1); // android }else{ window.location.href="uhelperPush://pushClick?"+1; //ios } }else{ match.isBrowser(); if(isWeiXin()){ window.location="http://html5.uhelper.cn/androidCode/"; } } }); } var xhr = new XMLHttpRequest(); if(window.navigator.userAgent.match(/uhelper/ig)=="uhelper"){ var timer=setInterval(function(){ var postData2 = { "mobile":window.navigator.userAgent.split("uhelper")[1] }; postData2 = (function(obj){ // 转成post需要的字符串. var str = ""; for(var prop in obj){ str += prop + "=" + obj[prop] + "&" } return str; })(postData2); xhr.open("POST", baseurl+"Cshiyue/get_companyid", true); //地址 xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xhr.onreadystatechange = function(){ var XMLHttpReq = xhr; if (XMLHttpReq.readyState == 4) { if (XMLHttpReq.status == 200) { var text2 = XMLHttpReq.responseText; var jsonObj2=JSON.parse(text2); if(Number(jsonObj2)){ getId("companyid").value=jsonObj2; clearInterval(timer); owrap3.style.display="none"; } } } }; xhr.send(postData2); },500); } //获取id function getId(id){ return document.getElementById(id); } var active={ init:function(){ this.pop_wrap2=document.querySelector(".pop_wrap2"); this.pop_true2=document.querySelector(".pop_true2"); return this; }, //提交表单 sendAjax:function(){ var _this=this; var postData = { "city":getId("city").value , "address": getId("address").value, "linkman": getId("linkman").value, "linkphone": getId("address").value, "giftid": getId("giftid").value, "companyid":getId("companyid").value }; postData = (function(obj){ // 转成post需要的字符串. var str = ""; for(var prop in obj){ str += prop + "=" + obj[prop] + "&" } return str; })(postData); var url=baseurl+"Cshiyue/lingqu"; xhr.open("POST", url, true); //地址 xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xhr.onreadystatechange = function(){ var XMLHttpReq = xhr; if (XMLHttpReq.readyState == 4) { if (XMLHttpReq.status == 200) { var text = XMLHttpReq.responseText; var jsonObj=JSON.parse(text); if(jsonObj.status){ if(isWeiXin()){ document.querySelector("#arrow").style.display="block"; } _this.shareContent(); }else{ pop.showBox("提交失败").hideBox(); } } } }; xhr.send(postData); return this; }, //分享按钮显示 shareContent:function(){ this.pop_wrap2.style.display="block"; }, //分享按钮隐藏 popHide:function(){ var _this=this; this.pop_true2.addEventListener("click",function(){ _this.pop_wrap2.style.display="none"; document.querySelector("#arrow").style.display="none"; },false); } }; active.init().popHide(); //表单验证 function validateForm(){ if(getId("city").value==""){ pop.showBox('省市区不能为空').hideBox(); return false; } if(getId("address").value==""){ pop.showBox('详细地址不能为空').hideBox(); return false; } if(getId("linkman").value==""){ pop.showBox('联系人不能为空').hideBox(); return false; } if(getId("linkphone").value==""){ pop.showBox('手机号码不能为空').hideBox(); return false; }else if(!telValid.test(getId("linkphone").value)){ pop.showBox('手机号输入有误').hideBox(); return false; } active.sendAjax(); return false; } //三级联动 var area1 = new LArea(); area1.init({ 'trigger': '#city', //触发选择控件的文本框,同时选择完毕后name属性输出到该位置 'valueTo': '#value1', //选择完毕后id属性输出到该位置 'keys': { id: 'id', name: 'name' }, //绑定数据源相关字段 id对应valueTo的value属性输出 name对应trigger的value属性输出 'type': 1, //数据源类型 'data': LAreaData //数据源 }); area1.value=[27,16,11];//控制初始位置,注意:该方法并不会影响到input的value var area2 = new LArea(); area2.init({ 'trigger': '#demo2', 'valueTo': '#value2', 'keys': { id: 'value', name: 'text' }, 'type': 2, 'data': [provs_data, citys_data, dists_data] }); </script> </body> </html>
自己看的
最新推荐文章于 2022-10-12 20:25:55 发布