| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?php
- use yii\widgets\LinkPager;
- ?>
- <?php
- use backend\widgets\TabWidget;
- echo TabWidget::widget(['list' => $this->context->menuList, 'currentMenu' => $this->context->id]);
- ?>
- <div class="panel panel-default">
- <?php
- use backend\widgets\SubTabWidget;
-
- echo SubTabWidget::widget(['list' => $this->context->subMenuList, 'currentMenu' => $this->context->action->id]);
- ?>
- <div class="panel-body">
- <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <div class="row">
- <form action="" method="GET" id="topSearchForm">
- <div class="col-xs-6" style="width:90%;">
- <div class="dataTables_length">
- <label>类型: <select name="status" class="form-control">
- <option value="-1" <?php if (isset($_GET['status']) && $_GET['status'] == "-1") {
- echo 'selected="selected"';
- } ?> >全部
- </option>
- <option value="0" <?php if (isset($_GET['status']) && $_GET['status'] == "1") {
- echo 'selected="selected"';
- } ?> >待领取
- </option>
- <option value="1" <?php if (isset($_GET['status']) && $_GET['status'] == "2") {
- echo 'selected="selected"';
- } ?> >已领取
- </option>
- <option value="2" <?php if (isset($_GET['status']) && $_GET['status'] == "3") {
- echo 'selected="selected"';
- } ?> >已过期
- </option>
- </select> </label>
- <label>卷编号:<input type="text" value="<?= isset($_GET['couponId']) ? $_GET['couponId'] : '' ?>" class="form-control" name="couponId" placeholder=""></label>
- <label>兑奖人手机号:<input type="text" value="<?= isset($_GET['mobile']) ? $_GET['mobile'] : '' ?>" class="form-control" name="mobile" placeholder=""></label>
- <input class="btn btn-secondary btn-single" id="submitButton" type="submit" name="" value="搜索"/>
- </div>
- </div>
- </form>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover">
- <thead>
- <tr class="active">
- <th class="no-sorting hidden-xs"><input type="checkbox"></th>
- <th>卷编号</th>
- <th>用卷人</th>
- <th>兑奖人</th>
- <th class="hidden-xs">兑奖人手机</th>
- <th>奖励</th>
- <th class="hidden-xs">状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php if (!empty($list)) {
- foreach ($list as $key => $val) { ?>
- <tr>
- <td class="hidden-xs"><input type="checkbox"></td>
- <td>
- <a href="/coupon/detail?id=<?= $val['couponId']; ?>"><?= $val['couponId']; ?></a>
- </td>
- </td>
- <td><?= isset($userInfo[$val['invitedUserId']]['userName']) ? $userInfo[$val['invitedUserId']]['userName'] : '' ?></td>
- <td><?= isset($userInfo[$val['userId']]['userName']) ? $userInfo[$val['userId']]['userName'] : '' ?></td>
- <td><?= $val['mobile'] ?></td>
- <td><?= $val['reward']; ?></td>
- <td>
- <span id="status_<?= $val['id'] ?>">
- <?php if ($val['status'] == 1) {
- echo '待发放';
- } elseif ($val['status'] == 2) {
- echo '<a href="javascript:void(0)" style="color:#68b828;"><i class="fa fa-check"></i></a>';
- } else {
- echo '已过期';
- } ?>
- </span>
- </td>
- <td>
- <?php if ($val['status'] == 1) { ?>
- <button type="button" onclick="confirmSendReward(<?= $val['id'] ?>)" class="btn btn-secondary btn-sm btn-icon icon-left set-get-btn">确认已发放</button>
- <?php } ?>
- </td>
- </tr>
- <?php }
- } ?>
- </tbody>
- </table>
- </div>
- <div class="row">
- <div>
- <div class="dataTables_paginate paging_simple_numbers" style="float:right;padding-top:0px;margin-right:15px;">
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- footer -->
- <?php
- use backend\widgets\FooterWidget;
- ?>
- <?= FooterWidget::widget() ?>
- <!-- footer -->
- <div class="modal fade" id="confirmSendReward">
- <div class="modal-dialog" style="height:300px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">提示</h4>
- </div>
- <div class="modal-body">
- 确认已发放?
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" onclick="confirmSendRewardOk()">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- //确认发放提示框 shish 2019.8.25
- var sendRewardId;
- function confirmSendReward(id) {
- sendRewardId = id;
- jQuery('#confirmSendReward').modal('show', {backdrop: 'fade'}).css({
- 'margin-top': function () {
- var modalHeight = jQuery("#confirmSendReward").find('.modal-dialog').height();
- return ($(window).height() / 2 - (modalHeight / 2));
- }
- });
- }
- //确认发放 shish 2019.8.25
- function confirmSendRewardOk() {
- $.ajax({
- type: "GET",
- url: '/coupon/grant-reward?id=' + sendRewardId,
- async: false,
- dataType: 'json',
- success: function (data) {
- xhPopMsg(data.msg, 1200);
- if (data.code == 1) {
- $('#confirmSendReward').modal('hide');
- window.location.reload(true);
- }
- }
- });
- }
- $("#topSearchForm").keydown(function (e) {
- var e = e || event;
- var code = e.which || e.keyCode;
- if (code == 13) {
- $("#submitButton").trigger("click");
- }
- });
- </script>
|