| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?php
- use yii\widgets\LinkPager;
- use common\components\stringUtil;
- ?>
- <div class="page-title">
- <div class="title-env">
- <h1 class="title">文章管理</h1>
- </div>
- <div class="breadcrumb-env">
- <ol class="breadcrumb bc-1">
- <li>
- <a href="/"><i class="fa-home"></i>Home</a>
- </li>
- <li>
- <a href="javascript:void(0)">商城管理</a>
- </li>
- <li class="active">
- <strong>文章管理</strong>
- </li>
- </ol>
- </div>
- </div>
- <div class="panel panel-default">
- <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">
- <label>标题:<input type="search" class="form-control" name="title" placeholder="" aria-controls="example-1"></label>
- <input class="btn btn-secondary btn-single" type="submit" value="搜索" />
- <a href="/article/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" >
- <thead>
- <tr class="active">
- <th class="no-sorting"><input type="checkbox"></th>
- <th>ID</th>
- <th>封面</th>
- <th>标题</th>
- <th>阅读</th>
- <th>转发</th>
- <th>创建日期</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php foreach($models as $key => $val){?>
- <tr>
- <td><input type="checkbox"></td>
- <td><?= $val['id'] ?></td>
- <td><?php if(!empty($val['cover'])){ ?><img src="<?= Yii::$app->params['imgUrl'].$val['cover'] ?>" width="20" /><?php }else{ ?><img src="/images/nopicture.png" width="20" /><?php } ?></td>
- <td>
- <?= stringUtil::subStringUtf8($val['title'],10,'…')?>
- <a data-urlqrcode="<?= $val['urlQrCode'] ?>" data-id="<?= $val['id'] ?>" name="qrShow" href="javascript:void(0)" style="color:#68b828;"><i class="fa-qrcode"></i></a>
- </td>
- <td><?= stringUtil::calcAdd($val['viewNum'], $val['viewAddNum']) ?></td>
- <td><?= $val['relayNum'] ?></td>
- <td><?= $val['createTime'] ?></td>
- <td>
- <a href="/article/edit?id=<?= $val['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">修改 </a>
- <a href="javascript:void(0)" class="btn btn-secondary btn-sm btn-icon icon-left">删除 </a>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <div class="row">
- <div>
- <!--
- <div style="display:inline-block;margin-left:15px;">
- <label><select name="example-1_length"
- aria-controls="example-1" class="form-control">
- <option value="0">批量操作</option>
- <option value="1">批量下架</option>
- <option value="2">批量删除</option>
- </select>
- </label>
- <input class="btn btn-secondary btn-single" type="submit" name="" value="确认" />
- </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>
- $("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:'/article/show-article-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");
- });
- </script>
|