添加百亿补贴商品上传栏目
This commit is contained in:
parent
f8e59ea570
commit
6725ff299c
27
app/admin/controller/billions/Goods.php
Normal file
27
app/admin/controller/billions/Goods.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package CipherSYS IM
|
||||
* @author Xiaowei Wang <wangxiaowei@ciphersys.com>
|
||||
* @copyright Copyright (c) 2022 - 2024, CipherSYS Co.,Ltd. (https://www.ciphersys.com/)
|
||||
* @license CipherSYS Commercial License
|
||||
* @link https://www.ciphersys.com
|
||||
*/
|
||||
|
||||
namespace app\admin\controller\billions;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
|
||||
class Goods extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return view('', [
|
||||
]);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
return view('', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
170
app/admin/view/billions/goods/add.html
Normal file
170
app/admin/view/billions/goods/add.html
Normal file
@ -0,0 +1,170 @@
|
||||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form {padding: 20px 30px;background-color: #ffffff;}
|
||||
.layui-form-item .layui-form-label { width: 95px; }
|
||||
.layui-form-item .layui-input-inline { width: 240px; }
|
||||
.layui-form-item .map-container{ width: 600px; height: 400px; margin-left: 100px; margin-top: 20px; }
|
||||
</style>
|
||||
|
||||
<div class="layui-card layui-form">
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color:red;">*</span>商品图片:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="like-upload-image" switch-tab="0" lay-verType="tips" lay-verify="logo">
|
||||
<div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="crftNo1" class="layui-form-label"><span style="color:red;">*</span>商品名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="crftNo1" id="crftNo1" lay-verType="tips" lay-verify="crftNo1"
|
||||
switch-tab="0" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="crftNo1" class="layui-form-label"><span style="color:red;">*</span>商品价格:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="crftNo1" id="crftNo1" lay-verType="tips" lay-verify="crftNo1"
|
||||
switch-tab="0" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span style="color:red;">*</span>商品详情:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" id="content" lay-verify="content"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="__PUBLIC__/static/common/js/area.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: "/static/lib/"
|
||||
}).extend({
|
||||
likeedit: 'likeedit/likeedit',
|
||||
likeArea: "likeArea/likeArea",
|
||||
txMap: "likeMap/txMap"
|
||||
}).use(["form", "laydate", "likeArea", "txMap", 'likeedit'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var likeArea = layui.likeArea;
|
||||
var laydate = layui.laydate;
|
||||
var txMap = layui.txMap;
|
||||
var likeedit = layui.likeedit;
|
||||
|
||||
|
||||
laydate.render({type:"datetime", elem:"#expire_time", trigger:"click",min:0});
|
||||
|
||||
|
||||
like.delUpload();
|
||||
$(document).on("click", ".add-upload-image", function () {
|
||||
like.imageUpload({
|
||||
limit: 1,
|
||||
field: "logo",
|
||||
that: $(this)
|
||||
});
|
||||
});
|
||||
|
||||
//------------------------------------------富文本编辑器 begin --------------------------------
|
||||
likeedit.set({
|
||||
uploadImage: {
|
||||
url: '{:url("file/lists")}?type=10',
|
||||
type: 'post'
|
||||
}
|
||||
});
|
||||
|
||||
var likeedit_index = likeedit.build('content');
|
||||
form.verify({
|
||||
content: function () {
|
||||
likeedit.sync(likeedit_index)
|
||||
}
|
||||
});
|
||||
//------------------------------------------富文本编辑器 end --------------------------------
|
||||
|
||||
|
||||
form.verify({
|
||||
name: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请填写商家名称";
|
||||
}
|
||||
},
|
||||
cid: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请选择主营类目";
|
||||
}
|
||||
},
|
||||
nickname: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请填写联系人";
|
||||
}
|
||||
},
|
||||
mobile: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请填写联系手机号";
|
||||
}
|
||||
},
|
||||
logo: function (value, item) {
|
||||
if (!value) {
|
||||
if ($(item).find(".upload-image-div").length <= 0) {
|
||||
switchTab($(item).attr("switch-tab"))
|
||||
return "请上传商家logo";
|
||||
}
|
||||
}
|
||||
},
|
||||
expire_time: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请选择到期时间";
|
||||
}
|
||||
},
|
||||
trade_service_fee: function (value, item) {
|
||||
if (!value && parseInt(value) !== 0) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请填写交易服务费";
|
||||
}
|
||||
},
|
||||
account: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请填写商家账号";
|
||||
}
|
||||
},
|
||||
password: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请填写商家登录密码";
|
||||
}
|
||||
},
|
||||
pwd: function (value, item) {
|
||||
if (!value) {
|
||||
switchTab($(item).attr("switch-tab"));
|
||||
return "请填确认商家登录密码";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function switchTab(number) {
|
||||
$('.layui-tab-card .layui-tab-title li').removeClass('layui-this');
|
||||
$('.layui-tab-content .layui-tab-item').removeClass('layui-show');
|
||||
$('.layui-tab-card .layui-tab-title li').eq(number).addClass('layui-this');
|
||||
$('.layui-tab-content .layui-tab-item').eq(number).addClass('layui-show');
|
||||
}
|
||||
})
|
||||
</script>
|
||||
208
app/admin/view/billions/goods/lists.html
Normal file
208
app/admin/view/billions/goods/lists.html
Normal file
@ -0,0 +1,208 @@
|
||||
{layout name="layout1" /}
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="layui-card">
|
||||
<!-- 操作提示 -->
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-collapse" style="border:1px dashed #c4c4c4">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<p>*百亿补贴商品列表。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 搜索区域 -->
|
||||
<div class="layui-card-body layui-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="merconat" class="layui-form-label" style="width: 100px;">商户联系人:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="merconat" name="merconat" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主体区域 -->
|
||||
<div class="layui-card-body">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm layEvent" lay-event="add">
|
||||
新增商品
|
||||
</button>
|
||||
|
||||
<table id="like-table-lists" lay-filter="like-table-lists"></table>
|
||||
<script type="text/html" id="businesslicense-operation">
|
||||
{{# if(d.businessLicense){ }}
|
||||
<img src="{{d.businessLicense}}" alt="营业执照" style="width: 200px;height: 200px;object-fit: contain;"
|
||||
class="image-show">
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="idcard-operation">
|
||||
{{# if(d.idCard){ }}
|
||||
<img src="{{d.idCard}}" alt="手持身份证" style="width: 200px;height: 200px;object-fit: contain;"
|
||||
class="image-show">
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="storeState-operation">
|
||||
{{# if(d.store_state == 0){ }}
|
||||
待审核
|
||||
{{# } else if(d.store_state == 1) { }}
|
||||
审核通过
|
||||
{{# } else if(d.store_state == 2) { }}
|
||||
审核失败
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="localstore-operation">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(["table", "form"], function () {
|
||||
var table = layui.table;
|
||||
var form = layui.form;
|
||||
like.tableLists("#like-table-lists", "{:url()}", [
|
||||
{field: "lstore_id", width: 60, title: "ID"}
|
||||
, {
|
||||
field: "businessLicense",
|
||||
width: 120,
|
||||
align: "center",
|
||||
title: "营业执照",
|
||||
toolbar: '#businesslicense-operation'
|
||||
}
|
||||
, {field: "crftNo1", width: 120, align: "center", title: "社会信用代码"}
|
||||
, {field: "idCard", width: 120, align: "center", title: "手持身份证", toolbar: '#idcard-operation'}
|
||||
, {field: "name", width: 120, align: "center", title: "商户联系人"}
|
||||
, {field: "empowerPhone", width: 120, align: "center", title: "联系电话"}
|
||||
, {field: "address", width: 300, align: "center", title: "地理位置"}
|
||||
, {field: "store_state", width: 150, align: "center", title: "审核状态", toolbar: '#storeState-operation'}
|
||||
, {fixed: 'right', title: '操作', width: 280, align: 'center', toolbar: '#localstore-operation'}
|
||||
]);
|
||||
|
||||
//图片放大
|
||||
$(document).on('click', '.image-show', function () {
|
||||
var src = $(this).attr('src');
|
||||
like.showImg(src, 600);
|
||||
});
|
||||
|
||||
var active = {
|
||||
add: function () {
|
||||
layer.open({
|
||||
type: 2
|
||||
, title: "新增商品"
|
||||
, content: "{:url('billions.Goods/add')}"
|
||||
, area: ['90%', '90%']
|
||||
, btn: ["确定", "取消"]
|
||||
, yes: function (index, layero) {
|
||||
var iframeWindow = window["layui-layer-iframe" + index];
|
||||
var submit = layero.find("iframe").contents().find("#addSubmit");
|
||||
iframeWindow.layui.form.on("submit(addSubmit)", function (data) {
|
||||
like.ajax({
|
||||
url: "{:url('shop.Category/add')}",
|
||||
data: data.field,
|
||||
type: "POST",
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
layui.layer.msg(res.msg);
|
||||
layer.close(index);
|
||||
table.reload("like-table-lists", {
|
||||
where: {},
|
||||
page: {cur: 1}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
submit.trigger("click");
|
||||
}
|
||||
});
|
||||
},
|
||||
edit: function (obj) {
|
||||
layer.open({
|
||||
type: 2
|
||||
, title: "编辑本地生活"
|
||||
, content: "{:url('shop.LocalStore/edit')}?id=" + obj.data.lstore_id
|
||||
, area: ['90%', '90%']
|
||||
, btn: ["确定", "取消"]
|
||||
, yes: function (index, layero) {
|
||||
var iframeWindow = window["layui-layer-iframe" + index];
|
||||
var submit = layero.find("iframe").contents().find("#addSubmit");
|
||||
iframeWindow.layui.form.on("submit(addSubmit)", function (data) {
|
||||
data.field['id'] = obj.data.id;
|
||||
like.ajax({
|
||||
url: "{:url('shop.Category/edit')}",
|
||||
data: data.field,
|
||||
type: "POST",
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
layui.layer.msg(res.msg);
|
||||
layer.close(index);
|
||||
table.reload("like-table-lists", {
|
||||
where: {},
|
||||
page: {cur: 1}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
submit.trigger("click");
|
||||
}
|
||||
});
|
||||
},
|
||||
del: function (obj) {
|
||||
layer.confirm("确定删除主营类目:" + obj.data.name, function (index) {
|
||||
like.ajax({
|
||||
url: "{:url('shop.Category/del')}",
|
||||
data: {id: obj.data.id},
|
||||
type: "POST",
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
layui.layer.msg(res.msg);
|
||||
layer.close(index);
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
})
|
||||
}
|
||||
};
|
||||
like.eventClick(active);
|
||||
|
||||
|
||||
form.on("submit(search)", function (data) {
|
||||
console.log(data.field);
|
||||
table.reload("like-table-lists", {
|
||||
where: data.field,
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
form.on("submit(clear-search)", function () {
|
||||
$("#merconat").val("");
|
||||
form.render("select");
|
||||
table.reload("like-table-lists", {
|
||||
where: {},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user