123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- {include file="public/header" /}
- <div class="page">
- <div class="fixed-bar">
- <div class="item-title">
- <div class="subject">
- <h3>{$Think.lang.ds_goods_manage}</h3>
- <h5></h5>
- </div>
- {include file="public/admin_items" /}
- </div>
- </div>
- <div class="fixed-empty"></div>
-
- <div class="explanation" id="explanation">
- <div class="title" id="checkZoom">
- <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
- <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
- </div>
- <ul>
- <li>{$Think.lang.goods_index_help1}</li>
- <li>{$Think.lang.goods_index_help2}</li>
- </ul>
- </div>
- <form method="get" name="formSearch" id="formSearch">
- <div class="ds-search-form">
- <dl>
- <dt>{$Think.lang.ds_goods_name}</dt>
- <dd><input type="text" value="{$Request.get.search_goods_name|default=''}" name="search_goods_name" id="search_goods_name" class="txt"></dd>
- </dl>
- <dl>
- <dt>{$Think.lang.search_commonid}</dt>
- <dd><input type="text" value="{$Request.get.search_commonid|default=''}" name="search_commonid" id="search_commonid" class="txt" /></dd>
- </dl>
- <dl>
- <dt>{$Think.lang.goods_index_class_name}</dt>
- <dd id="searchgc_td"></dd>
- <input type="hidden" id="choose_gcid" name="choose_gcid" value="0"/>
- </dl>
- <dl>
- <dt>{$Think.lang.goods_index_store_name}</dt>
- <dd><input type="text" value="{$Request.get.search_store_name|default=''}" name="search_store_name" id="search_store_name" class="txt"></dd>
- </dl>
- <dl>
- <dt>{$Think.lang.goods_index_brand}</dt>
- <dd>
- <div id="ajax_brand" class="dssc-brand-select w180">
- <div class="selection">
- <input name="b_name" id="b_name" value="{$Request.param.b_name|default=''}" type="text" class="txt w180" readonly="readonly" />
- <input type="hidden" name="b_id" id="b_id" value="{$Request.param.b_id|default=''}" />
- </div>
- <div class="dssc-brand-select-container">
- <div class="brand-index" data-url="{:url('Common/ajax_get_brand')}">
- <div class="letter" dstype="letter">
- <ul>
- <li><a href="javascript:void(0);" data-letter="all">{$Think.lang.all_brands}</a></li>
- <li><a href="javascript:void(0);" data-letter="A">A</a></li>
- <li><a href="javascript:void(0);" data-letter="B">B</a></li>
- <li><a href="javascript:void(0);" data-letter="C">C</a></li>
- <li><a href="javascript:void(0);" data-letter="D">D</a></li>
- <li><a href="javascript:void(0);" data-letter="E">E</a></li>
- <li><a href="javascript:void(0);" data-letter="F">F</a></li>
- <li><a href="javascript:void(0);" data-letter="G">G</a></li>
- <li><a href="javascript:void(0);" data-letter="H">H</a></li>
- <li><a href="javascript:void(0);" data-letter="I">I</a></li>
- <li><a href="javascript:void(0);" data-letter="J">J</a></li>
- <li><a href="javascript:void(0);" data-letter="K">K</a></li>
- <li><a href="javascript:void(0);" data-letter="L">L</a></li>
- <li><a href="javascript:void(0);" data-letter="M">M</a></li>
- <li><a href="javascript:void(0);" data-letter="N">N</a></li>
- <li><a href="javascript:void(0);" data-letter="O">O</a></li>
- <li><a href="javascript:void(0);" data-letter="P">P</a></li>
- <li><a href="javascript:void(0);" data-letter="Q">Q</a></li>
- <li><a href="javascript:void(0);" data-letter="R">R</a></li>
- <li><a href="javascript:void(0);" data-letter="S">S</a></li>
- <li><a href="javascript:void(0);" data-letter="T">T</a></li>
- <li><a href="javascript:void(0);" data-letter="U">U</a></li>
- <li><a href="javascript:void(0);" data-letter="V">V</a></li>
- <li><a href="javascript:void(0);" data-letter="W">W</a></li>
- <li><a href="javascript:void(0);" data-letter="X">X</a></li>
- <li><a href="javascript:void(0);" data-letter="Y">Y</a></li>
- <li><a href="javascript:void(0);" data-letter="Z">Z</a></li>
- <li><a href="javascript:void(0);" data-letter="0-9">{$Think.lang.goods_index_other}</a></li>
- </ul>
- </div>
- <div class="search" dstype="search"><input name="search_brand_keyword" id="search_brand_keyword" type="text" class="text" /><a href="javascript:void(0);" class="dssc-btn-mini" style="vertical-align: top;">Go</a></div>
- </div>
- <div class="brand-list" dstype="brandList">
- <ul dstype="brand_list">
- {notempty name="brand_list"}
- {foreach name="brand_list" item="val"}
- <li data-id='{$val.brand_id}'data-name='{$val.brand_name}'><em>{$val.brand_initial}</em>{$val.brand_name}</li>
- {/foreach}
- {/notempty}
- </ul>
- </div>
- <div class="no-result" dstype="noBrandList" style="display: none;">{$Think.lang.no_brand_result|raw}</div>
- </div>
- </div>
- </dd>
- </dl>
- {if $type == 'allgoods'}
- <dl>
- <dt>{$Think.lang.goods_index_show}</dt>
- <dd>
- <select name="goods_state">
- <option value="">{$Think.lang.ds_please_choose}...</option>
- {foreach name="state" item="val" key="key" }
- <option value="{$key}" {if isset($search['goods_state']) && $search['goods_state'] == $key }selected{/if}>{$val}</option>
- {/foreach}
- </select>
- </dd>
- </dl>
- <dl>
- <dt>{$Think.lang.goods_verify}</dt>
- <dd>
- <select name="goods_verify">
- <option value="" >{$Think.lang.ds_please_choose}...</option>
- {foreach name="verify" item="val" key="key"}
- <option value="{$key}" {if isset($search['goods_verify']) && $search['goods_verify'] == $key }selected{/if}>{$val}</option>
- {/foreach}
- </select>
- </dd>
- </dl>
- {/if}
-
- <div class="btn_group">
- <input type="hidden" name="type" value="{$Request.param.type}">
- <a href="javascript:void(0);" id="dssubmit" class="btn " title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
- <a href="{:url('Goods/index',['type'=>$Request.param.type])}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
- </div>
- </div>
- </form>
-
-
- <table class="ds-default-table">
- <thead>
- <tr class="thead">
- <th class="w24"></th>
- <th class="w24"></th>
- <th class="w60 align-center">{$Think.lang.search_commonid}</th>
- <th class="w24">{$Think.lang.goods_id}</th>
- <th colspan="2">{$Think.lang.ds_goods_name}</th>
- <th>{$Think.lang.goods_index_brand}&{$Think.lang.goods_index_class_name}</th>
- <th class="w72 align-center">{$Think.lang.goods_price}</th>
- <th class="w72 align-center">{$Think.lang.goods_storage}</th>
- <th class="w72 align-center">{$Think.lang.goods_state}</th>
- <th class="w72 align-center">{$Think.lang.goods_verify}</th>
- {if $type == 'allgoods'}
- <th class="w72 align-center">{$Think.lang.mall_goods_commend}</th>
- <th class="w72 align-center">{$Think.lang.ds_sort}</th>
- {/if}
- <th class="w200 align-center" >{$Think.lang.ds_handle}</th>
- </tr>
- </thead>
- <tbody>
- {notempty name="goods_list"}
- {foreach name="goods_list" item="v"}
- <tr class="hover edit" id="ds_row_{$v.goods_commonid}">
- <td><input type="checkbox" value="{$v.goods_commonid}" class="checkitem"></td>
- <td><i class="iconfont icon-jia" status="open" style="cursor: pointer;" dstype="ajaxGoodsList" data-comminid="{$v.goods_commonid}" title="{$Think.lang.show_all_spec}"></i></td>
- <td class="align-center">{$v.goods_commonid}</td>
- <td class="align-center">{$storage_array[$v['goods_commonid']]['goods_id']}</td>
- <td class="w60 picture"><div class="size-56x56"><span class="thumb size-56x56"><i></i><img src="{:goods_thumb($v, 240)}" width="56" height="56"/></span></div></td>
- <td>
- <dl class="goods-info"><dt class="goods-name">{$v.goods_name}</dt>
- <dd class="goods-type">
- {if $v.is_virtual eq 1}<span class="virtual" >{$Think.lang.ds_virtual}</span>{/if}
- {if $v.is_goodsfcode eq 1}<span class="fcode" >{$Think.lang.ds_fcode}</span>{/if}
- {if $v.is_appoint eq 1}<span class="appoint" >{$Think.lang.ds_appoint}</span>{/if}
- <i class="iconfont {if $v.mobile_body neq ''}open{/if}" ></i>
- </dd>
- <dd class="goods-store">{if isset($ownShopIds[$v['store_id']])}{$Think.lang.ds_platform}{else/}{$Think.lang.ds_three_party}{/if}{$Think.lang.ds_store}:{$v.store_name}</dd></dl>
- </td>
- <td>
- <p>{$v.gc_name}</p>
- <p class="goods-brand">{$Think.lang.ds_brand}:{$v.brand_name}</p>
- </td>
- <td class="align-center">{$v.goods_price}</td>
- <td class="align-center">{$storage_array[$v['goods_commonid']]['sum']}</td>
- <td class="align-center">{$state[$v['goods_state']]}</td>
- <td class="align-center">{$verify[$v['goods_verify']]}</td>
- {if $type == 'allgoods'}
- <td class="align-center yes-onoff">
- {if $v.mall_goods_commend == '0'}
- <a href="JavaScript:void(0);" class="disabled" ajax_branch='mall_goods_commend' ds_type="inline_edit" fieldname="mall_goods_commend" fieldid="{$v.goods_commonid}" fieldvalue="0" title="{$Think.lang.ds_editable}"><img src="{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif"></a>
- {else /}
- <a href="JavaScript:void(0);" class="enabled" ajax_branch='mall_goods_commend' ds_type="inline_edit" fieldname="mall_goods_commend" fieldid="{$v.goods_commonid}" fieldvalue="1" title="{$Think.lang.ds_editable}"><img src="{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif"></a>
- {/if}
- </td>
- <td class="align-center sort">
- <span class="editable" ds_type="inline_edit" fieldname="mall_goods_sort" ajax_branch='mall_goods_sort' fieldid="{$v.goods_commonid}" datatype="pint" maxvalue="255" title="{$Think.lang.ds_editable}">{$v.mall_goods_sort}</span>
- </td>
- {/if}
- <td class="align-center">
- <a href="{:url('/home/goods/index',['goods_id' =>$storage_array[$v['goods_commonid']]['goods_id']])}" target="_blank" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
-
- {if $type == 'lockup'}
- <a href="javascript:dsLayerConfirm('{:url('Goods/goods_del',['common_id'=>$v.goods_commonid])}','{$Think.lang.ds_ensure_del}',{$v.goods_commonid})" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a>
- {elseif $type == 'waitverify'}
- <a href="javascript:void(0);" onclick="goods_verify({$v['goods_commonid']});" class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_verify}</a>
- {elseif $type == 'allgoods' /}
- <a href="javascript:void(0);" onclick="goods_lockup({$v['goods_commonid']});" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.goods_index_lock}</a>
- {/if}
- </td>
- </tr>
- <tr style="display:none;">
- <td colspan="20"><div class="dssc-goods-sku ps-container"></div></td>
- </tr>
- {/foreach}
- {else /}
- <tr class="no_data">
- <td colspan="15">{$Think.lang.ds_no_record}</td>
- </tr>
- {/notempty}
- </tbody>
- <tfoot>
- <tr class="tfoot">
-
- {if $type == 'lockup'}
- <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
- <td colspan="16"><label for="checkallBottom">{$Think.lang.ds_select_all}</label>
- <a href="JavaScript:void(0);" class="btn btn-small" onclick="submit_delete_batch()"><span>{$Think.lang.ds_del}</span></a>
- </td>
- {elseif $type == 'waitverify'}
- <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
- <td colspan="16"><label for="checkallBottom">{$Think.lang.ds_select_all}</label>
- <a href="javascript:void(0);" class="btn btn-small" dstype="verify_batch"><span>{$Think.lang.ds_verify}</span></a>
- </td>
- {elseif $type == 'allgoods' /}
- <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
- <td colspan="16"><label for="checkallBottom">{$Think.lang.ds_select_all}</label>
- <a href="JavaScript:void(0);" class="btn btn-small" dstype="lockup_batch"><span>{$Think.lang.goods_index_lock}</span></a>
- </td>
- {/if}
- </tr>
- </tfoot>
- </table>
- {$show_page|raw}
- </div>
- <script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
- <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.mousewheel.js"></script>
- <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js" charset="utf-8"></script>
- <script type="text/javascript">
- var HOMESITEURL = "{$Think.HOME_SITE_URL}";
- $(function(){
- //商品分类
- init_gcselect({$gc_choose_json|raw},{$gc_json|raw});
- /* AJAX选择品牌 */
- $("#ajax_brand").brandinit();
-
- $('#dssubmit').click(function(){
- $('#formSearch').submit();
- });
-
- // 审核批量处理
- $('a[dstype="verify_batch"]').click(function(){
- ids_str = getItems();
- if (ids_str) {
- goods_verify(ids_str);
- }
- });
- // 违规下架批量处理
- $('a[dstype="lockup_batch"]').click(function(){
- ids_str = getItems();
- if (ids_str) {
- goods_lockup(ids_str);
- }
- });
- // ajax获取商品列表
- $('i[dstype="ajaxGoodsList"]').click(
- function(){
-
- var status = $(this).attr("status");
- if (status == 'open') {
- $(this).attr('status', 'close');
- $(this).removeClass('icon-jia').addClass('icon-jian');
- var _parenttr = $(this).parents('tr');
- var _commonid = $(this).attr('data-comminid');
- var _div = _parenttr.next().find('.dssc-goods-sku');
- if (_div.html() == '') {
- $.getJSON('{:url("Goods/get_goods_list_ajax")}' , {commonid : _commonid}, function(date){
- if (date != 'false') {
- var _ul = $('<ul class="dssc-goods-sku-list"></ul>');
- var res = eval('(' + date + ')');
- for (var i = 0; i < res.length; i++)
- {
- $('<li><div class="goods-thumb" title="{$Think.lang.goods_serial}:' + res[i].goods_serial + '"><a href="' + res[i].url + '" target="_blank"><image src="' + res[i].goods_image + '" ></a></div>' + res[i].goods_spec + '<div class="goods-price">{$Think.lang.goods_price}:<em title="¥' + res[i].goods_price + '">¥' + res[i].goods_price + '</em></div><div class="goods-storage">{$Think.lang.goods_storage}:<em title="' + res[i].goods_storage + '">' + res[i].goods_storage + '</em></div><a href="' + res[i].url + '" target="_blank" class="dssc-btn-mini">{$Think.lang.show_goods_detail}</a></li>').appendTo(_ul);
- _ul.appendTo(_div);
- _parenttr.next().show();
- }
-
- // 计算div的宽度
- _div.css('width', document.body.clientWidth-54);
-
- // _div.perfectScrollbar();
- }
- });
- } else {
- _parenttr.next().show()
- }
- }else{
- $(this).attr('status', 'open');
- $(this).removeClass('icon-jian').addClass('icon-jia');
- $(this).parents('tr').next().hide();
- }
-
- }
- );
- });
- // 获得选中ID
- function getItems() {
- /* 获取选中的项 */
- var items = '';
- $('.checkitem:checked').each(function () {
- items += this.value + ',';
- });
- if (items != '') {
- items = items.substr(0, (items.length - 1));
- }else{
- layer.alert('{$Think.lang.please_select_input}', {icon: 2})
- }
- return items;
- }
- // 商品下架
- function goods_lockup(ids_str) {
- _uri = ADMINSITEURL+"/Goods/goods_lockup?commonid=" + ids_str;
- dsLayerOpen(_uri,'{$Think.lang.goods_index_lock_reason}','400px','500px');
- }
-
- // 商品审核
- function goods_verify(ids_str) {
- _uri = ADMINSITEURL+"/Goods/goods_verify?commonid=" + ids_str;
- dsLayerOpen(_uri,'{$Think.lang.goods_verify}','400px','200px');
- }
-
- function submit_delete(ids_str){
- _uri = ADMINSITEURL+"/Goods/goods_del.html?common_id=" + ids_str;
- dsLayerConfirm(_uri,'{$Think.lang.ds_ensure_del}');
- }
- </script>
- {include file="public/footer" /}
|