[更新]同步Framework代码

This commit is contained in:
Anyon 2019-06-14 18:57:26 +08:00
parent 5990690c9f
commit 3e0afa2a04
33 changed files with 661 additions and 1037 deletions

View File

@ -47,7 +47,8 @@ class Update extends Controller
$file = env('root_path') . decode($encode);
if (!file_exists($file)) $this->error('获取文件内容失败!');
$this->success('获取文件内容成功!', [
'format' => 'base64', 'content' => base64_encode(file_get_contents($file)),
'format' => 'base64',
'content' => base64_encode(file_get_contents($file)),
]);
}

View File

@ -9,7 +9,7 @@
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// | github开源项目https://github.com/zoujingli/framework
// +----------------------------------------------------------------------
namespace app\index\controller;

View File

@ -14,9 +14,6 @@
namespace app\store\command;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\Db;
/**
@ -24,7 +21,7 @@ use think\Db;
* Class AutoRun
* @package app\store\command
*/
class AutoRun extends Command
class AutoRun extends \think\console\Command
{
protected function configure()
@ -34,20 +31,20 @@ class AutoRun extends Command
/**
* 业务指令执行
* @param Input $input
* @param Output $output
* @param \think\console\Input $input
* @param \think\console\Output $output
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
protected function execute(Input $input, Output $output)
protected function execute(\think\console\Input $input, \think\console\Output $output)
{
// 自动取消30分钟未支付的订单
$this->autoCancelOrder();
// 清理一天前未支付的订单
$this->autoCleanOrder();
$this->autoRemoveOrder();
// 订单自动退款处理
// $this->autoRefundOrder();
// 提现自动打款处理
@ -61,8 +58,9 @@ class AutoRun extends Command
*/
private function autoCancelOrder()
{
$where = [['create_at', '<', date('Y-m-d H:i:s', strtotime('-30 minutes'))]];
$count = Db::name('StoreOrder')->where(['pay_state' => '0'])->whereIn('status', ['1', '2'])->where($where)->update([
$datetime = $this->getDatetime('store_order_wait_time');
$where = [['status', 'in', ['1', '2']], ['pay_state', 'eq', '0'], ['create_at', '<', $datetime]];
$count = Db::name('StoreOrder')->where($where)->update([
'status' => '0',
'cancel_state' => '1',
'cancel_at' => date('Y-m-d H:i:s'),
@ -83,14 +81,15 @@ class AutoRun extends Command
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
private function autoCleanOrder()
private function autoRemoveOrder()
{
$where = [['create_at', '<', date('Y-m-d H:i:s', strtotime('-1 day'))]];
$list = Db::name('StoreOrder')->where(['pay_state' => '0'])->where($where)->limit(20)->select();
if (count($order_nos = array_unique(array_column($list, 'order_no'))) > 0) {
$this->output->info("自动删除前一天已经取消的订单:\n\t" . join(',' . PHP_EOL . "\t", $order_nos));
Db::name('StoreOrder')->whereIn('order_no', $order_nos)->delete();
Db::name('StoreOrderList')->whereIn('order_no', $order_nos)->delete();
$datetime = $this->getDatetime('store_order_clear_time');
$where = [['status', 'eq', '0'], ['pay_state', 'eq', '0'], ['create_at', '<', $datetime]];
$list = Db::name('StoreOrder')->where($where)->limit(20)->select();
if (count($orderNos = array_unique(array_column($list, 'order_no'))) > 0) {
$this->output->info("自动删除前一天已经取消的订单:" . PHP_EOL . join(',' . PHP_EOL, $orderNos));
Db::name('StoreOrder')->whereIn('order_no', $orderNos)->delete();
Db::name('StoreOrderList')->whereIn('order_no', $orderNos)->delete();
} else {
$this->output->comment('没有需要自动删除前一天已经取消的订单!');
}
@ -172,4 +171,17 @@ class AutoRun extends Command
}
}
/**
* 获取配置时间
* @param string $code
* @return string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
private function getDatetime($code)
{
$minutes = intval(sysconf($code) * 60);
return date('Y-m-d H:i:s', strtotime("-{$minutes} minutes"));
}
}

View File

@ -14,7 +14,7 @@
namespace app\store\controller;
use app\store\service\Extend;
use app\store\service\ExtendService;
use library\Controller;
/**
@ -35,7 +35,7 @@ class Config extends Controller
$this->applyCsrfToken();
$this->title = '商城参数配置';
if ($this->request->isGet()) {
$this->query = Extend::querySmsBalance();
$this->query = ExtendService::querySmsBalance();
$this->fetch();
} else {
foreach ($this->request->post() as $k => $v) sysconf($k, $v);
@ -43,4 +43,22 @@ class Config extends Controller
}
}
/**
* 商城短信配置
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function sms()
{
$this->applyCsrfToken();
$this->title = '商城短信配置';
if ($this->request->isGet()) {
$this->query = ExtendService::querySmsBalance();
$this->fetch();
} else {
foreach ($this->request->post() as $k => $v) sysconf($k, $v);
$this->success('商城短信配置保存成功!');
}
}
}

View File

@ -95,7 +95,7 @@ class ExpressCompany extends Controller
/**
* 删除快递公司
*/
public function del()
public function remove()
{
$this->_delete($this->table);
}

View File

@ -83,7 +83,7 @@ class ExpressProvince extends Controller
/**
* 删除配送省份
*/
public function del()
public function remove()
{
$this->applyCsrfToken();
$this->_delete($this->table);

View File

@ -21,11 +21,6 @@ class ExpressTemplate extends Controller
/**
* 邮费模板管理
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function index()
{

View File

@ -91,7 +91,7 @@ class Goods extends Controller
]);
if (!empty($data)) {
Db::name('StoreGoodsStock')->insertAll($data);
\app\store\service\Goods::syncStock($post['id']);
\app\store\service\GoodsService::syncStock($post['id']);
$this->success('商品信息入库成功!');
}
}
@ -104,7 +104,7 @@ class Goods extends Controller
*/
public function add()
{
$this->title = '添加商品';
$this->title = '添加商品信息';
$this->isAddMode = '1';
return $this->_form($this->table, 'form');
}
@ -115,7 +115,7 @@ class Goods extends Controller
*/
public function edit()
{
$this->title = '编辑商品';
$this->title = '编辑商品信息';
$this->isAddMode = '0';
return $this->_form($this->table, 'form');
}
@ -182,7 +182,7 @@ class Goods extends Controller
/**
* 删除商品信息
*/
public function del()
public function remove()
{
$this->_delete($this->table);
}

View File

@ -83,7 +83,7 @@ class GoodsCate extends Controller
/**
* 删除商品分类
*/
public function del()
public function remove()
{
$this->_delete($this->table);
}

View File

@ -40,7 +40,8 @@ class Member extends Controller
public function index()
{
$this->title = '会员信息管理';
$this->_query($this->table)->like('nickname,phone')->equal('vip_level')->dateBetween('create_at')->order('id desc')->page();
$query = $this->_query($this->table)->like('nickname,phone')->equal('vip_level');
$query->dateBetween('create_at')->order('id desc')->page();
}
/**

View File

@ -40,7 +40,16 @@ class Message extends Controller
public function index()
{
$this->title = '短信发送管理';
$this->_query($this->table)->like('phone,content,result')->dateBetween('create_at')->order('id desc')->page();
$query = $this->_query($this->table)->like('phone,content,result');
$query->dateBetween('create_at')->order('id desc')->page();
}
/**
* 删除短信记录
*/
public function remove()
{
$this->_delete($this->table);
}
}

View File

@ -83,7 +83,7 @@ class Order extends Controller
$this->_form($this->table);
}
/***
/**
* 快递追踪查询
*/
public function expressQuery()

View File

@ -14,7 +14,7 @@
namespace app\store\controller\api;
use app\store\service\Order;
use app\store\service\OrderService;
use think\Db;
/**
@ -64,7 +64,7 @@ class Notify
'pay_price' => $pay_price, 'pay_state' => '1', 'pay_at' => date('Y-m-d H:i:s'),
]);
// 调用会员升级机制
Order::update($order['order_no']);
OrderService::update($order['order_no']);
return $result !== false;
}

View File

@ -15,7 +15,7 @@
namespace app\store\controller\api\member;
use app\store\controller\api\Member;
use app\store\service\Extend;
use app\store\service\ExtendService;
use think\Db;
/**
@ -79,7 +79,7 @@ class Center extends Member
$this->error('获取短信模板失败,联系管理员配置!');
}
$cache = cache($cachekey);
if (Extend::sendSms($this->mid, $phone, str_replace('{code}', $code, $content))) {
if (ExtendService::sendSms($this->mid, $phone, str_replace('{code}', $code, $content))) {
$dtime = ($cache['time'] + 120 < time()) ? 0 : (120 - time() + $cache['time']);
$this->success('短信验证码发送成功!', ['time' => $dtime]);
}

View File

@ -15,7 +15,7 @@
namespace app\store\controller\api\member;
use app\store\controller\api\Member;
use app\store\service\Goods;
use app\store\service\GoodsService;
use library\tools\Data;
use think\Db;
@ -95,7 +95,7 @@ class Order extends Member
Db::name('StoreOrder')->insert($order);
Db::name('StoreOrderList')->insertAll($orderList);
// 同步商品库存及销量
foreach (array_unique(array_column($orderList, 'goods_id')) as $goodsId) Goods::syncStock($goodsId);
foreach (array_unique(array_column($orderList, 'goods_id')) as $goodsId) GoodsService::syncStock($goodsId);
$this->success('订单创建成功,请补全收货信息后支付!', ['order' => $order]);
} catch (\think\exception\HttpResponseException $exception) {
throw $exception;
@ -252,7 +252,7 @@ class Order extends Member
'cancel_at' => date('Y-m-d H:i:s'),
'cancel_desc' => '用户主动取消订单!',
]);
if ($result !== false && \app\store\service\Order::syncStock($order['order_no'])) {
if ($result !== false && \app\store\service\OrderService::syncStock($order['order_no'])) {
$this->success('订单取消成功!');
}
$this->error('订单取消失败,请稍候再试!');

View File

@ -1,71 +0,0 @@
<?php
namespace app\store\service;
use think\Db;
/**
* 商城邮费服务
* Class Express
* @package app\store\service
*/
class Express
{
/**
* 订单邮费计算
* @param string $province 配送省份
* @param string $number 计费数量
* @param string $amount 订单金额
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function price($province, $number, $amount)
{
// 读取对应的模板规则
$map = [['is_default', 'eq', '0'], ['rule', 'like', "%{$province}%"]];
$rule = Db::name('StoreExpressTemplate')->where($map)->find();
if (!empty($rule)) return self::buildData($rule, '普通模板', $number, $amount);
$rule = Db::name('StoreExpressTemplate')->where(['is_default' => '1'])->find();
return self::buildData($rule, '默认模板', $number, $amount);
}
/**
* 生成邮费数据
* @param array $rule 模板规则
* @param string $type 模板类型
* @param integer $number 计费件数
* @param double $amount 订单金额
* @return array
*/
protected static function buildData($rule, $type, $number, $amount)
{
// 异常规则
if (empty($rule)) return [
'express_price' => 0.00, 'express_type' => '未知模板', 'express_desc' => '未匹配到邮费模板',
];
// 满减免邮
if ($rule['order_reduction_state'] && $amount >= $rule['order_reduction_price']) {
return [
'express_price' => 0.00, 'express_type' => $type,
'express_desc' => "订单总金额满{$rule['order_reduction_price']}元减免全部邮费",
];
}
// 首重计费
if ($number <= $rule['first_number']) return [
'express_price' => $rule['first_price'], 'express_type' => $type,
'express_desc' => "首件计费,{$rule['first_number']}件及{$rule['first_number']}以内计费{$rule['first_price']}",
];
// 续重计费
list($price1, $price2) = [$rule['first_price'], 0];
if ($rule['next_number'] > 0 && $rule['next_price'] > 0) {
$price2 = $rule['next_price'] * ceil(($number - $rule['first_number']) / $rule['next_number']);
}
return [
'express_price' => $price1 + $price2, 'express_type' => $type,
'express_desc' => "续件计费,超出{$rule['first_number']}件,首件费用{$rule['first_price']}元 + 续件费用{$price2}",
];
}
}

View File

@ -1,82 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | framework
// +----------------------------------------------------------------------
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://framework.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/framework
// +----------------------------------------------------------------------
namespace app\store\service;
use library\tools\Http;
use think\Db;
/**
* 业务扩展服务
* Class Extend
* @package app\store\service
*/
class Extend
{
/**
* 发送短信验证码
* @param string $mid 会员ID
* @param string $phone 手机号
* @param string $content 短信内容
* @param string $productid 短信通道ID
* @return boolean
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public static function sendSms($mid, $phone, $content, $productid = '676767')
{
$tkey = date("YmdHis");
$data = [
'tkey' => $tkey,
'mobile' => $phone,
'content' => $content,
'username' => sysconf('sms_zt_username'),
'productid' => $productid,
'password' => md5(md5(sysconf('sms_zt_password')) . $tkey),
];
$result = Http::post('http://www.ztsms.cn/sendNSms.do', $data);
list($code, $msg) = explode(',', $result . ',');
$insert = ['mid' => $mid, 'phone' => $phone, 'content' => $content, 'result' => $result];
Db::name('StoreMemberSmsHistory')->insert($insert);
return intval($code) === 1;
}
/**
* 查询短信余额
* @return array
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public static function querySmsBalance()
{
$tkey = date("YmdHis");
$data = [
'tkey' => $tkey,
'username' => sysconf('sms_zt_username'),
'password' => md5(md5(sysconf('sms_zt_password')) . $tkey),
];
$result = Http::post('http://www.ztsms.cn/balanceN.do', $data);
if ($result > -1) {
return ['code' => 1, 'num' => $result, 'msg' => '获取短信剩余条数成功!'];
} elseif ($result > -2) {
return ['code' => 0, 'num' => '0', 'msg' => '用户名或者密码不正确!'];
} elseif ($result > -3) {
return ['code' => 0, 'num' => '0', 'msg' => 'tkey不正确'];
} elseif ($result > -4) {
return ['code' => 0, 'num' => '0', 'msg' => '用户不存在或用户停用!'];
}
}
}

View File

@ -1,70 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | framework
// +----------------------------------------------------------------------
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://framework.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/framework
// +----------------------------------------------------------------------
namespace app\store\service;
use think\Db;
/**
* 商品数据管理
* Class Goods
* @package app\store\logic
*/
class Goods
{
/**
* 同步商品库存信息
* @param integer $goodsId
* @return boolean
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public static function syncStock($goodsId)
{
// 商品入库统计
$fields = "goods_id,goods_spec,ifnull(sum(number_stock),0) number_stock";
$stockList = Db::name('StoreGoodsStock')->field($fields)->where(['goods_id' => $goodsId])->group('goods_id,goods_spec')->select();
// 商品销量统计
$where = [['b.goods_id', 'eq', $goodsId], ['a.status', 'in', ['1', '2', '3', '4', '5']]];
$fields = 'b.goods_id,b.goods_spec,ifnull(sum(b.number_goods),0) number_sales';
$salesList = Db::table('store_order a')->field($fields)->leftJoin('store_order_list b', 'a.order_no=b.order_no')->where($where)->group('b.goods_id,b.goods_spec')->select();
// 组装更新数据
$dataList = [];
foreach (array_merge($stockList, $salesList) as $vo) {
$key = "{$vo['goods_id']}@@{$vo['goods_spec']}";
$dataList[$key] = isset($dataList[$key]) ? array_merge($dataList[$key], $vo) : $vo;
if (empty($dataList[$key]['number_sales'])) $dataList[$key]['number_sales'] = '0';
if (empty($dataList[$key]['number_stock'])) $dataList[$key]['number_stock'] = '0';
}
unset($salesList, $stockList);
// 更新商品规格销量及库存
foreach ($dataList as $vo) Db::name('StoreGoodsList')->where([
'goods_id' => $goodsId,
'goods_spec' => $vo['goods_spec'],
])->update([
'number_stock' => $vo['number_stock'],
'number_sales' => $vo['number_sales'],
]);
// 更新商品主体销量及库存
Db::name('StoreGoods')->where(['id' => $goodsId])->update([
'number_stock' => intval(array_sum(array_column($dataList, 'number_stock'))),
'number_sales' => intval(array_sum(array_column($dataList, 'number_sales'))),
]);
return true;
}
}

View File

@ -1,66 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | framework
// +----------------------------------------------------------------------
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://framework.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/framework
// +----------------------------------------------------------------------
namespace app\store\service;
use think\Db;
/**
* 订单服务管理器
* Class Order
* @package app\store\service
*/
class Order
{
/**
* 根据订单号升级会员等级
* @param string $order_no 订单单号
* @return boolean
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function update($order_no)
{
// @todo 更新订单状态
}
/**
* 根据订单同步库存销量
* @param string $order_no
* @return boolean
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public static function syncStock($order_no)
{
$map = ['order_no' => $order_no];
$goodsIds = Db::name('StoreOrderList')->where($map)->column('goods_id');
foreach (array_unique($goodsIds) as $goodsId) if (!Goods::syncStock($goodsId)) return false;
return true;
}
/**
* 订单利润计算
* @param string $order_no
* @return boolean
*/
public static function profit($order_no = '')
{
// @todo 计算订单返佣
}
}

View File

@ -1,71 +1,40 @@
{extend name="admin@main"}
{block name="content"}
<form onsubmit="return false;" data-auto="true" action="{:request()->url()}" method="post" class='layui-form layui-card' autocomplete="off">
<form onsubmit="return false;" data-auto="true" action="{:request()->url()}" method="post" class='layui-form layui-card' style="max-width:1000px" autocomplete="off">
<div class="layui-card-body" style="padding-left:40px">
<div class="layui-card-body think-box-shadow padding-left-40">
<div style="padding:20px 40px">
<fieldset>
<label class="layui-form-item margin-top-20 block relative">
<span class="color-green margin-right-10">商城展示名称</span><span class="nowrap color-desc">StoreTitle</span>
<input name="store_title" required placeholder="请输入商城展示名称" value="{:sysconf('store_title')}" class="layui-input">
<p class="help-block">订单支付等待时长,新下订单未在此时间内容完成支付将会被自动取消</p>
</label>
<legend class="layui-bg-cyan">平台短信配置</legend>
<label class="layui-form-item margin-top-20 block relative">
<span class="color-green margin-right-10">未订单的支付等待时长(小时)</span><span class="nowrap color-desc">OrderWaitTime</span>
<input onblur="this.value=Math.abs(parseFloat(this.value)||0.00).toFixed(2)" name="store_order_wait_time" required placeholder="请输入订单支付等待时长" value="{:sysconf('store_order_wait_time')}" class="layui-input">
<p class="help-block">订单支付等待时长,新下订单未在此时间内容完成支付将会被自动取消</p>
</label>
{if empty($query.code)}
<div class="layui-code border-0">{$query.msg|default=''}</div>
{elseif $query.code eq 1}
<div class="layui-code border-0">平台剩余 {$query.num|default=0} 条可用短信,{$query.msg|default=''}</div>
{/if}
<label class="layui-form-item margin-top-20 block relative">
<span class="color-green margin-right-10">已取消的订单清理时长(小时)</span><span class="nowrap color-desc">OrderClearTime</span>
<input onblur="this.value=Math.abs(parseFloat(this.value)||0.00).toFixed(2)" name="store_order_clear_time" required placeholder="请输入已取消订单清理时长" value="{:sysconf('store_order_clear_time')}" class="layui-input">
<p class="help-block">已取消订单清理时长,已取消未支付订单将在此时间点将被自动清理掉</p>
</label>
<div class="layui-form-item">
<label>
<span class="color-green margin-right-10 font-s14">短信平台账号</span><span class="nowrap color-desc">Username</span>
<span class="block relative">
<input name="sms_zt_username" required placeholder="请输入助通短信平台账号" value="{:sysconf('sms_zt_username')}" class="layui-input">
</span>
</label>
<p class="help-block">助通短信平台账号,可以联系客服获取账号与密码。</p>
<label class="layui-form-item margin-top-20 block relative">
<span class="color-green margin-right-10">已发货订单自动确认收货时长(小时)</span><span class="nowrap color-desc">OrderConfirmTime</span>
<input onblur="this.value=Math.abs(parseFloat(this.value)||0.00).toFixed(2)" name="store_order_confirm_time" required placeholder="请输入已发货订单自动确认收货时长" value="{:sysconf('store_order_confirm_time')}" class="layui-input">
<p class="help-block">已取消订单清理时长,已取消未支付订单将在此时间点将被自动清理掉</p>
</label>
<div class="layui-form-item text-center margin-top-20 padding-bottom-20">
<button class="layui-btn" type="submit">保存配置</button>
</div>
<div class="layui-form-item">
<label>
<span class="color-green margin-right-10 font-s14">短信平台密码</span><span class="nowrap color-desc">Password</span>
<span class="block relative">
<input name="sms_zt_password" required placeholder="请输入助通短信平台密码" value="{:sysconf('sms_zt_password')}" class="layui-input">
</span>
</label>
<p class="help-block">助通短信平台账号,可以联系客服获取账号与密码。</p>
</div>
<div class="layui-form-item">
<label>
<span class="color-green margin-right-10 font-s14">短信发送安全码</span><span class="nowrap color-desc">Secure</span>
<span class="block relative">
<input name="sms_secure" required placeholder="请输入短信发送安全码" value="{:sysconf('sms_secure')}" class="layui-input">
</span>
</label>
<p class="help-block">短信发送安全码,调用接口发短信时需要传入此参数。</p>
</div>
<div class="layui-form-item">
<label>
<span class="color-green margin-right-10 font-s14">注册短信模板</span><span class="nowrap color-desc">Template</span>
<span class="block relative">
<textarea class="layui-textarea" required name="sms_reg_template" placeholder="请输入助通短信平台密码">{:sysconf('sms_reg_template')}</textarea>
</span>
</label>
<p class="help-block">会员注册短信模板,验证码变量使用 {code} 代替。</p>
</div>
<div class="layui-form-item text-center margin-top-20">
<div class="layui-row">
<div class="layui-col-sm8 layui-col-md6">
<button class="layui-btn" type="submit">保存配置</button>
</div>
</div>
</div>
</fieldset>
</div>
</div>
</form>
{/block}
{/block}

View File

@ -4,68 +4,68 @@
{if auth("store/express_company/add")}
<button data-modal='{:url("add")}' data-title="添加快递" class='layui-btn layui-btn-sm layui-btn-primary'>添加快递</button>
{/if}
{if auth("store/express_company/del")}
<button data-action='{:url("del")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除快递</button>
{if auth("store/express_company/remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除快递</button>
{/if}
{/block}
{block name="content"}
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='express_company/index_search'}</caption>
<!--{notempty name='list'}-->
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap'>快递名称</th>
<th class='text-left nowrap'>快递编码</th>
<th class="text-center">记录状态</th>
<th class="text-center">创建时间</th>
<th></th>
</tr>
</thead>
<!--{/notempty}-->
<tbody>
<!--{foreach $list as $key=>$vo}-->
<tr data-dbclick>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'>
</td>
<td class='list-table-sort-td'>
<input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
</td>
<td class='text-left nowrap'>{$vo.express_title|default=''}</td>
<td class='text-left nowrap'>{$vo.express_code|default=''}</td>
<td class='text-center nowrap'>
{eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
</td>
<td class='text-center nowrap'>{$vo.create_at|format_datetime}</td>
<td class='text-left nowrap'>
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='express_company/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap'>快递名称</th>
<th class='text-left nowrap'>快递编码</th>
<th class="text-center">记录状态</th>
<th class="text-center">创建时间</th>
<th></th>
</tr>
</thead>
{/notempty}
<tbody>
{foreach $list as $key=>$vo}
<tr data-dbclick>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'>
</td>
<td class='list-table-sort-td'>
<input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
</td>
<td class='text-left nowrap'>{$vo.express_title|default=''}</td>
<td class='text-left nowrap'>{$vo.express_code|default=''}</td>
<td class='text-center nowrap'>
{eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
</td>
<td class='text-center nowrap'>{$vo.create_at|format_datetime}</td>
<td class='text-left nowrap'>
{if auth("store/express_company/edit")}
<a data-dbclick data-title="编辑快递" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if auth("store/express_company/edit")}
<a data-dbclick data-title="编辑快递" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if $vo.status eq 1 and auth("store/express_company/forbid")}
<a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
{elseif auth("store/express_company/resume")}
<a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
{/if}
{if $vo.status eq 1 and auth("store/express_company/forbid")}
<a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
{elseif auth("store/express_company/resume")}
<a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
{/if}
{if auth("store/express_company/del")}
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('del')}" data-value="id#{$vo.id}">删 除</a>
{/if}
</td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
{if auth("store/express_company/remove")}
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}

View File

@ -6,67 +6,66 @@
<button data-modal='{:url("add")}' data-title="添加省份" class='layui-btn layui-btn-sm layui-btn-primary'>添加省份</button>
<!--{/if}-->
<!--{if auth("store/express_province/del")}-->
<button data-action='{:url("del")}' data-csrf="{:systoken('store/express_province/del')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除省份</button>
<!--{/if}-->
{if auth("store/express_province/remove")}
<button data-action='{:url("remove")}' data-csrf="{:systoken('store/express_province/remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除省份</button>
{/if}
{/block}
{block name="content"}
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='express_province/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th>省份名称</th>
<th>创建时间</th>
<th class="text-center">使用状态</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach $list as $key=>$vo}
<tr data-dbclick>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'>
</td>
<td class='list-table-sort-td padding-left-0 padding-right-0'>
<input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
</td>
<td class="nowrap">{$vo.title|default='--'}</td>
<td class="nowrap">{$vo.create_at|format_datetime}</td>
<td class='text-center nowrap'>
{eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}
</td>
<td class='text-center nowrap notselect'>
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='express_province/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th>省份名称</th>
<th>创建时间</th>
<th class="text-center">使用状态</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach $list as $key=>$vo}
<tr data-dbclick>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'>
</td>
<td class='list-table-sort-td padding-left-0 padding-right-0'>
<input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
</td>
<td class="nowrap">{$vo.title|default='--'}</td>
<td class="nowrap">{$vo.create_at|format_datetime}</td>
<td class='text-center nowrap'>
{eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}
</td>
<td class='text-center nowrap notselect'>
{if auth("store/express_province/edit")}
<a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑区域" data-modal='{:url("store/express_province/edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if auth("store/express_province/edit")}
<a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑区域" data-modal='{:url("store/express_province/edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if $vo.status eq 1 and auth("store/express_province/forbid")}
<a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('store/express_province/forbid')}">禁 用</a>
{elseif auth("store/express_province/resume")}
<a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('store/express_province/resume')}">启 用</a>
{/if}
{if auth("store/express_province/del")}
<a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除数据吗?" data-action="{:url('del')}" data-value="id#{$vo.id}" data-csrf="{:systoken('store/express_province/del')}">删 除</a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
{/notempty}
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
{if $vo.status eq 1 and auth("store/express_province/forbid")}
<a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('store/express_province/forbid')}">禁 用</a>
{elseif auth("store/express_province/resume")}
<a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('store/express_province/resume')}">启 用</a>
{/if}
{if auth("store/express_province/remove")}
<a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('store/express_province/remove')}">删 除</a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
{/notempty}
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}

