Jelajahi Sumber

新增F码H5页面

huanggang 8 tahun lalu
induk
melakukan
52a4ac47b3

+ 300 - 0
data/resource/mobile/fcode/css/main.css

@@ -0,0 +1,300 @@
+html,
+body {
+    height: 100%;
+    max-height: 100%;
+    color: #fff;
+    font-family: "PingFang SC","Helvetica Neue",Helvetica,Arial,"Microsoft Yahei","Hiragino Sans GB","Heiti SC","WenQuanYi Micro Hei",sans-serif;;
+}
+
+
+.t_center {
+    text-align: center;
+}
+.t_left {
+    text-align: left;
+}
+.t_right {
+    text-align: right;
+}
+
+
+.container-fluid {
+    width: 10rem;
+    height: 100%;
+    max-height: 100%;
+    overflow: hidden;
+}
+.layout_center {
+    margin: 0 auto;
+}
+.f_width {
+    width: 100%;
+}
+.p_relative {
+    position: relative;
+}
+.p_absolute {
+    position: absolute;
+}
+.p_fixed {
+    position: fixed;
+    bottom: 0;
+}
+.overflow {
+    overflow: hidden;
+}
+.f_left {
+    float: left;
+}
+.f_right {
+    float: right;
+}
+.block {
+    display: block;
+}
+.block_goods_item {
+    padding: 0.16rem 0.16rem 0.27rem 0.16rem;
+    width: 4.48rem;
+    background: #fff;
+    border-radius: 10px;
+    margin-top: 0.5rem;
+}
+.block_goods {
+
+}
+.block_goods_msg {
+    margin-top: 0.32rem;
+}
+
+.bg_write {
+    background: #fff;
+}
+
+.bit_img {
+    background: url("../images/index_bg.png") #FF4E4E bottom left no-repeat;
+    background-size: 10rem 4.4rem;
+    background-position-y: 98%;
+}
+
+.title {
+    margin-top: 1.06rem;
+}
+.title h3 {
+    font-size: 25px;
+    font-weight: normal;
+}
+[data-dpr="2"] .title h3 {
+    font-size: 50px;
+}
+[data-dpr="3"] .title h3 {
+    font-size: 75px;
+}
+.title h2 {
+    font-size: 28px;
+    font-weight: normal;
+}
+[data-dpr="2"] .title h2 {
+    font-size: 56px;
+}
+[data-dpr="3"] .title h2 {
+    font-size: 84px;
+}
+h4 {
+    color: #333;
+    font-size: 0.53rem;
+    font-weight: normal;
+}
+
+a {
+    text-decoration: none;
+    color: #fff;
+    -webkit-tap-highlight-color: rgba(255,255,255,0);
+}
+a:hover {
+    text-decoration: none;
+}
+p {
+    color: #1E1E1E;
+    font-size: 14px;
+    line-height: 22px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+[data-dpr="2"] p {
+    font-size: 28px;
+    line-height: 36px;
+}
+[data-dpr="3"] p {
+    font-size: 42px;
+    line-height: 50px;
+}
+img {
+    width: 100%;
+    max-height: 100%;
+    vertical-align: middle;
+}
+input,button,.btn {
+    -webkit-appearance: none;
+    outline:none;
+    border: none;
+    background: transparent;
+}
+.btn_receive {
+    width: 4.17rem;
+    height: 1.09rem;
+    line-height: 1.09rem;
+    background: #FFDD00;
+    color: #333;
+    font-size: 23px;
+    border-radius: 80px;
+    border: 3px solid #fff;
+    margin-top: 0.49rem;
+}
+[data-dpr="2"] .btn_receive {
+    font-size: 46px;
+    border: 6px solid #fff;
+}
+[data-dpr="3"] .btn_receive {
+    font-size: 69px;
+    border: 9px solid #fff;
+}
+.btn_down {
+    width: 2.21rem;
+    height: 0.8rem;
+    line-height: 0.8rem;
+    border: 2px solid #FF4E4E;
+    color: #FF4E4E;
+    font-size: 16px;
+    border-radius: 10px;
+    margin-top: 0.31rem;
+}
+[data-dpr="2"] .btn_down {
+    font-size: 32px;
+    border: 3px solid #FF4E4E;
+}
+[data-dpr="3"] .btn_down {
+    font-size: 48px;
+    border: 4px solid #FF4E4E;
+}
+.btn_submit {
+    width: 6.66rem;
+    height: 0.95rem;
+    background: #FF4E4E;
+    color: #fff;
+    line-height: 0.95rem;
+    font-size: 16px;
+    border-radius: 6px;
+    margin-top: 0.44rem;
+}
+[data-dpr="2"] .btn_submit {
+    font-size: 32px;
+}
+[data-dpr="3"] .btn_submit {
+    font-size: 48px;
+}
+.btn_yz {
+    width: 100%;
+    height: 100%;
+}
+.prompt_text {
+    color: #7E7E7E;
+    font-size: 0.4rem;
+    margin-top: 3.29rem;
+}
+.prompt_text ul li {
+    margin-top: 0.21rem;
+}
+.prompt_text ul {
+    width: 6.23rem;
+}
+.advert {
+    border-top: 1px solid #DADADA;
+    padding: 0.33rem 0.57rem 0.33rem 0.49rem;
+    width: 8.94rem;
+}
+.advert p {
+    color: #7E7E7E;
+}
+.advert .logo {
+    width: 1.43rem;
+    height: 1.43rem;
+    margin-right: 0.24rem;
+}
+.bind_tel_box {
+    width: 8.01rem;
+    height: 7.75rem;
+    top: 1rem;
+    left: 1rem;
+    border-radius: 20px;
+    box-shadow: 0 0 30px #ccc;
+    -webkit-box-shadow: 0 0 30px #ccc;
+}
+.bind_tel_box .fcode {
+    width: 5.05rem;
+    height: 1.08rem;
+    line-height: 1.08rem;
+    background: #D0D0D0;
+    color: #000000;
+    font-size: 16px;
+    border-radius: 80px;
+    margin-top: 1.1rem;
+}
+[data-dpr="2"] .bind_tel_box .fcode {
+    font-size: 32px;
+}
+[data-dpr="3"] .bind_tel_box .fcode {
+    font-size: 48px;
+}
+.bind_tel_box .tel {
+    padding: 0.19rem 0.32rem;
+    width: 6.02rem;
+    height: 2.02rem;
+    border: 2px solid #FF4E4E;
+    border-radius: 6px;
+    margin-top: 0.91rem;
+}
+.mobile {
+    margin-bottom: 0.25rem;
+}
+.mobile,.yzcode,.btn_yz {
+    font-size: 14px;
+    height: 0.89rem;
+    line-height: 0.89rem;
+    width: 100%;
+    position: relative;
+}
+[data-dpr="2"] .mobile,[data-dpr="2"] .yzcode,[data-dpr="2"] .btn_yz {
+    font-size: 28px;
+}
+[data-dpr="3"] .mobile,[data-dpr="3"] .yzcode,[data-dpr="3"] .btn_yz {
+    font-size: 42px;
+}
+.mobile_box:after {
+    content: "";
+    position: absolute;
+    left: 0;
+    bottom: -0.1rem;
+    height: 0;
+    width: 100%;
+    border-bottom: 1px solid #DADADA;
+}
+.yz_box {
+    width: 3.6rem;
+}
+.get_yz {
+    width: 2.4rem;
+}
+.get_box:after {
+    content: "";
+    position: absolute;
+    left: 3.6rem;
+    top: 0;
+    height: 100%;
+    width:0;
+    border-right: 1px solid #DADADA;
+}
+.btn_pressed {
+    box-shadow: 5px 5px 30px #ccc;
+    -webkit-box-shadow: 5px 5px 30px #ccc;
+}

TEMPAT SAMPAH
data/resource/mobile/fcode/images/content_bg.png


TEMPAT SAMPAH
data/resource/mobile/fcode/images/goods_img.png


TEMPAT SAMPAH
data/resource/mobile/fcode/images/index_bg.png


TEMPAT SAMPAH
data/resource/mobile/fcode/images/logo.png


+ 160 - 0
data/resource/mobile/fcode/js/fcode.js

@@ -0,0 +1,160 @@
+$(function(){
+    var tel={
+        //总入口
+        init:function(){
+            var that=this;
+            that.validate('#hack',that.msg.no_tel);
+            that.time('#hack');
+            that.active();
+            that.blurValidatetel('keyup');
+            that.blurValidatetel('blur');
+            that.focu(document);
+        },
+
+        //弹出信息
+        msg:{
+            no_tel:'请认真填写你的手机号',
+            no_yanz:'请填写验证码',
+            yanz_err:'验证码错误',
+            lg:'该手机已经领取过红包',
+            no_lq:'该手机不能领取红包',
+            remove:'获取验证码哦',
+            over:'该手机已经领取过红包',
+            no_pass:'该手机号不能领取红包'
+        },
+        //判断验证顺序
+        b:false,
+        //插入验证结构
+        validate:function(id,msg,btnmsg,sj){
+            var that=this;
+            $(id).on('tap',function(e){
+                e.preventDefault();//阻止浏览器默认事件
+                var telVal=$('#tel_number').val(),
+                    tel=new RegExp("^[1][3-8]+\\d{9}");
+                //验证输入手机规则
+                if(telVal==''||(!tel.test(telVal))){
+                    alert(msg);
+                    that.b=false;
+                }
+                else{
+                    that.b=true;
+                    return;
+                }
+            })
+        },
+        blurValidatetel:function(eve){
+            var that=this;
+            $("#tel_number").on(eve,function(){
+                var thisVal=$(this).val(),
+                    tel=new RegExp("^[1][3-8]+\\d{9}");
+                if(thisVal==''||(!tel.test(thisVal))){
+                    that.b=false;
+                    return false;
+                }
+                else {
+                    that.b=true;
+                }
+            })
+        },
+        //留言
+        input_msg:function(){
+            var   dom='<div class="layer_box" id="bomb">'+
+                '<div class="layer" style="padding-bottom: 2px">'+
+                '<div class="top_msg" style="padding: 0 20px;line-height: 126px">'+
+                '<div><textarea id="pass_msg" placeholder="写下你想说的话" style="width:98%;height:50px;font-size: 0.4rem;line-height: 0.4rem;"></textarea></div>'+
+                '</div>'+
+                '<div class="bottom_btn center" style="background: #fff;">'+
+                '<p id="go" class="post_btn" style="float: left;width: 50%;border-top: 1px solid #bfbfbf;color: #000;">取消</p>'+
+                '<p id="post" style="float:left; color: #ff4e4e;width: 49.5%;border-top: 1px solid #bfbfbf;border-left: 1px solid #bfbfbf;">发送</p>'+
+                '</div>'+
+                '</div>'+
+                '</div>';
+            $('body').append(dom);
+        },
+        //倒计时
+        time:function(id,msg,btnmsg){
+            var that=this,
+                times=function(){
+                    if(that.b==false){
+                        return;
+                    }
+                    tel = $("#tel_number").val();
+                    var url_host=window.location.hostname;
+                    $.post("/mobile/index.php?act=login&op=getcode&type=getbonus&client_type=ajax", {
+                        mobile: tel
+                    }), function (data, status) {
+                        return;
+                    };
+                    var yzVal = $('#yanz').val(),
+                        time = 60,
+                        a = setInterval(function () {
+                            time = time - 1;
+                            $(id).text(time);
+                            if (time == 0) {
+                                clearInterval(a);
+                                $(id).text('重新发送');
+                            }
+                        }, 1000);
+                };
+            $(id).on('tap', function () {
+                //判断倒计时是否开始了
+                var text = $(this).text();
+                if (text == '重新发送' || text == '获取验证码') {
+                    times();
+                }
+                else {
+                    return;
+                }
+            })
+        },
+        //验证码验证
+        active: function () {
+            var that = this;
+            $('#bind').on('tap', function () {
+                var b = that.b;
+                if (b == false) {
+                    alert(that.msg.no_tel);
+                }
+                else {
+                    if (yanzVal == '') {
+                        alert(that.msg.no_yanz);
+                    }
+
+                    else {
+                        var yanzVal = $("#yanz").val();
+                        var tel = $("#tel_number").val();
+                        $.ajax({
+                            type:'post',
+                            dataType:'json',
+                            url:'/mobile/index.php?act=bonusex&op=bind&client_type=ios',
+                            data:{
+                                mobile: tel,
+                                code: yanzVal
+                            },
+                            success:function(data)
+                            {
+                                if (data.code==200) {
+                                    alert('领取成功');
+                                }
+                                else {
+                                    alert(that.msg.yanz_err);
+                                }
+                            }
+                        });
+                    }
+                }
+            })
+        },
+        //收起键盘
+        focu:function(id){
+            $(id).on('tap',function(event){
+                var eventName=event.target.localName;
+                if(eventName.indexOf('input')!==-1||eventName.indexOf('button')!==-1){
+                    return;
+                }
+                $('input').blur();
+            })
+        }
+    };
+    tel.init();
+});

+ 75 - 0
mobile/templates/default/fcode/fcode_content.php

@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>熊猫美妆F码</title>
+    <meta name="format-detection" content="telephone=no" />
+    <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/flexible.js?<?php echo bonus_version(); ?>"></script>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/fcode/css/main.css?<?php echo bonus_version(); ?>"/>
+</head>
+<body>
+<div class="container-fluid bg_write layout_center p_relative">
+    <div>
+        <img src="./images/content_bg.png" alt="熊猫美妆"/>
+    </div>
+    <div class="prompt_text t_left">
+        <ul class="layout_center">
+            <li>1.领取后进入APP“F码专场”兑换</li>
+            <li>2.请在F码有效期内兑换,过期不补</li>
+            <li>3.如果商品退货F码不退</li>
+        </ul>
+    </div>
+    <div class="bind_tel_box p_absolute bg_write">
+        <div class="fcode t_center layout_center">HSDX012778301408</div>
+        <div class="tel layout_center">
+            <div class="mobile_box p_relative"><input type="number" placeholder="手机号" class="mobile block" id="tel_number"/></div>
+            <div class="overflow get_box p_relative">
+                <div class="f_left yz_box"><input type="number" placeholder="请输入验证码" class="yzcode block" id="yanz"/></div>
+                <div class="f_left get_yz p_relative"><button type="button" class="block btn_yz t_center" id="hack">获取验证码</button></div>
+            </div>
+        </div>
+        <div>
+            <button class="btn btn_submit block t_center layout_center" id="bind">提交领取</button>
+        </div>
+    </div>
+    <div class="p_fixed advert">
+        <div class="f_left logo">
+            <img src="./images/logo.png" alt="logo"/>
+        </div>
+        <div class="f_left">
+            <h4>熊猫美妆</h4>
+            <p>专柜美妆&nbsp;&nbsp;内买平台</p>
+        </div>
+        <div class="f_right">
+            <a href="javascript:void(0)" class="btn btn_down block t_center" id="link">立即下载</a>
+        </div>
+    </div>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/js/zepto.min.js?<?php echo bonus_version(); ?>"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/fcode/js/fcode.js?<?php echo bonus_version(); ?>"></script>
+<script type="text/javascript">
+    $(function(){
+        function app()
+        {
+            var app=navigator.userAgent.toLowerCase(),//判断设备
+                    app_nav=navigator.appVersion.toLowerCase(),
+                    href='';
+            if (app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
+                href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
+            } else if (app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1) {
+                href = "http://p.lrlz.com/hfive/android_down/index.html";
+            }
+            else {
+                href="javascript:void(0)";
+            }
+            return href;
+        }
+
+        function href() {
+            $('#link').attr('href',app());
+        }
+        href();
+    })
+</script>
+</body>
+</html>

+ 40 - 0
mobile/templates/default/fcode/index.php

@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>熊猫美妆F码</title>
+    <meta name="format-detection" content="telephone=no" />
+    <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/flexible.js?<?php echo bonus_version(); ?>"></script>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/fcode/css/main.css?<?php echo bonus_version(); ?>"/>
+</head>
+<body>
+<div class="container-fluid bit_img bg_red layout_center">
+    <div class="title">
+        <h3 class="t_center">领取F码</h3>
+        <h2 class="t_center">获得以下商品购买权</h2>
+    </div>
+    <div class="block_goods_item layout_center">
+        <div class="block_goods layout_center">
+            <img src="./images/goods_img.png" alt="兰芝夜间保湿修护唇膜"/>
+        </div>
+        <div class="block_goods_msg t_center">
+            <p>兰芝夜间保湿修护唇膜兰芝夜间保湿修护唇膜</p>
+            <p>¥125</p>
+        </div>
+    </div>
+    <div class="receive">
+        <a href="javascript:void(0)" class="btn btn_receive block layout_center t_center btn_pressed" id="receive">立即领取</a>
+    </div>
+</div>
+<script type="text/javascript">
+    $(function(){
+        $('#receive').on('touchstart',function(){
+            $(this).removeClass('btn_pressed');
+        });
+        $('#receive').on('touchend',function(){
+            $(this).addClass('btn_pressed');
+        });
+    })
+</script>
+</body>
+</html>