diff --git a/app/admin/controller/StoreProduct.php b/app/admin/controller/StoreProduct.php index 4ea5431..a554687 100644 --- a/app/admin/controller/StoreProduct.php +++ b/app/admin/controller/StoreProduct.php @@ -40,6 +40,11 @@ class StoreProduct extends BaseController if (isset($param['keywords']) && !empty($param['keywords'])){ $where[]=['store_name','like','%'.$param['keywords'].'%']; } + + if (isset($param['store_cate']) && !empty($param['store_cate'])){ + $where[]=['cate_id','=',$param['store_cate']]; + } + $list = $this->model->getStoreProductList($where,$param); foreach ($list as $k=>$v){ $www['brand_id'] = $v['brand_id']; @@ -419,8 +424,8 @@ class StoreProduct extends BaseController add_log('buy', $id, $param); $app = $this->payment(); -// $total_fee = env('APP_DEBUG') ? 1 : $post_price; - $total_fee = $post_price; + $total_fee = env('APP_DEBUG') ? 1 : $post_price; +// $total_fee = $post_price; // 用 easywechat 封装的方法请求微信的统一下单接口 $result = $app->order->unify([ 'trade_type' => 'NATIVE', // 原生支付即扫码支付,商户根据微信支付协议格式生成的二维码,用户通过微信“扫一扫”扫描二维码后即进入付款确认界面,输入密码即完成支付。 diff --git a/app/admin/view/store_product/datalist.html b/app/admin/view/store_product/datalist.html index a8ccb3d..e01bd58 100644 --- a/app/admin/view/store_product/datalist.html +++ b/app/admin/view/store_product/datalist.html @@ -1,9 +1,45 @@ {extend name="common/base"/} {block name="body"} - +
-
+ +
+ + +
+
+ +
+ + +
+
+
+
+ +
+
@@ -132,6 +168,104 @@ } }); +// 商户商品分类搜索 + layui.use(['rate','dropdown', 'util', 'layer', 'table'], function(){ + var dropdown = layui.dropdown + ,util = layui.util + ,layer = layui.layer + ,rate = layui.rate + // ,table = layui.table + ,$ = layui.jquery; + + var $ = layui.$, active = { + reload: function(){ + let dataRload = getformdata(); + //执行重载 + table.reload('store_product', { + page: { + curr: 1 //重新从第 1 页开始 + } + ,where: { + ...dataRload + } + }); + }, + }; + + //商户商品分类菜单 + $.ajax({ + url: '/admin/product.StoreCategory/getAllList', + method: "get", + data: {}, + success: function(res) { + if (res.code!==0)return ; + + //高级演示 - 各种组合 + dropdown.render({ + elem: '#seleform' + ,isAllowSpread: false //禁止菜单组展开收缩 + ,style: 'width: 200px' //定义宽度,默认自适应 + ,id: 'test777' //定义唯一索引 + ,title: 'title1' + ,data: res.data + ,click: function(item){ + $('#seleform').text(item.title); + $('#seleform').css({color:'rgba(0,0,0,.85)'}); + $('#store_cate').val(item.id); + + active['reload'] ? active['reload'].call(this) : ''; + } + }); + }, + fail:function(){} + }); + + + + //基础效果 + rate.render({ + elem: '#is_good' + }) + + + + + //监听搜索提交 + form.on('submit(searchform)', function(data) { + layui.pageTable.reload({ + where: { + ...data.field + }, + page: { + curr: 1 + } + }); + return false; + }); + + //监听select提交 + form.on('select(seleform)', function(data) { + active['reload'] ? active['reload'].call(this) : ''; + return false; + }); + + //监听removeselect点击 + $('#removeselect').on('click', function(){ + $('#seleform').text('请选择'); + $('#seleform').css({color:'#a39f9f'}); + $('#store_cate').val(''); + active['reload'] ? active['reload'].call(this) : ''; + return false; + }); + + // tab 状态列表切换 + $('.site-demo-active').on('click', function(){ + var othis = $(this), type = othis.data('type'); + $('#protype').val(this.getAttribute('type')); + active[type] ? active[type].call(this, othis) : ''; + }); + + }); //监听表格行工具事件 table.on('tool(store_product)', function(obj) { var data = obj.data; @@ -171,6 +305,19 @@ }); return false; }); + + // 获取表单所有参数 + function getformdata() { + var form = $('#filterform').serializeArray(); + + var data = new Array(); + for(let i=0;i {/block}