View File

@ -1,9 +1,9 @@
{extend name="admin@main"}
{block name="content"}
<form onsubmit="return false;" data-auto="true" action="{:request()->url()}" method="post" class='layui-form layui-card' autocomplete="off">
<form onsubmit="return false;" data-auto="true" action="{:request()->url()}" method="post" class='layui-form layui-card' style="max-width:1000px" autocomplete="off">
<div class="layui-card-body" style="padding-left:40px">
<div class="layui-card-body think-box-shadow padding-bottom-20" style="padding-left:40px">
<div data-item-container>
{foreach $list as $index=>$item}

View File

@ -1,35 +1,40 @@
{extend name='admin@main'}
{block name="content"}
{include file='store@goods/form_style'}
<form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body padding-left-40">
<div class="layui-card-body think-box-shadow padding-left-40">
<div class="layui-form-item block relative">
<h3 class="color-green"><sup class='color-red font-s14 absolute' style="margin-left:-10px">*</sup>商品分类</h3>
<select class="layui-select" name="cate_id" lay-search>
{foreach $cates as $cate}
{if isset($vo.cate_id) and $vo.cate_id eq $cate.id}
<option selected value="{$cate.id}">{$cate.title|default=''}</option>
{else}
<option value="{$cate.id}">{$cate.title|default=''}</option>
{/if}
{/foreach}
</select>
<div class="layui-form-item layui-row layui-col-space15">
<label class="layui-col-xs3 relative">
<span class="color-green">商品分类</span>
<select class="layui-select" required name="cate_id" lay-search>
{foreach $cates as $cate}
{if isset($vo.cate_id) and $vo.cate_id eq $cate.id}
<option selected value="{$cate.id}">{$cate.id} - {$cate.title|default=''}</option>
{else}
<option value="{$cate.id}">{$cate.id} - {$cate.title|default=''}</option>
{/if}
{/foreach}
</select>
</label>
<label class="layui-col-xs9 relative">
<span class="color-green">商品名称</span>
<input name="title" required class="layui-input" placeholder="请输入商品名称" value="{$vo.title|default=''}">
</label>
</div>
<div class="layui-form-item block relative">
<h3 class="color-green"><sup class='color-red font-s14 absolute' style="margin-left:-10px">*</sup>商品名称</h3>
<input name="title" required class="layui-input" placeholder="请输入商品名称" value="{$vo.title|default=''}">
</div>
<div class="layui-form-item">
<h3 class="color-green"><sup class='color-red font-s14 absolute' style="margin-left:-10px">*</sup>商品图片</h3>
<span class="color-green label-required-prev">商品LOGO及轮播展示图片</span>
<table class="layui-table">
<thead>
<tr>
<th class="text-center">LOGO</th>
<th class="text-left">商品图片</th>
<th class="text-left">展示图片</th>
</tr>
<tr>
<td width="90px" class="text-center"><input name="logo" type="hidden" value="{$vo.logo|default=''}"></td>
@ -40,42 +45,25 @@
<script>$('[name="logo"]').uploadOneImage(), $('[name="image"]').uploadMultipleImage()</script>
</div>
<fieldset class="margin-bottom-15">
<legend>快递运费及分成比例</legend>
<div>
<div class="layui-form-item block relative">
<div class="inline-block">
<div class="layui-unselect layui-form-radio">
<label>快递运费 <input onblur="this.value=(parseFloat(this.value)||0).toFixed(2)" name="price_express" value="{$vo.price_express|default='0.00'}" class="inline-block text-center font-s12 inner-input"> 元,</label>
<label>分成比例 <input onblur="this.value=(parseFloat(this.value)||0).toFixed(4)" name="price_rate" value="{$vo.price_rate|default='0.00'}" class="inline-block text-center font-s12 inner-input"> %</label>
</div>
</div>
</div>
</div>
</fieldset>
<div class="layui-form-item">
<h3 class="color-green">
<sup class='color-red font-s14 absolute' style="margin-left:-10px">*</sup>
商品规格<span class="color-desc font-s10">最多支持3个规格分组每个分组最多支持5个规格属性仅添加商品时可编辑内容</span>
</h3>
<span class="color-green label-required-prev">商品规格及商品SKU绑定<span class="color-red font-s12">(规格填写后不允许再次修改)</span></span>
<div ng-repeat="x in specs track by $index" style="display:none" class="margin-bottom-10" ng-class="{true:'layui-show'}[isAddMode&&specs.length>0]">
<div class="goods-spec-box padding-10 margin-0 relative" style="background:#ddd">
<span class="text-center goods-spec-title">名称</span>
<input ng-model="x.name" required placeholder="请输入分组">
<div class="fa-pull-right">
<span class="text-center goods-spec-title">分组</span>
<label class="label-required-null inline-block"><input ng-blur="x.name=trimSpace(x.name)" ng-model="x.name" required placeholder="请输入分组名称"></label>
<div class="pull-right">
<a class="layui-btn layui-btn-sm layui-btn-primary goods-spec-btn" ng-click="addSpecVal(x.list)">增加</a>
<a class="layui-btn layui-btn-sm layui-btn-primary goods-spec-btn" ng-class="{false:'layui-bg-gray'}[$index>0]" ng-click="upSpecRow(specs,$index)">上移</a>
<a class="layui-btn layui-btn-sm layui-btn-primary goods-spec-btn" ng-class="{false:'layui-bg-gray'}[$index<specs.length-1]" ng-click="dnSpecRow(specs,$index)">下移</a>
<a ng-if="specs.length>1" class="layui-btn layui-btn-sm layui-btn-primary goods-spec-btn" ng-click="delSpecRow(specs,$index)">删除</a>
<a class="layui-btn layui-btn-sm layui-btn-primary goods-spec-btn" ng-click="delSpecRow(specs,$index)" ng-if="specs.length>1">删除</a>
</div>
</div>
<div class="block padding-10 layui-bg-gray" ng-if="x.list && x.list.length > 0">
<label class="goods-spec-box inline-block nowrap margin-bottom-0" ng-repeat="xx in x.list">
<div class="goods-spec-box padding-10 margin-0 layui-bg-gray block relative" ng-if="x.list && x.list.length > 0">
<label class="label-required-null inline-block margin-right-10 margin-bottom-5 relative nowrap" ng-repeat="xx in x.list">
<input type="checkbox" lay-ignore ng-model="xx.check" ng-click="xx.check=checkListChecked(x.list,$event.target.checked)">
<input type="text" ng-model="xx.name" ng-keyup="xx.name=$event.target.value" required placeholder="请输入规格">
<input type="text" ng-blur="xx.name=trimSpace(xx.name)" ng-model="xx.name" ng-keyup="xx.name=$event.target.value" required placeholder="请输入规格">
<a ng-if="x.list.length>1" ng-click="x.list=delSpecVal(x.list,$index)" class="layui-icon layui-icon-close font-s12 goods-spec-close"></a>
</label>
<a class="layui-btn layui-btn-sm layui-btn-primary goods-spec-btn" ng-if="x.list.length<5" ng-click="addSpecVal(x.list)">增加</a>
</div>
</div>
<a ng-if="isAddMode&&specs.length<3" class="layui-btn layui-btn-sm layui-btn-primary" ng-click="addSpecRow(specs)">增加分组</a>
@ -83,10 +71,11 @@
<thead>
<tr>
<th ng-repeat="x in specsTreeNava track by $index" class="nowrap" ng-bind="x"></th>
<th width="10%" class="text-center nowrap">快递数量 <a ng-click="batchSet('express',0)" data-tips-text="批量设置" class="layui-icon">&#xe63c;</a></th>
<th width="10%" class="text-center nowrap">虚拟销量 <a ng-click="batchSet('virtual',0)" data-tips-text="批量设置" class="layui-icon">&#xe63c;</a></th>
<th width="10%" class="text-center nowrap">商品SKU <a ng-click="batchSet('sku',0)" data-tips-text="批量设置" class="layui-icon">&#xe63c;</a></th>
<th width="10%" class="text-center nowrap">市场价格 <a ng-click="batchSet('market',2)" data-tips-text="批量设置" class="layui-icon">&#xe63c;</a></th>
<th width="10%" class="text-center nowrap">销售价格 <a ng-click="batchSet('selling',2)" data-tips-text="批量设置" class="layui-icon">&#xe63c;</a></th>
<th width="10%" class="text-center nowrap">虚拟销量 <a ng-click="batchSet('virtual',0)" data-tips-text="批量设置" class="layui-icon">&#xe63c;</a></th>
<th width="10%" class="text-center nowrap">快递计件 <a ng-click="batchSet('express',0)" data-tips-text="批量设置" class="layui-icon">&#xe63c;</a></th>
<th width="10%" class="text-center nowrap">销售状态</th>
</tr>
</thead>
@ -95,12 +84,7 @@
<td class="layui-bg-gray" ng-if="td.show" rowspan="{{td.span}}" ng-repeat="td in rows" ng-bind="td.name"></td>
<td class="padding-0">
<label class="padding-0 margin-0">
<input ng-blur="rows[0].express=setValue(rows[0].key,'express',$event.target.value,'(parseFloat(_)||0).toFixed(0)')" class="layui-input border-0 padding-left-0 text-center" ng-model="rows[0].express">
</label>
</td>
<td class="padding-0">
<label class="padding-0 margin-0">
<input ng-blur="rows[0].virtual=setValue(rows[0].key,'virtual',$event.target.value,'(parseInt(_)||0)')" class="layui-input border-0 padding-left-0 text-center" ng-model="rows[0].virtual">
<input ng-blur="rows[0].sku=setValue(rows[0].key,'sku',$event.target.value,'(parseFloat(_)||0).toFixed(0)')" class="layui-input border-0 padding-left-0 text-center" ng-model="rows[0].sku">
</label>
</td>
<td class="padding-0">
@ -113,18 +97,29 @@
<input ng-blur="rows[0].selling=setValue(rows[0].key,'selling',$event.target.value,'(parseFloat(_)||0).toFixed(2)')" class="layui-input border-0 padding-left-0 text-center" ng-model="rows[0].selling">
</label>
</td>
<td class="padding-0">
<label class="padding-0 margin-0">
<input ng-blur="rows[0].virtual=setValue(rows[0].key,'virtual',$event.target.value,'(parseInt(_)||0)')" class="layui-input border-0 padding-left-0 text-center" ng-model="rows[0].virtual">
</label>
</td>
<td class="padding-0">
<label class="padding-0 margin-0">
<input ng-blur="rows[0].express=setValue(rows[0].key,'express',$event.target.value,'(parseInt(_)||0)')" class="layui-input border-0 padding-left-0 text-center" ng-model="rows[0].express">
</label>
</td>
<td class="text-center layui-bg-gray">
<label class="think-checkbox margin-0 full-width full-height block"><input lay-ignore type="checkbox" ng-model="rows[0].status"></label>
</td>
</tr>
</tbody>
</table>
<p class="color-desc">请从仓储平台获取商品SKU与商品条码请注意尽量不要重复也不能产生订单后再修改</p>
<textarea class="layui-textarea layui-hide" name="specs">{{specs}}</textarea>
<textarea class="layui-textarea layui-hide" name="lists">{{specsTreeData}}</textarea>
</div>
<div class="layui-form-item block">
<h3 class="color-green"><sup class='color-red font-s14 absolute' style="margin-left:-10px">*</sup>商品内容</h3>
<span class="label-required-prev color-green">商品详细内容</span>
<textarea name="content">{$vo.content|default=''|raw}</textarea>
</div>
@ -136,110 +131,22 @@
</div>
</form>
<style>
.inner-input {
width: 80px;
height: 14px;
padding: 1px 5px;
line-height: 12px;
}
.goods-spec-box {
position: relative;
margin: 0 10px 10px 0;
vertical-align: middle;
}
.goods-spec-title {
z-index: 2;
width: 40px;
color: #fff;
height: 28px;
position: absolute;
background: #999;
line-height: 28px;
}
.goods-spec-close {
right: 8px;
z-index: 2;
line-height: 28px;
position: absolute;
display: inline-block
}
.goods-spec-btn {
height: 28px;
margin-left: 5px !important;
line-height: 26px !important;
}
.goods-spec-box input {
z-index: 1;
width: 120px;
position: relative;
border: 1px solid #999;
padding: 5px 0 5px 45px;
display: inline-block !important;
}
.goods-spec-box input[type=checkbox] {
z-index: 2;
width: 40px;
height: 28px;
border: none;
cursor: pointer;
appearance: none;
position: absolute;
-webkit-appearance: none;
}
.goods-spec-box input[type=checkbox]:before {
top: 1px;
left: 1px;
width: 40px;
height: 26px;
content: ' ';
position: absolute;
background: #c9c9c9;
}
.goods-spec-box input[type=checkbox]:after {
top: 1px;
left: 1px;
color: #999;
width: 40px;
height: 26px;
content: '\e63f';
font-size: 16px;
line-height: 26px;
position: absolute;
text-align: center;
font-family: 'layui-icon';
}
.goods-spec-box input[type=checkbox]:checked:after {
color: #333;
content: '\e605';
}
</style>
{/block}
{block name='script'}
<textarea class="layui-hide" id="goods-specs">{$vo.specs|raw|default=''}</textarea>
<textarea class="layui-hide" id="goods-value">{$defaultValues|raw|default=''}</textarea>
<script>
window.form.render();
require(['ckeditor', 'angular'], function () {
window.createEditor('[name="content"]', {height: 500});
let app = angular.module("GoodsForm", []).run(callback);
var app = angular.module("GoodsForm", []).run(callback);
angular.bootstrap(document.getElementById(app.name), [app.name]);
function callback($rootScope) {
$rootScope.isAddMode = parseInt('{$isAddMode|default=0}');
let defaultValues = angular.fromJson('{$defaultValues|raw|default=0}') || {};
$rootScope.specs = angular.fromJson('{$vo.specs|raw|default=0}') || [{name: '默认分组', list: [{name: '默认规格', check: true}]}];
$rootScope.maps = JSON.parse(angular.element('#goods-value').val() || '[]') || {};
$rootScope.specs = JSON.parse(angular.element('#goods-specs').val() || '[{"name":"默认分组","list":[{"name":"默认规格","check":true}]}]');
// 批量设置数值
$rootScope.batchSet = function (type, fixed) {
layer.prompt({title: '请输入数值', formType: 0}, function (value, index) {
@ -260,72 +167,74 @@
};
// 设置默认值
$rootScope.setValue = function (key, type, value, call) {
defaultValues[key] || (defaultValues[key] = {});
return defaultValues[key][type] = eval(call.replace('_', "'" + value + "'"));
$rootScope.maps[key] || ($rootScope.maps[key] = {});
return $rootScope.maps[key][type] = eval(call.replace('_', "'" + value + "'"));
};
// 读取默认值
let getValue = function (key, callback) {
if (typeof callback === 'function') return callback(defaultValues[key] || {});
$rootScope.getValue = function (key, callback) {
if (typeof callback === 'function') {
return callback($rootScope.maps[key] || {});
}
return {};
};
// 去除空白字符
$rootScope.trimSpace = function (value) {
return (value + '').replace(/\s*/ig, '');
};
// 生成交叉表格数据
$rootScope.specsTreeData = [];
$rootScope.specsTreeNava = [];
// 当前商品规格发生变化时重新计算规格列表
$rootScope.$watch('specs', function () {
let list = [], nava = [], table = [[]];
let data = angular.fromJson(angular.toJson($rootScope.specs));
var data = $rootScope.specs, list = [], navs = [], table = [[]];
// 过滤无效记录
for (let o of data) {
let tmp = [];
for (let x of o.list) (x.check && typeof x.name === 'string' && x.name.length > 0) && tmp.push(x);
if (tmp.length > 0) for (let x of tmp) x.group = o.name, x.span = 1, x.show = true;
if (tmp.length > 0) list.push(tmp), nava.push(o.name);
$rootScope.specsTreeNava = nava;
for (var i in data) {
var tmp = [];
for (var j in data[i].list) if (data[i].list[j].check && data[i].list[j].name.length > 0) {
data[i].list[j].span = 1, data[i].list[j].show = true, data[i].list[j].group = data[i].name;
tmp.push(data[i].list[j]);
}
list.push(tmp), navs.push(data[i].name);
}
$rootScope.specsTreeNava = navs;
// 表格交叉
for (let i in list) {
let temp = [];
for (let j in table) for (let k in list[i]) temp.push(table[j].concat(list[i][k]));
table = temp;
for (var i in list) {
var tmp = [];
for (var j in table) for (var k in list[i]) tmp.push(table[j].concat(list[i][k]));
table = tmp;
}
// 表格合并
list = angular.fromJson(angular.toJson(table));
for (let row in list) {
let key = [], _key = '';
for (let td in list[row]) key.push(list[row][td].group + '::' + list[row][td].name);
for (let td in list[row]) {
if (_key.length === 0) {
list[row][0].key = _key = key.join(';;');
list[row][0].express = getValue(_key, function (data) {
return data.express || '1';
});
list[row][0].virtual = getValue(_key, function (data) {
return data.virtual || '0';
});
list[row][0].market = getValue(_key, function (data) {
return data.market || '0.00';
});
list[row][0].selling = getValue(_key, function (data) {
return data.selling || '0.00';
});
list[row][0].status = getValue(_key, function (data) {
return !!(typeof data.status !== 'undefined' ? data.status : true);
});
}
// 表格TD处理
for (let dow = 1 + parseInt(row); dow < list.length; dow++)
if (list[row][td].name === list[dow][td].name) {
list[row][td].span++;
list[dow][td].show = false;
} else break;
for (var i in list) {
var key = [], _key = '';
for (var td in list[i]) key.push(list[i][td].group + '::' + list[i][td].name);
for (var td in list[i]) if (_key.length === 0) {
list[i][0].key = _key = key.join(';;');
list[i][0].sku = $rootScope.getValue(_key, function (data) {
return data.sku || '0';
});
list[i][0].virtual = $rootScope.getValue(_key, function (data) {
return data.virtual || '0';
});
list[i][0].express = $rootScope.getValue(_key, function (data) {
return data.express || '1';
});
list[i][0].market = $rootScope.getValue(_key, function (data) {
return data.market || '0.00';
});
list[i][0].selling = $rootScope.getValue(_key, function (data) {
return data.selling || '0.00';
});
list[i][0].status = $rootScope.getValue(_key, function (data) {
return !!(typeof data.status !== 'undefined' ? data.status : true);
});
}
}
$rootScope.specsTreeData = list;
}, true);
// 判断规则是否能取消选择
$rootScope.checkListChecked = function (list, check) {
for (let o of list) if (o.check) return check;
for (var i in list) if (list[i].check) return check;
return true;
};
// 增加整行规格分组
@ -334,9 +243,9 @@
};
// 下移整行规格分组
$rootScope.dnSpecRow = function (data, $index) {
let tmp = [], cur = data[$index];
var tmp = [], cur = data[$index];
if ($index > data.length - 2) return false;
for (let i in data) {
for (var i in data) {
(parseInt(i) !== parseInt($index)) && tmp.push(data[i]);
(parseInt(i) === parseInt($index) + 1) && tmp.push(cur);
}
@ -344,9 +253,9 @@
};
// 上移整行规格分组
$rootScope.upSpecRow = function (data, $index) {
let tmp = [], cur = data[$index];
var tmp = [], cur = data[$index];
if ($index < 1) return false;
for (let i in data) {
for (var i in data) {
(parseInt(i) === parseInt($index) - 1) && tmp.push(cur);
(parseInt(i) !== parseInt($index)) && tmp.push(data[i]);
}
@ -354,8 +263,8 @@
};
// 移除整行规格分组
$rootScope.delSpecRow = function (data, $index) {
let tmp = [];
for (let i in data) if (parseInt(i) !== parseInt($index)) tmp.push(data[i]);
var tmp = [];
for (var i in data) if (parseInt(i) !== parseInt($index)) tmp.push(data[i]);
return $rootScope.specs = tmp;
};
// 增加分组的属性
@ -364,8 +273,8 @@
};
// 移除分组的属性
$rootScope.delSpecVal = function (data, $index) {
let temp = [];
for (let i in data) if (parseInt(i) !== parseInt($index)) temp.push(data[i]);
var temp = [];
for (var i in data) if (parseInt(i) !== parseInt($index)) temp.push(data[i]);
return temp;
};
}

View File

@ -4,119 +4,115 @@
<!--{if auth("store/goods/add")}-->
<button data-open='{:url("add")}' data-title="添加商品" class='layui-btn layui-btn-sm layui-btn-primary'>添加商品</button>
<!--{/if}-->
<!--{if auth("store/goods/del")}-->
<button data-action='{:url("del")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除商品</button>
<!--{if auth("store/goods/remove")}-->
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除商品</button>
<!--{/if}-->
{/block}
{block name="content"}
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='goods/index_search'}</caption>
<!--{notempty name='list'}-->
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap' width="10%">商品信息</th>
<th class='text-left nowrap' width="10%">商品状态</th>
<th class='text-left nowrap padding-0 relative' style="min-width:400px">
<div class="layui-row" style="line-height:28px">
<div class="layui-col-xs6 text-center layui-elip">商品规格</div>
<div class="layui-col-xs3 text-center layui-elip">市价 / 售价</div>
<div class="layui-col-xs3 text-center layui-elip">库存 / 销量</div>
</div>
</th>
<th></th>
</tr>
</thead>
<!--{/notempty}-->
<tbody>
<!--{foreach $list as $key=>$vo}-->
<tr data-dbclick>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
<td class='text-left nowrap'>
{notempty name='vo.logo'}
<img data-tips-image style="width:60px;height:60px" src="{$vo.logo|default=''}" class="margin-right-5 text-top">
{/notempty}
<div class="inline-block">
商品编号:{$vo.id|default='--'}<br>
所属分类:{$vo.cate.title|default='--'}<br>
商品名称:{$vo.title|default='--'}<br>
</div>
</td>
<td class='text-left nowrap'>
快递费用:{$vo.price_express|default='0.00'} 元<br>
分成比例:{$vo.price_rate+0} %<br>
销售状态:{eq name='vo.status' value='0'}<span class="layui-badge">已下架</span>{else}<span class="layui-badge layui-bg-green">销售中</span>{/eq}<br>
</td>
<td class='text-left nowrap padding-0 relative'>
<div style="overflow:auto;max-height:68px;padding:5px 0">
{foreach $vo.list as $goods}
<div class="layui-row" style="line-height:23px">
<div class="layui-col-xs6 text-center layui-elip font-s10">{:str_replace(['::',';;'],[':',';'],$goods.goods_spec)}</div>
<div class="layui-col-xs3 text-center layui-elip color-blue font-s10">{$goods.price_market+0} / {$goods.price_selling+0}</div>
<div class="layui-col-xs3 text-center layui-elip color-blue font-s10">{$goods.number_stock+0} / {$goods.number_sales+0}</div>
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='goods/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap' width="10%">商品信息</th>
<th class='text-left nowrap' width="10%">商品状态</th>
<th class='text-left nowrap padding-0 relative' style="min-width:400px">
<div class="layui-row" style="line-height:28px">
<div class="layui-col-xs6 text-center layui-elip">商品规格</div>
<div class="layui-col-xs3 text-center layui-elip">市价 / 售价</div>
<div class="layui-col-xs3 text-center layui-elip">库存 / 销量</div>
</div>
{/foreach}
</div>
</td>
<td class='text-left nowrap'>
</th>
<th></th>
</tr>
</thead>
{/notempty}
<tbody>
{foreach $list as $key=>$vo}
<tr data-dbclick>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
<td class='text-left nowrap'>
{notempty name='vo.logo'}
<img data-tips-image style="width:60px;height:60px" src="{$vo.logo|default=''}" class="margin-right-5 text-top">
{/notempty}
<div class="inline-block">
商品编号:{$vo.id|default='--'}<br>
所属分类:{$vo.cate.title|default='--'}<br>
商品名称:{$vo.title|default='--'}<br>
</div>
</td>
<td class='text-left nowrap'>
快递费用:{$vo.price_express|default='0.00'} 元<br>
分成比例:{$vo.price_rate+0} %<br>
销售状态:{eq name='vo.status' value='0'}<span class="layui-badge">已下架</span>{else}<span class="layui-badge layui-bg-green">销售中</span>{/eq}<br>
</td>
<td class='text-left nowrap padding-0 relative'>
<div style="overflow:auto;max-height:68px;padding:5px 0">
{foreach $vo.list as $goods}
<div class="layui-row" style="line-height:23px">
<div class="layui-col-xs6 text-center layui-elip font-s10">{:str_replace(['::',';;'],[':',';'],$goods.goods_spec)}</div>
<div class="layui-col-xs3 text-center layui-elip color-blue font-s10">{$goods.price_market+0} / {$goods.price_selling+0}</div>
<div class="layui-col-xs3 text-center layui-elip color-blue font-s10">{$goods.number_stock+0} / {$goods.number_sales+0}</div>
</div>
{/foreach}
</div>
</td>
<td class='text-left nowrap'>
<div class="nowrap margin-bottom-5">
{if auth("store/goods/edit")}
<a data-dbclick class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
{else}
<a data-tips-text="您没有编辑商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">编 辑</a>
{/if}
<div class="nowrap margin-bottom-5">
{if auth("store/goods/edit")}
<a data-dbclick class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
{else}
<a data-tips-text="您没有编辑商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">编 辑</a>
{/if}
{if isset($vo.status) and $vo.status eq 1}
<!--{if auth("store/goods/forbid")}-->
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">下 架</a>
<!--{else}-->
<a data-tips-text="您没有下架商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">下 架</a>
<!--{/if}-->
{else}
<!--{if auth("store/goods/resume")}-->
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">上 架</a>
<!--{else}-->
<a data-tips-text="您没有上架商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">上 架</a>
<!--{/if}-->
{/if}
</div>
{if isset($vo.status) and $vo.status eq 1}
<!--{if auth("store/goods/forbid")}-->
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">下 架</a>
<!--{else}-->
<a data-tips-text="您没有下架商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">下 架</a>
<!--{/if}-->
{else}
<!--{if auth("store/goods/resume")}-->
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">上 架</a>
<!--{else}-->
<a data-tips-text="您没有上架商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">上 架</a>
<!--{/if}-->
{/if}
</div>
<div class="nowrap margin-bottom-5">
<div class="nowrap margin-bottom-5">
{if auth("store/goods/stock")}
<a class="layui-btn layui-btn-sm layui-btn-normal" data-title="商品入库" data-modal='{:url("stock")}?id={$vo.id}'>入 库</a>
{else}
<a data-tips-text="您没有商品入库的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">入 库</a>
{/if}
{if auth("store/goods/stock")}
<a class="layui-btn layui-btn-sm layui-btn-normal" data-title="商品入库" data-modal='{:url("stock")}?id={$vo.id}'>入 库</a>
{else}
<a data-tips-text="您没有商品入库的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">入 库</a>
{/if}
{if auth("store/goods/del")}
<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('del')}" data-value="id#{$vo.id}">删 除</a>
{else}
<a data-tips-text="您没有删除商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">删 除</a>
{/if}
{if auth("store/goods/remove")}
<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
{else}
<a data-tips-text="您没有删除商品的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">删 除</a>
{/if}
</div>
</div>
</td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
</td>
</tr>
{/foreach}
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
<style>
table.trim-bottom-border tr:last-child td {
border: none !important;
}
</style>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}

View File

@ -11,7 +11,7 @@
<label class="layui-form-label">商品分类</label>
<div class="layui-input-inline">
<select class="layui-select" name="cate_id" lay-search>
<option value="">-- 所有商品 --</option>
<option value="">-- 全部商品 --</option>
{foreach $clist as $v}
<!--{eq name='Think.get.cate_id' value='$v.id.""'}-->
<option selected value="{$v.id}">{$v.title}</option>
@ -26,7 +26,7 @@
<label class="layui-form-label">销售状态</label>
<div class="layui-input-inline">
<select class="layui-select" name="status">
{foreach [''=>'- 全部商品 -','1'=>'销售中商品','0'=>'已下架商品'] as $k=>$v}
{foreach [''=>'- 全部状态 -','1'=>'销售中商品','0'=>'已下架商品'] as $k=>$v}
<!--{eq name='Think.get.status' value='$k.""'}-->
<option selected value="{$k}">{$v}</option>
<!--{else}-->

View File

@ -2,26 +2,28 @@
<div class="layui-card-body">
<div class="layui-form-item">
<label class="layui-form-label">商品分类图片</label>
<div class="layui-input-block">
<div class="layui-row margin-bottom-15">
<label class="layui-col-xs2 think-form-label">商品分类图片</label>
<label class="layui-col-xs8 think-form-group-left">
<input name="logo" required value='{$vo.logo|default=""}' placeholder="请上传分类图片" class="layui-input">
<button data-file="btn" data-field="logo" data-type="png,jpg,gif" class="layui-btn layui-btn-sm" type="button">上传图片</button>
</div>
</label>
<a class="layui-col-xs2 layui-btn think-form-group-right" data-file="btn" data-field="logo" data-type="png,jpg,gif">
<i class="layui-icon layui-icon-upload"></i> 上传图片
</a>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品分类名称</label>
<div class="layui-input-block">
<div class="layui-row margin-bottom-15">
<label class="layui-col-xs2 think-form-label">商品分类名称</label>
<label class="layui-col-xs10">
<input name="title" required value='{$vo.title|default=""}' placeholder="请输入商品分类名称" class="layui-input">
</div>
</label>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品分类描述</label>
<div class="layui-input-block">
<div class="layui-row margin-bottom-15">
<label class="layui-col-xs2 think-form-label">商品分类描述</label>
<label class="layui-col-xs10">
<textarea class="layui-textarea" name="desc">{$vo.desc|default=''}</textarea>
</div>
</label>
</div>
</div>

View File

@ -1,72 +1,72 @@
{extend name='admin@main'}
{block name="button"}
<!--{if auth("store/goods_cate/add")}-->
{if auth("store/goods_cate/add")}
<button data-modal='{:url("add")}' data-title="添加商品分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加商品分类</button>
<!--{/if}-->
<!--{if auth("store/goods_cate/del")}-->
<button data-action='{:url("del")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除商品分类</button>
<!--{/if}-->
{/if}
{if auth("store/goods_cate/remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除商品分类</button>
{/if}
{/block}
{block name="content"}
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='goods_cate/index_search'}</caption>
<!--{notempty name='list'}-->
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap'>分类名称</th>
<th class="text-center">状态</th>
<th class="text-center"></th>
<th></th>
</tr>
</thead>
<!--{/notempty}-->
<tbody>
<!--{foreach $list as $key=>$vo}-->
<tr>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'>
</td>
<td class='list-table-sort-td'>
<input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
</td>
<td class='text-left nowrap'>
<a data-tips-image="{$vo.logo|default=''}" class="fa fa-image font-s14 margin-right-5"></a>
{$vo.title|default=''}
</td>
<td class='text-center nowrap'>
{eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
</td>
<td class='text-center nowrap'>{$vo.create_at|format_datetime}</td>
<td class='text-left nowrap'>
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='goods_cate/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap'>分类名称</th>
<th class="text-center">状态</th>
<th class="text-center"></th>
<th></th>
</tr>
</thead>
{/notempty}
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'>
</td>
<td class='list-table-sort-td'>
<input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
</td>
<td class='text-left nowrap'>
<a data-tips-image="{$vo.logo|default=''}" class="fa fa-image font-s14 margin-right-5"></a>
{$vo.title|default=''}
</td>
<td class='text-center nowrap'>
{eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
</td>
<td class='text-center nowrap'>{$vo.create_at|format_datetime}</td>
<td class='text-left nowrap'>
{if auth("store/goods_cate/edit")}
<a data-title="编辑商品分类" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if auth("store/goods_cate/edit")}
<a data-title="编辑商品分类" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if $vo.status eq 1 and auth("store/goods_cate/forbid")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
{elseif auth("store/goods_cate/resume")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
{/if}
{if $vo.status eq 1 and auth("store/goods_cate/forbid")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
{elseif auth("store/goods_cate/resume")}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
{/if}
{if auth("store/goods_cate/del")}
<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('del')}" data-value="id#{$vo.id}">删 除</a>
{/if}
</td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
{if auth("store/goods_cate/remove")}
<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}

View File

@ -11,7 +11,7 @@
<label class="layui-form-label">使用状态</label>
<div class="layui-input-inline">
<select class="layui-select" name="status">
{foreach [''=>'- 全部商品分类 -','1'=>'使用中的商品分类','0'=>'已禁用的商品分类'] as $k=>$v}
{foreach [''=>'- 全部状态 -','1'=>'使用中的商品分类','0'=>'已禁用的商品分类'] as $k=>$v}
<!--{eq name='Think.get.status' value='$k.""'}-->
<option selected value="{$k}">{$v}</option>
<!--{else}-->

View File

@ -1,45 +1,45 @@
{extend name='admin@main'}
{block name="content"}
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='member/index_search'}</caption>
<!--{notempty name='list'}-->
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='text-left nowrap'>会员昵称</th>
<th class='text-left nowrap'>会员手机</th>
<th class='text-left nowrap'>会员级别</th>
<th class='text-left nowrap'>注册时间</th>
</tr>
</thead>
<!--{/notempty}-->
<tbody>
<!--{foreach $list as $key=>$vo}-->
<tr>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td class='text-left nowrap'>
{notempty name='vo.headimg'}
<img data-tips-image style="width:20px;height:20px;vertical-align:top" src="{$vo.headimg|default=''}" class="margin-right-5">
{/notempty}
<div class="inline-block">{$vo.nickname|default='--'}</div>
</td>
<td class='text-left'>{$vo.phone|default='--'}</td>
<td class='text-left'>
{if $vo.vip_level eq 0} 游客会员
{elseif $vo.vip_level eq 1} 临时会员({$vo.vip_date|default=''}
{elseif $vo.vip_level eq 2} VIP1会员({$vo.vip_date|default=''}
{elseif $vo.vip_level eq 3} VIP2会员({$vo.vip_date|default=''}
{/if}
</td>
<td class='text-left'>{$vo.create_at|format_datetime}</td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='member/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='text-left nowrap'>会员昵称</th>
<th class='text-left nowrap'>会员手机</th>
<th class='text-left nowrap'>会员级别</th>
<th class='text-left nowrap'>注册时间</th>
</tr>
</thead>
{/notempty}
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td class='text-left nowrap'>
{notempty name='vo.headimg'}
<img data-tips-image style="width:20px;height:20px;vertical-align:top" src="{$vo.headimg|default=''}" class="margin-right-5">
{/notempty}
<div class="inline-block">{$vo.nickname|default='--'}</div>
</td>
<td class='text-left'>{$vo.phone|default='--'}</td>
<td class='text-left'>
{if $vo.vip_level eq 0} 游客会员
{elseif $vo.vip_level eq 1} 临时会员({$vo.vip_date|default=''}
{elseif $vo.vip_level eq 2} VIP1会员({$vo.vip_date|default=''}
{elseif $vo.vip_level eq 3} VIP2会员{$vo.vip_date|default=''}
{/if}
</td>
<td class='text-left'>{$vo.create_at|format_datetime}</td>
</tr>
{/foreach}
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}

View File

@ -1,34 +1,40 @@
{extend name='admin@main'}
{block name="content"}
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='message/index_search'}</caption>
<!--{notempty name='list'}-->
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='text-left nowrap'>发送手机</th>
<th class='text-left nowrap'>短信内容</th>
<th class='text-left nowrap'>返回结果</th>
<th class='text-left nowrap'>发送时间</th>
</tr>
</thead>
<!--{/notempty}-->
<tbody>
<!--{foreach $list as $key=>$vo}-->
<tr>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td>{$vo.phone|default=''}</td>
<td>{$vo.content|default=''}</td>
<td>{$vo.result|default=''}</td>
<td>{$vo.create_at|default=''}<br></td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='message/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='text-left nowrap'>发送手机</th>
<th class='text-left nowrap'>短信内容</th>
<th class='text-left nowrap'>返回结果</th>
<th class='text-left nowrap'>发送时间</th>
<th></th>
</tr>
</thead>
{/notempty}
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td>{$vo.phone|default=''}</td>
<td>{$vo.content|default=''}</td>
<td>{$vo.result|default=''}</td>
<td>{$vo.create_at|default=''}<br></td>
<td>
{if auth("store/member/remove")}
<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}

View File

@ -1,89 +1,86 @@
{extend name='admin@main'}
{block name="content"}
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='order/index_search'}</caption>
<!--{notempty name='list'}-->
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class="text-left nowrap">会员信息</th>
<th class='text-left nowrap'>订单信息</th>
<th class='text-left nowrap'>发货信息</th>
<th class='text-right nowrap'>商品信息</th>
</tr>
</thead>
<!--{/notempty}-->
<tbody>
<!--{foreach $list as $key=>$vo}-->
<tr>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td class="text-left nowrap relative">
{notempty name='vo.member.headimg'}
<img data-tips-image style="width:80px;height:80px" src="{$vo.member.headimg|default=''}" class="margin-right-5 text-top">
{/notempty}
<div class="inline-block">
推荐会员:{$vo.from_member.nickname|default='--'}<br>
推荐手机:{$vo.from_member.phone|default='--'}<br>
会员昵称:{$vo.member.nickname|default='--'}<br>
会员手机:{$vo.member.phone|default='--'}<br>
</div>
</td>
<td class='text-left nowrap'>
订单单号:<span class="color-blue">{$vo.order_no|default=''}</span>
{eq name='vo.status' value='1'}<span class="layui-badge layui-bg-red margin-left-5">预订单</span>{/eq}
{eq name='vo.status' value='2'}<span class="layui-badge layui-bg-orange margin-left-5">待付款</span>{/eq}
{eq name='vo.status' value='3'}<span class="layui-badge layui-bg-black margin-left-5">待发货</span>{/eq}
{eq name='vo.status' value='4'}<span class="layui-badge layui-bg-green margin-left-5">已发货</span>{/eq}
{eq name='vo.status' value='5'}<span class="layui-badge layui-bg-blue margin-left-5">已完成</span>{/eq}
<br>
订单金额:<strong class="color-blue">{$vo.price_total+0}</strong>
分成 <strong class="color-blue">{$vo.price_rate_amount+0}</strong>
已支付 <strong class="color-blue">{$vo.pay_price+0}</strong><br>
下单时间:{$vo.create_at|format_datetime}<br>
支付时间:{$vo.pay_at|format_datetime|default='--'}<br>
</td>
<td class="text-left nowrap">
收货信息:{$vo.express_name|default='--'}<span class="margin-left-5 color-blue">{$vo.express_phone}</span><br>
收货地址:{$vo.express_province|default='--'}{$vo.express_city}{$vo.express_area}{$vo.express_address}<br>
发货状态:{eq name='vo.express_state' value='0'}
<span class="layui-badge layui-bg-black">未发货</span>
{else}
<span class="layui-badge layui-bg-blue">{$vo.express_company_title|default='--'}</span>
<a data-title="{$vo.express_company_title}{$vo.express_send_no}" data-tips-text="快递追踪查询"
data-modal="{:url('expressQuery')}?code={$vo.express_company_code}&no={$vo.express_send_no}"
class="layui-badge layui-bg-gray margin-left-5">{$vo.express_send_no|default='--'}</a>
{/eq}
{if $vo.status eq 3}
<a class=" margin-left-5" data-title="填写订单信息" data-modal="{:url('express')}?id={$vo.id}">填写发货信息</a>
{elseif $vo.status eq 4}
<a class=" margin-left-5" data-title="修改发货信息" data-modal="{:url('express')}?id={$vo.id}">修改发货信息</a>
{/if}
<br>
发货时间:{$vo.express_send_at|format_datetime}<br>
</td>
<td class="nowrap">
{foreach $vo.list as $g}
<div class="nowrap">
<p class="text-right">{$g.goods_title|default=''} x{$g.number_goods|default=0}</p>
<p class="text-right color-desc">
售价 {$g.price_real} 元,分成比例 {$g.price_rate+0}%,分成金额 {$g.price_rate_amount+0} 元
</p>
</div>
{/foreach}
</td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
<div class="think-box-shadow">
<table class="layui-table" lay-skin="line">
<caption class="margin-bottom-10 text-left">{include file='order/index_search'}</caption>
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class="text-left nowrap">会员信息</th>
<th class='text-left nowrap'>订单信息</th>
<th class='text-left nowrap'>发货信息</th>
<th class='text-right nowrap'>商品信息</th>
</tr>
</thead>
{/notempty}
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
<td class="text-left nowrap relative">
{notempty name='vo.member.headimg'}
<img data-tips-image style="width:80px;height:80px" src="{$vo.member.headimg|default=''}" class="margin-right-5 text-top">
{/notempty}
<div class="inline-block">
推荐会员:{$vo.from_member.nickname|default='--'}<br>
推荐手机:{$vo.from_member.phone|default='--'}<br>
会员昵称:{$vo.member.nickname|default='--'}<br>
会员手机:{$vo.member.phone|default='--'}<br>
</div>
</td>
<td class='text-left nowrap'>
订单单号:<span class="color-blue">{$vo.order_no|default=''}</span>
{eq name='vo.status' value='1'}<span class="layui-badge layui-bg-red margin-left-5">预订单</span>{/eq}
{eq name='vo.status' value='2'}<span class="layui-badge layui-bg-orange margin-left-5">待付款</span>{/eq}
{eq name='vo.status' value='3'}<span class="layui-badge layui-bg-black margin-left-5">待发货</span>{/eq}
{eq name='vo.status' value='4'}<span class="layui-badge layui-bg-green margin-left-5">已发货</span>{/eq}
{eq name='vo.status' value='5'}<span class="layui-badge layui-bg-blue margin-left-5">已完成</span>{/eq}
<br>
订单金额:<strong class="color-blue">{$vo.price_total+0}</strong>
分成 <strong class="color-blue">{$vo.price_rate_amount+0}</strong>
已支付 <strong class="color-blue">{$vo.pay_price+0}</strong><br>
下单时间:{$vo.create_at|format_datetime}<br>
支付时间:{$vo.pay_at|format_datetime|default='--'}<br>
</td>
<td class="text-left nowrap">
收货信息:{$vo.express_name|default='--'}<span class="margin-left-5 color-blue">{$vo.express_phone}</span><br>
收货地址:{$vo.express_province|default='--'}{$vo.express_city}{$vo.express_area}{$vo.express_address}<br>
发货状态:{eq name='vo.express_state' value='0'}
<span class="layui-badge layui-bg-black">未发货</span>
{else}
<span class="layui-badge layui-bg-blue">{$vo.express_company_title|default='--'}</span>
<a data-title="{$vo.express_company_title}{$vo.express_send_no}" data-tips-text="快递追踪查询"
data-modal="{:url('expressQuery')}?code={$vo.express_company_code}&no={$vo.express_send_no}"
class="layui-badge layui-bg-gray margin-left-5">{$vo.express_send_no|default='--'}</a>
{/eq}
{if $vo.status eq 3}
<a class=" margin-left-5" data-title="填写订单信息" data-modal="{:url('express')}?id={$vo.id}">填写发货信息</a>
{elseif $vo.status eq 4}
<a class=" margin-left-5" data-title="修改发货信息" data-modal="{:url('express')}?id={$vo.id}">修改发货信息</a>
{/if}
<br>
发货时间:{$vo.express_send_at|format_datetime}<br>
</td>
<td class="nowrap">
{foreach $vo.list as $g}
<div class="nowrap">
<p class="text-right">{$g.goods_title|default=''} x{$g.number_goods|default=0}</p>
<p class="text-right color-desc">
售价 {$g.price_real} 元,分成比例 {$g.price_rate+0}%,分成金额 {$g.price_rate_amount+0} 元
</p>
</div>
{/foreach}
</td>
</tr>
{/foreach}
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
<style>
table.trim-bottom-border tr:last-child td {
border: none !important
}
</style>
</div>
{/block}

View File

@ -91,7 +91,6 @@
</div>
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
<button type="button" data-export-list class="layui-btn layui-btn-primary"><i class="layui-icon layui-icon-export"></i> 导 出</button>
</div>
</form>
<script>