var s = 2;//几秒刷新
setInterval(f5,s*1000);
//定时器刷新
function f5() {
$.post("/api/com/get_config?",{field:'addr2'},function(data,status){
// alert("Data: " + data.data + "nStatus: " + status);
// console.log(data);
Backend.api.sidebar({
'article2': 2,
'example/colorbadge': data.code
});
});
}
添加的代码示例图
或者
var s = 15;//几秒刷新
setInterval(f5,s*1000);
//定时器刷新
function f5() {
$.post("/xiaoheQQ496631085.php/com/get_sidebar?",{field:'addr2'},function(data,status){
Backend.api.sidebar(JSON.parse(data));
});
}
public function get_sidebar()
{
$data['seas'] = $this->获取公海总数量();//公海QQ496631085
$data['customercontract'] = $this->获取项目即将到期数量();
$data['applycustomer'] = $this->申请领取客户();
return json_encode($data);
}