index.js 8.1 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/trends/index"],{"0613":function(t,e,i){"use strict";i.r(e);var n=i("e893"),a=i("801f");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("403c");var s=i("f0c5"),r=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"ce5f0f50",null,!1,n["a"],void 0);e["default"]=r.exports},"403c":function(t,e,i){"use strict";var n=i("79fd"),a=i.n(n);a.a},"79fd":function(t,e,i){},"801f":function(t,e,i){"use strict";i.r(e);var n=i("ea5b"),a=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},aa10:function(t,e,i){"use strict";(function(t,e){var n=i("4ea4");i("11d3"),i("5c17");n(i("66fd"));var a=n(i("0613"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(a.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},e893:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={uniNavBar:function(){return i.e("uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar").then(i.bind(null,"8d91"))}},a=function(){var t=this,e=t.$createElement,i=(t._self._c,t.list.length),n=i?t.__map(t.list,(function(e,i){var n=t.__get_orig(e),a=e.photo?t.__map(e.photo,(function(i,n){var a=t.__get_orig(i),o=e.photo.length;return{$orig:a,g1:o}})):null,o=e.prisedlist.length,s=o?t.__map(e.prisedlist,(function(i,n){var a=t.__get_orig(i),o=e.prisedlist.length;return{$orig:a,g3:o}})):null,r=e.prisedlist.length&&e.commentlist.length,c=e.commentlist.length;return{$orig:n,l0:a,g2:o,l1:s,g4:r,g5:c}})):null;t.$mp.data=Object.assign({},{$root:{g0:i,l2:n}})},o=[]},ea5b:function(t,e,i){"use strict";(function(t){var n=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n(i("1efe")),o=(i("1214"),i("55e8")),s=i("1be3"),r=a.default.baseUrl,c={components:{noData:function(){Promise.all([i.e("common/vendor"),i.e("components/nodata/nodata")]).then(function(){return resolve(i("2bf6"))}.bind(null,i)).catch(i.oe)},footers:function(){i.e("components/footer/footer").then(function(){return resolve(i("3939"))}.bind(null,i)).catch(i.oe)}},data:function(){return{footlist:[{module:"home",title:"首页",icon_checked:i("9d9c"),icon_nochecked:i("4dd2")},{module:"work",title:"课表",icon_checked:i("ac89"),icon_nochecked:i("6c1c"),limit:"course:table:list"},{module:"trends",title:"动态",icon_checked:i("2f3c"),icon_nochecked:i("7724"),limit:"xiaoYuan:notice:list"},{module:"mine",title:"我的",icon_checked:i("1a1e"),icon_nochecked:i("b7a3")}],footerindex:"trends",isfootflag:!0,color_checked:"161616",color_nochecked:"666666",more:i("dba0"),addimg:i("fff8"),delimg:i("a4d1"),windowHeight:0,wtopimg:i("6e0a"),tapline:i("7021"),tricona:i("bcdd"),triconb:i("dd08"),triconc:i("6ff8"),tricond:i("5dac"),tricone:i("0a3c"),triconf:i("a493"),tricong:i("25eb"),backgroundColor:"#ffffff",navborder:!1,leftwith:"200",pageSize:10,pageNum:1,reachflag:!0,wtdt:"",list:[],file:[],baseUrl:"",zhtype:6,placeholder:"评论:",bottom:0,noticeId:"",comment:"",comflag:!1,autoHeight:!0,confirmBar:!1,adrfixed:!0,adjustpos:!1,curspac:"0",userId:this.$store.state.user.userId,name:this.$store.state.user.name,selectidx:0,huiflag:!1,huserid:"",husername:"",avatarimg:i("bf2b")}},computed:{avatar:function(){return this.$store.state.user.avatar}},onUnload:function(){t.$off("refreshdatalist")},onShow:function(){var e=this;t.onKeyboardHeightChange((function(i){var n=t.getSystemInfoSync(),a=i.height-(n.screenHeight-n.windowHeight);e.bottom="".concat(a>0?a:0),0==e.bottom&&(e.comflag=!1)}))},onHide:function(){t.offKeyboardHeightChange()},onPullDownRefresh:function(){this.reachflag=!0,this.pageNum=1,this.list=[],this.getDataFn(),setTimeout((function(){t.stopPullDownRefresh()}),1e3)},onPageScroll:function(t){this.comflag=!1},onLoad:function(){var e=this;t.$on("refreshdatalist",(function(t){e.reachflag=!0,e.pageNum=1,e.list=[],e.getDataFn()})),this.baseUrl=r,this.getDataFn()},mounted:function(){var e=t.getSystemInfoSync();this.windowHeight=Number(e.windowHeight)},onReachBottom:function(){this.reachflag&&(this.pageNum++,this.getDataFn())},onShareAppMessage:function(t){if(this.comflag=!1,"button"===t.from){var e=t.target.dataset,i={title:e.tit||"智能校管家",path:"/mine/pages/trends/trenddetail?type=share&id="+e.id};return e.img&&(i.imageUrl=this.baseUrl+e.img),i}return{title:"智能校管家",path:"/pages/trends/index"}},onShareTimeline:function(t){console.log(t,888)},methods:{checkPermi:s.checkPermi,checkRole:s.checkRole,getShare:function(){},refreshdataFn:function(){this.reachflag=!0,this.pageNum=1,this.list=[],this.getDataFn()},getDetail:function(t){this.comflag=!1,this.$tab.navigateTo("/mine/pages/trends/trenddetail?id="+t)},getPreview:function(e,i){var n=this;this.comflag=!1;var a=[];e.forEach((function(t){var e=n.baseUrl+t;a.push(e)})),t.previewImage({urls:a,current:i,success:function(t){},fail:function(t){console.log(t.errMsg)}})},kaType:function(t,e){var i=[];return Object.keys(e).some((function(n){if(e[n].userId==""+t)return i.push(e[n].id),!0})),i.join("")},getMyTrend:function(){this.$tab.navigateTo("/mine/pages/trends/mytrends")},getAdd:function(){this.$tab.navigateTo("/mine/pages/trends/addtrend?from=index")},getComflag:function(){this.comflag=!1},btns:function(){},getPin:function(t,e){t==this.noticeId&&this.comflag?this.comflag=!1:(this.placeholder="评论:",this.comflag=!0,this.huiflag=!1,this.selectidx=e,this.noticeId=t)},getComFn:function(t,e,i){var n=this;this.comflag=!1,e.userId==this.userId?this.$modal.confirm("确定删除该条评论").then((function(){n.getZan(t,e.id,i,1)})):(this.placeholder="回复"+e.name,this.comflag=!0,this.selectidx=i,this.noticeId=t,this.huiflag=!0,this.huserid=e.userId,this.husername=e.name)},getSubmit:function(){var t=this,e={text:this.comment,userId:this.userId,name:this.name};this.avatar&&(e.avatar=this.avatar),this.huiflag&&(e.huserid=this.huserid,e.husername=this.husername);var i={noticeId:this.noticeId,updateType:1,comment:JSON.stringify(e)};(0,o.getNoticeUpt)(i).then((function(e){200==e.code?(t.comment="",t.comflag=!1,t.huiflag=!1,t.getNoticeDetail(t.noticeId)):t.$toast(e.msg)}))},getZan:function(t,e,i,n){var a=this;this.comflag=!1,this.selectidx=i;var s={type:1,userId:this.userId,name:this.name},r={noticeId:t,updateType:n};2==n?r.prised=JSON.stringify(s):3==n?r.collect=JSON.stringify(s):1==n&&(r.comment=JSON.stringify(s)),e&&(r.deleteId=e),(0,o.getNoticeUpt)(r).then((function(i){200==i.code?(1==n&&e?a.$toast("删除评论成功"):2==n?e?a.$toast("取消点赞"):a.$toast("点赞成功"):3==n&&(e?a.$toast("取消收藏"):a.$toast("收藏成功")),a.getNoticeDetail(t)):a.$toast(i.msg)}))},getNoticeDetail:function(t){var e=this,i=this.selectidx;(0,o.getNoticeDetail)(t).then((function(t){if(200==t.code){var n=t.data;if(t.data.image?n.photo=t.data.image.split(","):n.photo=[],n.prised){var a=JSON.parse(n.prised);n.prisedId=e.kaType(e.userId,a),n.prisedlist=JSON.parse(n.prised)}else n.prisedlist=[];if(n.collect){var o=JSON.parse(n.collect);n.collectId=e.kaType(e.userId,o)}n.comment?n.commentlist=JSON.parse(n.comment):n.commentlist=[];var s=JSON.parse(JSON.stringify(e.list));s[i]=JSON.parse(JSON.stringify(n)),e.list=s}}))},getDataFn:function(){var t=this,e={pageSize:this.pageSize,pageNum:this.pageNum,noticeType:1},i=this.$store.state.user.choseroles;"school"!=i&&(e["params[role]"]=i),(0,o.getNoticeList)(e).then((function(e){if(200==e.code){if(e.rows.length<t.pageSize)t.reachflag=!1,t.wtdt="到底了~";else{var i=parseInt(e.rows.length)+parseInt(t.pageSize)*parseInt(t.pageNum-1);i<e.total?(t.reachflag=!0,t.wtdt="上拉加载更多"):(t.reachflag=!1,t.wtdt="到底了~")}var n=e.rows||[];n.length&&n.forEach((function(e){if(e.image?e.photo=e.image.split(","):e.photo=[],e.prised){var i=JSON.parse(e.prised);e.prisedId=t.kaType(t.userId,i),e.prisedlist=JSON.parse(e.prised)}else e.prisedlist=[];if(e.collect){var n=JSON.parse(e.collect);e.collectId=t.kaType(t.userId,n)}e.comment?e.commentlist=JSON.parse(e.comment):e.commentlist=[]})),1==t.pageNum?t.list=n:t.list=t.list.concat(n)}else t.$toast(e.msg)}))}}};e.default=c}).call(this,i("543d")["default"])}},[["aa10","common/runtime","common/vendor"]]]);