video.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view class="kc_bg">
  3. <!-- <view class="header-nav" :style="{height: `calc(44px + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
  4. <image class="back_icon" src="https://cdn.his.cdwjyyh.com/minapp/course_home.png" mode="aspectFill" @click="goHome()"></image>
  5. </view> -->
  6. <view class="kc_body" :style="{paddingTop: `calc(44px + ${statusBarHeight}px + 32rpx)`}">
  7. <view class="coursebox" @click="getLink(1)">
  8. <image class="coursebox-img" :src="configJson.coverImg||courseInfo.imgUrl" mode="aspectFill"></image>
  9. <view class="coursebox-title x-ac">
  10. <image class="star" src="https://cdn.his.cdwjyyh.com/minapp/course_star.png"></image>
  11. <view>{{courseInfo.title}}</view>
  12. <image class="star" src="https://cdn.his.cdwjyyh.com/minapp/course_star.png"></image>
  13. </view>
  14. </view>
  15. <view class="title">{{title}}</view>
  16. <view class="name x-ac" v-if="configJson.broadcastingEnable">
  17. <image class="" src="https://cdn.his.cdwjyyh.com/minapp/course_select_icon.png"></image>
  18. <text>播出主体:{{configJson.broadcasting || ''}}</text>
  19. </view>
  20. <view class="btn" @click="getLink(1)">点击开始观看</view>
  21. <view class="desc-box line">监督投诉电话:400-1881-959</view>
  22. <view class="desc-box x-baseline mt40" v-if="configJson.tvEnable">
  23. <view class="label-dot"></view>
  24. <text class="label">首播电视台:</text>
  25. <view v-if="configJson.tv">
  26. <view v-for="(it,index) in configJson.tv.split(',')">{{it}}</view>
  27. </view>
  28. <view v-else>
  29. <view v-for="(it,index) in defaultInfo.tv.split(',')">{{it}}</view>
  30. </view>
  31. </view>
  32. <view class="desc-box x-baseline mt20" v-if="configJson.networkEnable">
  33. <view class="label-dot"></view>
  34. <text class="label">网络播放平台:</text>
  35. <view v-if="configJson.network">
  36. <view v-for="(it,index) in configJson.network.split(',')">{{it}}</view>
  37. </view>
  38. <view v-else>
  39. <view v-for="(it,index) in defaultInfo.network.split(',')">{{it}}</view>
  40. </view>
  41. </view>
  42. <view class="desc-box x-baseline mt20" v-if="configJson.unitEnable">
  43. <view class="label-dot"></view>
  44. <text class="label">制作单位:</text>
  45. <view v-if="configJson.unit">
  46. <view v-for="(it,index) in configJson.unit.split(',')">{{it}}</view>
  47. </view>
  48. <view v-else>
  49. <view v-for="(it,index) in defaultInfo.unit.split(',')">{{it}}</view>
  50. </view>
  51. </view>
  52. <view class="desc-box x-baseline mt20" v-if="configJson.teamEnable">
  53. <view class="label-dot"></view>
  54. <text class="label">专家顾问团队:</text>
  55. <view v-if="configJson.team">
  56. <view v-for="(it,index) in configJson.team.split(',')">{{it}}</view>
  57. </view>
  58. <view v-else>
  59. <view v-for="(it,index) in defaultInfo.team.split(',')">{{it}}</view>
  60. </view>
  61. </view>
  62. <view class="desc-box x-baseline mt20" v-if="configJson.supportEnable">
  63. <view class="label-dot"></view>
  64. <text class="label">支持单位:</text>
  65. <view v-if="configJson.support">
  66. <view v-for="(it,index) in configJson.support.split(',')">{{it}}</view>
  67. </view>
  68. <view v-else>
  69. <view v-for="(it,index) in defaultInfo.support.split(',')">{{it}}</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import {getRealLink,getH5CourseByVideoId} from "@/api/course.js"
  77. export default {
  78. data() {
  79. return {
  80. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  81. title:'<<以下资料已审核>>',
  82. urlOption: {},
  83. videoId: '',
  84. courseInfo: {},
  85. loading: false,
  86. configJson: {
  87. broadcasting: '御君方互联网医院',
  88. coverImg: "",
  89. network: '芳华未来',
  90. support: '华夏文化促进会大健康养生文化专委会',
  91. team: '杜丁-副主任医师,于晓津-副主任医师,史士昊-主治医师,岳晓燕-主任医师,陈涛-执业医师,李俭-副主任医师',
  92. tv: '贵州广播电视台公共频道,大石桥综合频道',
  93. unit: '大石桥市融媒之声广播电视报刊,网络新传媒有限公司'
  94. },
  95. defaultInfo: {
  96. broadcasting: '御君方互联网医院',
  97. coverImg: "",
  98. network: '芳华未来',
  99. support: '华夏文化促进会大健康养生文化专委会',
  100. team: '杜丁-副主任医师,于晓津-副主任医师,史士昊-主治医师,岳晓燕-主任医师,陈涛-执业医师,李俭-副主任医师',
  101. tv: '贵州广播电视台公共频道,大石桥综合频道',
  102. unit: '大石桥市融媒之声广播电视报刊,网络新传媒有限公司'
  103. }
  104. }
  105. },
  106. onLoad(option) {
  107. this.urlOption = option.course ? JSON.parse(decodeURIComponent(option.course)) : {}
  108. console.log("this.urlOption==",this.urlOption,option)
  109. this.videoId = this.urlOption.videoId || ''
  110. this.sortLink = this.urlOption.link || ''
  111. if (this.videoId) {
  112. this.getH5CourseByVideo()
  113. }
  114. },
  115. onShow() {
  116. if(this.sortLink){
  117. this.getLink()
  118. } else {
  119. uni.showToast({
  120. title: '链接地址有误',
  121. icon: 'none'
  122. });
  123. }
  124. },
  125. methods: {
  126. goHome() {
  127. if(getApp().globalData.appId == 'wx45cf09091aead547') {
  128. uni.switchTab({
  129. url: '/pages/home/index'
  130. })
  131. } else {
  132. uni.navigateToMiniProgram({
  133. appId: 'wx45cf09091aead547',
  134. path: '/pages/home/index'
  135. })
  136. }
  137. },
  138. getH5CourseByVideo() {
  139. uni.showLoading({
  140. title: '加载中'
  141. })
  142. getH5CourseByVideoId({
  143. videoId: this.videoId
  144. }).then(res => {
  145. this.courseInfo = res.data || {}
  146. this.configJson = res.data&&res.data.configJson ? JSON.parse(res.data.configJson) : this.defaultInfo
  147. uni.hideLoading()
  148. }).catch(() => {
  149. uni.hideLoading()
  150. })
  151. },
  152. getLink(type) {
  153. let that = this;
  154. if(this.loading) {
  155. return
  156. }
  157. uni.showLoading({
  158. title: '加载中'
  159. })
  160. this.loading = true
  161. getRealLink({sortLink:this.sortLink}).then(res=>{
  162. uni.hideLoading()
  163. this.loading = false
  164. if(res.code == 200) {
  165. if(type==1) {
  166. uni.navigateTo({
  167. url: '/pages_course/videoDetail?course='+ JSON.stringify(this.urlOption)
  168. })
  169. }
  170. } else {
  171. uni.showToast({
  172. title: '课程已过期或链接无效',
  173. icon: 'none'
  174. });
  175. }
  176. }).catch(err=>{
  177. uni.hideLoading()
  178. this.loading = false
  179. uni.showToast({
  180. title: '发生错误,请稍后再试',
  181. icon: 'none'
  182. });
  183. })
  184. },
  185. }
  186. }
  187. </script>
  188. <style scoped lang="scss">
  189. .mt20 {
  190. margin-top: 20rpx;
  191. }
  192. .mt40 {
  193. margin-top: 40rpx;
  194. }
  195. .kc_bg {
  196. min-height: 100vh;
  197. background-image: url('https://cdn.his.cdwjyyh.com/minapp/kc_bg.png');
  198. // background-repeat: no-repeat;
  199. background-size: 100%;
  200. }
  201. .header-nav {
  202. display: flex;
  203. align-items: center;
  204. position: fixed;
  205. top: 0;
  206. left: 0;
  207. width: 100%;
  208. box-sizing: border-box;
  209. background-image: url('https://cdn.his.cdwjyyh.com/minapp/kc_bg.png');
  210. background-repeat: no-repeat;
  211. background-size: 100%;
  212. overflow: hidden;
  213. }
  214. .back_icon {
  215. height: 70rpx;
  216. width: 70rpx;
  217. padding-left: 28rpx;
  218. }
  219. .kc_body {
  220. padding:36rpx 36rpx 120rpx 36rpx;
  221. display: flex;
  222. flex-direction: column;
  223. align-items: center;
  224. .title {
  225. font-family: Source Han Sans CN;
  226. font-weight: 500;
  227. font-size: 38rpx;
  228. color: #FFFFFF;
  229. padding: 10rpx 60rpx;
  230. background: linear-gradient(269deg, #AE7F47, #CE9B5D);
  231. border-radius: 4rpx;
  232. display: inline-block;
  233. margin-top: 54rpx;
  234. }
  235. .line {
  236. padding: 42rpx 0 27rpx 0;
  237. border-bottom: 1rpx solid #B9884C;
  238. text-align: center;
  239. }
  240. .x-baseline {
  241. display: flex;
  242. align-items: baseline;
  243. }
  244. .desc-box {
  245. width: 100%;
  246. font-family: PingFang;
  247. font-weight: bold;
  248. font-size: 29rpx;
  249. color: #C9985B;
  250. background: linear-gradient(to right, #9B6B2F 0%, #C9985B 52%, #9B6B2F 98%);
  251. -webkit-background-clip: text;
  252. -webkit-text-fill-color: transparent;
  253. .label {
  254. flex-shrink: 0;
  255. }
  256. .label-dot {
  257. width: 16rpx;
  258. height: 16rpx;
  259. background: #D3984F;
  260. border-radius: 50%;
  261. margin: 0 6rpx;
  262. }
  263. }
  264. .coursebox {
  265. background: #FFFFFF;
  266. box-shadow: 0rpx 7rpx 5rpx 0rpx rgba(193,148,93,0.29);
  267. border-radius: 29rpx;
  268. padding: 20rpx 20rpx 0 20rpx;
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. border: 4px solid rgba(255, 239, 208, 1);
  273. &-img {
  274. height: 362rpx;
  275. width: 633rpx;
  276. border-radius: 16rpx;
  277. }
  278. &-title {
  279. text-align: center;
  280. margin: 40rpx 0;
  281. font-family: Source Han Sans CN;
  282. font-weight: bold;
  283. font-size: 45rpx;
  284. color: #9B6B2F;
  285. line-height: 51rpx;
  286. background: linear-gradient(0deg, #9B6B2F 0%, #C9985B 52.978515625%, #9B6B2F 98.291015625%);
  287. -webkit-background-clip: text;
  288. -webkit-text-fill-color: transparent;
  289. }
  290. .star {
  291. flex-shrink: 0;
  292. height: 48rpx;
  293. width: 48rpx;
  294. margin: 0 15rpx;
  295. }
  296. }
  297. .name {
  298. margin-top: 28rpx;
  299. font-weight: bold;
  300. font-size: 36rpx;
  301. color: #9B6B2F;
  302. line-height: 40rpx;
  303. background: linear-gradient(0deg, #9B6B2F 0%, #C9985B 52.978515625%, #9B6B2F 98.291015625%);
  304. -webkit-background-clip: text;
  305. -webkit-text-fill-color: transparent;
  306. image {
  307. height: 44rpx;
  308. width: 44rpx;
  309. margin-right: 10rpx;
  310. }
  311. }
  312. .btn {
  313. width: 660rpx;
  314. height: 81rpx;
  315. margin-top: 55rpx;
  316. background: linear-gradient(90deg, #9B6B2F 0%, #DDB37F 49%, #A57539 100%);
  317. border-radius: 40rpx;
  318. font-family: Source Han Sans CN;
  319. font-weight: 500;
  320. font-size: 42rpx;
  321. color: #FFFFFF;
  322. display: flex;
  323. align-items: center;
  324. justify-content: center;
  325. will-change: transform;
  326. animation: scaleAnimation 1s ease infinite;
  327. }
  328. }
  329. @keyframes scaleAnimation {
  330. 0% {
  331. transform: scale(1);
  332. }
  333. 50% {
  334. transform: scale(0.9);
  335. }
  336. 100% {
  337. transform: scale(1);
  338. }
  339. }
  340. </style>