video.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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. if (!option.course) {
  113. const keys = decodeURIComponent(Object.keys(option)[0]);
  114. this.urlOption = JSON.parse(keys.split('course=')[1])
  115. } else {
  116. this.urlOption = option.course ? JSON.parse(decodeURIComponent(option.course)) : {}
  117. }
  118. console.log("this.urlOption==",this.urlOption,option)
  119. this.videoId = this.urlOption.videoId || ''
  120. this.sortLink = this.urlOption.link || ''
  121. if (this.videoId) {
  122. this.getH5CourseByVideo()
  123. }
  124. },
  125. onShow() {
  126. if(this.sortLink){
  127. this.getLink()
  128. } else {
  129. uni.showToast({
  130. title: '链接地址有误',
  131. icon: 'none'
  132. });
  133. }
  134. },
  135. methods: {
  136. goHome() {
  137. if(getApp().globalData.appId == 'wx45cf09091aead547') {
  138. uni.switchTab({
  139. url: '/pages/home/index'
  140. })
  141. } else {
  142. uni.navigateToMiniProgram({
  143. appId: 'wx45cf09091aead547',
  144. path: '/pages/home/index'
  145. })
  146. }
  147. },
  148. getH5CourseByVideo() {
  149. uni.showLoading({
  150. title: '加载中'
  151. })
  152. getH5CourseByVideoId({
  153. videoId: this.videoId
  154. }).then(res => {
  155. this.courseInfo = res.data || {}
  156. this.configJson = res.data&&res.data.configJson ? JSON.parse(res.data.configJson) : this.defaultInfo
  157. uni.hideLoading()
  158. }).catch(() => {
  159. uni.hideLoading()
  160. })
  161. },
  162. getLink(type) {
  163. let that = this;
  164. if(this.loading) {
  165. return
  166. }
  167. uni.showLoading({
  168. title: '加载中'
  169. })
  170. this.loading = true
  171. getRealLink({sortLink:this.sortLink}).then(res=>{
  172. uni.hideLoading()
  173. this.loading = false
  174. if(res.code == 200) {
  175. if(type==1) {
  176. uni.navigateTo({
  177. url: '/pages_course/videoDetail?course='+ JSON.stringify(this.urlOption)
  178. })
  179. }
  180. } else {
  181. uni.showToast({
  182. title: '课程已过期或链接无效',
  183. icon: 'none'
  184. });
  185. }
  186. }).catch(err=>{
  187. uni.hideLoading()
  188. this.loading = false
  189. uni.showToast({
  190. title: '发生错误,请稍后再试',
  191. icon: 'none'
  192. });
  193. })
  194. },
  195. }
  196. }
  197. </script>
  198. <style scoped lang="scss">
  199. .mt20 {
  200. margin-top: 20rpx;
  201. }
  202. .mt40 {
  203. margin-top: 40rpx;
  204. }
  205. .kc_bg {
  206. min-height: 100vh;
  207. background-image: url('https://cdn.his.cdwjyyh.com/minapp/kc_bg.png');
  208. // background-repeat: no-repeat;
  209. background-size: 100%;
  210. }
  211. .header-nav {
  212. display: flex;
  213. align-items: center;
  214. position: fixed;
  215. top: 0;
  216. left: 0;
  217. width: 100%;
  218. box-sizing: border-box;
  219. background-image: url('https://cdn.his.cdwjyyh.com/minapp/kc_bg.png');
  220. background-repeat: no-repeat;
  221. background-size: 100%;
  222. overflow: hidden;
  223. }
  224. .back_icon {
  225. height: 70rpx;
  226. width: 70rpx;
  227. padding-left: 28rpx;
  228. }
  229. .kc_body {
  230. padding:36rpx 36rpx 120rpx 36rpx;
  231. display: flex;
  232. flex-direction: column;
  233. align-items: center;
  234. .title {
  235. font-family: Source Han Sans CN;
  236. font-weight: 500;
  237. font-size: 38rpx;
  238. color: #FFFFFF;
  239. padding: 10rpx 60rpx;
  240. background: linear-gradient(269deg, #AE7F47, #CE9B5D);
  241. border-radius: 4rpx;
  242. display: inline-block;
  243. margin-top: 54rpx;
  244. }
  245. .line {
  246. padding: 42rpx 0 27rpx 0;
  247. border-bottom: 1rpx solid #B9884C;
  248. text-align: center;
  249. }
  250. .x-baseline {
  251. display: flex;
  252. align-items: baseline;
  253. }
  254. .desc-box {
  255. width: 100%;
  256. font-family: PingFang;
  257. font-weight: bold;
  258. font-size: 29rpx;
  259. color: #C9985B;
  260. background: linear-gradient(to right, #9B6B2F 0%, #C9985B 52%, #9B6B2F 98%);
  261. -webkit-background-clip: text;
  262. -webkit-text-fill-color: transparent;
  263. .label {
  264. flex-shrink: 0;
  265. }
  266. .label-dot {
  267. width: 16rpx;
  268. height: 16rpx;
  269. background: #D3984F;
  270. border-radius: 50%;
  271. margin: 0 6rpx;
  272. }
  273. }
  274. .coursebox {
  275. background: #FFFFFF;
  276. box-shadow: 0rpx 7rpx 5rpx 0rpx rgba(193,148,93,0.29);
  277. border-radius: 29rpx;
  278. padding: 20rpx 20rpx 0 20rpx;
  279. display: flex;
  280. flex-direction: column;
  281. align-items: center;
  282. border: 4px solid rgba(255, 239, 208, 1);
  283. &-img {
  284. height: 362rpx;
  285. width: 633rpx;
  286. border-radius: 16rpx;
  287. }
  288. &-title {
  289. text-align: center;
  290. margin: 40rpx 0;
  291. font-family: Source Han Sans CN;
  292. font-weight: bold;
  293. font-size: 45rpx;
  294. color: #9B6B2F;
  295. line-height: 51rpx;
  296. background: linear-gradient(0deg, #9B6B2F 0%, #C9985B 52.978515625%, #9B6B2F 98.291015625%);
  297. -webkit-background-clip: text;
  298. -webkit-text-fill-color: transparent;
  299. }
  300. .star {
  301. flex-shrink: 0;
  302. height: 48rpx;
  303. width: 48rpx;
  304. margin: 0 15rpx;
  305. }
  306. }
  307. .name {
  308. margin-top: 28rpx;
  309. font-weight: bold;
  310. font-size: 36rpx;
  311. color: #9B6B2F;
  312. line-height: 40rpx;
  313. background: linear-gradient(0deg, #9B6B2F 0%, #C9985B 52.978515625%, #9B6B2F 98.291015625%);
  314. -webkit-background-clip: text;
  315. -webkit-text-fill-color: transparent;
  316. image {
  317. height: 44rpx;
  318. width: 44rpx;
  319. margin-right: 10rpx;
  320. }
  321. }
  322. .btn {
  323. width: 660rpx;
  324. height: 81rpx;
  325. margin-top: 55rpx;
  326. background: linear-gradient(90deg, #9B6B2F 0%, #DDB37F 49%, #A57539 100%);
  327. border-radius: 40rpx;
  328. font-family: Source Han Sans CN;
  329. font-weight: 500;
  330. font-size: 42rpx;
  331. color: #FFFFFF;
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. will-change: transform;
  336. animation: scaleAnimation 1s ease infinite;
  337. }
  338. }
  339. @keyframes scaleAnimation {
  340. 0% {
  341. transform: scale(1);
  342. }
  343. 50% {
  344. transform: scale(0.9);
  345. }
  346. 100% {
  347. transform: scale(1);
  348. }
  349. }
  350. </style>