Commit b5f11c9c by 梁建民

js

parent 33a08254
......@@ -142,6 +142,12 @@
<a class="edit fr">编辑</a>
</div>
{{# }); }}
{{# if(d.length === 0){ }}
<div class="no_data">
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">无商品信息</p>
</div>
{{# } }}
</div>
<div class="pagination-with" id="pagination" style="text-align: right;margin-top: 25px;"></div>
</script>
......
......@@ -68,9 +68,9 @@
<span class="input_title lineBlock">*货期:</span>
<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>
<input type="radio" name="delivery_time" lay-filter="delivery" value="期货" title="期货" checked id="daytext">
<div class="lineBlock" id="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number">
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number" name="day">
<i class="day"></i>
</div>
</div>
......@@ -97,7 +97,7 @@
<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">
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number" name="day">
<i class="day"></i>
{{# } }}
</script>
......
......@@ -128,7 +128,7 @@
* @param val
* @returns {string}
*/
getDateStr(val) {
getDateStr:function (val) {
var dd = new Date();
dd.setDate(dd.getDate() + val);
var y = dd.getFullYear();
......
......@@ -3,7 +3,7 @@
init: function () {
this.created(this).mounted(this).listData(this, {offset: 10, p: 1}, 1).handleBind(this);
},
created(opt) {
created: function (opt) {
//日期控件初始化
layui.laydate.render({
elem: '#start_time',
......@@ -34,35 +34,40 @@
//商品列表初始化
IcController.getData(apis.goodsInfo, 'POST', params, function (res) {
var getTpl = listHtml.innerHTML;
layui.laytpl(getTpl).render(res.goods_list, function (html) {
$("#listData").empty().html(html);
layui.laypage.render({
elem: 'pagination',
theme: '#1080d0',
count: res.total,
limit: 10,
curr: curr,
jump: function (obj, first) {
if (!first) {
//分页回调调用
var json = {
p: obj.curr
if (res.errcode == 0) {
layui.laytpl(getTpl).render(res.goods_list, function (html) {
$("#listData").empty().html(html);
layui.laypage.render({
elem: 'pagination',
theme: '#1080d0',
count: res.total,
limit: 10,
curr: curr,
jump: function (obj, first) {
if (!first) {
//分页回调调用
var json = {
p: obj.curr
}
var param = $.extend({}, params, json);
opt.mounted(opt, param, obj.curr);
}
var param = $.extend({}, params, json);
opt.mounted(opt, param, obj.curr);
}
}
});
});
});
} else if (res.errcode == 110001) {
layui.laytpl(getTpl).render([], function (html) {
$("#listData").empty().html(html);
});
}
});
return this;
},
handleBind: function (opt) {
//搜索
layui.form.on('submit(search)', function (data) {
IcController.getData(apis.goodsSearch, 'POST', data.field, function (res) {
......
......@@ -3,9 +3,7 @@
init: function () {
this.created(this).mounted(this).handleBind(this);
},
created(opt) {
created: function (opt) {
return this;
},
mounted: function (opt, params, curr) {
......@@ -23,13 +21,19 @@
} else if (data.value == '现货') {
val = 2;
}
var getTpl = deliveryHtml.innerHTML;
layui.laytpl(getTpl).render(val, function (html) {
$("#day").empty().html(html);
});
});
//天数同步数据
$(document).on('input propertychange', 'input[name="day"]', function () {
var val = $(this).val();
$("#daytext").val(val + '天');
});
//上传商品
......
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