123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- var countDown = '',count_down = '';
- var source = '';
- var scrollTop = '';
- var scrollTop02 = '';
- var qs = parseQueryString(window.location.href);
- $().ready(function () {
- if(qs.source) {source = qs.source}
- if(source == '40064'){
- document.title='厦门小小雨点金融信息服务有限公司';
- $("#company").html('厦门小小雨点金融信息服务有限公司')
- }
- if(source == '40054' || source == '40055' || source == '40056' || source == '40057'){
- $(".xiaohuazhu-icon").html('<img src="img/WechatIMG132.jpeg" />')
- }
- countLandingPage({click_source:'money_phone',source:source})
- $(window).scroll(function(){
- scrollTop = $(this).scrollTop(); //scrollTop() 方法返回或设置匹配元素的滚动条的垂直位置
- })
- })
- //点击获取验证码
- function getYzmEvent () {
-
- var myreg = /^[0-9]{11}$/;
- if (!myreg.test($("#phone").val())) {
- //手机号码未填写及填写不正确
- showMsg('请正确填写手机号')
- return;
- }
- countLandingPage({click_source:'achieve',source:source})
- $("#mask").css({'visibility': 'visible'});
- $('#picCode .modal-inner img').attr("src", "/user/VerifyImage/getImageCode?phone=" + $("#phone").val() + "&time=" + new Date().getTime())
- scrollTop02 = scrollTop;
- $('body').css({'position':'fixed',"top":-scrollTop});
- }
- //关闭弹层
- function closePanel(){
- $('#mask').css({'visibility': 'hidden'});
- //$('#maskMoney').css({'visibility': 'hidden'});
- $("#imgYzm").val('');
- $("body").css({"position":"initial"});
- $(window).scrollTop(scrollTop02);
- }
- /* 点击更换图片验证码*/
- function getChangeCodeImg(){
- $('#picCode .modal-inner img').attr("src", "/user/VerifyImage/getImageCode?phone=" + $("#phone").val() + "&time=" + new Date().getTime());
- }
- // 输入图片验证码后点击确定请求短信验证码
- function goResPanel(){
- if($("#imgYzm").val() == ''){
- showMsg('请输入图片验证码')
- return;
- }
- registerSecond();
- }
- //发送短信验证码
- function registerSecond () {
- $.ajax({
- type:"post",
- url:"/user/user/registerSecond",
- dataType:'json',
- data:{
- phone:$("#phone").val(),
- smstype:1,
- qrcode:2,
- image_code:$("#imgYzm").val(),
- source:source
- },
- success:function (res){
- console.log(res)
- if(res && res.errno == 0){
- closePanel();
- countDown = res.rst.wait_time;
- count_down = countDown;
- var that = this;
- $("#getYzm").attr("disabled","true").css({'background':'#ccc','color':"#ffffff"});
- $("#getYzm").html(count_down);
- count_down = count_down-1;
- var time = setInterval(function () {
- $("#getYzm").html(count_down);
- count_down--;
- if(count_down < 0){
- $("#getYzm").removeAttr("disabled")
- .html('发送验证码')
- .css({'background':'#fbde3a','color':'#fe474b'});
- clearInterval(time);
- count_down = countDown;
- }
- },1000)
- }else{
- showMsg(res.err)
- }
- }
- });
- }
- //登录
- function loginEvent () {
- var myreg = /^[0-9]{11}$/;
- if (!myreg.test($("#phone").val())) {
- //手机号码未填写及填写不正确
- showMsg('请正确填写手机号')
- return;
- }
- if($("#phoneYzm").val() == ""){
- showMsg('请输入短信验证码')
- return;
- }
- loginCodeEvent();
- }
- //短信验证码登录
- function loginCodeEvent () {
- countLandingPage({click_source:'click',source:source})
- $.ajax({
- type:"post",
- url:"/user/user/loginCode",
- dataType:'json',
- data:{
- phone:$("#phone").val(),
- code:$("#phoneYzm").val(),
- source:source
- },
- success:function(res) {
- console.log(res)
- if(res && res.errno == 0){
- goAppEvent();//下载
- // $("#maskMoney").css({'visibility': 'visible'});
- // scrollTop02 = scrollTop;
- // $('body').css({'position':'fixed',"top":-scrollTop});
- }else{
- showMsg(res.err)
- }
- }
- });
- }
- //点击下载app
- function goAppEvent () {
- countLandingPage({click_source:'download',source:source})
- showMsg('注册成功')
- var downLoad = [{
- source:'40020',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/BNDXJDqutoutiao07_v1.0.0_2018-11-13_100_jiagu_sign.apk'
- },{
- source:'40028',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/xiaohuazhu_smss03.apk'
- },{
- source:'40032',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/xhz_smss07.apk'
- },{
- source:'40033',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/xhz_smss08.apk'
- },{
- source:'40034',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/xhz_smss09.apk'
- },{
- source:'40035',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/xhz_smss10.apk'
- },{
- source:'40036',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/xhz_smss11.apk'
- },{
- source:'40044',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/qtt_03.apk'
- },{
- source:'40054',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/aqy_01.apk'
- },{
- source:'40055',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/aqy_02.apk'
- },{
- source:'40056',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/aqy_03.apk'
- },{
- source:'40057',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/aqy_04.apk'
- },{
- source:'40064',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/uc_01.apk'
- },{
- source:'40065',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/xhz_tg40065.apk'
- },{
- source:'40074',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/ss_uc_03.apk'
- },{
- source:'40075',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/ss_uc_04.apk'
- },{
- source:'40076',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/ss_uc_05.apk'
- },{
- source:'4001',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/search360.apk'
- },{
- source:'40004',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_03_40004.apk'
- },{
- source:'40005',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_07_40005.apk'
- },{
- source:'40006',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_08_40006.apk'
- },{
- source:'40007',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_09_40007.apk'
- },{
- source:'40008',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_10_40008.apk'
- },{
- source:'40009',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_11_40009.apk'
- },{
- source:'40002',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_01_40002.apk'
- },{
- source:'40003',
- url:'https://kx-loans.oss-cn-beijing.aliyuncs.com/xiaohuazhu/smss_02_40003.apk'
- }]
- if(source != '40065' && source != '40024' && source != '40025'){
- if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
- window.location.href = 'https://itunes.apple.com/cn/app/%E5%B0%8F%E8%8A%B1%E7%8C%AA-%E5%88%86%E6%9C%9F%E6%97%A0%E5%BF%A7-%E9%80%89%E6%8B%A9%E5%A4%9A%E6%A0%B7/id1440274732?mt=8';
- return;
- }
- }
-
- downLoad.forEach(function (item, index) {
- if(source == item.source){
- setTimeout(function () {
- window.location.href = item.url;
- },1000)
- return;
- }
- })
-
- }
- //埋点
- function countLandingPage (data) {
- $.ajax({
- type:'post',
- url:'/user/log/countLandingPage',
- dataType:'json',
- data:data,
- success:function (res) {
- console.log(res)
- }
- })
- }
- //提示信息
- function showMsg(msg) {
- var msg = msg;
- var msgBox = $('.alert-info');
- msgBox.children('p').text(msg);
- msgBox.show();
- setTimeout(function() {
- msgBox.hide();
- }, 2000);
- }
- //获取地址栏参数
- function parseQueryString(url) {
- var urlObj = {};
- var reg = /([^?=&]+)=([^?=&]+)/g;
- url.replace(reg, ($0, $1, $2) => {
- urlObj[$1] = decodeURIComponent($2);
- })
- return urlObj;
- }
|