video.vue 9.4 KB

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