mycollect.js 4.1 KB

1
  1. require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/trends/mycollect"],{1731:function(t,e,a){"use strict";a.r(e);var n=a("52d3"),i=a.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(o);e["default"]=i.a},"2c73":function(t,e,a){"use strict";(function(t,e){var n=a("4ea4");a("11d3"),a("5c17");n(a("66fd"));var i=n(a("47e0"));t.__webpack_require_UNI_MP_PLUGIN__=a,e(i.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},"47e0":function(t,e,a){"use strict";a.r(e);var n=a("c0c9"),i=a("1731");for(var o in i)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(o);a("51fc");var r=a("f0c5"),c=Object(r["a"])(i["default"],n["b"],n["c"],!1,null,"55037341",null,!1,n["a"],void 0);e["default"]=c.exports},"51fc":function(t,e,a){"use strict";var n=a("f523"),i=a.n(n);i.a},"52d3":function(t,e,a){"use strict";(function(t){var n=a("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a("55e8"),o=a("1214"),r=n(a("1efe")),c=r.default.baseUrl,s={components:{noData:function(){Promise.all([a.e("common/vendor"),a.e("components/nodata/nodata")]).then(function(){return resolve(a("2bf6"))}.bind(null,a)).catch(a.oe)}},data:function(){return{addimg:a("c9bb"),tablist:[{tit:"我的动态",val:1},{tit:"我的点赞",val:2},{tit:"我的收藏",val:3}],pageSize:10,pageNum:1,tabidx:1,reachflag:!0,wtdt:"",baseUrl:"",list:""}},onUnload:function(){t.$off("refreshdatalis")},onLoad:function(){var e=this;t.$on("refreshdatalis",(function(a){t.$emit("refreshdatalist"),e.reachflag=!0,e.pageNum=1,e.list=[],e.getDataFn()})),this.baseUrl=c,this.getDataFn()},onReachBottom:function(){this.reachflag&&(this.pageNum++,this.getDataFn())},methods:{getCheck:function(t){this.tabidx=t},judgeDate:function(t){var e=new Date;e.setDate(e.getDate()-1);var a=this.ge_time_format(e),n=new Date;n.setTime(n.getTime());var i=this.ge_time_format(n);if(t.split(" ")[0]==i){var o={type:1,tit:"今天"};return o}if(t.split(" ")[0]==a){o={type:1,tit:"昨天"};return o}var r=this.ge_format(t),c=r.split("-");o={type:2,tit:c};return o},ge_time_format:function(t){if(t)var e=new Date(t);else e=new Date;var a=e.getFullYear(),n=e.getMonth()+1,i=e.getDate();n<10&&(n="0"+n),i<10&&(i="0"+i);var o=a+"-"+n+"-"+i;return o},ge_format:function(t){if(t)var e=new Date(t);else e=new Date;var a=e.getFullYear(),n=e.getMonth()+1,i=e.getDate();i<10&&(i="0"+i);var o=a+"-"+n+"-"+i;return o},getphotoFn:function(){var e=this;t.chooseImage({count:9,success:function(a){var n=a.tempFilePaths;if(n.length>9)t.showToast({title:"最多上传9张图片",icon:"none",duration:2e3});else{var i=a.tempFilePaths.length;(0,o.uploadmore)("/common/upload",n,0,0,0,i,[],(function(t){e.$tab.navigateTo("/mine/pages/trends/addtrend?data="+encodeURIComponent(JSON.stringify(t)))}))}}})},getDetail:function(t){this.$tab.navigateTo("/mine/pages/trends/trenddetail?id="+t)},getPreview:function(e,a){var n=this,i=[];e.forEach((function(t){var e=n.baseUrl+t;i.push(e)})),t.previewImage({urls:i,current:a,success:function(t){},fail:function(t){}})},getDataFn:function(){var t=this,e={pageSize:this.pageSize,pageNum:this.pageNum};(0,i.getCollecttMy)(e).then((function(e){if(200==e.code){if(e.rows.length<t.pageSize)t.reachflag=!1,t.wtdt="到底了~";else{var a=parseInt(e.rows.length)+parseInt(t.pageSize)*parseInt(t.pageNum-1);a<e.total?(t.reachflag=!0,t.wtdt="上拉加载更多"):(t.reachflag=!1,t.wtdt="到底了~")}var n=e.rows||[];n.length&&n.forEach((function(e){e.createTime?e.time=t.judgeDate(e.createTime):e.time="",e.image?e.photo=e.image.split(","):e.photo=[]})),1==t.pageNum?t.list=n:t.list=t.list.concat(n)}else t.$toast(e.msg)}))}}};e.default=s}).call(this,a("543d")["default"])},c0c9:function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,a=(t._self._c,t.list.length),n=a?t.__map(t.list,(function(e,a){var n=t.__get_orig(e),i=e.photo.length;return{$orig:n,g1:i}})):null;t.$mp.data=Object.assign({},{$root:{g0:a,l0:n}})},i=[]},f523:function(t,e,a){}},[["2c73","common/runtime","common/vendor","mine/common/vendor"]]]);