//公众号: 声色视觉
//webSite: www.softboyo.cn
//date:2022-08-09
$(function(){GetDB(1,$(".d-inline-block").val())});$(".d-inline-block").change(function(a){GetDB(1,$(".d-inline-block").val())});function GetDB(a,b){GetServiceData("OnLineGoods/"+a+"/"+b+"/"+localStorage.getItem("caketoken"),function(a){a=a.result[0];if(null!=a){var d=a["items[1]"][0];a=a["items[0]"];Fill(a);$(".pagination").html("");a=Math.ceil(d/$(".d-inline-block").val());for(var b=0;b<a;b++)$(".pagination").append('\x3cli class\x3d"page-item"\x3e\x3ca class\x3d"page-link" href\x3d"javascript:;" onclick\x3d"Turnpage(this)"\x3e'+parseInt(b+1)+"\x3c/a\x3e\x3c/li\x3e");$("#dataTable_info").text("\u5171\u6709\u5546\u54c1\uff1a"+d+" \u9879")}else self.location="login.html"})}function Fill(a){var b=$("#dt");b.html("");for(key in a)b.append(String.format('\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"edit.html?pid\x3d{4}"\x3e{0}\x3c/a\x3e\x3c/td\x3e\x3ctd\x3e{1}\x3c/td\x3e\x3ctd\x3e{2}\x3c/td\x3e\x3ctd\x3e{3}\x3c/td\x3e\x3c/tr\x3e',a[key].product,a[key].model,"\uffe5"+a[key].price.toFixed(2),$.formatDT(a[key].putdate,0),a[key].id))}function Turnpage(a){a=$(a).text();GetDB(a,$(".d-inline-block").val())}$("#quit").click(function(a){localStorage.removeItem("caketoken")});$(".btn-primary").click(function(a){a=$("input").filter(".bg-light");for(var b="",c=0;c<a.length&&(b=a[c].value,""==b);c++);GetServiceData("FindGoods/"+b+"/"+localStorage.getItem("caketoken"),function(a){a=a.result[0];if(0<a.id.length){var c=$("#dt");c.html("");for(key in a.id)c.append(String.format('\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"edit.html?pid\x3d{4}"\x3e{0}\x3c/a\x3e\x3c/td\x3e\x3ctd\x3e{1}\x3c/td\x3e\x3ctd\x3e{2}\x3c/td\x3e\x3ctd\x3e{3}\x3c/td\x3e\x3c/tr\x3e',a.product[key],a.model[key],"\uffe5"+a.price[key].toFixed(2),$.formatDT(a.Putdate[key],0),a.id[key]))}else msgbox("\u672a\u627e\u5230\uff1a"+b)})});