From 2aaa456d0ee7569e6ee5df35526ccc42c14d1df6 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 14 Sep 2020 18:39:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data/controller/Config.php | 2 +- app/data/controller/ShopGoods.php | 5 +++-- app/data/view/config/slider.html | 20 +++++++++++++------- app/data/view/news_item/select.html | 2 +- app/data/view/shop_goods/index_search.html | 2 +- app/data/view/shop_goods/select.html | 12 ++++++------ 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/data/controller/Config.php b/app/data/controller/Config.php index cea2c7ee2..55dd02fab 100644 --- a/app/data/controller/Config.php +++ b/app/data/controller/Config.php @@ -21,8 +21,8 @@ class Config extends Controller */ public function slider() { + $this->skey = 'slider'; if ($this->request->isGet()) { - $this->skey = 'slider'; $this->title = '轮播图管理'; $this->data = sysdata($this->skey); $this->fetch(); diff --git a/app/data/controller/ShopGoods.php b/app/data/controller/ShopGoods.php index 21cd3eac6..7b62770df 100644 --- a/app/data/controller/ShopGoods.php +++ b/app/data/controller/ShopGoods.php @@ -50,8 +50,9 @@ class ShopGoods extends Controller */ public function select() { - $query = $this->_query($this->table)->equal('status,cate')->like('name'); - $query->where(['deleted' => '0'])->order('sort desc,id desc')->page(); + $query = $this->_query($this->table); + $query->equal('status,cate')->like('name,mark'); + $query->where(['deleted' => 0])->order('sort desc,id desc')->page(); } /** diff --git a/app/data/view/config/slider.html b/app/data/view/config/slider.html index f94f79426..90b12a1d5 100644 --- a/app/data/view/config/slider.html +++ b/app/data/view/config/slider.html @@ -23,16 +23,17 @@ @@ -61,11 +62,16 @@ setTimeout(initUpload, 100); })(); /*! 轮播选项操作 */ - $('[data-slider-box]').on('click', '[data-item-article]', function ($that) { - $that = $(this), top.setNewsId = function (id) { + $('[data-slider-box]').on('click', '[data-item-news]', function ($that) { + $that = $(this), top.setCheckValue = function (id) { $that.prevAll('input').val('news#{v}'.replace('{v}', id)); }; $.form.iframe('{:url("data/news_item/select")}', '选择文章', ['930px', '600px']); + }).on('click', '[data-item-goods]', function ($that) { + $that = $(this), top.setCheckValue = function (id) { + $that.prevAll('input').val('goods#{v}'.replace('{v}', id)); + }; + $.form.iframe('{:url("data/shop_goods/select")}', '选择商品', ['930px', '600px']); }).on('click', '[data-item-add]', function () { addItem(); }).on('click', '[data-item-rm]', function () { @@ -84,7 +90,7 @@ this.data = []; for (this.index in ret.img) { if (!ret.img[this.index]) return $.msg.tips('请上传展示图片哦!'); - this.data.push({img: ret.img[this.index], url: ret.url[this.index], title: ret.title[this.index]}); + this.data.push({img: ret.img[this.index], rule: ret.rule[this.index], name: ret.name[this.index]}); } $.form.load('{$request->url()}', {data: JSON.stringify(this.data)}, 'post'); }); diff --git a/app/data/view/news_item/select.html b/app/data/view/news_item/select.html index fe89b22f8..45df4394b 100644 --- a/app/data/view/news_item/select.html +++ b/app/data/view/news_item/select.html @@ -34,7 +34,7 @@ $(function () { layui.form.render(); $('[data-news]').on('click', function () { - top.setNewsId(this.getAttribute('data-news') || ''); + top.setCheckValue(this.getAttribute('data-news') || ''); parent.layer.close(parent.layer.getFrameIndex(window.name)); }); $.form.reInit($('[data-select-container]')); diff --git a/app/data/view/shop_goods/index_search.html b/app/data/view/shop_goods/index_search.html index 1020f20e4..f81d9cb99 100644 --- a/app/data/view/shop_goods/index_search.html +++ b/app/data/view/shop_goods/index_search.html @@ -4,7 +4,7 @@
diff --git a/app/data/view/shop_goods/select.html b/app/data/view/shop_goods/select.html index 405519949..f6a12dfad 100644 --- a/app/data/view/shop_goods/select.html +++ b/app/data/view/shop_goods/select.html @@ -22,20 +22,20 @@ img {/notempty}
- 商品编号:{$vo.id|default='--'}
- 商品名称:{$vo.title|default='--'}
+ 商品编号:{$vo.code|default='--'}
+ 商品名称:{$vo.name|default='--'}
- 入会礼包:{$vo.vip_mod?"是":"否"}
- 所属分类:{$vo.cate.title|default='--'}
+ 所属分类:{$vo.cate.name|default=''}
+ {notempty name='vo.mark'}{foreach $vo.mark as $mark}{$mark}{/foreach}{/notempty} 剩余库存:{$vo.number_stock|default='0'} 件
销售状态:{eq name='vo.status' value='0'}已下架{else}销售中{/eq}
- 选择商品 + 选择商品 {/foreach} @@ -51,7 +51,7 @@