123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- {extend name="public/layout"}
- {block name="body"}
- <style>
- .layui-table thead tr,
- .layui-table-header {
- background-color: #D8E6F1 !important;
- }
- .layui-tab-title .layui-this {
- background-color: #249EFB;
- color: #fff;
- }
- .layui-tab-title .layui-this:after {
- border-bottom: none;
- border: none;
- }
- .layui-tab-title li {
- background-color: #F2F2F2;
- margin: 0px 5px;
- padding: 0px 20px;
- }
- .layui-btn-xs,.layui-btn-xs:hover {
- border: 1px solid #249EFB;
- background-color: #fff;
- color: #249EFB;
- padding: 0px 10px;
- }
- .layui-btn-danger,.layui-btn-danger:hover{
- color: #FF5722;
- background-color: #fff;
- border: 1px solid #FF5722;
- padding: 0px 10px;
- }
- </style>
- <body>
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12" style="background-color:#ffffff">
- <div class="tplay-body-div">
- <div class="layui-tab">
- <ul class="layui-tab-title">
- <li style="margin-left: 0px;">
- <a href="{:url('broad/order')}">已支付订单</a>
- </li>
- <li>
- <a href="{:url('broad/order_no_pay')}">下单未支付</a>
- </li>
- <li class="layui-this">
- 进店礼订单
- </li>
- <li>
- <a href="{:url('broad/gift')}">打赏订单</a>
- </li>
- <li>
- <a href="{:url('broad/order_course_pay')}">课程购买订单</a>
- </li>
- </ul>
- </div>
- <div class="layui-card-body">
- <div class="layui-form">
- <div class="layui-inline">
- <select name="course_id" id="course_id">
- <option value="">选择活动</option>
- {volist name="course" id="vo"}
- <option value="{$vo.cid}">{$vo.title}</option>
- {/volist}
- </select>
- </div>
- <div class="layui-inline">
- <input type="text" class="layui-input" id="date" placeholder="开始日期 - 结束日期"
- autocomplete="off">
- </div>
- <div class="layui-inline">
- <select name="status" id="status">
- <option value="">选择状态</option>
- <option value="0">未进店</option>
- <option value="1">已进店</option>
- </select>
- </div>
- <button class="layui-btn" data-type="reload"><i class="layui-icon layui-icon-search layuiadmin-button-btn"></i></button>
- </div>
- <table class="layui-hide" id="user" lay-filter="user"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="js"}
- <script type="text/html" id="bt">
- {{# if(d.state == 1){ }}
- 已进店
- {{# }else{ }}
- <a class="layui-btn layui-btn-xs enter" title="确认到店" data-value="{{d.id}}">确认到店</a>
- {{# } }}
- </script>
- <script>
- var indexurl = '{:url("broad/present_order")}';
- var enterurl = '{:url("broad/present_enter_shop")}';
- var t;
- layui.use(['table', 'laydate'], function () {
- var form = layui.form
- , table = layui.table
- , laydate = layui.laydate
- , $ = layui.jquery
- , active = {
- reload: function () {
- var course_id = $('#course_id');
- var date = $('#date');
- var status = $('#status');
- //执行重载
- table.reload('userTable', {
- page: {
- curr: 1 //重新从第 1 页开始
- }
- , where: {
- course_id: course_id.val(),
- date: date.val(),
- status: status.val()
- }
- });
- }
- };
- laydate.render({
- elem: '#date'
- , range: true
- , type: 'date'
- });
- //展示已知数据
- t = table.render({
- elem: '#user'
- , url: indexurl
- , page: true
- , autoSort: true
- , cols: [[ //标题栏
- { type: 'numbers', title: '序号', fixed: 'left', width: 50 }
- , { field: 'nickname', title: '昵称', width: 100 }
- , { field: 'mobile', title: '电话', width: 140, style: "color:green", align: 'center' }
- , { field: 'title', title: '活动', minWidth: 200 }
- , { field: 'content', title: '进店礼' }
- , { field: 'addtime', title: '报名时间', width: 180, sort: true }
- , { fixed: 'right', title: '操作', toolbar: '#bt', width: 100, align: 'center' }
- ]]
- , id: 'userTable'
- });
- $('table').on('click', '.enter', function () {
- var that = this;
- var id = $(that).data('value');
- $.post(enterurl, { id: id }, function (res) {
- var resp = JSON.parse(res);
- if (resp.code == 0) {
- that.before('已进店');
- that.remove();
- layer.msg('操作成功', { anim: 0 }, function () {
- });
- } else {
- layer.msg(resp.msg, { anim: 6 });
- }
- });
- });
- form.on('switch(enter)', function (obj) {
- var that = $(obj.elem);
- var id = this.value;
- $.post(enterurl, { id: id }, function (res) {
- if (res.code == 0) {
- that.remove();
- layer.msg('操作成功', { anim: 0 }, function () {
- });
- } else {
- layer.msg(res.mgs, { anim: 6 });
- }
- });
- });
- $('.layui-form>.layui-btn').on('click', function () {
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- });
- </script>
- {/block}
|