mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
/*! tuban-wlhmyit 2014-12-26 */
|
|
!function(a){function b(a,b,c,d,e,f,g,h){if(!document.getElementById("__vczero_vczero_tip")){var i=document.createElement("div");i.style.position="fixed","number"==typeof a&&(i.style.top=a+"px"),"number"==typeof b&&(i.style.left=b+"px"),"number"==typeof c&&(i.style.right=c+"px"),"number"==typeof d&&(i.style.bottom=d+"px"),i.id="__vczero_vczero_tip",i.style.zIndex="100",i.style.height=f+"px",i.style.width=e+"px",i.style.backgroundColor="#000",i.style.opacity="0.7",i.style.color="#FFF",i.style.textAlign="center",i.style.fontSize="15px",i.style.lineHeight=f/h+"px",i.style.borderRadius="3px",i.innerHTML=g,document.getElementsByTagName("body")[0].appendChild(i)}}function c(){var a=document.getElementById("__vczero_vczero_tip");a&&document.querySelector("body").removeChild(a)}var d={setTip:b,hideTip:c};a.Tip=d}(window);var app=angular.module("app",["ui.router","ngCookies"]),SERVER_BASE_URL="http://123.57.39.116:6547/";app.run(["$rootScope",function(a){a.appName="图班网",a.desc="基于位置的通讯录",a.author="鬼谣",a.email="wlhmyit@126.com"}]),app.constant("ServiceConfig",{wei_content:SERVER_BASE_URL+"wei/get",wei_zan:SERVER_BASE_URL+"wei/zan",wei_comment:SERVER_BASE_URL+"wei/comment",wei_create:SERVER_BASE_URL+"wei/create",user_get:SERVER_BASE_URL+"user/get",user_login:SERVER_BASE_URL+"user/login",user_register:SERVER_BASE_URL+"user/register",user_common:SERVER_BASE_URL+"user/getCommon",user_ben:SERVER_BASE_URL+"user/getBen",user_self:SERVER_BASE_URL+"user/getSelf",user_common_update:SERVER_BASE_URL+"user/updateCommon",user_ben_update:SERVER_BASE_URL+"user/updateBen",user_ben_get_name:SERVER_BASE_URL+"user/singleBen/name",user_common_get_nickname:SERVER_BASE_URL+"user/getCommon/name",user_ben_get_realname:SERVER_BASE_URL+"user/singleBen/name",wei_get_token_page:SERVER_BASE_URL+"wei/getByToken",wei_delete:SERVER_BASE_URL+"wei/delete",user_update_password:SERVER_BASE_URL+"user/updatePassword",article_get:SERVER_BASE_URL+"article/get",article_detail:SERVER_BASE_URL+"article/get/id",amap_url:"http://webapi.amap.com/maps?v=1.3&key=ad925c5003760094713775d64748d872&callback=init"}),app.config(["$httpProvider",function(a){a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.defaults.headers.put["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.defaults.transformRequest=[function(a){var b=[];for(var c in a)b.push(c+"="+a[c]);return b.join("&")}]}]),app.config(["$stateProvider","$urlRouterProvider",function(a,b){b.otherwise("/"),a.state("index",{url:"/",views:{"":{templateUrl:"views/index/index.html"},"header@index":{templateUrl:"views/header.html",controller:"HeaderController"},"footer@index":{templateUrl:"views/footer.html",controller:""},"weibo@index":{templateUrl:"views/index/weibo.html",controller:"WeiboController"},"article@index":{templateUrl:"views/index/article.html",controller:"ArticleController"},"post@index":{templateUrl:"views/index/post.html",controller:"PostWeiboController"}}}).state("login",{url:"/login",views:{"":{templateUrl:"views/login/login.html",controller:"LoginController"}}}).state("register",{url:"/register",views:{"":{templateUrl:"views/register/register.html",controller:"RegisterController"}}}).state("contacts",{url:"/contacts",views:{"":{templateUrl:"views/contacts/contacts.html",controller:""},"header@contacts":{templateUrl:"views/header.html",controller:"HeaderController"},"userinfo@contacts":{templateUrl:"views/contacts/userinfo.html",controller:"UserInfoController"},"map@contacts":{templateUrl:"views/contacts/map.html",controller:"MapController"},"search@contacts":{templateUrl:"views/contacts/search.html",controller:"SearchUserController"}}}).state("ucenter",{url:"/ucenter",views:{"":{templateUrl:"views/ucenter/ucenter.html",controller:""},"header@ucenter":{templateUrl:"views/header.html",controller:"HeaderController"},"userWeibo@ucenter":{templateUrl:"views/ucenter/weibo.html",controller:"UcWeiboController"},"userDetailInfo@ucenter":{templateUrl:"views/ucenter/user.html",controller:"UcUserController"},"footer@ucenter":{templateUrl:"views/footer.html",controller:""}}}).state("article",{url:"/article/:id",views:{"":{templateUrl:"views/article/article.html",controller:""},"header@article":{templateUrl:"views/header.html",controller:"HeaderController"},"article_content@article":{templateUrl:"views/article/article_content.html",controller:"ArticleDetailController"},"footer@article":{templateUrl:"views/footer.html",controller:""}}}).state("article_index",{url:"/article",views:{"":{templateUrl:"views/article/article.html",controller:""},"header@article_index":{templateUrl:"views/header.html",controller:"HeaderController"},"article_content@article_index":{templateUrl:"views/article/article_content.html",controller:"ArticleDetailController"},"footer@article_index":{templateUrl:"views/footer.html",controller:""}}})}]),app.service("SelfWeibo",["$http","ServiceConfig","Time",function(a,b,c){return{getData:function(d,e,f){var g="?token="+d+"&page="+e;a.get(b.wei_get_token_page+g).success(function(a){if(a.status){var b=a.items;for(i in b){b[i].time=c.formatTime(b[i].time);for(var d in b[i].comments)b[i].comments[d].time=c.formatTime(b[i].comments[d].time)}}f(a)}).error(function(){f({status:0})})}}}]),app.service("Time",function(){return{formatTime:function(a){var b=new Date(a);return b.getFullYear()+"-"+(parseInt(b.getMonth())+1)+"-"+b.getDate()+" "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()}}}),app.service("WeiboData",["$http","Time","ServiceConfig",function(a,b,c){return{getItems:function(d,e){a.get(c.wei_content+"?page="+d).success(function(a){var c=[];if(a.status){c=a.items;for(var d=0;d<c.length;d++){c[d].time=b.formatTime(c[d].time),c[d].isShowComDiv=!1;for(var f=c[d].comments,g=0;g<f.length;g++)c[d].comments[g].time=b.formatTime(c[d].comments[g].time)}c=c}e(c,a.pageSize)}).error(function(){e([],0)})}}}]),app.controller("ArticleDetailController",["$scope","$http","$location","ServiceConfig","Time",function(a,b,c,d,e){if("/article"===c.path()){var f="?_id=549c2c9a019ed08429e9fad8";b.get(d.article_detail+f).success(function(b){b.status&&(b.time=e.formatTime(b.time),a.article=b)})}if(2===c.path().split("article/").length){var g=c.path().split("article/")[1],f="?_id="+g;b.get(d.article_detail+f).success(function(b){b.status&&(b.time=e.formatTime(b.time),a.article=b)})}}]),app.controller("MapController",["$scope","$http","$cookieStore","ServiceConfig",function(a,b,c,d){$LAB.script(d.amap_url).wait(function(){var b=Math.random(1e11);AMap||location.reload(!1);var c=new AMap.Map("map",{resizeEnable:!0,zooms:[5,18]});c.setZoom(5),c.plugin(["AMap.ToolBar"],function(){c.addControl(new AMap.ToolBar)}),a.$emit("mapObject",{AMap:AMap,map:c}),a.$watch(b,function(){a.$emit("mapObject",{AMap:AMap,map:c,random:b})})})}]),app.controller("SearchUserController",["$scope","$http","$cookieStore","$timeout","ServiceConfig",function(a,b,c,d,e){function f(a,b){return(a||"").substr(0,b)}var g=null,h=null,i=c.get("user"),j=window.innerWidth;a.$on("mapObj",function(c,k){g=k.AMap,h=k.map,i&&"ben"===i.tag||b.get(e.user_common).success(function(b){if(b.status&&b.user.length){var c=b.user;a.realname="",a.tel="",a.job="",c.length?(a.avatar=c[0].avatar,a.nickname=f(c[0].nickname,11),a.jobAddress=f(c[0].address,11),a.hometown=f(c[0].hometown,11),a.sign=f(c[0].sign,11)):(a.avatar="img/pp.png",a.nickname="放羊的娃",a.jobAddress="浙江省 杭州市",a.hometown="安徽省 安庆市 望江县",a.sign="梦想还是要有的,万一实现了呢!");for(var e=0;e<c.length;e++)if(c[e].address_lnglat){var i=c[e],k=i.address_lnglat.split(","),l=new g.Marker({position:new g.LngLat(k[0],k[1])});l.setIcon("img/pos.png"),l.setMap(h),l.index=e,g.event.addListener(l,"click",function(){var b=c[this.index];a.$apply(function(){a.nickname=f(b.nickname,11),a.avatar=b.avatar,a.jobAddress=f(b.address,11),a.hometown=f(b.hometown,11),a.sign=f(b.sign,30)||"这家伙很懒,什么都没留下"})})}}else Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"地图上的点被谁偷去啦...",1),d(Tip.hideTip,3e3)}).error(function(){Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"服务器君挂了...",1),d(Tip.hideTip,3e3)}),i&&"ben"===i.tag&&b.get(e.user_ben+"?token="+i.token).success(function(b){if(b.status&&b.users.length){var c=b.users;c.length?(a.realname=f(c[0].realname,11)||"未知",a.tel=f(c[0].tel,11)||"未知",a.job=f(c[0].job,11)||"未知",a.avatar=c[0].avatar,11,a.nickname=f(c[0].nickname,11)||"未知",a.jobAddress=f(c[0].address,11)||"未知",a.hometown=f(c[0].hometown,11)||"未知",a.sign=f(c[0].sign,11)||"未知"):(a.realname="",a.tel="",a.job="",a.avatar="img/pp.png",a.nickname="放羊的娃",a.jobAddress="浙江省 杭州市",a.hometown="安徽省 安庆市 望江县",a.sign="梦想还是要有的,万一实现了呢!");for(var e=0;e<c.length;e++)if(c[e].address_lnglat){var i=c[e],k=i.address_lnglat.split(","),l=new g.Marker({position:new g.LngLat(k[0],k[1])});l.setIcon("img/pos.png"),l.setMap(h),l.index=e,g.event.addListener(l,"click",function(){var b=c[this.index];a.$apply(function(){a.nickname=f(b.nickname,11),a.realname=f(b.realname,11),a.tel=b.tel||"",a.job=f(b.job,11),a.avatar=b.avatar,a.jobAddress=f(b.address,11),a.hometown=f(b.hometown,11),a.sign=f(b.sign,30)||"这家伙很懒,什么都没留下"})})}}else Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"地图上的点被谁偷去啦...",1),d(Tip.hideTip,3e3)}).error(function(){Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"服务器君挂了...",1),d(Tip.hideTip,3e3)})}),a.goSearch=function(c){if(i&&"ben"===i.tag||b.get(e.user_common_get_nickname+"?nickname="+c).success(function(b){b.status?(a.avatar=b.avatar,a.nickname=f(b.nickname,11),a.jobAddress=f(b.address,11),a.hometown=f(b.hometown,11),a.sign=f(b.sign,30)||"这个家伙很懒,什么都没留下..."):(Tip.setTip(220,null,50,null,260,80,"没有查询到数据.....",1),d(Tip.hideTip,3e3))}),i&&"ben"===i.tag){var g=e.user_ben_get_realname+"?realname="+c+"&token="+i.token;b.get(g).success(function(b){b.status?(a.nickname=f(b.nickname,11),a.realname=f(b.realname,11),a.tel=b.tel||"",a.job=f(b.job,11),a.avatar=b.avatar,a.jobAddress=f(b.address,11),a.hometown=f(b.hometown,11),a.sign=f(b.sign,30)||"这家伙很懒,什么都没留下..."):(Tip.setTip(220,null,50,null,260,80,"没有查询到数据.....",1),d(Tip.hideTip,3e3))})}},a.enterSearch=function(b,c){(13===b.keyCode||32===b.which)&&a.goSearch(c)}}]),app.controller("UserInfoController",["$scope","$http","$timeout","$cookieStore","ServiceConfig",function(a,b,c,d,e){var f=null,g=null,h=window.innerWidth,i=d.get("user");a.$on("mapObj",function(a,b){f=b.AMap,g=b.map}),i?b.get(e.user_self+"?token="+i.token).success(function(b){a.user=b.status?b:{avatar:"img/avat.jpg"}}).error(function(){a.user={avatar:"img/avat.jpg"},Tip.setTip(250,(parseInt(h)-240)/2,null,null,260,80,"哎呀,服务君开小差去了....",1),c(Tip.hideTip,3e3)}):a.user={avatar:"img/avat.jpg"},a.mapHometown=function(){var b=new f.Marker({position:g.getCenter(),draggable:!0,map:g});b.setIcon("img/home.png"),f.event.addListener(b,"dragend",function(b){g.plugin(["AMap.Geocoder"],function(){var d=new f.Geocoder,e=b.lnglat;d.getAddress(e,function(b,d){if("complete"===b&&"OK"===d.info){var f=d.regeocode.formattedAddress;a.$apply(function(){a.user.hometown=f,a.user.hometown_lnglat=e})}else Tip.setTip(250,50,null,null,260,80,"地址解析失败..........",1),c(Tip.hideTip,3e3)})})})},a.mapAddress=function(){var b=new f.Marker({position:g.getCenter(),draggable:!0,map:g});b.setIcon("img/address.png"),f.event.addListener(b,"dragend",function(b){g.plugin(["AMap.Geocoder"],function(){var d=new f.Geocoder;address_lnglat=b.lnglat,d.getAddress(address_lnglat,function(b,d){if("complete"===b&&"OK"===d.info){var e=d.regeocode.formattedAddress;a.$apply(function(){a.user.address=e,a.user.address_lnglat=address_lnglat})}else Tip.setTip(250,50,null,null,260,80,"地址解析失败..........",1),c(Tip.hideTip,3e3)})})})},a.save=function(a){var d={token:a.token,nickname:a.nickname,realname:a.realname,tel:a.tel,hometown:a.hometown,job:a.job,address:a.address,sign:a.sign,hometown_lnglat:a.hometown_lnglat,address_lnglat:a.address_lnglat};"guest"===a.tag&&b.post(e.user_common_update,d).success(function(a){a.status?(Tip.setTip(250,50,null,null,260,80,"您好!你的资料保存成功",1),c(Tip.hideTip,3e3)):(Tip.setTip(250,50,null,null,260,80,"不好意思,你的资料保存失败",1),c(Tip.hideTip,3e3))}),"ben"===a.tag&&b.post(e.user_ben_update,d).success(function(a){a.status?(Tip.setTip(250,50,null,null,260,80,"您好!你的资料保存成功",1),c(Tip.hideTip,3e3)):(Tip.setTip(250,50,null,null,260,80,"不好意思,你的资料保存失败",1),c(Tip.hideTip,3e3))})},a.upload=function(){i&&i.token?(document.getElementById("uploadImg").click(),document.getElementById("selfToken").value=i.token):Util.alertForm("您好!请登录..........")}}]),app.controller("HeaderController",["$scope","$cookieStore",function(a,b){var c=b.get("user");a.isLogined=!1,c&&(a.isLogined=!0,a.username=c.realname||c.nickname||c.email),a.quit=function(){b.remove("user"),a.isLogined=!1,a.username=""}}]),app.controller("ArticleController",["$http","$scope","ServiceConfig",function(a,b,c){a.get(c.article_get).success(function(a){a.status&&(b.items=a.items)})}]),app.controller("PostWeiboController",["$http","$scope","$cookieStore","$timeout","ServiceConfig","Time",function(a,b,c,d,e,f){b.isShowPanel=!1,b.show=function(){b.isShowPanel=b.isShowPanel?!1:!0},b.submit=function(g,h,i,j){var g=g,k=c.get("user"),l=[h,i,j],m=[];if(!g)return Tip.setTip(200,350,null,null,260,80,"哥哥,无字天书是不能发表的哦~~",1),void d(Tip.hideTip,2300);if(!k)return Tip.setTip(200,350,null,null,260,80,"发表微博,起码登录一下吧~~",1),void d(Tip.hideTip,2300);for(var n in l)l[n]&&m.push(l[n]);var o={token:k.token,content:g,tags:m.join(",")};a.post(e.wei_create,o).success(function(a){a.status?(a.time=f.formatTime(a.time),b.$emit("weiboDataUp",a),b.isShowPanel=!1,Tip.setTip(200,350,null,null,260,80,"您发表的内容实在是太精彩了!",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,260,80,"服务君,老大喊你回来干活~",1),d(Tip.hideTip,2300))}).error(function(){Tip.setTip(200,350,null,null,260,80,"服务君该嗑药了,都出错了~",1),d(Tip.hideTip,2300)})}}]),app.controller("WeiboController",["$http","$scope","$cookieStore","$timeout","ServiceConfig","Time","WeiboData",function(a,b,c,d,e,f,g){g.getItems(0,function(a,c){a.length?(b.currentPage=0,b.pageSize=c,b.items=a):(Tip.setTip(100,200,null,null,260,80,"服务君感冒了,请刷新页面重试...",1),d(Tip.hideTip,3e3))}),b.$on("weiboDataDown",function(a,c){b.items.unshift(c);var d=b.items.length;d>10&&(b.items=b.items.slice(0,10))}),b.zan=function(b){var e=c.get("user");if(e){var f="token="+e.token,g="&id="+b._id,h="http://127.0.0.1:3000/wei/zan?"+f+g;a.get(h).success(function(a){a.status?a.zans?(b.zans=a.zans,Tip.setTip(200,350,null,null,240,80,"谢谢您的打赏~~~~",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"伦家怎么好意思再收呢!",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"不好意思,打赏失败了...",1),d(Tip.hideTip,2300))}).error(function(){Tip.setTip(200,350,null,null,260,80,"服务君感冒了,请刷新页面重试...",1),d(Tip.hideTip,2300)})}else Tip.setTip(200,350,null,null,240,80,"只有登录了,才能点赞哦~~~",1),d(Tip.hideTip,2300)},b.comment=function(a){a.isShowComDiv=a.isShowComDiv?!1:!0},b.addComment=function(b,e){var g=c.get("user");if(g&&e){var h="token="+g.token,i="&comment="+e,j="&id="+b._id,k="http://127.0.0.1:3000/wei/comment?"+h+i+j;a.get(k).success(function(a){a.status?(b.comments.push({nickname:a.nickname,email:a.email,comment:a.comment,avatar:a.avatar,time:f.formatTime(a.time)}),document.getElementById("_commentContent").value="",Tip.setTip(200,350,null,null,240,80,"您的评论实在是精彩了~~",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"不好意思,评论失败了...",1),d(Tip.hideTip,2300))}).error(function(){Tip.setTip(200,350,null,null,240,80,"服务君感冒了,评论失败了...",1),d(Tip.hideTip,2300)})}else Tip.setTip(200,350,null,null,280,80,"请登录,评论的内容不能为空~~",1),d(Tip.hideTip,2300)},b.prePage=function(){b.currentPage=b.currentPage-1,b.currentPage>=0?g.getItems(10*b.currentPage,function(a){a.length?b.items=a:(Tip.setTip(200,350,null,null,260,80,"君别着急,现在都查不出数据了...",1),d(Tip.hideTip,2300))}):(b.currentPage=b.currentPage+1,Tip.setTip(200,350,null,null,260,80,"君别翻旧账了,这是第一页啦~~~",1),d(Tip.hideTip,2300))},b.nextPage=function(){b.currentPage=b.currentPage+1,b.currentPage<b.pageSize?g.getItems(10*b.currentPage,function(a){a.length?b.items=a:(Tip.setTip(200,350,null,null,260,80,"君别着急,现在都查不出数据了...",1),d(Tip.hideTip,2300))}):(b.currentPage=b.currentPage-1,Tip.setTip(200,350,null,null,290,80,"底都被你掏空了,这是最后一页啦~~~",1),d(Tip.hideTip,2300))},b.safeApply=function(a){var b=this.$root.$$phase;"$apply"==b||"$digest"==b?a&&"function"==typeof a&&a():this.$apply(a)}}]),app.controller("LoginController",["$scope","$http","$cookieStore","$timeout","$location","ServiceConfig",function(a,b,c,d,e,f){a.login=function(){var g=a.email,h=a.password,i={email:g,password:h};b.post(f.user_login,i).success(function(a){if(a.status)c.put("user",a),e.path("/");else{var b=window.innerWidth;Tip.setTip(250,(parseInt(b)-240)/2,null,null,260,80,"难倒你忘记了密码...",1),d(Tip.hideTip,3e3)}}).error(function(){var a=window.innerWidth;Tip.setTip(250,(parseInt(a)-240)/2,null,null,260,80,"服务君该回家养老了...",1),d(Tip.hideTip,3e3)})},a.goRegister=function(){e.path("/register")}}]),app.controller("RegisterController",["$scope","$http","$cookieStore","$timeout","$location","ServiceConfig",function(a,b,c,d,e,f){a.register=function(){var g=a.email,h=a.password,i=a.re_password,j=window.innerWidth;if(!g||!h||!i)return Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"邮箱、密码不能为空....",1),void d(Tip.hideTip,3e3);if(h!==i)return Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"两次输入密码不一致呀~~",1),void d(Tip.hideTip,3e3);var k={email:g,password:h,repeatPassword:i};b.post(f.user_register,k).success(function(a){a.status?(c.put("user",a),e.path("/")):(Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"注册失败,请重试~~",1),d(Tip.hideTip,3e3))}).error(function(){Tip.setTip(250,(parseInt(j)-240)/2,null,null,260,80,"服务君感冒了,紧急修复中...",1),d(Tip.hideTip,3e3)})},a.goLogin=function(){e.path("/login")}}]),app.controller("RootController",["$scope",function(a){a.$on("weiboDataUp",function(b,c){a.$broadcast("weiboDataDown",c)}),a.$on("mapObject",function(b,c){a.$broadcast("mapObj",c)})}]),app.controller("UcUserController",["$http","$cookieStore","$scope","$timeout","ServiceConfig",function(a,b,c,d,e){var f=b.get("user");f&&(c.user=f,c.changePassword=function(b){if(b){var c=b.oldPassword,g=b.newPassword,h=b.rePassword;if(g===h&&g&&h&&c){var i={token:f.token,oldPassword:c,newPassword:g,rePassword:h};a.post(e.user_update_password,i).success(function(a){a.status?(Tip.setTip(250,null,150,null,260,80,"更改密码成功...",1),d(Tip.hideTip,3e3)):(Tip.setTip(250,null,150,null,260,80,"更改密码失败...",1),d(Tip.hideTip,3e3))})}else Tip.setTip(250,null,150,null,260,80,"密码不一致或者没有输入密码",1),d(Tip.hideTip,3e3)}else Tip.setTip(250,null,150,null,260,80,"信息不能为空...",1),d(Tip.hideTip,3e3)})}]),app.controller("UcWeiboController",["$scope","$http","$cookieStore","$timeout","ServiceConfig","Time","SelfWeibo",function(a,b,c,d,e,f,g){var h=c.get("user"),i=window.innerWidth;if(!h)return Tip.setTip(250,(parseInt(i)-240)/2,null,null,260,80,"请先登录您的账号~~~~",1),void d(Tip.hideTip,3e3);var j=("?token="+h.token+"&page=0",0);g.getData(h.token,0,function(b){b.status&&(a.pages=b.pageSize,a.items=b.items)}),a.deleteWeibo=function(c){var f=a.items[c]._id,g={token:h.token,_id:f};b.post(e.wei_delete,g).success(function(b){b.status?(a.items=a.items.slice(1),Tip.setTip(250,(parseInt(i)-240)/2,null,null,260,80,"删除一条微博成功...",1),d(Tip.hideTip,3e3)):(Tip.setTip(250,(parseInt(i)-240)/2,null,null,260,80,"删除一条微博失败...",1),d(Tip.hideTip,3e3))})},a.prePage=function(){j-=1,j>=0?g.getData(h.token,j,function(b){b.status&&(a.items=b.items)}):(j=0,Tip.setTip(250,(parseInt(i)-240)/2,null,null,260,80,"已经是第一页...",1),d(Tip.hideTip,3e3))},a.nextPage=function(){j+=1,j<a.pages?g.getData(h.token,j,function(b){b.status&&(a.items=b.items)}):(j=a.pages-1,Tip.setTip(250,(parseInt(i)-240)/2,null,null,260,80,"已经是最后一页...",1),d(Tip.hideTip,3e3))}}]); |