video.vue 9.7 KB

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