"use strict";var e=require("../common/vendor.js"),t=require("../api/adv.js"),i=require("../api/doctorArticle.js");require("../common/request.js");const r={data:()=>({advs:[],advImgs:[],src:"",articleId:null,item:{}}),onLoad(e){this.articleId=e.articleId},onShow(){this.getAdvList(),this.getDoctorArticleById()},onShareAppMessage(e){return{title:this.item.title,path:"/pages_doctor/doctorArticleDetails?articleId="+this.articleId}},onShareTimeline(e){return{title:this.item.title,query:"articleId="+this.articleId}},methods:{handleAdvClick(t){var i=this.advs[t];console.log(i.advUrl),1==i.showType?(e.index.setStorageSync("url",i.advUrl),e.index.navigateTo({url:"h5"})):2==i.showType?e.index.navigateTo({url:i.advUrl}):3==i.showType&&(e.index.setStorageSync("content",i.content),e.index.navigateTo({url:"content"}))},getAdvList(){var i=this;t.getAdvList({advType:10}).then((t=>{200==t.code?(i.advImgs=[],i.advs=[],t.data.forEach((function(e){null!=e.imageUrl&&""!=e.imageUrl&&(i.advs.push(e),i.advImgs.push(e.imageUrl))}))):e.index.showToast({icon:"none",title:"请求失败"})}))},videoErrorCallback:function(t){e.index.showModal({content:t.target.errMsg,showCancel:!1})},navTo(t){e.index.navigateTo({url:t})},getDoctorArticleById(){let t={articleId:this.articleId};i.getDoctorArticleById(t).then((t=>{200==t.code?this.item=t.data:e.index.showToast({icon:"none",title:"请求失败"})}),(e=>{}))}}};if(!Array){e.resolveComponent("u-swiper")()}Math;var o=e._export_sfc(r,[["render",function(t,i,r,o,a,d){return e.e({a:e.t(a.item.title),b:e.t(a.item.views),c:e.t(a.item.createTime),d:null!=a.item.videoUrl},null!=a.item.videoUrl?{e:a.item.videoUrl,f:e.o(((...e)=>d.videoErrorCallback&&d.videoErrorCallback(...e)))}:{},{g:a.item.content,h:a.item.avatar,i:e.t(a.item.doctorName),j:e.o((e=>d.navTo("/pages_doctor/doctorDetails?doctorId="+a.item.doctorId))),k:e.o(d.handleAdvClick),l:e.p({list:a.advImgs,indicator:!0,indicatorMode:"line",circular:!0})})}]]);r.__runtimeHooks=6,wx.createPage(o);
