stanley-king 9 vuotta sitten
vanhempi
commit
240153a288
43 muutettua tiedostoa jossa 1077 lisäystä ja 201 poistoa
  1. 15 0
      data/model/member.model.php
  2. 47 1
      data/resource/mobile/bonus/css/common.css
  3. 4 1
      data/resource/mobile/bonus/css/content.css
  4. BIN
      data/resource/mobile/bonus/imgaes/arrow_icon.jpg
  5. BIN
      data/resource/mobile/bonus/imgaes/coin.png
  6. 278 154
      data/resource/mobile/bonus/js/tel.js
  7. 133 0
      data/resource/mobile/bonusbak/css/common.css
  8. 211 0
      data/resource/mobile/bonusbak/css/content.css
  9. 0 0
      data/resource/mobile/bonusbak/image/bag_head.png
  10. 0 0
      data/resource/mobile/bonusbak/image/bomb_bg.png
  11. 0 0
      data/resource/mobile/bonusbak/image/close.png
  12. 0 0
      data/resource/mobile/bonusbak/image/content.png
  13. 0 0
      data/resource/mobile/bonusbak/image/down.png
  14. 0 0
      data/resource/mobile/bonusbak/image/foot_bg.png
  15. 0 0
      data/resource/mobile/bonusbak/image/icon.png
  16. 0 0
      data/resource/mobile/bonusbak/image/loadicon.png
  17. 0 0
      data/resource/mobile/bonusbak/image/price_bg.png
  18. 0 0
      data/resource/mobile/bonusbak/image/rcope.png
  19. 0 0
      data/resource/mobile/bonusbak/image/rcope02.png
  20. 0 0
      data/resource/mobile/bonusbak/image/tel_icon.png
  21. 0 0
      data/resource/mobile/bonusbak/image/top_bg.png
  22. BIN
      data/resource/mobile/bonusbak/imgaes/cloud.png
  23. BIN
      data/resource/mobile/bonusbak/imgaes/content_bg.png
  24. BIN
      data/resource/mobile/bonusbak/imgaes/icon_king.png
  25. BIN
      data/resource/mobile/bonusbak/imgaes/icon_open.png
  26. BIN
      data/resource/mobile/bonusbak/imgaes/icon_pin.png
  27. BIN
      data/resource/mobile/bonusbak/imgaes/logo.png
  28. BIN
      data/resource/mobile/bonusbak/imgaes/top_bg.png
  29. 167 0
      data/resource/mobile/bonusbak/js/tel.js
  30. 2 0
      data/resource/mobile/bonusbak/js/zepto.min.js
  31. 1 1
      helper/bonus/factory.php
  32. 1 1
      helper/bonus/manager.php
  33. 3 0
      helper/bonus/type.php
  34. 8 0
      helper/bonus/user_bonus.php
  35. 3 5
      helper/bonus_helper.php
  36. 67 4
      helper/predeposit_helper.php
  37. 63 18
      mobile/control/bonusex.php
  38. 8 1
      mobile/control/control.php
  39. 11 13
      mobile/control/member_bonus.php
  40. 2 0
      mobile/templates/default/bonus/content.php
  41. 34 0
      mobile/templates/default/bonus/detail.php
  42. 18 1
      mobile/templates/default/bonus/open.php
  43. 1 1
      mobile/templates/default/bonus/over.php

+ 15 - 0
data/model/member.model.php

@@ -612,6 +612,21 @@ class memberModel extends Model
             'available_relay_balance' => $available_relay_balance,'freeze_relay_balance' => $freeze_relay_balance);
     }
 
