作者 李忠强

更新

... ... @@ -31,6 +31,7 @@ class Litestoregoods extends Backend
$this->view->assign("deductStockTypeList", $this->model->getDeductStockTypeList());
$this->view->assign("goodsStatusList", $this->model->getGoodsStatusList());
$this->view->assign("isDeleteList", $this->model->getIsDeleteList());
$this->view->assign("makeforList", $this->model->getMakeforList());
$this->view->assign("spec_attr", '');
$this->view->assign("spec_list", '');
... ...
... ... @@ -4,7 +4,8 @@ return [
'Goods_id' => 'ID',
'Goods_name' => '商品名称',
'Category_id' => '商品类别',
'Images' => '商品图片',
'Image' => '商品封面',
'Images' => '商品轮播图片',
'Spec_type' => '商品规格',
'Spec_type 10' => '单规格',
'Spec_type 20' => '多规格',
... ... @@ -25,5 +26,14 @@ return [
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Category.name' => '分类名称',
'Freight.name' => '运费模版名称'
'Freight.name' => '运费模版名称',
'Makefor' => '产地',
'Makefor 1' => '国产',
'Makefor 2' => '进口',
'Number' => '编号',
'Keep' => '保存条件',
'Packing' => '包装方式',
'Brand' => '品牌',
'Four_images' => '四宫格图',
'Down_image' => '底部图',
];
... ...
... ... @@ -42,7 +42,12 @@ class Litestoregoods extends Model
public function getDeductStockTypeList()
{
return ['10' => __('Deduct_stock_type 10'),'20' => __('Deduct_stock_type 20')];
}
}
public function getMakeforList()
{
return ['1' => __('Makefor 1'),'2' => __('Makefor 2')];
}
public function getGoodsStatusList()
{
... ...
... ... @@ -13,6 +13,20 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control form-control" size="50" name="row[image]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
... ... @@ -152,34 +166,96 @@
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <textarea id="c-content" data-rule="required" class="form-control editor form-control" rows="5" name="row[content]" cols="50"></textarea>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sales_initial')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sales_initial" data-rule="required" class="form-control form-control" name="row[sales_initial]" type="number" value="0">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sales_actual')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sales_actual" data-rule="required" class="form-control form-control" name="row[sales_actual]" type="number" value="0">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Goods_sort')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-goods_sort" data-rule="required" class="form-control form-control" name="row[goods_sort]" type="number" value="100">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Delivery_id')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-delivery_id" data-rule="required" data-source="litestore/litestorefreight/index" class="form-control selectpage form-control" name="row[delivery_id]" type="text" value="">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Brand')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="required" class="form-control editor form-control" rows="5" name="row[content]" cols="50"></textarea>
<input id="c-brand" data-rule="required" class="form-control form-control" name="row[brand]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_initial')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Makefor')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sales_initial" data-rule="required" class="form-control form-control" name="row[sales_initial]" type="number" value="0">
<div class="radio">
{foreach name="makeforList" item="vo"}
<label for="row[makefor]-{$key}"><input id="row[makefor]-{$key}" name="row[makefor]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_actual')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Packing')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sales_actual" data-rule="required" class="form-control form-control" name="row[sales_actual]" type="number" value="0">
<input id="c-packing" data-rule="required" class="form-control form-control" name="row[packing]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Goods_sort')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Keep')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goods_sort" data-rule="required" class="form-control form-control" name="row[goods_sort]" type="number" value="100">
<input id="c-keep" data-rule="required" class="form-control form-control" name="row[keep]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Delivery_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Number')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-delivery_id" data-rule="required" data-source="litestore/litestorefreight/index" class="form-control selectpage form-control" name="row[delivery_id]" type="text" value="">
<input id="c-number" data-rule="required" class="form-control form-control" name="row[number]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Down_image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-down_image" data-rule="required" class="form-control form-control" size="50" name="row[down_image]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-down_image" class="btn btn-danger plupload" data-input-id="c-down_image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false" data-preview-id="p-down_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-down_image" class="btn btn-primary fachoose" data-input-id="c-down_image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-down_image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-down_image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Four_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-four_images" data-rule="required" class="form-control form-control" size="50" name="row[four_images]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-four_images" class="btn btn-danger plupload" data-input-id="c-four_images" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true" data-preview-id="p-four_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-four_images" class="btn btn-primary fachoose" data-input-id="c-four_images" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-four_images"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-four_images"></ul>
</div>
</div>
<div class="form-group">
... ...
... ... @@ -13,6 +13,20 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control form-control" size="50" name="row[image]" type="text" value="{$row.image}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
... ... @@ -152,34 +166,96 @@
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <textarea id="c-content" data-rule="required" class="form-control editor form-control" rows="5" name="row[content]" cols="50">{$row.content}</textarea>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sales_initial')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sales_initial" data-rule="required" class="form-control form-control" name="row[sales_initial]" type="number" value="{$row.sales_initial}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sales_actual')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sales_actual" data-rule="required" class="form-control form-control" name="row[sales_actual]" type="number" value="{$row.sales_actual}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Goods_sort')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-goods_sort" data-rule="required" class="form-control form-control" name="row[goods_sort]" type="number" value="{$row.goods_sort}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Delivery_id')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-delivery_id" data-rule="required" data-source="litestore/litestorefreight/index" class="form-control selectpage form-control" name="row[delivery_id]" type="text" value="{$row.delivery_id}">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Brand')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="required" class="form-control editor form-control" rows="5" name="row[content]" cols="50">{$row.content}</textarea>
<input id="c-brand" data-rule="required" class="form-control form-control" name="row[brand]" type="text" value="{$row.brand}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_initial')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Makefor')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sales_initial" data-rule="required" class="form-control form-control" name="row[sales_initial]" type="number" value="{$row.sales_initial}">
<div class="radio">
{foreach name="makeforList" item="vo"}
<label for="row[makefor]-{$key}"><input id="row[makefor]-{$key}" name="row[makefor]" type="radio" value="{$key}" {in name="key" value="$row.makefor"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_actual')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Packing')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sales_actual" data-rule="required" class="form-control form-control" name="row[sales_actual]" type="number" value="{$row.sales_actual}">
<input id="c-packing" data-rule="required" class="form-control form-control" name="row[packing]" type="text" value="{$row.packing}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Goods_sort')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Keep')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goods_sort" data-rule="required" class="form-control form-control" name="row[goods_sort]" type="number" value="{$row.goods_sort}">
<input id="c-keep" data-rule="required" class="form-control form-control" name="row[keep]" type="text" value="{$row.keep}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Delivery_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Number')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-delivery_id" data-rule="required" data-source="litestore/litestorefreight/index" class="form-control selectpage form-control" name="row[delivery_id]" type="text" value="{$row.delivery_id}">
<input id="c-number" data-rule="required" class="form-control form-control" name="row[number]" type="text" value="{$row.number}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Down_image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-down_image" data-rule="required" class="form-control form-control" size="50" name="row[down_image]" type="text" value="{$row.down_image}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-down_image" class="btn btn-danger plupload" data-input-id="c-down_image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false" data-preview-id="p-down_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-down_image" class="btn btn-primary fachoose" data-input-id="c-down_image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-down_image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-down_image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Four_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-four_images" data-rule="required" class="form-control form-control" size="50" name="row[four_images]" type="text" value="{$row.four_images}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-four_images" class="btn btn-danger plupload" data-input-id="c-four_images" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true" data-preview-id="p-four_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-four_images" class="btn btn-primary fachoose" data-input-id="c-four_images" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-four_images"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-four_images"></ul>
</div>
</div>
<div class="form-group">
... ...
... ... @@ -10,15 +10,15 @@
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('litestore/litestoregoods/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('litestore/litestoregoods/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('litestore/litestoregoods/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('litestore/litestoregoods/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<!-- <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('litestore/litestoregoods/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<div class="dropdown btn-group {:$auth->check('litestore/litestoregoods/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
<!-- <div class="dropdown btn-group {:$auth->check('litestore/litestoregoods/multi')?'':'hide'}">-->
<!-- <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!-- <ul class="dropdown-menu text-left" role="menu">-->
<!-- <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
<!-- <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
<!-- </ul>-->
<!-- </div>-->
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('litestore/litestoregoods/edit')}"
... ...
... ... @@ -218,7 +218,7 @@ class Order extends Api
* @ApiParams (name="address_id", type="integer", required=true, description="地址id")
* @ApiReturn ({
'code':'1',
'msg':'返回成功'
'msg':'计算运费'
'data':
"price": "37574.00" 总价
})
... ... @@ -237,7 +237,7 @@ class Order extends Api
$lng2 = $admin_address['lng'];
$sum_price = $this->distancePrice($lat1,$lng1,$lat2,$lng2);
if ($sum_price === false) $this->error('地址超出配送距离');
$this->success('下单页详情',['price'=>$sum_price]);
$this->success('计算运费',['price'=>$sum_price]);
}
/**
... ... @@ -335,7 +335,7 @@ class Order extends Api
if (!$goods) $this->error('商品不存在');
$sku = $skumodel->where('goods_spec_id',$value['goods_sku_id'])->find();
if (!$sku) $this->error('商品规格不存在');
if ($sku['stock_num'] < $value['number']) $this->error('库存不足');
if ($goods['spec_type'] == 10){
$sku_name =''; //规格名
}else{
... ...
... ... @@ -22,6 +22,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','template','litestoreg
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'goods_id',
sortName: 'goods_sort',
search:false,
showExport:false,
columns: [
[
{checkbox: true},
... ...