This commit is contained in:
彭桃 2023-04-08 17:47:15 +08:00
parent c0ff1742fd
commit 45e9f2810d
7 changed files with 672 additions and 38 deletions

View File

@ -23,9 +23,31 @@ use app\admin\model\InformationUserAddress;
use app\admin\model\ShopUser;
use app\admin\model\SupplyBrokerage as SupplyBrokerageModel;
use app\admin\model\StoreOrder;
use app\admin\model\StoreCategory as StoreCategoryModel;
use app\common\controller\FormatList;
use app\common\model\merchant\user\UserMerchant;
class Api extends BaseController
{
protected $category;
public function __construct(StoreCategoryModel $category)
{
$this->category = $category;
}
/**
* 平台商品分类
*
*/
public function getAllList()
{
$where['mer_id'] = 0;
$where['is_show'] = 0;
$data = $this->category->getStoreCategoryList(0,1);
$list = FormatList::FormatCategory($data,'store_category_id', 'pid', 'cate_name','child', 'id', 'title');
return to_assign(0, '', $list);
}
//上传文件
public function upload()
{

View File

@ -384,7 +384,7 @@ class StoreProduct extends BaseController
'key' => '95d195Dcf6ec66156dfeeb4E7435faef',//支付秘钥
'secret' => 'c02aa7ad9e4a5c423862e068b6cb4ad4',
'notify_url' => Request::instance()->domain().'/api/PayNotify/notify',//异步回调通知地址
// 'notify_url' => 'http://t7kqa2.natappfree.cc/api/PayNotify/notify',//异步回调通知地址
// 'notify_url' => 'http://an8r22.natappfree.cc/api/PayNotify/notify',//异步回调通知地址
];
// 这个就是 easywechat 封装的了, 一行代码搞定, 照着写就行了
@ -423,6 +423,7 @@ class StoreProduct extends BaseController
'number' => $number,
'admin_id' =>$admin_id,
'create_time'=>time(),
'total_fee' =>$post_price
];
Db::table('cms_store_product_paylog')->strict(false)->field(true)->insert($param);
add_log('buy', $id, $param);
@ -495,7 +496,7 @@ class StoreProduct extends BaseController
if($type == 2){
$where[] = ['a.admin_id','=',$this->uid];
if (isset($param['keywords']) && !empty($param['keywords'])){
$where[]=['b.store_name','like','%'.$param['keywords'].'%'];
$where[]=['a.order_sn','=',$param['keywords']];
}
if (isset($param['store_cate']) && !empty($param['store_cate'])){
$where[]=['b.cate_id','=',$param['store_cate']];
@ -527,7 +528,7 @@ class StoreProduct extends BaseController
}else{
$where[] = ['admin_id','=',$this->uid];
if (isset($param['keywords']) && !empty($param['keywords'])){
$where[]=['store_name','like','%'.$param['keywords'].'%'];
$where[]=['out_trade_no','=',$param['keywords']];
}
// if (isset($param['store_cate']) && !empty($param['store_cate'])){
// $where[]=['b.cate_id','=',$param['store_cate']];
@ -547,9 +548,20 @@ class StoreProduct extends BaseController
}
})
->withAttr('paid_at',function ($value,$data){
return '';
return '无';
})
->withAttr('order_sn',function ($value,$data){
return $data['out_trade_no'];
})
->withAttr('total_fee',function ($value,$data){
return bcdiv($data['total_fee'],'100',2);
})
->withAttr('status',function ($value,$data){
return 0;
})
->where($where)
->whereNull('result_code')
->whereNull('return_code')
->order('id desc')
->paginate($rows, false, ['query' => $param]);
@ -757,7 +769,8 @@ class StoreProduct extends BaseController
'number' => $number,
'admin_id' =>$admin_id,
'cart_id' =>$id,
'create_time'=>time()
'create_time'=>time(),
'total_fee' => $post_price
];
Db::table('cms_store_product_paylog')->strict(false)->field(true)->insert($param);
@ -803,6 +816,7 @@ class StoreProduct extends BaseController
}
// 删除购物车
public function delcar(){
$param = get_params();
$where['cart_id'] = $param['cart_id'];
@ -937,6 +951,61 @@ class StoreProduct extends BaseController
}
}
// 预支付订单支付
public function payorder(){
$param = get_params();
$id = $param['id'];
if($id){
$paylog = Db::table('cms_store_product_paylog')->where('id',$id)->find();
if(empty($paylog)){
return to_assign(0, '数据未找到');
}
}else{
return to_assign(0, '请选择需要支付的订单');
}
Db::startTrans();//开启事务
$app = $this->payment();
$order_sn = $paylog['out_trade_no'];
$total_fee = env('APP_DEBUG') ? 1 : $paylog['total_fee'];
// $total_fee = $post_price;
// 用 easywechat 封装的方法请求微信的统一下单接口
$result = $app->order->unify([
'trade_type' => 'NATIVE', // 原生支付即扫码支付,商户根据微信支付协议格式生成的二维码,用户通过微信“扫一扫”扫描二维码后即进入付款确认界面,输入密码即完成支付。
'body' => '购物车商品-订单支付', // 这个就是会展示在用户手机上巨款界面的一句话, 随便写的
'out_trade_no' => $order_sn,
'total_fee' => $total_fee,
'spbill_create_ip' => request()->ip(), // 可选如不传该参数SDK 将会自动获取相应 IP 地址
]);
if ($result['result_code'] == 'SUCCESS') {
// 如果请求成功, 微信会返回一个 'code_url' 用于生成二维码
$code_url = $result['code_url'];
// 生成二维码
// 引用二维码生成方法
require '../vendor/phpqrcode/phpqrcode.php';
$errorCorrectionLevel = 'L'; //容错级别
$matrixPointSize = 5; //生成图片大小
//生成二维码图片
// 判断是否有这个文件夹 没有的话就创建一个
if(!is_dir("static/qrcode")){
// 创建文件加
mkdir("static/qrcode");
}
//设置二维码文件名
$filename = 'static/qrcode/'.time().rand(10000,9999999).'.png';
//生成二维码
\QRcode::png($code_url,$filename , $errorCorrectionLevel, $matrixPointSize, 2);
// 订单编号, 用于在当前页面向微信服务器发起订单状态查询请求
$data['order_sn'] = $order_sn;
$data['html'] = Request::instance()->domain().'/'.$filename;
Db::commit();
return to_assign(200,'操作成功',$data);
}
return to_assign(0,'操作失败');
}

