<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
  <title>Redeem Code</title> 
  <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
  <link rel="stylesheet" href="/mamber/layui.css"> 
  <link rel="stylesheet" href="/mamber/common.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/layui/2.5.7/css/layui.min.css">
  <style>
    body {
      background-image: #666666;
      background-size: cover;
      background-repeat: no-repeat;
    }
    .common_card {
      background: #fff;
      padding: 20px;
      margin: 20px;
      border-radius: 12px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    }
    .bonus-header {
      font-family: Arial, sans-serif;
      font-size: 18px;
      font-weight: bold;
      color: #003862;
    }
    .bonus-desc {
      font-size: 14px;
      color: #666;
      margin-top: 10px;
    }
    .input-container {
      margin-top: 20px;
    }
    .layui-input {
      background: #f9f9f9;
      border-radius: 8px;
      font-size: 16px;
    }
    .layui-btn {
      width: 100%;
      border-radius: 8px;
      font-weight: bold;
      margin-top: 15px;
    }
    .msg {
      text-align: center;
      font-size: 14px;
      margin-top: 10px;
    }
    .msg.success { color: #28a745; }
    .msg.error { color: #f44336; }
    .common_body{
            background-image: url("/public/site/img/user/reward_bg.png");
            background-repeat: no-repeat;
            background-size: 100% 200px;
        }
        #Balance_details{
            margin: 0px;
            border-radius: 16px;
            background: none;
            padding: 0px;
        }
        .record {
            margin-bottom: 10px;
            background: #ffffff;
            padding: 10px;
            border-radius: 8px;
            border-bottom: 1px solid #E5E5E5;

        }
        .record .img {width: 121px;height: 100%; min-height: 120px; max-height: 130px; border-radius: 10px 0 0 10px;}
        .record .right {
            /*border-bottom: 1px solid #E5E5E5;*/
            padding: 5px 0;
         }
        .record .right .item{display:flex;justify-content: space-between; font-size: 12px;}
        .record .right .item .label{
            font-family: Arial, Arial;
            font-weight: 700;
            font-size: 16px;
            color: #393939;
            line-height: 18px
        }
        .record .right .item .date{
            font-family: PingFang SC, PingFang SC;
            font-weight: 400;
            font-size: 13px;
            color: #888888;
            line-height: 18px;
        }
        .record .right .item .value{
            font-family: Arial, Arial;
            font-weight: 700;
            font-size: 16px;
            color: #2BE26C;
            line-height: 18px;
        }
        .record .right .item .out{color: #EE6323;}
        .record .right .item .in{color: #67AD4F;}
        /* 隐藏滚动条 */
        ::-webkit-scrollbar {
            display: none;
        }
        .tab-head{
            margin-top: 30px;
            list-style-type: none;
            display:-webkit-box;
            display:-webkit-flex;
            display:-ms-flexbox;
            display:flex;
            -webkit-flex-wrap:nowrap;
            -ms-flex-wrap:nowrap;
            flex-wrap:nowrap;
            -webkit-box-pack:justify;
            -webkit-justify-content:space-between;
            -ms-flex-pack:justify;
            justify-content:space-between;
            background:none;
            padding:0;
            overflow:auto;
        }
        .tab-head-item{
            -webkit-box-flex:1;
            -webkit-flex:1 0 auto;
            -ms-flex:1 0 auto;
            flex:1 0 auto;
            color:white;
            padding:0 5px;
            padding-bottom: 10px;
        }
        .tab-head-item p{
            /*min-width: 124px;*/
            height: 34px;
            font-family: Arial, Arial;
            font-weight: 400;
            font-size: 16px;
            color: #FFFFFF;
            text-align: left;
            font-style: normal;
            text-transform: none;
            line-height: 34px;
            text-align: center;
            background: rgba(255,255,255,0.25);
            border-radius: 100px 100px 100px 100px;
            padding: 0px 20px;
        }
        .tab-head-item .this{
            font-weight: 700;
            font-size: 18px;
            background: #AF8923;
            border-radius: 100px 100px 100px 100px;
        }
        .bill_main{
            overflow: hidden;
            margin: 15px;
        }
        .bill_bg{
            background: none;
            border-radius: 16px 16px 0px 0px;
        }
        .nav{ padding: 5px 20px;width: 30%;  text-align: center;}
        .nav_active{
            width: 30%;
            text-align: center;
        }
        .nav_active .title{
            color: #0B73DB;
            text-align: center;
        }
        .common_body{
            background-image: url("/public/site/img/reward/bg.png");
            background-repeat: no-repeat;
            background-size: 100% 200px;
        }
        .reward_title{
            margin: 15px;
            font-family: HarmonyOS Sans, HarmonyOS Sans;font-weight: 500;font-size: 24px;color: #000;line-height: 22px;text-align: center;font-style: normal;text-transform: none;
        }
        .reward_desc{
            font-family: PingFang SC, PingFang SC;
            font-weight: 400;
            font-size: 14px;
            color: #000;
            line-height: 14px;
            text-align: center;
            font-style: normal;
            text-transform: none;        }
    </style> 
 </head> 
 <body class="page_common_body" style=" background: #e1be87;"> 
  <div class="common_header" style="background: none"> 
   <a href="javascript:history.back(-1)" class="back position flex_space"> <p class="btn"><i class="layui-icon layui-icon-left layui-font-20"></i></p> <p>redeem code</p> </a> 
  </div> 

  <div class="common_card">
    <p class="bonus-header">🎁 Redeem Your Bonus</p>
    <p class="bonus-desc">Enter the bonus code to receive your reward.</p>

    <form class="layui-form input-container" id="redeem-form">
      <div class="layui-form-item">
        <input type="text" name="bonus_code" required placeholder="Enter your bonus code" class="layui-input">
      </div>
      <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitBonus">Redeem Now</button>
    </form>

    <div class="msg" id="messageBox"></div>
  </div>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/layui/2.5.7/layui.min.js"></script>
  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script>
    layui.use(['form', 'layer'], function(){
      var form = layui.form;
      var layer = layui.layer;

      form.on('submit(submitBonus)', function(data){
        layer.load(1, {shade: [0.1,'#fff']});
        $('#messageBox').text('');

        $.ajax({
          url: "<?php echo e(route('user.submit-bonus')); ?>",
          method: "POST",
          headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
          },
          data: data.field,
          success: function(res){
            layer.closeAll('loading');
            if(res.status === 1){
              $('#messageBox').text(res.message).addClass('msg success').removeClass('error');
              layer.msg(res.message, {icon: 1});
            } else {
              $('#messageBox').text(res.message).addClass('msg error').removeClass('success');
              layer.msg(res.message, {icon: 2});
            }
          },
          error: function(){
            layer.closeAll('loading');
            $('#messageBox').text("An error occurred.").addClass('msg error');
          }
        });

        return false;
      });
    });
  </script>
</body>
</html>
<?php /**PATH /home/zgvdquyg/public_html/resources/views/app/main/bonus/index.blade.php ENDPATH**/ ?>