Commit 33a08254 by 梁建民

js

parent a283ddc2
......@@ -16,24 +16,24 @@
<div class="nav_title">商品管理 > 商品列表</div>
<div class="good_total clr">
<div class="fl my_good">
<h3>85</h3>
<h3>--</h3>
<p>我的商品</p>
</div>
<div class="fl week_good">
<h3>85</h3>
<h3>--</h3>
<p>本周新增</p>
</div>
<div class="fl no_good">
<h3>85</h3>
<h3>--</h3>
<p>等待完善</p>
</div>
<div class="center_line line1"></div>
<div class="center_line line2"></div>
</div>
<div class="filter_section clr">
<div class="filter_section layui-form clr">
<div class="fr">
<div class="btn_div fr">
<a class="cx lineBlock btn nohover">查询</a>
<a class="cx lineBlock btn nohover" lay-submit lay-filter="search">查询</a>
</div>
<div class="date_div fr">
<span class="fl">日期选择:</span>
......@@ -49,9 +49,9 @@
</div>
</div>
<div class="layui-form fr">
<div class="layui-form-style fr">
<span class="lineBlock">状态:</span>
<select name="city" lay-verify="required">
<select name="status">
<option value=""></option>
<option value="1">上架</option>
<option value="2">下架</option>
......@@ -145,7 +145,22 @@
</div>
<div class="pagination-with" id="pagination" style="text-align: right;margin-top: 25px;"></div>
</script>
<script type="text/html" id="countHtml">
<div class="fl my_good">
<h3>{{d.mygoods}}</h3>
<p>我的商品</p>
</div>
<div class="fl week_good">
<h3>{{d.newadd}}</h3>
<p>本周新增</p>
</div>
<div class="fl no_good">
<h3>{{d.imperfect}}</h3>
<p>等待完善</p>
</div>
<div class="center_line line1"></div>
<div class="center_line line2"></div>
</script>
<script>
$('.dgsc').click(function () {
window.location.href = '/uploadsingle'
......
......@@ -26,60 +26,57 @@
<span class="icon iconfont iconjuxing19 va-m"></span>
<span>上传的商品有图片,搜索排名会优先排前</span>
</div>
<div class="form_content clr">
<div class="form_content layui-form clr">
<div class="form_left fl layui-form">
<div class="xh input_div ">
<span class="input_title lineBlock">*型号:</span>
<div class="input_parent">
<input type="text" placeholder="请输入商品型号" class="input boxsiz">
<input type="text" name="goods_name" placeholder="请输入商品型号" class="input boxsiz" lay-verify="required">
</div>
</div>
<div class="brand input_div ">
<span class="input_title lineBlock">*品牌:</span>
<div class="input_parent">
<input type="text" placeholder="请输入品牌(必填)" class="input boxsiz">
<input type="text" name="brand_name" placeholder="请输入品牌" class="input boxsiz" lay-verify="required">
</div>
</div>
<div class="fz input_div ">
<span class="input_title lineBlock">封装:</span>
<div class="input_parent">
<input type="text" placeholder="请输入封装" class="input boxsiz">
<input type="text" name="encap" placeholder="请输入封装" class="input boxsiz">
</div>
</div>
<div class="num input_div ">
<span class="input_title lineBlock">*库存:</span>
<div class="input_parent">
<input type="text" placeholder="请输入需求数量(必填)" class="input boxsiz">
<input type="text" name="stock" placeholder="请输入需求数量" class="input boxsiz" lay-verify="required">
</div>
</div>
<div class="price input_div ">
<span class="input_title lineBlock">*单价:</span>
<div class="input_parent">
<input type="text" placeholder="请输入接受价格" class="input boxsiz price_input">
<input type="text" name="price" placeholder="请输入接受价格" class="input boxsiz price_input" lay-verify="required">
<div class="rmb layui-form">
<select name="city" lay-verify="required">
<option value=""></option>
<option value="0">北京</option>
<option value="1">上海</option>
<option value="2">广州</option>
<option value="3">深圳</option>
<option value="4">杭州</option>
<option value="1">RMB</option>
<option value="2">USD</option>
</select>
</div>
</div>
</div>
<div class="hq input_div ">
<div class="hq input_div">
<span class="input_title lineBlock">*货期:</span>
<div class="input_parent">
<input type="radio" name="sex" value="现货" title="现货">
<input type="radio" name="sex" value="期货" title="期货" checked>
<input type="text" placeholder="输入时间" class="boxsiz day_input input">
<div class="input_parent" id="delivery">
<input type="radio" name="delivery_time" lay-filter="delivery" value="现货" title="现货">
<input type="radio" name="delivery_time" lay-filter="delivery" value="期货" title="期货" checked>
<div class="lineBlock" id="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number">
<i class="day"></i>
</div>
</div>
</div>
<div class="btn_div">
<span class="lineBlock fb btn">发布</span>
<span class="lineBlock fb btn" lay-submit lay-filter="add">发布</span>
<span class="lineBlock cz btn btn_border">重置</span>
</div>
</div>
......@@ -97,6 +94,13 @@
</div>
</div>
<include file="public/foot" />
<script src="__PUBLIC__/js/goodmanage/uploadsingle.js"></script>
<script type="text/html" id="deliveryHtml">
{{# if (d== 1) { }}
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number">
<i class="day"></i>
{{# } }}
</script>
</body>
</html>
\ No newline at end of file
\ No newline at end of file
<?php
return array(
//'配置项'=>'配置值'
);
\ No newline at end of file
\ No newline at end of file
<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller
{
public function index()
{
$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>!</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
}
}
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
......@@ -101,15 +101,15 @@
height: 40px;
line-height: 40px;
}
.good_manage_content .filter_section .layui-form {
.good_manage_content .filter_section .layui-form-style {
margin-right: 20px;
}
.good_manage_content .filter_section .layui-form .layui-form-select {
.good_manage_content .filter_section .layui-form-style .layui-form-select {
display: inline-block;
width: 170px;
vertical-align: middle;
}
.good_manage_content .filter_section .layui-form .layui-form-select input {
.good_manage_content .filter_section .layui-form-style .layui-form-select input {
border-radius: 4px;
}
.good_manage_content .filter_section .heng {
......@@ -232,3 +232,4 @@
.good_manage_content .good_data .data_list .data_item .xj.fb {
color: #0D84D1;
}
/*# sourceMappingURL=goodmanage.css.map */
\ No newline at end of file
{"version":3,"sources":["goodmanage.less"],"names":[],"mappings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A,sBAAA;EACA,iBAAA;;AAGJ,oBAlEhB,WACI,WAGI,WAoDI,aAUK,GACG;EACI,yBAAA;;AAIR,oBAxEhB,WACI,WAGI,WAoDI,aAgBK,GACG;EACI,yBAAA;;AA3P5B,oBAiLI,WACI,WAGI,WAoDI,aAsBI;EACI,cAAA;;AAhQxB,oBAiLI,WACI,WAGI,WA+EI;EACI,UAAA;;AArQpB,oBAiLI,WACI,WAGI,WAoFI;EACI,cAAA;EACA,UAAA;;AAGJ,mBAAqC;EAArC,oBA7FZ,WACI,WAGI,WA4FQ;IACI,UAAA;;EAJR,oBA7FZ,WACI,WAGI,WAgGQ;IACI,UAAA;;EARR,oBA7FZ,WACI,WAGI,WAoGQ;IACI,UAAA;;EAZR,oBA7FZ,WACI,WAGI,WAwGQ;IACI,aAAA;;;AA9RxB,oBAiLI,WACI,WAGI,WA6GI;EACI,cAAA;EACA,eAAA;;AApSpB,oBAiLI,WACI,WAGI,WAkHI;EACI,cAAA;EACA,eAAA;EACA,iBAAA;;AAEA,oBA3HhB,WACI,WAGI,WAkHI,IAKK;EACG,cAAA","file":"goodmanage.css"}
\ No newline at end of file
......@@ -131,7 +131,7 @@
}
}
.layui-form {
.layui-form-style {
margin-right: 20px;
.layui-form-select {
......
......@@ -24,7 +24,20 @@
/**
* 商品搜索
*/
goodsSearch: goods + '/goods/search'
goodsSearch: goods + '/goods/search',
/**
* 商品数量
*/
goodsCount: goods + '/goods/count',
/**
* 商品新增
*/
goodsAdd: goods + '/goods/add',
/**
* 商品修改
*/
goodsSave: goods + '/goods/save'
};
if (typeof define === "function" && define.amd) {
return apis;
......
!function () {
window.GoodManage = {
init: function () {
this.created(this).mounted(this, {offset: 1, p: 1}, 1).handleBind(this);
this.created(this).mounted(this).listData(this, {offset: 10, p: 1}, 1).handleBind(this);
},
created(opt) {
return this;
},
mounted: function (opt, params, curr) {
//日期控件初始化
layui.laydate.render({
elem: '#start_time',
......@@ -18,7 +14,23 @@
theme: '#0D84D1'
});
return this;
},
mounted: function (opt) {
//商品数量获取
IcController.getData(apis.goodsCount, 'POST', null, function (res) {
var getTpl = countHtml.innerHTML;
layui.laytpl(getTpl).render(res.count, function (html) {
$(".good_total").empty().html(html);
});
});
return this;
},
listData: function (opt, params, curr) {
//商品列表初始化
IcController.getData(apis.goodsInfo, 'POST', params, function (res) {
var getTpl = listHtml.innerHTML;
......@@ -28,7 +40,7 @@
elem: 'pagination',
theme: '#1080d0',
count: res.total,
limit: 1,
limit: 10,
curr: curr,
jump: function (obj, first) {
if (!first) {
......@@ -46,9 +58,19 @@
});
return this;
},
handleBind: function (opt) {
//搜索
layui.form.on('submit(search)', function (data) {
IcController.getData(apis.goodsSearch, 'POST', data.field, function (res) {
});
});
return this;
},
}, $(function () {
......
!function () {
window.UploadSingle = {
init: function () {
this.created(this).mounted(this).handleBind(this);
},
created(opt) {
return this;
},
mounted: function (opt, params, curr) {
return this;
},
handleBind: function (opt) {
//货期选择
layui.form.on('radio(delivery)', function (data) {
var val = 1;
if (data.value == '期货') {
val = 1
} else if (data.value == '现货') {
val = 2;
}
var getTpl = deliveryHtml.innerHTML;
layui.laytpl(getTpl).render(val, function (html) {
$("#day").empty().html(html);
});
});
//上传商品
layui.form.on('submit(add)', function (data) {
IcController.getData(apis.goodsAdd, 'POST', data.field, function (res) {
console.log(res)
});
});
return this;
},
}, $(function () {
UploadSingle.init();
})
}();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment