detail.js 8.4 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/article/detail"],{2669:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=r(e("a34a")),i=e("59de");function r(t){return t&&t.__esModule?t:{default:t}}function u(t){return l(t)||s(t)||c(t)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,n){if(t){if("string"===typeof t)return d(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?d(t,n):void 0}}function s(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function l(t){if(Array.isArray(t))return d(t)}function d(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function f(t,n,e,o,i,r,u){try{var a=t[r](u),c=a.value}catch(s){return void e(s)}a.done?n(c):Promise.resolve(c).then(o,i)}function h(t){return function(){var n=this,e=arguments;return new Promise((function(o,i){var r=t.apply(n,e);function u(t){f(r,o,i,u,a,"next",t)}function a(t){f(r,o,i,u,a,"throw",t)}u(void 0)}))}}var m={mixins:[i.tools,i.vote],onLoad:function(t){var n=this.$Route.query||t||{};this.id=n.id||0,this.diyname=n.diyname||"",this.getArchivesDetail()},onShow:function(){},computed:{isShow:function(){return""!=this.archivesInfo.images},isPay:function(){return parseInt(this.archivesInfo.price)>0}},watch:{content:function(t,n){t||(this.pid=0)}},data:function(){return{id:0,archivesInfo:{},channelInfo:{},commentList:[],imagesList:[],downloadurl:{},content:"",isRender:!1,dowshow:!1,downtips:!1,pid:0,description:"",downkey:"",downurl:"",baucode:"",diyname:"",scrollTop:0,page:1,has_more:!0}},methods:{getArchivesDetail:function(){var n=h(o.default.mark((function n(){var e;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,this.$api.getArchivesDetail({id:this.id,diyname:this.diyname});case 2:if(e=n.sent,e.code){n.next=5;break}return n.abrupt("return");case 5:this.archivesInfo=e.data.archivesInfo||{},this.channelInfo=e.data.channelInfo||[],this.commentList=e.data.commentList||[],this.downloadurl=e.data.archivesInfo.downloadurl||{},this.imagesList=e.data.archivesInfo.images.split(","),this.$u.mpShare.title=e.data.archivesInfo.title,this.isRender=!0,this.$u.vuex("vuex__token__",e.data.__token__),t.setNavigationBarTitle({title:this.archivesInfo.title});case 14:case"end":return n.stop()}}),n,this)})));function e(){return n.apply(this,arguments)}return e}(),goCommentIndex:function(){var t=this;this.$api.goCommentIndex({page:this.page,aid:this.archivesInfo.id}).then((function(n){1==n.code&&(t.has_more=n.data.commentList.length>0,t.commentList=[].concat(u(t.commentList),u(n.data.commentList)))}))},replay:function(t){t.user?(this.content="@".concat(t.user.nickname," "),this.pid=t.id):this.$u.toast("用户不存在")},submit:function(){var t=h(o.default.mark((function t(){var n;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this.content){t.next=3;break}return this.$u.toast("请输入评论内容!"),t.abrupt("return");case 3:return t.next=5,this.$api.goCommentPost({content:this.content,aid:this.id,pid:this.pid});case 5:if(n=t.sent,this.$u.toast(n.msg),n.code){t.next=9;break}return t.abrupt("return");case 9:this.content="",n.data&&n.data.comment&&(this.commentList=[n.data.comment].concat(u(this.commentList)));case 11:case"end":return t.stop()}}),t,this)})));function n(){return t.apply(this,arguments)}return n}(),goLogin:function(){this.$Router.push("/pages/login/mobilelogin")},toUser:function(t){this.$Router.push("/pages/user/user?user_id="+t)},goPay:function(){this.$refs.faPayment.show()},paySuccess:function(){this.getArchivesDetail()},download:function(n){var e=this;switch(n.name){case"local":t.downloadFile({url:n.url,success:function(n){200===n.statusCode&&t.saveFile({tempFilePath:n.tempFilePath,success:function(t){e.downtips=!0,e.description=t.savedFilePath},fail:function(t){}})}});break;case"baidu":this.dowshow=!0,this.downurl=n.url,this.baucode=n.password;break}},copydown:function(){var t=this;this.$util.uniCopy({content:this.baucode,success:function(){t.$u.toast("提取码复制成功!")}})},goTag:function(t){this.$Router.push({path:"/pages/tag/tag",query:{name:t}})},openproduct:function(){this.$Router.push({path:"/pages/product/detail",query:{id:this.archivesInfo.productid}})}},onPageScroll:function(t){this.scrollTop=t.scrollTop},onReachBottom:function(){this.has_more&&(this.page+=1,this.goCommentIndex())}};n.default=m}).call(this,e("f266")["default"])},"45fb":function(t,n,e){"use strict";e.r(n);var o=e("ceff"),i=e("a4df");for(var r in i)"default"!==r&&function(t){e.d(n,t,(function(){return i[t]}))}(r);e("8cc5");var u,a=e("f0c5"),c=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],u);n["default"]=c.exports},"8cc5":function(t,n,e){"use strict";var o=e("a059"),i=e.n(o);i.a},a059:function(t,n,e){},a4df:function(t,n,e){"use strict";e.r(n);var o=e("2669"),i=e.n(o);for(var r in o)"default"!==r&&function(t){e.d(n,t,(function(){return o[t]}))}(r);n["default"]=i.a},ceff:function(t,n,e){"use strict";e.d(n,"b",(function(){return i})),e.d(n,"c",(function(){return r})),e.d(n,"a",(function(){return o}));var o={faNavbar:function(){return e.e("components/fa-navbar/fa-navbar").then(e.bind(null,"6858"))},uAvatar:function(){return e.e("uview-ui/components/u-avatar/u-avatar").then(e.bind(null,"3108"))},uIcon:function(){return e.e("uview-ui/components/u-icon/u-icon").then(e.bind(null,"ba52"))},uImage:function(){return e.e("uview-ui/components/u-image/u-image").then(e.bind(null,"9406"))},uGap:function(){return e.e("uview-ui/components/u-gap/u-gap").then(e.bind(null,"71a3"))},uButton:function(){return e.e("uview-ui/components/u-button/u-button").then(e.bind(null,"6829"))},uParse:function(){return Promise.all([e.e("common/vendor"),e.e("uview-ui/components/u-parse/u-parse")]).then(e.bind(null,"fb53"))},uTag:function(){return e.e("uview-ui/components/u-tag/u-tag").then(e.bind(null,"a8f0"))},uAlertTips:function(){return e.e("uview-ui/components/u-alert-tips/u-alert-tips").then(e.bind(null,"bcd1"))},uInput:function(){return Promise.all([e.e("common/vendor"),e.e("uview-ui/components/u-input/u-input")]).then(e.bind(null,"b3e3"))},uEmpty:function(){return e.e("uview-ui/components/u-empty/u-empty").then(e.bind(null,"34ad"))},faPayment:function(){return e.e("components/fa-payment/fa-payment").then(e.bind(null,"4409"))},uModal:function(){return e.e("uview-ui/components/u-modal/u-modal").then(e.bind(null,"165c"))},uLink:function(){return e.e("uview-ui/components/u-link/u-link").then(e.bind(null,"da55"))},uBackTop:function(){return e.e("uview-ui/components/u-back-top/u-back-top").then(e.bind(null,"ad8f"))},faTabbar:function(){return Promise.all([e.e("common/vendor"),e.e("components/fa-tabbar/fa-tabbar")]).then(e.bind(null,"ecd8"))}},i=function(){var t=this,n=t.$createElement,e=(t._self._c,t.isRender&&t.archivesInfo.productid>0?{backgroundColor:t.theme.bgColor,color:t.theme.color,width:"60vw"}:null),o=t.isRender?{backgroundColor:t.theme.bgColor,color:t.theme.color}:null,i=t.isRender?{backgroundColor:t.theme.bgColor,color:t.theme.color}:null,r=t.isRender&&3==t.archivesInfo.model_id&&(t.archivesInfo.ispaid||0==t.archivesInfo.price)?t.__map(t.downloadurl,(function(n,e){var o=t.__get_orig(n),i={backgroundColor:t.theme.bgColor,color:t.theme.color};return{$orig:o,a3:i}})):null,u=t.isRender&&t.archivesInfo.price>0&&!t.archivesInfo.ispaid&&!t.vuex_token?{backgroundColor:t.theme.bgColor,color:t.theme.color,width:"60vw"}:null,a=t.isRender&&t.archivesInfo.price>0&&!t.archivesInfo.ispaid&&t.vuex_token?{backgroundColor:t.theme.bgColor,color:t.theme.color,width:"60vw"}:null,c=t.isRender&&!t.vuex_token?{backgroundColor:t.theme.bgColor,color:t.theme.color,width:"60vw"}:null,s=t.isRender&&t.vuex_token?{backgroundColor:t.theme.bgColor,color:t.theme.color,width:"60vw"}:null,l={color:t.theme.bgColor};t._isMounted||(t.e0=function(n){t.downtips=!1}),t.$mp.data=Object.assign({},{$root:{a0:e,a1:o,a2:i,l0:r,a4:u,a5:a,a6:c,a7:s,a8:l}})},r=[]},fba6:function(t,n,e){"use strict";(function(t){e("630e");o(e("66fd"));var n=o(e("45fb"));function o(t){return t&&t.__esModule?t:{default:t}}t(n.default)}).call(this,e("f266")["createPage"])}},[["fba6","common/runtime","common/vendor"]]]);