| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <?php
- use yii\widgets\LinkPager;
- use common\components\stringUtil;
- ?>
- <div class="page-title">
- <div class="title-env">
- <h1 class="title"><?= $categoryName ?> 分类下的商品</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 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" >
- <thead>
- <tr class="active">
- <th class="no-sorting hidden-xs"><input type="checkbox"></th>
- <th class="hidden-xs">ID</th>
- <th>封面</th>
- <th>标题</th>
- <th class="hidden-xs">价格</th>
- <th class="hidden-xs">销量</th>
- <th class="hidden-xs">状态</th>
- <th class="hidden-xs">创建时间</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php foreach($list as $key => $val){ ?>
- <tr>
- <td class="hidden-xs"><input type="checkbox"></td>
- <td class="hidden-xs"><?php echo $val['id'];?></td>
- <td>
- <img src="/images/newGrey.gif" class="lazy" data-original="<?php echo Yii::$app->params['imgUrl'].$val['cover'];?>" onerror="javascript:this.src='/images/nopicture.png';" width="20" />
- </td>
- <td>
- <?= stringUtil::subStringUtf8($val['goodsName'],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 class="hidden-xs"><?php echo $val['price'];?></td>
- <td class="hidden-xs"><?php echo $val['sold'];?></td>
- <td class="hidden-xs"><?php if($val['status'] == 0) echo '上架'; else echo '下架'; ?></td>
- <td class="hidden-xs"><?php echo $val['createTime'];?></td>
- <td>
- </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>
- </div>
- </div>
- </div>
- </div>
- <!-- footer -->
- <?php
- use backend\widgets\FooterWidget;
- ?>
- <?= FooterWidget::widget()?>
- <!-- footer -->
- <!-- modal 确认提醒框 -->
- <div class="modal fade" id="confirmMention">
- <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">
- 确认<span></span>?<input type="hidden" name="requestUrl" value="" />
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="confirmOk" >确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <!-- Modal 查看商品-->
- <div class="modal fade" id="modal-goodsDetail">
- <div class="modal-dialog">
- <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" data-dismiss="modal">确认</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- //确认提醒操作
- $(function(){
- jQuery("a[name=dealGoods]").click(function(){
- var url = $(this).attr('data-url');
- var msg = $(this).attr('data-msg');
- $("#confirmMention .modal-body span").text(msg);
- $("#confirmMention .modal-body input").val(url);
- jQuery('#confirmMention').modal('show', {backdrop: 'fade'}).css({
- 'margin-top': function () {
- var modalHeight = jQuery("#confirmMention").find('.modal-dialog').height();
- return ($(window).height() / 2 - (modalHeight / 2));
- }
- });
- });
- //点击确认操作
- jQuery("button[name=confirmOk]").click(function(){
- var url = $("#confirmMention .modal-body input").val();
- $.ajax({type:"GET",url:url,async:false,dataType:'json',success:function(data){
- if(data.code == 'A0001'){
- $('#confirmMention').modal('hide');
- window.location.reload();
- }
- }});
- });
- });
- //推荐商品
- $(function(){
- jQuery("a[name=recommendGoods]").click(function(){
- var url = $(this).attr('data-url');
- $.ajax({type:"GET",url:url,async:false,dataType:'json',success:function(data){
- if(data.code == 'A0001'){
- xhPopMsg(data.msg,1200);//调用定时浮层 XXX毫秒后消失
- }else{
- xhPopMsg(data.msg,2000);//调用定时浮层 XXX毫秒后消失
- }
- }});
- });
- });
- $("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:'/goods/show-goods-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>
|