You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
16 KiB
2 lines
16 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-11d3d696"],{"07a8":function(t,e,n){t.exports=n.p+"img/praise.981f2823.svg"},"0b96":function(t,e,n){t.exports=n.p+"img/bear.d8f350ed.svg"},"1da1":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n("d3b7");function r(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(l){return void n(l)}a.done?e(c):Promise.resolve(c).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var s=t.apply(e,n);function a(t){r(s,o,i,a,c,"next",t)}function c(t){r(s,o,i,a,c,"throw",t)}a(void 0)}))}}},"2ab9":function(t,e,n){"use strict";var r=n("cff4"),o=n.n(r);o.a},5020:function(t,e,n){},"74ca":function(t,e,n){"use strict";var r=n("5020"),o=n.n(r);o.a},"7d22":function(t,e,n){t.exports=n.p+"img/refresh.072e417a.svg"},"8d33":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wrapper",staticClass:"wrapper"},[n("div",{staticClass:"content"},[t._t("default")],2)])},o=[],i=(n("a9e3"),n("f40f")),s={name:"Scroll",props:{probeType:{type:Number,default:0},pullUpLoad:{type:Boolean,default:!1},pullDownLoad:{type:Boolean,default:!1}},data:function(){return{scroll:null}},mounted:function(){var t=this;this.$nextTick((function(){t.scroll=new i["a"](t.$refs.wrapper,{click:!0,probeType:t.probeType,pullUpLoad:{threshold:80,stop:80},useTransition:!1,pullDownRefresh:{threshold:40,stop:30},disableMouse:!1,disableTouch:!1}),t.scroll.on("scroll",(function(e){t.$emit("scrollw",e)})),t.scroll.on("pullingUp",(function(){t.$emit("pullingUp")})),t.scroll.on("pullingDown",(function(){t.$emit("pullingDown")})),t.scroll.scrollTo(0,0)}))},methods:{scrollTo:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;this.scroll&&this.scroll.scrollTo(t,e,n)},finishPullUp:function(){this.refresh(),this.scroll&&this.scroll.finishPullUp()},finishPullDown:function(){this.refresh(),this.scroll&&this.scroll.finishPullDown()},refresh:function(){this.scroll&&this.scroll.refresh()},getScrollY:function(){return this.scroll?this.scroll.y:0}}},a=s,c=n("2877"),l=Object(c["a"])(a,r,o,!1,null,"62c7f78a",null);e["a"]=l.exports},"96cf":function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(S){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),s=new C(r||[]);return i._invoke=L(t,n,s),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(S){return{type:"throw",arg:S}}}t.wrap=l;var f="suspendedStart",h="suspendedYield",p="executing",m="completed",d={};function v(){}function g(){}function w(){}var y={};y[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(T([])));x&&x!==n&&r.call(x,i)&&(y=x);var $=w.prototype=v.prototype=Object.create(y);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,s,a){var c=u(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"===typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var o;function i(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}this._invoke=i}function L(t,e,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw i;return I()}n.method=o,n.arg=i;while(1){var s=n.delegate;if(s){var a=E(s,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=u(t,e,n);if("normal"===c.type){if(r=n.done?m:h,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=m,n.method="throw",n.arg=c.arg)}}}function E(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=u(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(t){if(t){var n=t[i];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function n(){while(++o<t.length)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}return{next:I}}function I(){return{value:e,done:!0}}return g.prototype=$.constructor=w,w.constructor=g,g.displayName=c(w,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,a,"GeneratorFunction")),t.prototype=Object.create($),t},t.awrap=function(t){return{__await:t}},_(k.prototype),k.prototype[s]=function(){return this},t.AsyncIterator=k,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var s=new k(l(e,n,r,o),i);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_($),c($,a,"Generator"),$[i]=function(){return this},$.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return a.type="throw",a.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=r}catch(o){Function("r","regeneratorRuntime = r")(r)}},"9f8f":function(t,e,n){},cf54:function(t,e,n){"use strict";var r=n("9f8f"),o=n.n(r);o.a},cff4:function(t,e,n){},e9f0:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.loginexit?r("div",{staticClass:"home"},[r("NavBar",{staticClass:"nav-bar"},[r("img",{attrs:{img:"~assets/img/moment/bear.svg"}}),r("div",{attrs:{slot:"left"},slot:"left"},[r("img",{attrs:{src:n("0b96"),width:"40px",height:"40px"}})]),r("div",{attrs:{slot:"center"},slot:"center"},[t._v("酒友乡")]),r("div",{attrs:{slot:"right"},on:{click:t.createmoment},slot:"right"},[r("i",{staticClass:"el-icon-plus"})])]),r("Scroll",{ref:"scroll",staticClass:"content",attrs:{"pull-up-load":!0,"probe-type":3},on:{pullingUp:t.loadMore,pullingDown:t.pullingDown}},[r("div",{directives:[{name:"show",rawName:"v-show",value:t.pullingdown,expression:"pullingdown"}],staticClass:"pulldown"},[r("img",{attrs:{src:n("7d22"),width:"30px",height:"30px"}})]),t.refreshmoment?r("MomentList",{attrs:{moments:t.moments}}):t._e(),r("div",{directives:[{name:"show",rawName:"v-show",value:t.pullingUp,expression:"pullingUp"}],staticClass:"pullUp"},[r("span",[t._v("Loading...")])])],1)],1):t._e()},o=[],i=n("2909"),s=(n("96cf"),n("1da1")),a=n("8d33"),c=n("a7ac"),l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"moment-list"},t._l(t.moments,(function(t,e){return n("MomentListItem",{key:e,staticClass:"moment-list-item",attrs:{moments:t}})})),1)},u=[],f=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.isExist?r("div",{staticClass:"moment-items"},[r("div",[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.showImage,expression:"showImage"}],staticClass:"avatar",on:{load:t.uploadavatar}})]),r("div",{staticClass:"name"},[t._v(t._s(t.moments.author.name))]),r("div",{staticClass:"time"},[t._v(" "+t._s(this.$moment(t.moments.createAT).fromNow())+" ")]),r("div",{staticClass:"content"},[t._v(t._s(t.moments.content))]),r("div",{staticClass:"image"},t._l(t.moments.images,(function(e,n){return r("li",{key:n},[r("img",{attrs:{width:"100px",height:"100px",preview:n,src:e+"?type=small"},on:{load:t.uploadavatar}})])})),0),this.isdisplay?r("div",{staticClass:"icon"},[r("div",[r("i",{on:{click:t.clickpraise}},[r("img",{attrs:{src:n("07a8")}})]),r("span",{staticClass:"icon1"},[t._v(t._s(t.promiseCount()))])]),r("div",[r("i",{staticClass:"el-icon-chat-dot-square",staticStyle:{"font-size":"20px"},on:{click:t.comment}}),r("span",[t._v(t._s(t.moments.commentCount))])])]):t._e()]):t._e()},h=[],p={name:"MomentListItem",props:{moments:{type:Object,default:function(){return{}}}},data:function(){return{id:this.moments.id,isExist:!0,images:[],praise:{},isdisplay:!0,number:"",isfrist:!0,token:""}},created:function(){this.getAllPraise(),window.localStorage.setItem("number","0"),this.token=window.localStorage.getItem("token")},computed:{showImage:function(){return this.moments.author.avatarUrl}},methods:{promiseCount:function(){return this.praise.promiseCount||0},uploadavatar:function(){this.$bus.$emit("upload")},remove:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.token){e.next=4;break}t.$router.push("/login"),e.next=15;break;case 4:return e.prev=4,e.next=7,t.$http.delete("/moment/"+t.id);case 7:t.isExist=!t.isExist,t.$message.success("删除成功"),t.$bus.$emit("upload"),e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](4),t.$message.error("你不具备删除该动态权限");case 15:case"end":return e.stop()}}),e,null,[[4,12]])})))()},comment:function(){this.$router.push("detailcomment/"+this.moments.id)},getAllPraise:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("/praise/"+t.moments.id);case 2:n=e.sent,r=n.data,t.praise=r;case 5:case"end":return e.stop()}}),e)})))()},refresh:function(){var t=this;this.isdisplay=!1,this.$nextTick((function(){t.isdisplay=!0}),100),this.getAllPraise()},clickpraise:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var n,r,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.token){e.next=4;break}t.$router.push("/login"),e.next=21;break;case 4:return e.next=6,t.$http.post("/praise/ispraise/"+t.moments.id);case 6:if(n=e.sent,r=n.data,"200"!=r.status&&(t.number=window.localStorage.getItem("number"),"1"===t.number?window.localStorage.setItem("number","0"):window.localStorage.setItem("number","1")),"200"!=r.status){e.next=15;break}return e.next=12,t.$http.post("/praise/"+t.moments.id);case 12:t.$nextTick((function(){t.refresh()}),100),e.next=21;break;case 15:return t.number=window.localStorage.getItem("number"),o={ispraise:""},o.ispraise=t.number,e.next=20,t.$http.post("/praise/update/"+t.moments.id,o);case 20:t.$nextTick((function(){t.refresh()}),100);case 21:case"end":return e.stop()}}),e)})))()},isclickpraise:function(){}},mounted:function(){this.$bus.$on("aaispraise",this.isclickpraise)}},m=p,d=(n("74ca"),n("2877")),v=Object(d["a"])(m,f,h,!1,null,"705616d0",null),g=v.exports,w={name:"MomentList",components:{MomentListItem:g},props:{moments:{type:Array,defalut:function(){return[]}}},created:function(){}},y=w,b=(n("cf54"),Object(d["a"])(y,l,u,!1,null,"801c5818",null)),x=b.exports,$=n("90b9"),_=n("6e74");function k(t,e){return Object(_["a"])({url:"/moment",params:{offset:t,size:e}})}var L={name:"Moment",components:{Scroll:a["a"],NavBar:c["a"],MomentList:x},data:function(){return{moments:[],size:10,offset:0,pullingdown:!1,refreshmoment:!0,pullingUp:!1,loginexit:!0}},created:function(){this.getMoment()},methods:{isallrefreshInfo:function(){this.loginexit=!1;var t=this;setTimeout(Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.loginexit=!0;case 1:case"end":return e.stop()}}),e)}))),300)},createmoment:function(){this.$router.push("/createmoment")},getMoment:function(){var t=this;k(this.offset,this.size).then((function(e){var n;(n=t.moments).push.apply(n,Object(i["a"])(e.data)),t.offset+=10}))},ReMoment:function(){var t=this;k(0,10).then((function(e){t.moments=e.data}))},loadMore:function(){var t=this;this.pullingUp=!0,this.offset=10,this.getMoment(),setTimeout((function(){t.pullingUp=!1,t.$refs.scroll.finishPullUp(),t.$refs.scroll.refresh()}),1e3)},pullingDown:function(){var t=this;this.pullingdown=!0,this.offset,this.ReMoment(),this.refreshmoment=!1,this.refreshmoment=!0,setTimeout((function(){t.pullingdown=!1,t.$refs.scroll.finishPullDown()}),1e3)}},mounted:function(){var t=this,e=Object($["a"])(this.$refs.scroll.refresh,300);this.uploadavatar=function(){e()},this.refreshmoment=function(){t.ReMoment(),t.refreshmoment=!1,t.refreshmoment=!0},this.$bus.$on("upload",this.uploadavatar),this.$bus.$on("createmoment",this.refreshmoment),this.$bus.$on("isallrefreshInfo",this.isallrefreshInfo)},activated:function(){this.$refs.scroll.scrollTo(0,this.saveY,0),this.$refs.scroll.refresh()},deactivated:function(){this.saveY=this.$refs.scroll.getScrollY()}},E=L,O=(n("2ab9"),Object(d["a"])(E,r,o,!1,null,"7536a858",null));e["default"]=O.exports}}]);
|
|
//# sourceMappingURL=chunk-11d3d696.721a59ce.js.map
|