1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- function getList(page){
- var data = $("#saerchFrm").serializeJSON();
- data['page'] = page || 1;
- data['size'] = 20;
- $("#list, #page").empty();
- ajax(apiUrl+"forecast/list",data,function(res){
- if(res.code == 1){
- if(res.data.length > 0){
- $("#list").html($.Template7.renderTpl("tempaltelist",res.data));
- var newpage = new createPage(res['total'],data['page'],data['size'],3);
- $("#page").html(newpage.pageHtml);
- $(".table").hoverTable(true);
- }else
- $("#list").info("暂无信息。");
- }else
- $("#list").info(res.msg);
- });
- }
- pageGo = getList;
- function updateStatus(obj, id){
- var status = $(obj).data("status");
- ajax(apiUrl+"forecast/frame",{"forecastId": id,"onFrame": status},function(res){
- if(res.code == 1){
- $(obj).text(status.decode(0,'上架','-1','下架'));
- $(obj).data("status",status == -1 ? 0 : -1);
- }
- });
- }
- function getVote(){
- ajax(apiUrl+"forecast/voteList",{"id":$.getParam("id")},function(res){
- if(res.code == 1){
- $(".mainContent").html($.Template7.renderTpl("tempalteVote",res.data));
- }else{
- alert(res.msg);
- }
- });
- }
- function getDetail(){
- ajax(apiUrl+"forecast/detail",{"forecastId":$.getParam("id")},function(res){
- if(res.code == 1){
- $(".mainContent").html($.Template7.renderTpl("tempalteDetail",res.data));
- }else{
- alert(res.msg);
- }
- });
- }
|