lessonDetail.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view class="content">
  3. <view class="detail-cont">
  4. <view class="title">{{item.title||'-'}}</view>
  5. <view class="info">
  6. <view class="time">
  7. <u-icon name="clock" color="#fff" size="14"></u-icon>{{item.createTime}}</view>
  8. <view class="reads ">
  9. <u-icon name="eye" color="#fff" size="14"></u-icon>{{item.viewCount ||0}}</view>
  10. </view>
  11. <view class="video" v-if="isShow==1">
  12. <video class="myVideo" id="myVideo" :src="item.videoUrl"
  13. @error="videoErrorCallback" controls ></video>
  14. </view>
  15. <view class="img-box" v-else>
  16. <image :src="item.coverUrl" mode="aspectFill"></image>
  17. </view>
  18. <!-- 正文 -->
  19. <!-- <view class="full-text" >
  20. <view v-html="item.content"></view>
  21. </view> -->
  22. <view class="tips">
  23. <image class="w48 h48" src="@/static/image/icon_warning.png" mode=""></image>
  24. <view class="text-box">本内容仅代表嘉宾观点,不代表本站立场。仅供医学药学专业人士查看,不构成实际治疗建议。</view>
  25. </view>
  26. <view class="actor x-f">
  27. <image class="w88 h88" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/images/my_heads_icon64.png" mode=""></image>
  28. <view class="infor y-start">
  29. <view class="name">{{item.doctorName+'-'+item.jobTitle}}</view>
  30. <view class="position">{{item.institution||'-'}}·{{item.department||'-'}}</view>
  31. </view>
  32. </view>
  33. <view class="full-text">
  34. <view>
  35. {{item.summary||'-'}}
  36. </view>
  37. </view>
  38. <!-- <view class="tag">#转载#肾病</view> -->
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import {getClassroomDetail,getShowVideo} from '@/api/index.js'
  44. export default {
  45. data() {
  46. return {
  47. advs:[],
  48. advImgs:[],
  49. src: '',
  50. groupId:null,
  51. item:{},
  52. type:'',
  53. isShow:0
  54. };
  55. },
  56. onLoad(option) {
  57. this.groupId=option.groupId;
  58. },
  59. onShow() {
  60. this.getClassroomDetail()
  61. this.getShow()
  62. //this.getDoctorArticleById();
  63. },
  64. //发送给朋友
  65. onShareAppMessage(res) {
  66. return {
  67. title: this.item.title,
  68. path: '/pages_live/lessonDetail?groupId='+this.groupId,
  69. }
  70. },
  71. methods:{
  72. handleAdvClick(index){
  73. var ad=this.advs[index];
  74. console.log(ad.advUrl);
  75. if(ad.showType==1){
  76. uni.setStorageSync('url',ad.advUrl);
  77. uni.navigateTo({
  78. url:"h5"
  79. })
  80. }
  81. else if(ad.showType==2){
  82. uni.navigateTo({
  83. url:ad.advUrl
  84. })
  85. }
  86. else if(ad.showType==3){
  87. uni.setStorageSync('content',ad.content);
  88. uni.navigateTo({
  89. url:"content"
  90. })
  91. }
  92. },
  93. videoErrorCallback: function(e) {
  94. uni.showModal({
  95. content: e.target.errMsg,
  96. showCancel: false
  97. })
  98. },
  99. navTo(url){
  100. uni.navigateTo({
  101. url: url
  102. })
  103. },
  104. getClassroomDetail(){
  105. getClassroomDetail(this.groupId).then(
  106. res => {
  107. if(res.code==200){
  108. this.item=res.data;
  109. }else{
  110. uni.showToast({
  111. icon:'none',
  112. title: "请求失败",
  113. });
  114. }
  115. },
  116. rej => {}
  117. );
  118. },
  119. getShow(){
  120. getShowVideo().then(
  121. res => {
  122. if(res.code==200){
  123. this.isShow=res.data
  124. }else{
  125. uni.showToast({
  126. icon:'none',
  127. title: "请求失败",
  128. });
  129. }
  130. },
  131. rej => {}
  132. );
  133. },
  134. }
  135. }
  136. </script>
  137. <style lang="scss">
  138. page{
  139. height: 100%;
  140. }
  141. .content{
  142. height: 100%;
  143. display: flex;
  144. flex-direction: column;
  145. background: #000;
  146. }
  147. .detail-cont{
  148. width:100%;
  149. flex: 1;
  150. overflow-y: auto;
  151. // background: #fff;
  152. .title{
  153. padding:0 30upx;
  154. font-family: PingFang SC, PingFang SC;
  155. font-weight: 500;
  156. font-size: 40rpx;
  157. color: #FFFFFF;
  158. line-height: 60rpx;
  159. }
  160. .info{
  161. padding:0 30upx;
  162. display: flex;
  163. align-items: center;
  164. margin-top: 16rpx;
  165. margin-bottom: 32rpx;
  166. .time{
  167. display: flex;
  168. align-items: center;
  169. font-family: PingFang SC, PingFang SC;
  170. font-weight: 400;
  171. font-size: 24rpx;
  172. color: #FFFFFF;
  173. line-height: 44rpx;
  174. .u-icon{
  175. margin-right: 10rpx;
  176. }
  177. }
  178. .reads{
  179. margin-left: 32rpx;
  180. display: flex;
  181. align-items: center;
  182. font-family: PingFang SC, PingFang SC;
  183. font-weight: 400;
  184. font-size: 24rpx;
  185. color: #FFFFFF;
  186. line-height: 44rpx;
  187. .u-icon{
  188. margin-right: 10rpx;
  189. }
  190. }
  191. }
  192. .full-text{
  193. padding:0 30upx;
  194. width: calc(100% - 60rpx);
  195. font-family: PingFang SC, PingFang SC;
  196. font-weight: 400;
  197. font-size: 28rpx;
  198. color: #FFFFFF;
  199. line-height: 44rpx;
  200. }
  201. .tips{
  202. // width: calc(100% - 60rpx);
  203. margin-bottom:184rpx;
  204. display: flex;
  205. align-items: center;
  206. padding: 16rpx 24rpx;
  207. margin-top: 40rpx;
  208. margin-left: 24rpx;
  209. margin-right: 24rpx;
  210. background: rgba(255, 255, 255, 0.1);
  211. border-radius: 18rpx 18rpx 18rpx 18rpx;
  212. .text-box{
  213. flex:1;
  214. margin-left: 16rpx;
  215. font-family: PingFang SC, PingFang SC;
  216. font-weight: 400;
  217. font-size: 24rpx;
  218. color: #FFFFFF;
  219. line-height: 40rpx;
  220. }
  221. }
  222. .actor{
  223. padding:0 30upx;
  224. margin-bottom: 32rpx;
  225. .infor{
  226. margin-left: 24rpx;
  227. height: 88rpx;
  228. justify-content: space-around;
  229. .name{
  230. font-family: PingFang SC, PingFang SC;
  231. font-weight: 600;
  232. font-size: 28rpx;
  233. color: #FFFFFF;
  234. line-height: 36rpx;
  235. }
  236. .position{
  237. font-family: PingFang SC, PingFang SC;
  238. font-weight: 400;
  239. font-size: 24rpx;
  240. color: #FFFFFF;
  241. line-height: 32rpx;
  242. }
  243. }
  244. }
  245. .tag{
  246. padding:0 30upx;
  247. font-family: PingFang SC, PingFang SC;
  248. font-weight: 400;
  249. font-size: 24rpx;
  250. color: #FFFFFF;
  251. line-height: 44rpx;
  252. }
  253. .video{
  254. width: 100%;
  255. display: flex;
  256. align-items: center;
  257. justify-content: center;
  258. video{
  259. width: 100%;
  260. }
  261. }
  262. .img-box{
  263. width: 100%;
  264. display: flex;
  265. align-items: center;
  266. justify-content: center;
  267. video{
  268. width: 100%;
  269. }
  270. }
  271. }
  272. .ad{
  273. margin-bottom: 50rpx;
  274. width: 100%;
  275. padding: 15rpx;
  276. background: #FFFFFF;
  277. border-radius: 18rpx 18rpx 18rpx 18rpx;
  278. }
  279. .inquiry{
  280. position: fixed;
  281. right: 22upx;
  282. bottom: 193upx;
  283. z-index: 99;
  284. .content{
  285. display: flex;
  286. align-items: center;
  287. justify-content: center;
  288. flex-direction: column;
  289. image{
  290. box-sizing: border-box;
  291. width: 100upx;
  292. height: 100upx;
  293. border-radius: 50%;
  294. z-index: 9;
  295. border: 2rpx solid #0bb3f2;
  296. }
  297. .text{
  298. margin-top: 15upx;
  299. font-size: 30upx;
  300. font-family: PingFang SC;
  301. font-weight: bold;
  302. color: #0bb3f2;
  303. }
  304. }
  305. }
  306. </style>