Commit a283ddc2 by 梁建民

js

parent 1a7c6622
......@@ -4,7 +4,9 @@
this.mounted(this).handleBind(this);
},
getData: function (url, type, param, callback) {
var index = layer.load(1);
var index = layer.load(1,{
offset: ['50%', "50%"], shade: false
})
var platform = {
pf: 20,
......
!function () {
window.GoodManage = {
init: function () {
this.created(this).mounted(this).handleBind(this);
},
created(opt) {
IcController.getData(apis.goodsInfo,'POST',null,function (res) {
console.log(res)
})
return this;
},
mounted: function (opt) {
return this;
},
handleBind: function (opt) {
return this;
},
}, $(function () {
GoodManage.init();
})
window.GoodManage = {
init: function () {
this.created(this).mounted(this, {offset: 1, p: 1}, 1).handleBind(this);
},
created(opt) {
return this;
},
mounted: function (opt, params, curr) {
//日期控件初始化
layui.laydate.render({
elem: '#start_time',
theme: '#0D84D1'
});
layui.laydate.render({
elem: '#end_time',
theme: '#0D84D1'
});
//商品列表初始化
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: 1,
curr: curr,
jump: function (obj, first) {
if (!first) {
//分页回调调用
var json = {
p: obj.curr
}
var param = $.extend({}, params, json);
opt.mounted(opt, param, obj.curr);
}
}
});
});
});
return this;
},
handleBind: function (opt) {
return this;
},
}, $(function () {
GoodManage.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