View File

@ -0,0 +1,389 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<style>
.layui-input-inline{
width:35% !important;
}
.layui-input-inline .layui-form-item{
display:flex;
}
.layui-input-inline .layui-form-item .layui-form-label{
width:30%;
}
.layui-input-block{
margin-left:unset !important;
width:75%;
}
#seleform{
border-color: #eee;
background-color: #fff;
color:#a39f9f;
width:100%;
}
</style>
<div class="p-3">
<form id="filterform" class="layui-form gg-form-bar border-t border-x">
<div class="layui-form-item">
<div class="layui-input-inline">
<div class="layui-form-item">
<label class="layui-form-label">商品分类</label>
<div class="layui-input-block">
<input id="store_cate" type="hidden" readonly="readonly" name="store_cate">
<button id="seleform" lay-filter="seleform" class="layui-btn">请选择</button>
<div id="removeselect"><i class="bi-x-lg" style="position: absolute;right:2px;top:10px;z-index: 9;cursor:pointer;"></i></div>
</div>
</div>
</div>
</div>
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="store_product" lay-filter="store_product"></table>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="paycar" data-title="支付">支付</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#store_product',
title: '列表',
toolbar: '#toolbarDemo',
url: '/admin/store_product/carlist',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{type:'checkbox', fixed: 'left'},
{
field: 'cart_id',
title: '编号',
align: 'center',
width: 80
},{
field: 'nickname',
title: '用户',
align: 'center',
width: 200,
},{
field: 'cart_num',
title: '商品数量',
align: 'center',
width: 100
},{
field: 'product',
title: '商品简介',
align: 'center',
width: 300,
templet: function (d) {
var html = '<div><img src="'+d.image+'" style="width:30px; height:30px;"> '+d.store_name+'</div>';
return html;
}
}, {
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
],
id: 'testReload' ,
});
//监听表头工具栏事件
table.on('toolbar(store_product)', function(obj){
if (obj.event === 'paycar') {
//获取选中数据
var checkStatus = table.checkStatus('testReload')
,data = checkStatus.data;
var newJson = []
$.each(data, function (index, item) {
newJson.push(item.cart_id);
})
newJson.join(",");
if (newJson.length == 0){
layer.msg("请选择需要操作数据")
}else {
// 单击之后提交按钮不可选,防止重复提交
var DISABLED = 'layui-btn-disabled';
// 增加样式
$('.preservation').addClass(DISABLED);
// 增加属性
$('.preservation').attr('disabled', 'disabled');
$.ajax({
url : "/admin/store_product/paycar?cart_id="+newJson, //请求的url地址
dataType : "json", //返回格式为json
async : true,//请求是否异步默认为异步这也是ajax重要特性
type : "POST", //请求方式
success : function(data) {
var url = data.data.html;
/** 弹出二维码 **/
layer.open({
//type:1 表示页面层
type: 1,
title: '扫码支付',
//是否点击遮罩关闭
shadeClose: false,
//样式类名,可以自定义弹窗样式
//弹层外区域
shade: 0.3,
maxmin: false, //开启最大化最小化按钮
//宽高
area: ['250px','250px'],
//内容
content: "<img src='"+url+"' alt='' style='margin-left: 40px;'>",
});
/** 设置定时器, 即一弹出二维码就开始不断请求查看支付状态, 直到收到支付成功的返回, 再终止定时器 **/
var timer = setInterval(function () {
/** 在这里请求微信支付状态的接口 **/
//ajax。必填参数'options':请求参数,对象,'callback':成功回调函数
let options = {
url: '/admin/store_product/paid',
type: 'get',
data: {
out_trade_no: data.data.order_sn,
}
};
let callback = function(res) {
if (res.code == 200) {
layer.msg('支付成功',{time:2000,icon:6});
/** 如果支付成功, 就取消定时器, 并重新加载页面 */
window.clearInterval(timer);
// 关闭所有层
setTimeout(function () {
layer.closeAll();
}, 2000);
// tool.sideClose(2000);
}
}
tool.ajax(options, callback);
}, 3000);
},
complete : function() {
//请求完成的处理
},
error : function() {
//请求出错处理
layer.alert("系统异常");
}
});
// 恢复按钮
var DISABLED = 'layui-btn-disabled';
$('.preservation').removeClass(DISABLED);
$('.preservation').removeAttr('disabled');
}
}
});
// 表格点击行自动选中 ==========================================================================
$(document).on("click",".layui-table-body table.layui-table tbody tr", function (e) {
var index = $(this).attr('data-index');
var tableBox = $(this).parents('.layui-table-box');
//存在固定列
if (tableBox.find(".layui-table-fixed.layui-table-fixed-l").length > 0) {
tableDiv = tableBox.find(".layui-table-fixed.layui-table-fixed-l");
} else {
tableDiv = tableBox.find(".layui-table-body.layui-table-main");
}
var checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
if (checkCell.length > 0) {
checkCell.click();
}
});
// 表格点击行出发复选框后,阻止向上冒泡===============================================================
$(document).on("click", "td div.laytable-cell-checkbox div.layui-form-checkbox", function (e) {
e.stopPropagation();
});
//监听表格行工具事件
table.on('tool(store_product)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('/admin/store_product/buy?cart_id='+obj.data.cart_id);
}
else if (obj.event === 'edit') {
tool.side('/admin/store_product/edit?cart_id='+obj.data.cart_id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 200) {
obj.del();
}
}
tool.delete("/admin/store_product/delcar", { cart_id: data.cart_id }, callback);
layer.close(index);
});
}
return false;
});
// 商户商品分类搜索
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/api/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) : '';
});
});
// //监听搜索提交
// form.on('submit(searchform)', function(data) {
// layui.pageTable.reload({
// where: {
// keywords: data.field.keywords
// },
// page: {
// curr: 1
// }
// });
// return false;
// });
// 获取表单所有参数
function getformdata() {
var form = $('#filterform').serializeArray();
var data = new Array();
for(let i=0;i<form.length; i++){
data[form[i].name] = form[i].value;
}
return data;
}
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -83,6 +83,11 @@
title: '编号',
align: 'center',
width: 80
},{
field: 'shangjia',
title: '商家',
align: 'center',
width: 100
},{
field: 'image',
title: '商品图片',
@ -99,6 +104,11 @@
title: '商品简介',
align: 'center',
width: 100
},{
field: 'stock',
title: '总库存',
align: 'center',
width: 100
},{
field: 'keyword',
title: '关键字',
@ -134,11 +144,6 @@
title: '原价',
align: 'center',
width: 100
},{
field: 'stock',
title: '总库存',
align: 'center',
width: 100
}, {
fixed: 'right',
field: 'right',
@ -189,7 +194,7 @@
//商户商品分类菜单
$.ajax({
url: '/admin/product.StoreCategory/getAllList',
url: '/admin/api/getAllList',
method: "get",
data: {},
success: function(res) {

View File

@ -51,7 +51,7 @@
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">采购</a></div>
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">采购</a><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="joincar">加入购物车</a></div>
</script>
{/block}
@ -78,6 +78,11 @@
title: '编号',
align: 'center',
width: 80
},{
field: 'shangjia',
title: '商家',
align: 'center',
width: 100
},{
field: 'image',
title: '商品图片',
@ -94,6 +99,11 @@
title: '商品简介',
align: 'center',
width: 100
},{
field: 'stock',
title: '总库存',
align: 'center',
width: 100
},{
field: 'keyword',
title: '关键字',
@ -134,11 +144,6 @@
title: '原价',
align: 'center',
width: 100
},{
field: 'stock',
title: '总库存',
align: 'center',
width: 100
}, {
fixed: 'right',
field: 'right',
@ -177,6 +182,52 @@
else if (obj.event === 'edit') {
tool.side('/admin/store_product/edit?product_id='+obj.data.product_id);
}
else if (obj.event === 'joincar') {
layer.open({
type: 1,
area: ["400px", "200px"],
title: "加入购物车",
content: "<input type=\"text\" name=\"number\" lay-verify=\"required|number\" placeholder=\"输入加入购物车数量\" lay-reqtext=\"请输入数字\" autocomplete=\"off\" class=\"layui-input\" id='carnum' min='1 '>",
btn: ['确定', '关闭'],
yes: function (index, layero) {
//ajax。必填参数'options':请求参数,对象,'callback':成功回调函数
// 单击之后提交按钮不可选,防止重复提交
var DISABLED = 'layui-btn-disabled';
// 增加样式
$('.layui-layer-btn0').addClass(DISABLED);
// 增加属性
$('.layui-layer-btn0').attr('disabled', 'disabled');
let options = {
url: '/admin/store_product/joincar',
type: 'get',
data: {
product_id: obj.data.product_id,
cart_num:$('#carnum').val(),
is_new:1,
}
};
let callback = function(res) {
if (res.code == 200) {
layer.msg('加入成功',{time:2000,icon:6});
// 关闭所有层
setTimeout(function () {
layer.closeAll();
}, 2000);
}else{
layer.msg(res.msg,{time:2000,icon:2});
$('.layui-layer-btn0').removeClass(DISABLED);
$('.layui-layer-btn0').removeAttr('disabled');
}
}
tool.ajax(options, callback);
},
cancel: function (layer_window) {
// 关闭弹出框页面
layer.close(layer_window);
}
});
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
@ -221,7 +272,7 @@
//商户商品分类菜单
$.ajax({
url: '/admin/product.StoreCategory/getAllList',
url: '/admin/api/getAllList',
method: "get",
data: {},
success: function(res) {

View File

@ -23,25 +23,34 @@
}
</style>
<div class="p-3">
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
<li class="layui-this site-demo-active" type="1" data-type="reload">预订单</li>
<li class="site-demo-active" type="2" data-type="reload">已支付订单</li>
</ul>
</div>
<form id="filterform" class="layui-form gg-form-bar border-t border-x">
<input id="protype" type="hidden" name="type" value="1">
<div class="layui-form-item">
<div class="layui-input-inline">
<div class="layui-form-item">
<label class="layui-form-label">商品分类</label>
<div class="layui-input-block">
<input id="store_cate" type="hidden" readonly="readonly" name="store_cate">
<button id="seleform" lay-filter="seleform" class="layui-btn">请选择</button>
<div id="removeselect"><i class="bi-x-lg" style="position: absolute;right:2px;top:10px;z-index: 9;cursor:pointer;"></i></div>
</div>
</div>
</div>
<!-- <div class="layui-input-inline">-->
<!-- <div class="layui-form-item">-->
<!-- <label class="layui-form-label">商品分类</label>-->
<!-- <div class="layui-input-block">-->
<!-- <input id="store_cate" type="hidden" readonly="readonly" name="store_cate">-->
<!-- <button id="seleform" lay-filter="seleform" class="layui-btn">请选择</button>-->
<!-- <div id="removeselect"><i class="bi-x-lg" style="position: absolute;right:2px;top:10px;z-index: 9;cursor:pointer;"></i></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
<input type="text" name="keywords" placeholder="请输入订单号" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
@ -51,7 +60,9 @@
<script type="text/html" id="barDemo">
<div class="layui-btn-group"></div>
<div class="layui-btn-group">
<a class="layui-btn layui-btn-normal layui-btn-xs preservation {{# if(d.status != 0){ }}layui-hide{{# } }}" lay-event="topay">去支付</a>
</div>
</script>
{/block}
@ -99,14 +110,22 @@
align: 'center',
width: 300,
templet: function (d) {
var html = '<div><img src="'+d.image+'" style="width:30px; height:30px;"> '+d.store_name+'</div>';
return html;
var html = '<div>';
var img = '';
var prod = d.product;
for (i = 0; i < prod.length; i++) {
img = '<img src="'+prod[i].image+'" style="width:30px; height:30px;"> '+prod[i].store_name + '&nbsp;' +img;
}
var html2 = '</div>';
// var html = '<div><img src="'+d[k].image+'" style="width:30px; height:30px;"> '+d[k].store_name+'</div>';
var ret = html + img + html2;
return ret;
}
},{
field: 'paid_at',
title: '支付完成时间',
align: 'center',
width: 150
width: 150,
},{
field: 'status',
title: '状态',
@ -119,6 +138,13 @@
}
return html;
}
}, {
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
]
@ -135,8 +161,80 @@
//监听表格行工具事件
table.on('tool(store_product)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('/admin/store_product/buy?product_id='+obj.data.product_id);
if (obj.event === 'topay') {
// 单击之后提交按钮不可选,防止重复提交
var DISABLED = 'layui-btn-disabled';
// 增加样式
$('.preservation').addClass(DISABLED);
// 增加属性
$('.preservation').attr('disabled', 'disabled');
$.ajax({
url : "/admin/store_product/payorder?id="+data.id, //请求的url地址
dataType : "json", //返回格式为json
async : true,//请求是否异步默认为异步这也是ajax重要特性
type : "POST", //请求方式
success : function(data) {
var url = data.data.html;
/** 弹出二维码 **/
layer.open({
//type:1 表示页面层
type: 1,
title: '扫码支付',
//是否点击遮罩关闭
shadeClose: false,
//样式类名,可以自定义弹窗样式
//弹层外区域
shade: 0.3,
maxmin: false, //开启最大化最小化按钮
//宽高
area: ['250px','250px'],
//内容
content: "<img src='"+url+"' alt='' style='margin-left: 40px;'>",
});
/** 设置定时器, 即一弹出二维码就开始不断请求查看支付状态, 直到收到支付成功的返回, 再终止定时器 **/
var timer = setInterval(function () {
/** 在这里请求微信支付状态的接口 **/
//ajax。必填参数'options':请求参数,对象,'callback':成功回调函数
let options = {
url: '/admin/store_product/paid',
type: 'get',
data: {
out_trade_no: data.data.order_sn,
}
};
let callback = function(res) {
if (res.code == 200) {
layer.msg('支付成功',{time:2000,icon:6});
/** 如果支付成功, 就取消定时器, 并重新加载页面 */
window.clearInterval(timer);
// 关闭所有层
setTimeout(function () {
layer.closeAll();
}, 2000);
// tool.sideClose(2000);
}
}
tool.ajax(options, callback);
}, 3000);
},
complete : function() {
//请求完成的处理
},
error : function() {
//请求出错处理
layer.alert("系统异常");
}
});
// 恢复按钮
var DISABLED = 'layui-btn-disabled';
$('.preservation').removeClass(DISABLED);
$('.preservation').removeAttr('disabled');
}
else if (obj.event === 'edit') {
tool.side('/admin/store_product/edit?product_id='+obj.data.product_id);
@ -185,7 +283,7 @@
//商户商品分类菜单
$.ajax({
url: '/admin/product.StoreCategory/getAllList',
url: '/admin/api/getAllList',
method: "get",
data: {},
success: function(res) {
@ -220,7 +318,6 @@
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({

View File

@ -155,6 +155,7 @@
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
@ -288,7 +289,7 @@
//商户商品分类菜单
$.ajax({
url: '/admin/product.StoreCategory/getAllList',
url: '/admin/api/getAllList',
method: "get",
data: {},
success: function(res) {