| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <?php
- use yii\widgets\LinkPager;
- use common\components\stringUtil;
- ?>
- <?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">
- <div class="col-xs-6" style="width:90%;">
- <div class="dataTables_length">
- <a href="./add" class="btn btn-secondary btn-single" style="margin-right:15px;">添加刮刮卡</a>
- </div>
- </div>
- </form>
- </div>
- <div name="xhQrTip" style="position:absolute;border-color: #8dc63f;width:110px;height:122px;z-index:9999;display:none;background:white;border:1px solid #ccc;">
- <div style="background:red;">
- <a href="javascript:void(0)" style="color:#68b828;float:right;z-index:9999;"
- <i="" class="fa-times"></a>
- </div>
- <div></div>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover table-condensed">
- <thead>
- <tr class="active">
- <th class="no-sorting hidden-xs"><input type="checkbox"></th>
- <th class="hidden-xs">ID</th>
- <th>活动名称</th>
- <th class="hidden-xs">开始时间</th>
- <th class="hidden-xs">结束时间</th>
- <th class="hidden-xs">访问次数</th>
- <th class="hidden-xs">客户数</th>
- <th class="hidden-xs">抽奖人数</th>
- <th class="hidden-xs">中奖人数</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
-
- <?php
- foreach ($activities as $key => $activity) {
- ?>
- <tr>
- <td class="hidden-xs"><input type="checkbox"></td>
- <td class="hidden-xs"><?= $activity['id'] ?></td>
- <td title="<?= $activity['actName'] ?>">
- <a href="./edit?id=<?= $activity['id'] ?>"><?= stringUtil::subStringUtf8($activity['actName'], 9, '…') ?></a>
-
- <a data-toggle="tooltip" data-placement="bottom" title="" data-original-title="点击将访问链接发送到管理员手机上" data-urlqrcode="<?= $activity['urlQrCode'] ?>" data-id="<?= $activity['id'] ?>" name="sendActiveUrlToMobile" href="javascript:void(0)" style="color:#68b828;margin-left:6px;text-decoration:none;">
- <i class="fa-mobile-phone" style="font-size:16px;"></i> </a>
-
- <a data-toggle="tooltip" data-placement="bottom" title="" data-original-title="点击显示二维码链接" data-urlqrcode="<?= $activity['urlQrCode'] ?>" data-id="<?= $activity['id'] ?>" name="qrShow" href="javascript:void(0)" style="color:#68b828;margin-left:4px;text-decoration:none;">
- <i class="fa-qrcode"></i>
- </td>
- <td class="hidden-xs"><?= date('Y-m-d', $activity['startTime']) ?></td>
- <td class="hidden-xs"><?= date('Y-m-d', $activity['endTime']) ?></td>
- <td><?= $activity['visitNum'] ?></td>
- <td><?= $activity['visitUser'] ?></td>
- <td><a href="./join-list?id=<?= $activity['id'] ?>"><?= $activity['drawUser'] ?></a></td>
- <td><a href="./win-list?id=<?= $activity['id'] ?>"><?= $activity['winUser'] ?></a></td>
- <td><?= $activity['status'] ?></td>
- <td>
- <a href="./win-list?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">中奖客户</a>
- <a href="./prize-detail?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">奖品</a>
- <a href="./join-list?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">参与人</a>
- <a href="./edit?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">修改</a>
- </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 -->
- <script>
- $(function () {
- $("a[name=qrShow]").click(function () {
- var left = $(this).position().left;
- var top = $(this).position().top;
- var id = $(this).attr('data-id');
- var urlqrcode = $(this).attr('data-urlqrcode');
- var object = $(this);
- $("div[name=xhQrTip]").children('div').eq(1).html('<img src="/images/loading.gif" style="margin:47px 0 0 47px;" />');
- $("div[name=xhQrTip]").css('left', left).css('top', top - 110).css('display', 'block');
- if (urlqrcode.length > 0) {
- $("div[name=xhQrTip]").children('div').eq(1).html('<img width="105" src="<?= Yii::$app->params['imgUrl'] ?>' + urlqrcode + '" />');
- $("div[name=xhQrTip]").css('left', left).css('top', top - 110).css("padding", "2px").fadeIn();
- } else {
- $.ajax({
- type: "get",
- url: '/gua-gua/show-act-qrcode?id=' + id,
- async: true,
- dataType: 'json',
- success: function (data) {
- if (data.code == 'A0001') {
- var imgUrl = data.data.url;
- object.attr('data-urlqrcode', imgUrl);
- $("div[name=xhQrTip]").children('div').eq(1).html('<img width="105" src="<?= Yii::$app->params['imgUrl'] ?>' + imgUrl + '" />');
- $("div[name=xhQrTip]").css('left', left).css('top', top - 110).css("padding", "2px").fadeIn();
- }
- }
- });
- }
- });
- $("div[name=xhQrTip]").click(function () {
- $(this).css("display", "none");
- });
- $("a[name=sendActiveUrlToMobile]").click(function () {
- var activeId = $(this).attr('data-id');
- $.ajax({
- type: "get",
- url: '/gua-gua/send-active-url?activeId=' + activeId,
- async: true,
- dataType: 'json',
- success: function (data) {
- xhPopMsg(data.msg, 2000);
- }
- });
- });
- });
- </script>
|