special-detail-legacy.83371a86.js 2.9 KB

1
  1. ;(function(){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}System.register(['./index-legacy.8e7636e9.js','./vendor-legacy.85605a93.js','./index-legacy.f25f109a4.js','./index-legacy.637f35562.js','./index-legacy.f25f109a15.js','./help-center-detail.module-legacy.42970883.js'],function(exports){'use strict';var request,defineComponent,dayjs,ImagePreview,createVNode,createTextVNode,styles;return{setters:[function(module){request=module.r;},function(module){defineComponent=module.d;dayjs=module.g;ImagePreview=module.ai;createVNode=module.a;createTextVNode=module.j;},function(){},function(){},function(){},function(module){styles=module.s;}],execute:function execute(){var specialDetail=exports('default',defineComponent({name:'special-detail',data:function data(){return{detail:{title:'',createTime:'',content:''}};},mounted:function mounted(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var query,res,_res$data,title,createTime,content;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;query=_this.$route.query;_context.next=4;return request.get('/api-cms/news/query/'+query.id);case 4:res=_context.sent;_res$data=res.data,title=_res$data.title,createTime=_res$data.createTime,content=_res$data.content;_this.detail={title:title,createTime:dayjs(createTime).format('YYYY-MM-DD HH:mm:ss'),content:content};_context.next=11;break;case 9:_context.prev=9;_context.t0=_context["catch"](0);case 11:case"end":return _context.stop();}}},_callee,null,[[0,9]]);}))();},methods:{onShowImg:function onShowImg(target){var localName=target.srcElement.localName;if(localName!=='img'){return;}var startPosition=0;var domList=document.querySelectorAll('.msgWrap img');var imgList=Array.from(domList).map(function(item,index){if(target.srcElement==item){startPosition=index;}return item.src;});ImagePreview({images:imgList,startPosition:startPosition,closeable:true});}},render:function render(){return createVNode("div",{"class":styles['help-center-detail']},[createVNode("h2",null,[this.detail.title]),createVNode("div",{"class":styles.titleInfo},[createVNode("p",null,[createTextVNode("\u9177\u4E50\u79C0")]),createVNode("p",null,[this.detail.createTime])]),createVNode("div",{"class":[styles.imgContent,'msgWrap'],"onClick":this.onShowImg,"innerHTML":this.detail.content},null)]);}}));}};});})();