goods_comment_he.js 3.5 KB

1
  1. require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["bundle/pages/goods_comment_he/goods_comment_he"],{"0882":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("b46f");o(t("3240"));var u=o(t("b2d6"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(u.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},"25c7":function(e,n,t){"use strict";t.r(n);var o=t("65c8"),u=t.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=u.a},"4dce":function(e,n,t){},"65c8":function(e,n,t){"use strict";(function(e){var o=t("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u=o(t("7eb4")),r=o(t("ee10")),i=o(t("af34")),a=t("30a0"),c=null,s={name:"GoodsCommentHe",data:function(){return{goods_id:"",goodsPercent:"",goodsCategory:[],goodsCategoryCurrent:{},goodsCommentList:[],hasComment:!1}},methods:{initCommentCategory:function(){var e=this;return new Promise((function(n,t){(0,a.apiGoodsCommentCategory)({goods_id:e.goods_id}).then((function(t){var o,u;e.goodsPercent=null!==(o=t.percent)&&void 0!==o?o:"0%",e.goodsCategory=null!==(u=t.comment.filter((function(e){return e.count})))&&void 0!==u?u:[],e.goodsCategoryCurrent=e.goodsCategory[0],n(t)})).catch((function(e){t(e)}))}))},upCallback:function(e){var n=this,t=e.num,o=e.size;(0,a.apiGoodsCommentList)({id:this.goodsCategoryCurrent.id,goods_id:this.goods_id,page_no:t,page_size:o}).then((function(e){var o=e.lists,u=e.page_size,r=e.count;1===t&&(n.goodsCommentList=[]),n.goodsCommentList=[].concat((0,i.default)(n.goodsCommentList),(0,i.default)(o)),c.endBySize(u,r)})).catch((function(e){c.endBySize()}))},changeCategory:function(e){this.goodsCategoryCurrent=e,c.downCallback()},showCommentImage:function(n,t){e.previewImage({urls:n,current:t})}},onLoad:function(){var e=this;return(0,r.default)(u.default.mark((function n(){var t;return u.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t=e.$Route.query,n.prev=1,t.id){n.next=4;break}throw new Error;case 4:return e.goods_id=t.id,n.next=7,e.initCommentCategory().then((function(){e.hasComment=!!e.goodsCategory.length,e.hasComment&&e.$nextTick((function(){c.downCallback()}))}));case 7:n.next=14;break;case 9:n.prev=9,n.t0=n["catch"](1),console.log(n.t0),e.$toast({title:"页面异常"}),setTimeout((function(){e.$Router.back()}),1200);case 14:case"end":return n.stop()}}),n,null,[[1,9]])})))()},mounted:function(){c=this.$refs["mescroll"]}};n.default=s}).call(this,t("df3c")["default"])},"65ef":function(e,n,t){"use strict";var o=t("4dce"),u=t.n(o);u.a},b2d6:function(e,n,t){"use strict";t.r(n);var o=t("e0c9"),u=t("25c7");for(var r in u)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return u[e]}))}(r);t("65ef");var i=t("828b"),a=Object(i["a"])(u["default"],o["b"],o["c"],!1,null,"39e93ed0",null,!1,o["a"],void 0);n["default"]=a.exports},e0c9:function(e,n,t){"use strict";t.d(n,"b",(function(){return u})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){return o}));var o={mescrollContain:function(){return Promise.all([t.e("common/vendor"),t.e("components/mescroll-contain/mescroll-contain")]).then(t.bind(null,"3ff6"))},uImage:function(){return t.e("components/uview-ui/components/u-image/u-image").then(t.bind(null,"566d"))},uRate:function(){return t.e("components/uview-ui/components/u-rate/u-rate").then(t.bind(null,"8aa5"))},uEmpty:function(){return t.e("components/uview-ui/components/u-empty/u-empty").then(t.bind(null,"7bc9"))}},u=function(){var e=this.$createElement;this._self._c},r=[]}},[["0882","common/runtime","common/vendor"]]]);