+    public function getPdOrderListEx($member_id)
+    {
+        $member_info = $this->getMemberInfo(array('member_id'=>$member_id));
+        if (!is_array($member_info) || count($member_info)<=0){
+            return false;  // 用户信息不对
+        }
+
+        // 预存款订单查询条件(支付, 红包列表)
+        $condition = 'lg_type in(\'order_pay\', \'bonus_add_money\', \'hand_out_bonus\', \'sys_add_money\') and lg_member_id=\'' . $member_info['member_id'] . '\'';
+        $model_pd = Model('predeposit');
+        $pd_log_list = $model_pd->getPdLogList($condition,'','*','lg_id desc');
+
+        return $pd_log_list;
+    }
+
     /**
      * @param $user_id  用户ID
      * @return value  获取用户预存款订单列表(图片, 名字, 数量, 订单时间, 订单号)

+ 47 - 1
data/resource/mobile/bonus/css/common.css

@@ -15,7 +15,12 @@ html,body {
 }
 
 img {border: none}
-
+input,textarea {
+    -webkit-appearance: none;
+    outline: none;
+    resize: none;
+    border: none;
+}
 a {
     -webkit-tap-highlight-color:rgba(0,0,0,0);
     text-decoration: none;
@@ -96,6 +101,7 @@ a {
     margin-bottom: -50px;
     background: url("../imgaes/icon_open.png") no-repeat;
     background-size: 100% 100%;
+    z-index: 999;
 }
 .logo {
     width: 135px;
@@ -130,4 +136,44 @@ a {
 }
 .look a {
     display: block;
+}
+.arrow_icon {
+    display: inline-block;
+    width: 0.8rem;
+    height: 0.8rem;
+    background: url("../imgaes/arrow_icon.jpg") no-repeat;
+    background-size: 100% 100%;
+    vertical-align: middle;
+}
+
+.coin_f {
+    position: absolute;
+    width: 100px;
+    height: 100px;
+    left: 50%;
+    bottom: 0;
+    margin-left: -50px;
+    margin-bottom: -50px;
+    -webkit-perspective: 5000;
+}
+.coin {
+    width: 100%;
+    height: 100%;
+    background: url("../imgaes/coin.png") no-repeat;
+    background-size: 100% 100%;
+    opacity: 0;
+    -webkit-transform: rotateY(0deg);
+}
+@-webkit-keyframes coin {
+    0% {
+        opacity: 0;
+        -webkit-transform: rotateY(0deg);
+    }
+    100% {
+        opacity: 1;
+        -webkit-transform: rotateY(360deg);
+    }
+}
+.gold_coin{
+    -webkit-animation: coin 1s ease-out ;
 }

+ 4 - 1
data/resource/mobile/bonus/css/content.css

@@ -1,3 +1,6 @@
+body {
+    height: auto;
+}
 .maincontent {
     background: #fff;
 }
@@ -37,7 +40,7 @@ div.link a{
     font-size: 1.5rem;
     display: block;
 }
-.p {
+p.p {
     color: #454545;
     font-size: 1.4rem;
 }

BIN
data/resource/mobile/bonus/imgaes/arrow_icon.jpg


BIN
data/resource/mobile/bonus/imgaes/coin.png


+ 278 - 154
data/resource/mobile/bonus/js/tel.js

@@ -1,167 +1,291 @@
 $(function(){
-    tel={
-        //总入口
-        init:function(){
-            var that=this;
-            that.validate('#hack',that.msg.no_tel,that.btnname.just_white);
-            //that.validate('#bind',that.msg.no_tel,that.btnname.just_white);
-            that.time('#hack');
-            //that.close('#close');
-            that.close('#go');
-            that.active();
-            that.blurValidatetel('keyup');
-            that.blurValidatetel('blur');
-        },
-        //弹出信息
-        msg:{
-            no_tel:'请认真填写你的手机号',
-            no_yanz:'请填写验证码',
-            yanz_err:'验证码错误',
-            lg:'该手机已经领取过红包',
-            no_lq:'该手机不能领取红包',
-            remove:'获取验证码哦',
-            over:'该手机已经领取过红包',
-            no_pass:'该手机号不能领取红包'
-        },
-        //按钮信息
-        btnname:{
-            just_white:'这就写',
-            rewrite:'重新填写',
-            check:'知道了'
-        },
-        //判断验证顺序
-        b:false,
-        //插入验证结构
-        validate:function(id,msg,btnmsg,sj){
-            var that=this;
-            $(id).on('touchstart',function(e){
-                e.preventDefault();//阻止浏览器默认事件
-                var telVal=$('#tel_number').val(),
-                    tel=new RegExp("^[1][3-8]+\\d{9}");
-                //console.log(tel.test(telVal));
-                //验证输入手机规则
-                if(telVal==''||(!tel.test(telVal))){
-                    that.appendDom(msg,btnmsg);//插入HTML弹窗结构
-                    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;
-                }
-            })
-        },
-        //dom结构
-        appendDom:function(msg,btnmsg){
-            var dom='<div class="layer_box center" id="bomb">'+
-                '<div class="layer">'+
-                '<div class="top_msg">'+
-                '<p>'+msg+'</p>'+
-                '</div>'+
-                '<div class="bottom_btn">'+
-                '<p id="go">'+btnmsg+'</p>'+
-                '</div>'+
-                '</div>'+
-                '</div>';
-            $('body').append(dom);
-        },
-        //关闭弹出
-        close:function(id){
-            $(id).live('touchstart',function(e){
-                e.preventDefault();
-                $('#bomb').remove();
-            });
-        },
-        //倒计时
-        time:function(id,msg,btnmsg){
-            var that=this,
-                times=function(){
-                    if(that.b==false){
+        tel={
+            //总入口
+            init:function(){
+                var that=this;
+                that.validate('#hack',that.msg.no_tel,that.btnname.just_white);
+                //that.validate('#bind',that.msg.no_tel,that.btnname.just_white);
+                that.time('#hack');
+                //that.close('#close');
+                that.close('#go');
+                that.active();
+                that.blurValidatetel('keyup');
+                that.blurValidatetel('blur');
+                that.message('#message');
+            },
+
+            //弹出信息
+            msg:{
+                no_tel:'请认真填写你的手机号',
+                no_yanz:'请填写验证码',
+                yanz_err:'验证码错误',
+                lg:'该手机已经领取过红包',
+                no_lq:'该手机不能领取红包',
+                remove:'获取验证码哦',
+                over:'该手机已经领取过红包',
+                no_pass:'该手机号不能领取红包'
+            },
+            //按钮信息
+            btnname:{
+                just_white:'这就写',
+                rewrite:'重新填写',
+                check:'知道了'
+            },
+            //判断验证顺序
+            b:false,
+            //插入验证结构
+            validate:function(id,msg,btnmsg,sj){
+                var that=this;
+                $(id).on('touchstart',function(e){
+                    e.preventDefault();//阻止浏览器默认事件
+                    var telVal=$('#tel_number').val(),
+                        tel=new RegExp("^[1][3-8]+\\d{9}");
+                    //console.log(tel.test(telVal));
+                    //验证输入手机规则
+                    if(telVal==''||(!tel.test(telVal))){
+                        that.appendDom(msg,btnmsg);//插入HTML弹窗结构
+                        that.b=false;
+                    }
+                    else{
+                        that.b=true;
                         return;
                     }
-                    tel = $("#tel_number").val();
-                    var url_host=window.location.hostname;
-                    $.post("http://" + url_host + "/mobile/index.php?act=login&op=getcode&type=getbonus&client_type=ajax", {
-                        mobile: tel
-                    }), function (data, status) {
-                        console.log(data);
-                    };
-
-                    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('touchstart', function () {
-                //判断倒计时是否开始了
-                var text = $(this).text();
-                if (text == '重新发送' || text == '获取验证码') {
-                    times();
-                }
-                else {
-                    return;
-                }
-            })
-        },
-        //验证码验证
-        active: function () {
-            var that = this;
-            $('#bind').on('touchstart', function () {
-                var b = that.b,
-                    yanzVal = $('#yanz').val();
-                if (b == false) {
-                    that.appendDom(that.msg.no_tel, that.btnname.just_white);
-                }
-                else {
-                    if (yanzVal == '') {
-                        that.appendDom(that.msg.no_yanz, that.btnname.just_white);
+                })
+            },
+            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 {
-                        var yanzVal = $("#yanz").val();
-                        var tel = $("#tel_number").val();
-                        var alink = $("#url").val();
-                        var bonus_sn = $("#mine_bonus").val();
+                        that.b=true;
+                    }
+                })
+            },
+            //dom结构
+            appendDom:function(msg,btnmsg){
+                var dom='<div class="layer_box center" id="bomb">'+
+                    '<div class="layer">'+
+                    '<div class="top_msg">'+
+                    '<p>'+msg+'</p>'+
+                    '</div>'+
+                    '<div class="bottom_btn">'+
+                    '<p id="go">'+btnmsg+'</p>'+
+                    '</div>'+
+                    '</div>'+
+                    '</div>';
+                $('body').append(dom);
+            },
+            //留言
+            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: 1.2rem"></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);
+            },
+            //关闭弹出
+            close:function(id){
+                $(id).live('touchstart',function(e){
+                    e.preventDefault();
+                    $('#bomb').remove();
+                });
+            },
+            //倒计时
+            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("http://"+url_host + "/mobile/index.php?act=bonusex&op=bind&client_type=ajax", {
-                            mobile: tel,
-                            code: yanzVal,
-                            bonus_sn:bonus_sn
-                        }, function (data, status) {
-                            console.log(data);
-                            if (data) {
-                                $('#bind_link').hide();
-                                $('#link').css('display','block').addClass('link_but');
-                            } else {
-                                that.appendDom(that.msg.yanz_err, that.btnname.rewrite);
-                            }
-                        });
+                        $.post("http://" + url_host + "/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('touchstart', function () {
+                    //判断倒计时是否开始了
+                    var text = $(this).text();
+                    if (text == '重新发送' || text == '获取验证码') {
+                        times();
+                    }
+                    else {
                         return;
                     }
-                }
+                })
+            },
+            //验证码验证
+            active: function () {
+                var that = this;
+                $('#bind').on('touchstart', function () {
+                    var b = that.b;
+                        //yanzVal = $('#yanz').val();
+                    if (b == false) {
+                        that.appendDom(that.msg.no_tel, that.btnname.just_white);
+                    }
+                    else {
+                        if (yanzVal == '') {
+                            that.appendDom(that.msg.no_yanz, that.btnname.just_white);
+                        }
+
+                        else {
+                            var yanzVal = $("#yanz").val();
+                            var tel = $("#tel_number").val();
+                            var alink = $("#url").val();
+                            var bonus_sn = $("#mine_bonus").val();
+                            var url_host=window.location.hostname;
+
 
+                            $.ajax({
+                                type:'post',
+                                dataType:'json',
+                                url:'http://'+url_host + '/mobile/index.php?act=bonusex&op=bind&client_type=ios',
+                                data:{
+                                    mobile: tel,
+                                    code: yanzVal,
+                                    bonus_sn:bonus_sn
+                                },
+                                success:function(data) {
+                                    if (data.code==200) {
+                                        var tel = $("#tel_number").val();
+                                        var alink = $("#url").val();
+                                        var other_html='';
+                                        var html='';
+                                        var ser = function binded_info(){
+                                            function   formatDate(now)   {
+                                                //var   year=now.getYear()+1900;
+                                                var   month=now.getMonth()+1;
+                                                var   date=now.getDate();
+                                                var   hour=now.getHours();
+                                                var   minute=now.getMinutes();
+                                                var   second=now.getSeconds();
+                                                return   month+"-"+date+"   "+hour+":"+minute;
+                                            }
+                                            //其他用户的结构
+                                            var other_ser=data.datas.binded_info;
+                                            var king=data.datas.type_info.max_amount;
+                                            var mine_bonus_sn=data.datas.mine_bonus.bonus_sn;
+                                            var comment=data.datas.binded_info;
 
-           })
+                                            for(var i=0;i<other_ser.length;i++){
+                                                var king_icon='',
+                                                    mine ='',
+                                                    user_comment='';
+
+                                                if(other_ser[i].bonus_sn==mine_bonus_sn){
+                                                    mine = '<a href="javascript:void(0)" id="message" style="color: #1927D1">留言</a>'
+                                                }
+                                                else {
+                                                    mine=formatDate(new Date(parseInt(other_ser[i].get_time)*1000));
+                                                }
+                                                if(other_ser[i].bonus_value==king) {
+                                                    king_icon = '<s class="king"></s>手气最佳';
+                                                }
+                                                if(comment[i].user_comment==''){
+                                                    user_comment='';
+                                                }
+                                                else {
+                                                    user_comment=comment[i].user_comment;
+                                                }
+                                                other_html+='<div class="li">'+
+                                                    '<div class="li_left">'+
+                                                    '<p class="p">'+other_ser[i].user_name+'</p>'+
+                                                    '<p class="prompt" id="my_prompt">'+mine+'</p>'+
+                                                    '<p style="color:#9b9b9b">'+user_comment+'</p>'+
+                                                    '</div>'+
+                                                    '<div class="li_right">'+
+                                                    '<p class="p">'+other_ser[i].bonus_value+'</p>'+
+                                                    '<p class="king_box">'+king_icon+'</p>'+
+                                                    '</div>'+
+                                                    '</div>';
+                                            }
+
+                                            var    binded_num=data.datas.type_info.binded_num,
+                                                total_num=data.datas.type_info.total_num,
+
+                                            //抢购数量
+                                                shtml='<div class="prompt text_left">'+
+                                                    '<p class="prompt pro">领取'+binded_num+'/'+total_num+'个</p>'+
+                                                    '</div>';
+
+                                            html+=shtml+other_html;
+                                            return html;
+                                        };
+                                        $('.list').html(ser());
+                                        $('#bind_link').hide();
+                                        $('#link').css('display','block').addClass('link_but');
+                                    } else {
+                                        that.appendDom(that.msg.yanz_err, that.btnname.rewrite);
+                                    }
+                                }
+                            });
+
+
+
+
+
+
+
+                        }
+
+                    }
+            })
+    },
+    //留言框
+    message:function(id){
+    var that=this;
+    $(id).live('touchstart',function(){
+        that.input_msg(that.msg.no_yanz, that.btnname.just_white);
+        $('#pass_msg').focus();
+    });
+    $('#post').live('touchstart',function(){
+        var msg=$('#pass_msg').val();
+        if(msg==''){return false;}
+        else {
+            var url_host=window.location.hostname;
+            var my_bonus_sn=$('#mine_bonus').val();
+            $.post("http://" + url_host + "/mobile/index.php?act=bonusex&op=comment&client_type=ajax", {
+                comment: msg,
+                bonus_sn:my_bonus_sn
+            }),function (data, status) {
+                return false;
+            };
+            $('#my_prompt').html(msg);
+            $('#bomb').remove();
+        }
+    });
+    $('#pass_msg').live('textInput',function(){
+        var msg_length=$(this).val().length;
+        if(msg_length>20){
+            $(this).val($(this).val().substr(0,20));
         }
-    };
-    tel.init();
+    })
+}
+};
+tel.init();
 });

+ 133 - 0
data/resource/mobile/bonusbak/css/common.css

@@ -0,0 +1,133 @@
+html,
+body,
+p,
+a,
+img
+{
+    padding: 0;
+    margin: 0;
+}
+html,body {
+    height: 100%;
+    width: 100%;
+    position: relative;
+    font-family: "Helvetica Light","华文细黑";
+}
+
+img {border: none}
+
+a {
+    -webkit-tap-highlight-color:rgba(0,0,0,0);
+    text-decoration: none;
+    color:#ffe7b8 ;
+}
+@media screen and (max-width: 319px){
+    html {
+        font-size: 12px;
+    }
+}
+@media screen and (min-width: 320px) and (max-width:374px){
+    html {
+        font-size: 13px;
+    }
+}
+@media screen and (min-width: 375px){
+    html {
+        font-size: 14px;
+    }
+}
+.maincontent {
+    width: 100%;
+    height: 100%;
+    background: #e14f48;
+    position: relative;
+    color: #ffe7b8;
+}
+.bg_position {
+    position: absolute;
+}
+.cloud_left,.cloud_right {
+    width: 44px;
+    height: 17px;
+    background: url("../imgaes/cloud.png") no-repeat;
+    background-size: 100% 100%;
+}
+.cloud_left {
+    bottom: 3%;
+    left: 4%;
+}
+.cloud_right {
+    bottom: 3%;
+    right: 4%;
+}
+.dot_right,.dot_left {
+    width: 5px;
+    height: 5px;
+    border-radius: 10px;
+    background: #ff8a6b;
+    z-index: 999;
+}
+.dot_left {
+    top: 2%;
+    left: 3%;
+}
+.dot_right {
+    top: 2%;
+    right: 3%;
+}
+.center {
+    text-align: center;
+}
+.content {
+    width: 100%;
+    height: 60%;
+    background: url("../imgaes/top_bg.png") no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    padding-top: 4rem;
+}
+.open{
+    position: absolute;
+    width: 100px;
+    height: 100px;
+    left: 50%;
+    bottom: 0;
+    margin-left: -50px;
+    margin-bottom: -50px;
+    background: url("../imgaes/icon_open.png") no-repeat;
+    background-size: 100% 100%;
+}
+.logo {
+    width: 135px;
+    height: 25px;
+    background: url("../imgaes/logo.png") no-repeat;
+    background-size: 100% 100%;
+    margin: 0 auto;
+}
+.msg_box {
+    margin-top: 10%;
+    line-height: 2.4rem;
+}
+.name {
+    font-size: 1.8rem;
+}
+.msg {
+    font-size: 1.2rem;
+    color: #ffd39b;
+}
+.msg_bottom {
+    margin-top: 15%;
+}
+.msg_bottom p {
+    font-size: 2rem;
+}
+.look {
+    position: absolute;
+    left: 50%;
+    bottom: -20%;
+    width: 7rem;
+    margin-left: -3.5rem;
+}
+.look a {
+    display: block;
+}

+ 211 - 0
data/resource/mobile/bonusbak/css/content.css

@@ -0,0 +1,211 @@
+.maincontent {
+    background: #fff;
+}
+.top {
+    height: 12%;
+    background: url("../imgaes/content_bg.png") no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    padding:6% 0;
+    line-height: 2.2rem;
+}
+.logo {
+    margin-top: 0.8rem;
+}
+.title {
+    font-size: 1.2rem;
+    padding-left: 0.6rem;
+}
+.prompt {
+    font-size: 1rem;
+    color: #9b9b9b;
+}
+.pro {
+    padding-bottom: 0.5rem;
+}
+.icon_pin {
+    display: inline-block;
+    width: 1.2rem;
+    height: 1.2rem;
+    background: url("../imgaes/icon_pin.png") no-repeat;
+    background-size: 100% 100%;
+    margin-left: 5px;
+    vertical-align: middle;
+}
+div.link a{
+    color: #1927D1;
+    font-size: 1.5rem;
+    display: block;
+}
+.p {
+    color: #454545;
+    font-size: 1.4rem;
+}
+.li {
+    display: table;
+    width: 100%;
+    border-bottom: 1px solid #e3e3e3;
+}
+.list {
+    padding: 0 8%;
+    margin-top: 2rem;
+}
+.text_left {
+    text-align: left;
+    border-bottom: 1px solid #e3e3e3;
+}
+.li_left,.li_right {
+    display: table-cell;
+    width: 50%;
+    line-height: 1.8rem;
+    padding-top: 0.5rem;
+    padding-bottom: 0.3rem;
+}
+.li_left {
+    text-align: left;
+}
+.li_right {
+    text-align: right;
+}
+.king_box {
+    color: #ff8c1e;
+}
+.king {
+    display: inline-block;
+    width: 12px;
+    height: 10px;
+    background: url("../imgaes/icon_king.png") no-repeat;
+    background-size: 100% 100%;
+    margin-right: 5px;
+}
+.name {
+    margin-top: 1.2rem;
+    margin-bottom: 1.6rem;
+    line-height: 1.8rem;
+}
+p.p_name {
+    font-size: 1.5rem;
+}
+
+.price p {
+    color: #454545;
+}
+.price p span {
+    font-size: 4rem;
+    vertical-align: sub;
+}
+.linqu_box {
+    padding: 0 8%;
+}
+.tel_box {
+    border: 1px solid #fe6565;
+    border-radius: 5px;
+    padding: 2% 5%;
+}
+.just_button {
+    background: #ff4e4e;
+    border-radius: 5px;
+    color: #fff;
+    height: 45px;
+    line-height: 46px;
+    margin-top: 15px;
+    font-size: 1.3rem;
+}
+.tel_pro {
+    color: #454545;
+    margin:1rem 0;
+}
+input,button {
+    outline: none;
+    -webkit-appearance: none;
+    border: none;
+    background: #fff;
+    font-size: 1.1rem;
+}
+.tel {
+    height: 36px;
+}
+.yanz {
+    height: 35px;
+}
+.tel {
+    border-bottom: 1px solid #e3e3e3;
+}
+.tel input {
+    height: 77%;
+    width: 98%;
+    display: inline-block;
+}
+.yanz {
+    margin-top: 2%;
+}
+.yanz input,.yanz button{
+    height: 78%;
+    display: inline-block;
+}
+.yanz_num {
+    display: inline-block;
+    width: 56%;
+    height: 100%;
+}
+.yanz input {
+    width: 100%;
+}
+.yanz button {
+    width: 42%;
+    display: inline-block;
+    border-left: 1px solid #e3e3e3;
+}
+#link {
+    display: none;
+    margin-top: 1rem;
+}
+@-webkit-keyframes link {
+    0%{
+        -webkit-transform: translate3d(0,0,0);
+    }
+    50% {
+        -webkit-transform: translate3d(0,0,0) scale(1.2);
+    }
+    100% {
+        -webkit-transform: translate3d(0,0,0) scale(1);
+    }
+}
+.link_but {
+    -webkit-animation: link 1s ease;
+}
+.layer_box {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    top: 0;
+    left: 0;
+    background:rgba(0,0,0,0.8);
+    z-index: 999;
+    font-size: 1.3rem;
+}
+.layer {
+    background: #fff;
+    width: 80%;
+    height: 160px;
+    position: absolute;
+    top: 25%;
+    left: 50%;
+    margin-left: -40%;
+    border-radius: 10px;
+}
+.top_msg{
+    height: 110px;
+    line-height: 110px;
+}
+.top_msg p {
+    height: 100%;
+}
+.bottom_btn {
+    background: #ff4e4e;
+    height: 50px;
+    line-height: 50px;
+    border-bottom-right-radius: 10px;
+    border-bottom-left-radius: 10px;
+    color: #fff;
+}

data/resource/mobile/bonus/image/bag_head.png → data/resource/mobile/bonusbak/image/bag_head.png


data/resource/mobile/bonus/image/bomb_bg.png → data/resource/mobile/bonusbak/image/bomb_bg.png


data/resource/mobile/bonus/image/close.png → data/resource/mobile/bonusbak/image/close.png


data/resource/mobile/bonus/image/content.png → data/resource/mobile/bonusbak/image/content.png


data/resource/mobile/bonus/image/down.png → data/resource/mobile/bonusbak/image/down.png


data/resource/mobile/bonus/image/foot_bg.png → data/resource/mobile/bonusbak/image/foot_bg.png


data/resource/mobile/bonus/image/icon.png → data/resource/mobile/bonusbak/image/icon.png


data/resource/mobile/bonus/image/loadicon.png → data/resource/mobile/bonusbak/image/loadicon.png


data/resource/mobile/bonus/image/price_bg.png → data/resource/mobile/bonusbak/image/price_bg.png


data/resource/mobile/bonus/image/rcope.png → data/resource/mobile/bonusbak/image/rcope.png


data/resource/mobile/bonus/image/rcope02.png → data/resource/mobile/bonusbak/image/rcope02.png


data/resource/mobile/bonus/image/tel_icon.png → data/resource/mobile/bonusbak/image/tel_icon.png


data/resource/mobile/bonus/image/top_bg.png → data/resource/mobile/bonusbak/image/top_bg.png


BIN
data/resource/mobile/bonusbak/imgaes/cloud.png


BIN
data/resource/mobile/bonusbak/imgaes/content_bg.png


BIN
data/resource/mobile/bonusbak/imgaes/icon_king.png


BIN
data/resource/mobile/bonusbak/imgaes/icon_open.png


BIN
data/resource/mobile/bonusbak/imgaes/icon_pin.png


BIN
data/resource/mobile/bonusbak/imgaes/logo.png


BIN
data/resource/mobile/bonusbak/imgaes/top_bg.png


+ 167 - 0
data/resource/mobile/bonusbak/js/tel.js

@@ -0,0 +1,167 @@
+$(function(){
+    tel={
+        //总入口
+        init:function(){
+            var that=this;
+            that.validate('#hack',that.msg.no_tel,that.btnname.just_white);
+            //that.validate('#bind',that.msg.no_tel,that.btnname.just_white);
+            that.time('#hack');
+            //that.close('#close');
+            that.close('#go');
+            that.active();
+            that.blurValidatetel('keyup');
+            that.blurValidatetel('blur');
+        },
+        //弹出信息
+        msg:{
+            no_tel:'请认真填写你的手机号',
+            no_yanz:'请填写验证码',
+            yanz_err:'验证码错误',
+            lg:'该手机已经领取过红包',
+            no_lq:'该手机不能领取红包',
+            remove:'获取验证码哦',
+            over:'该手机已经领取过红包',
+            no_pass:'该手机号不能领取红包'
+        },
+        //按钮信息
+        btnname:{
+            just_white:'这就写',
+            rewrite:'重新填写',
+            check:'知道了'
+        },
+        //判断验证顺序
+        b:false,
+        //插入验证结构
+        validate:function(id,msg,btnmsg,sj){
+            var that=this;
+            $(id).on('touchstart',function(e){
+                e.preventDefault();//阻止浏览器默认事件
+                var telVal=$('#tel_number').val(),
+                    tel=new RegExp("^[1][3-8]+\\d{9}");
+                //console.log(tel.test(telVal));
+                //验证输入手机规则
+                if(telVal==''||(!tel.test(telVal))){
+                    that.appendDom(msg,btnmsg);//插入HTML弹窗结构
+                    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;
+                }
+            })
+        },
+        //dom结构
+        appendDom:function(msg,btnmsg){
+            var dom='<div class="layer_box center" id="bomb">'+
+                '<div class="layer">'+
+                '<div class="top_msg">'+
+                '<p>'+msg+'</p>'+
+                '</div>'+
+                '<div class="bottom_btn">'+
+                '<p id="go">'+btnmsg+'</p>'+
+                '</div>'+
+                '</div>'+
+                '</div>';
+            $('body').append(dom);
+        },
+        //关闭弹出
+        close:function(id){
+            $(id).live('touchstart',function(e){
+                e.preventDefault();
+                $('#bomb').remove();
+            });
+        },
+        //倒计时
+        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("http://" + url_host + "/mobile/index.php?act=login&op=getcode&type=getbonus&client_type=ajax", {
+                        mobile: tel
+                    }), function (data, status) {
+                        console.log(data);
+                    };
+
+                    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('touchstart', function () {
+                //判断倒计时是否开始了
+                var text = $(this).text();
+                if (text == '重新发送' || text == '获取验证码') {
+                    times();
+                }
+                else {
+                    return;
+                }
+            })
+        },
+        //验证码验证
+        active: function () {
+            var that = this;
+            $('#bind').on('touchstart', function () {
+                var b = that.b,
+                    yanzVal = $('#yanz').val();
+                if (b == false) {
+                    that.appendDom(that.msg.no_tel, that.btnname.just_white);
+                }
+                else {
+                    if (yanzVal == '') {
+                        that.appendDom(that.msg.no_yanz, that.btnname.just_white);
+                    }
+                    else {
+                        var yanzVal = $("#yanz").val();
+                        var tel = $("#tel_number").val();
+                        var alink = $("#url").val();
+                        var bonus_sn = $("#mine_bonus").val();
+                        var url_host=window.location.hostname;
+                        $.post("http://"+url_host + "/mobile/index.php?act=bonusex&op=bind&client_type=ajax", {
+                            mobile: tel,
+                            code: yanzVal,
+                            bonus_sn:bonus_sn
+                        }, function (data, status) {
+                            console.log(data);
+                            if (data) {
+                                $('#bind_link').hide();
+                                $('#link').css('display','block').addClass('link_but');
+                            } else {
+                                that.appendDom(that.msg.yanz_err, that.btnname.rewrite);
+                            }
+                        });
+
+                        return;
+                    }
+                }
+
+
+           })
+        }
+    };
+    tel.init();
+});

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2 - 0
data/resource/mobile/bonusbak/js/zepto.min.js


+ 1 - 1
helper/bonus/factory.php

@@ -27,7 +27,7 @@ class factory
 
             $type_paramer = $type->get_param();
             $pre_helper = new predeposit_helper();
-            $pre_helper->hand_out_bonus($money,$type->getType_sn(),$type_paramer['type_name'],"发送了{$money}元的红包.");
+            $pre_helper->hand_out_bonus($money,$type->getType_sn(),$_SESSION['member_name'],"发送了{$money}元的红包.");
             return $type->getType_sn();
         }
         catch (Exception $ex) {

+ 1 - 1
helper/bonus/manager.php

@@ -247,7 +247,7 @@ class manager
         $condition = array('user_mobile' => $_SESSION['member_mobile'],
             'bonus_sn' => $bonus_sn,
             'status' => array('in',array(2,3)));
-        $ret = Model('user_bonus')->edit($condition)->update(array('user_comment' => $content));
+        $ret = Model('user_bonus')->edit($condition,array('user_comment' => $content));
         if($ret == true) {
             $user_bonus = user_bonus::create_by_sn($bonus_sn);
             dcache($user_bonus->type_sn(),self::type_prefix);

+ 3 - 0
helper/bonus/type.php

@@ -118,6 +118,9 @@ class type
     public function get_param() {
         return $this->mParam;
     }
+    public function sender_name() {
+        return $this->mParam['sender_name'];
+    }
     public function isStart() {
         $start_time = intval($this->mParam['send_start_date']);
         if($start_time === 0) {

+ 8 - 0
helper/bonus/user_bonus.php

@@ -64,6 +64,14 @@ class user_bonus
         }
         return $user_name;
     }
+    public function user_comment() {
+        $user_comment = $this->mParamer['user_comment'];
+        if(mb_strlen($user_comment) < 20) {
+            return $user_comment;
+        } else {
+            return mb_substr($user_comment,0,15) . '...';
+        }
+    }
     public function get_time_format() {
         $get_time = $this->mParamer['get_time'];
         return strftime("%m-%d %H:%M",$get_time);

+ 3 - 5
helper/bonus_helper.php

@@ -14,13 +14,11 @@ require_once (BASE_ROOT_PATH . '/helper/bonus/grab.php');
 require_once (BASE_ROOT_PATH . '/helper/bonus/bind.php');
 require_once (BASE_ROOT_PATH . '/helper/bonus/factory.php');
 require_once (BASE_ROOT_PATH . '/helper/bonus/manager.php');
-
 require_once (BASE_ROOT_PATH . '/helper/field_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/predeposit_helper.php');
 
 class bonus_helper
 {
-
     static public function filter_type($type_info) {
         $type = \bonus\type::crate_by_paramer($type_info);
         $fileds = 'type_sn,type_bless,send_type,sender_name,total_amount,total_num,max_amount,grabed_num,binded_num,send_start_date';
@@ -40,10 +38,10 @@ class bonus_helper
     }
 
     static public function filter_bonus($bonus_info) {
-        $fileds = 'bonus_sn,bonus_value,user_name,user_comment,get_time,status';
+        $fileds = 'bonus_sn,bonus_value,user_name,user_mobile,user_comment,get_time,status';
         $ret = array();
         field_helper::copy_column($ret,$bonus_info,$fileds);
-        if($bonus_info['user_name']) {
+        if(empty($bonus_info['user_name'])) {
             $ret['user_name'] = substr_replace($bonus_info['user_mobile'], '****', 3, 4);
         }
         return $ret;
@@ -129,7 +127,7 @@ class bonus_helper
             {
                 $info = sprintf("来自%s的红包.",$bonus['sender_name']);
                 Db::beginTransaction();
-                $pd_helper->bonus_add_money($bonus['bonus_value'],$bonus['bonus_sn'],$bonus['type_name'],$info);
+                $pd_helper->bonus_add_money($bonus['bonus_value'],$bonus['bonus_sn'],$type->sender_name(),$info);
                 if($manager->topup($mod_bonus,$val) === false) {
                     throw new Exception();
                 } else {

+ 67 - 4
helper/predeposit_helper.php

@@ -14,6 +14,15 @@ class predeposit_helper
         $this->model_pd = Model('predeposit');
     }
 
+    public function get_predeposit()
+    {
+        $pd_array = Model('member')->getMemberPdInfo($_SESSION['member_id']);
+        $total_value = $pd_array['available_predeposit'];   // 当前预存款
+        $freeze_value = $pd_array['freeze_predeposit'];     // 当前预存款冻结
+
+        return array('total_value' => $total_value,'freeze_value' => $freeze_value);
+    }
+
     public function get_predeposit_total()
     {
         $member = Model('member');
@@ -26,28 +35,82 @@ class predeposit_helper
         return intval(self::get_predeposit_total() * 100) >= intval($money * 100);
     }
 
-    public function bonus_add_money($amount,$bonus_sn,$bonus_name,$info)
+    public function bonus_add_money($amount,$bonus_sn,$sender_name,$info)
     {
         $data = array();
         $data['member_id'] = $_SESSION['member_id'];
         $data['member_name'] = $_SESSION['member_name'];
         $data['amount'] = $amount;
         $data['order_sn'] = $bonus_sn;
-        $data['admin_name'] = $bonus_name;
+        $data['admin_name'] = $sender_name;
         $data['pdr_sn'] = $bonus_sn;
         $data['lg_desc'] = $info;
         $this->model_pd->changePd("bonus_add_money", $data);
     }
 
-    public function hand_out_bonus($amount,$bonus_sn,$bonus_name,$info) {
+    public function hand_out_bonus($amount,$bonus_sn,$sender_name,$info) {
         $data = array();
         $data['member_id'] = $_SESSION['member_id'];
         $data['member_name'] = $_SESSION['member_name'];
         $data['amount'] = $amount;
         $data['order_sn'] = $bonus_sn;
-        $data['admin_name'] = $bonus_name;
+        $data['admin_name'] = $sender_name;
         $data['pdr_sn'] = $bonus_sn;
         $data['lg_desc'] = $info;
         $this->model_pd->changePd("hand_out_bonus", $data);
     }
+
+    private function filter_sn($lg_desc)
+    {
+        //发送红包系统调节预存款【减少】,红包单号: 910514563264556490
+        $pos = mb_strpos($lg_desc,':');
+        if($pos != false) {
+            return mb_substr($lg_desc,$pos + 1);
+        }
+        return '';
+    }
+
+    //'order_pay\', \'bonus_add_money\', \'hand_out_bonus\', \'sys_add_money\'
+    public function filter_pd_log($items)
+    {
+        $pdlogs = array();
+        foreach($items as $val)
+        {
+            $item = array();
+
+            $av_amount = $val['lg_av_amount'];
+            $freeze_amount = $val['lg_freeze_amount'];
+            $admin_name = $val['lg_admin_name'];
+            $add_time = $val['lg_add_time'];
+            $type = $val['lg_type'];
+            $sn = $this->filter_sn($val['lg_desc']);
+
+            $item['av_amount'] = $av_amount;
+            $item['freeze_amount'] = $freeze_amount;
+            $item['add_time'] = $add_time;
+
+            $fAdd = true;
+            if($type == 'hand_out_bonus') {
+                $item['title'] = "发出红包";
+            }
+            else if($type == 'bonus_add_money') {
+                $item['title'] = "{$admin_name}的红包";
+            }
+            else if($type == 'order_pay') {
+                $item['title'] = "支付订单:{$sn}";
+            }
+            else if($type == 'sys_add_money') {
+                $item['title'] = "系统充值";
+            }
+            else {
+                $fAdd = false;
+            }
+
+            if($fAdd) {
+                array_push($pdlogs,$item);
+            }
+        }
+
+        return $pdlogs;
+    }
 }

+ 63 - 18
mobile/control/bonusex.php

@@ -25,9 +25,14 @@ class bonusexControl extends mobileControl
 
         $binded_info = array();
         $binded_infos = $type_infos['binded_info'];
-        if(is_array($binded_infos)) {
-            foreach($binded_infos as $val) {
+        if(is_array($binded_infos))
+        {
+            foreach($binded_infos as $val)
+            {
                 $user_info = bonus_helper::filter_bonus($val);
+                if(isset($val['user_mobile'])) {
+                    unset($val['user_mobile']);
+                }
                 array_push($binded_info,$user_info);
             }
         }
@@ -66,7 +71,7 @@ class bonusexControl extends mobileControl
         {
             $type = \bonus\type::crate_by_paramer($type_infos['type_info']);
             if($type->binded_over()) {
-                return self::outerr(errcode::ErrBonusGrabNull,"手慢了,红包派完了","bonus/over");
+                return self::outsuccess(array('type_info' => $type_info,'msg' => "手慢了,红包派完了"),"bonus/over");
             } else {
                 return self::outsuccess(array('type_info' => $type_info),"bonus/open");
             }
@@ -90,7 +95,7 @@ class bonusexControl extends mobileControl
             $mine_bonus = bonus_helper::filter_bonus($mine_bonus);
         }
 
-        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info));
+        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),'bonus/detail');
     }
 
     public function grabOp()
@@ -135,13 +140,13 @@ class bonusexControl extends mobileControl
         {
             $type = \bonus\type::crate_by_paramer($type_infos['type_info']);
             if($type->binded_over()) {
-                return self::outerr(errcode::ErrBonusGrabNull,"手慢了,红包派完了","bonus/over");
+                return self::outsuccess(array('type_info' => $type_info,'msg' => "手慢了,红包派完了"),"bonus/over");
             }
             else
             {//从库里抢一个红包逻辑
                 $bonus = bonus_helper::grab_bonus($type_sn);
                 if($bonus == false) {
-                    return self::outerr(errcode::ErrBonusGrabNull,"手慢了,红包派完了","bonus/over");
+                    return self::outsuccess(array('type_info' => $type_info,'msg' => "手慢了,红包派完了"),"bonus/over");
                 }
                 else
                 {
@@ -235,7 +240,7 @@ class bonusexControl extends mobileControl
         }
         $comment = $_GET['comment'];
 
-        if(bonus_helper::comment($bonus_sn,$comment) == true) {
+        if(bonus_helper::comment($bonus_sn,urldecode($comment)) == true) {
             return self::outsuccess(array());
         } else {
             return self::outerr(errcode::ErrBonusComment,"留言失败.");
@@ -243,44 +248,69 @@ class bonusexControl extends mobileControl
     }
 }
 
+function bonus_output_openurl($output)
+{
+    $type_info = $output['type_info'];
+    $type = \bonus\type::crate_by_paramer($type_info);
+    $type_sn = $type->getType_sn();
+
+    $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&type_sn={$type_sn}";
+    return $url;
+}
+
+function bonus_output_detailurl($output)
+{
+    $type_info = $output['type_info'];
+    $type = \bonus\type::crate_by_paramer($type_info);
+    $type_sn = $type->getType_sn();
+
+    $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=detail&type_sn={$type_sn}";
+    return $url;
+}
+
 function bonus_output_graburl($output)
 {
     $type_info = $output['type_info'];
     $type = \bonus\type::crate_by_paramer($type_info);
     $type_sn = $type->getType_sn();
     $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=grab&client_type=wap&type_sn={$type_sn}";
-    echo("<a href=\"{$url}\" target=\"_self\" class=\"open\"></a>");
+    return $url;
 }
 
 function bonus_output_type($output)
 {
-    echo '<p class="p p_name">';
+    echo '<p class="p p_name" style="color:#454545">';
     $type_info = $output['type_info'];
     $type = \bonus\type::crate_by_paramer($type_info);
-
     echo($type_info['sender_name'] . "的红包");
     if($type->isRandomAmount()) {
         echo '<s class="icon_pin"></s>';
     }
     echo '</p>';
+
     echo '<p class="prompt">' . $type_info['type_bless'] . '</p>';
 }
 
 function bonus_output_mine($output)
 {
     $mine_bonus = $output['mine_bonus'];
-    if(!empty($mine_bonus))
-    {
+    if(!empty($mine_bonus)) {
         $bonus = \bonus\user_bonus::create_by_param($mine_bonus);
         echo('<div class="price">');
         echo('<p><span>' . $bonus->bonus_value() . '</span>元</p>');
         echo('</div>');
         echo('<input type="hidden" id="mine_bonus" value=' ."{$bonus->bonus_sn()}>");
-    }
 
-//    echo('<div class="link">');
-//    echo('<p><a href="javascript:void(0)">请下载熊猫美妆APP</a></p>');
-//    echo('</div>');
+        if($bonus->isBinded()) {
+            echo('<div class="link">');
+            echo('<p style="margin: 20px 0"><a href="javascript:void(0)">请下载熊猫美妆APP,享用红包</a></p>');
+            echo('</div>');
+        }
+    } else {
+        echo('<div class="link">');
+        echo('<p style="margin: 20px 0><a href="javascript:void(0)">请下载熊猫美妆APP</a></p>');
+        echo('</div>');
+    }
 }
 
 function bonus_output_bindedinfo($output)
@@ -303,15 +333,30 @@ function bonus_output_bindedinfo($output)
 
     $bined_info = $output['binded_info'];
     if(empty($bined_info)) return;
+
     foreach($bined_info as $val)
     {
         $bonus = \bonus\user_bonus::create_by_param($val);
         echo('<div class="li">');
         echo('<div class="li_left">');
         echo('<p class="p">' . $bonus->user_name() .'</p>');
-        echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
-        echo('</div>');
+        if(empty($bonus->user_comment()))
+        {
+            if($bonus->user_mobile() == $_SESSION['member_mobile']) {
+                echo ('<p class="prompt" id="my_prompt">');
+                echo ('<a href="javascript:void(0)" id="message" style="color: #1927D1">留言</a>');
+                echo ('</p>');
+                echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
+            } else {
+                echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
+                echo('<p class="prompt"></p>');
+            }
+        } else {
+            echo('<p class="prompt">' . $bonus->user_comment() . '</p>');
+            echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
+        }
 
+        echo('</div>');
         echo('<div class="li_right">');
         echo('<p class="p">' . $bonus->bonus_value() . '元</p>');
         if($type->binded_over() && $type->isMaxAmount($bonus->bonus_value()) && $type->isRandomAmount()) {

+ 8 - 1
mobile/control/control.php

@@ -84,7 +84,6 @@ class mobileControl
             if(!empty($page)) {
                 TPL::showpage($page);
             }
-
         }
         else {
             if(empty($msg)) {
@@ -139,6 +138,14 @@ class mobileControl
             }
         }
     }
+
+    public function separate_page($items,&$pages)
+    {
+        $arr_items = array_chunk($items,$this->page_size());
+        $pages = count($arr_items);
+        $page_no = $pages >= $this->page_no() ? $this->page_no() : $pages;
+        return ($arr_items[$page_no - 1]);
+    }
 }
 
 class mobileHomeControl extends mobileControl

+ 11 - 13
mobile/control/member_bonus.php

@@ -134,20 +134,18 @@ class member_bonusControl extends mbMemberControl
         return self::outsuccess(array('type_infos' => $type_infos, 'mobile_page' => mobile_page($pages)));
     }
 
-    public function bonus_listOp()
+    //预存款收支记录
+    public function pdlogOp()
     {
-        $condition = array();
-        $condition['user_id'] = $_SESSION['member_id'];
-        if (!empty($condition['user_id']))
-        {
-            // 红包总值(直接等于预存款值)
-            $member = Model('member');
-            $pd_array = $member->getMemberPdInfo($condition['user_id']);;
-            $total_value = $pd_array['available_predeposit'];   // 当前预存款
-            $freeze_value = $pd_array['freeze_predeposit'];     // 当前预存款冻结
-            // 获取使用列表
-            $ret_array = $member->getPdOrderList($condition['user_id']);
-            self::outsuccess(array('total_value' => $total_value,'freeze_value' => $freeze_value,"ret_array" => $ret_array));
+        $member = Model('member');
+        $items = $member->getPdOrderListEx($_SESSION['member_id']);
+        if(empty($items)) {
+            return self::outsuccess(array('pd_logs' => array(),'mobile_page' => mobile_page(0)));
         }
+        $cur_items = $this->separate_page($items,$pages);
+        $predeposit = new predeposit_helper();
+        $pd_logs = $predeposit->filter_pd_log($cur_items);
+
+        return self::outsuccess(array('pd_logs' => $pd_logs,'mobile_page' => mobile_page($pages)));
     }
 }

+ 2 - 0
mobile/templates/default/bonus/content.php

@@ -6,6 +6,8 @@
     <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
     <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common.css"/>
     <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/content.css"/>
+    <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/js/zepto.min.js"></script>
+    <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/js/tel.js"></script>
 </head>
 
 <body>

+ 34 - 0
mobile/templates/default/bonus/detail.php

@@ -0,0 +1,34 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>熊猫美妆红包</title>
+    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common.css"/>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/content.css"/>
+</head>
+
+<body>
+<div class="maincontent center">
+    <div class="top">
+        <p class="title">红包详情</p>
+        <div class="logo"></div>
+    </div>
+
+    <div class="name">
+        <?php bonus_output_type($output); ?>
+    </div>
+    <?php
+        echo('<div class="link">');
+        echo('<p style="margin: 20px 0><a href="javascript:void(0)">请下载熊猫美妆APP</a></p>');
+        echo('</div>');
+    ?>
+
+    <div class="list">
+        <?php
+            bonus_output_bindedinfo($output);
+        ?>
+    </div>
+</div>
+</body>
+</html>

+ 18 - 1
mobile/templates/default/bonus/open.php

@@ -5,6 +5,7 @@
     <title>熊猫美妆红包</title>
     <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
     <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common.css"/>
+    <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/js/zepto.min.js"></script>
 </head>
 
 <body>
@@ -31,9 +32,25 @@
                     <p><?php echo($output['type_info']['type_bless']); ?></p>
                 </div>
             <div>
-                <?php bonus_output_graburl($output); ?>
+                <a href="javascript:void(0)" target="_self" class="open"></a>
+            </div>
+            <div class="coin_f">
+                <div class="coin" id="coin"></div>
             </div>
         </div>
+        <input type="hidden" id="grab_url" value="<?php echo(bonus_output_graburl($output)); ?>">
     </div>
+    <script>
+        $(function(){
+            $('.open').on('touchstart',function(){
+                $(this).hide();
+                $('#coin').addClass('gold_coin');
+               var grab_url=$('#grab_url').val();
+                setTimeout(function(){
+                     window.location.href=grab_url;
+                },500)
+            })
+        })
+    </script>
 </body>
 </html>

+ 1 - 1
mobile/templates/default/bonus/over.php

@@ -19,7 +19,7 @@
             <p>手慢了,红包派完了</p>
         </div>
         <div>
-            <p class="look"><a href="javascript:void(0)">查看领取详情></a></p>
+            <p class="look"><a href="<?php echo bonus_output_detailurl($output); ?>">查看领取详情></a></p>
         </div>
 
     </div>