enterprise.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="column" style="height: 100%;">
  3. <view class="top-content ">
  4. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  5. <!-- 这里是状态栏 -->
  6. <view class="top-title">企业理念</view>
  7. </view>
  8. <view class="flex-1 scrolly ">
  9. <view class="imgbox">
  10. <image :src="enterpriseimg[0]" mode="widthFix"></image>
  11. </view>
  12. <view class="p20 ">
  13. <video id="myVideo" :src='enterpriseurl'
  14. show-mute-btn='true' @fullscreenchange='changvideo'
  15. vslide-gesture-in-fullscreen='true' :muted='muted' loop='true'
  16. @error="videoErrorCallback" enable-danmu controls autoplay="true"
  17. class="videotop"></video>
  18. <!-- <video class="myVideo" id="myVideo" :src="enterpriseurl"
  19. @error="videoErrorCallback" controls></video> -->
  20. </view>
  21. <view class="imgbox column">
  22. <image :src="enterpriseimg[3]" mode="widthFix"></image>
  23. <image :src="enterpriseimg[2]" mode="widthFix"></image>
  24. <image :src="enterpriseimg[1]" mode="widthFix"></image>
  25. </view>
  26. </view>
  27. <!-- <tabbar :actindex="1"></tabbar> -->
  28. </view>
  29. </template>
  30. <script>
  31. import{getenterprise} from '@/api/index.js'
  32. export default {
  33. data() {
  34. return {
  35. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  36. enterpriseurl:'',
  37. enterpriseimg:'',
  38. muted:true,
  39. }
  40. },
  41. mounted() {
  42. this.getenterprise()
  43. },
  44. methods: {
  45. changvideo(e){
  46. if(e.target.fullScreen==true){
  47. this.muted=false
  48. }else{
  49. this.muted=true
  50. }
  51. e.target.fullScreen
  52. },
  53. getenterprise(){
  54. getenterprise().then(res=>{
  55. this.enterpriseurl=res.data.videoUrl
  56. this.enterpriseimg=res.data.images
  57. const url=this.enterpriseimg.split(',')
  58. this.enterpriseimg=url
  59. uni.setStorageSync('enterpriseurl',this.enterpriseurl)
  60. console.log(res)
  61. })
  62. },
  63. videoErrorCallback: function(e) {
  64. },
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .top-content {
  70. width: 100%;
  71. z-index: 10;
  72. .top-title {
  73. height: 88upx;
  74. line-height: 88upx;
  75. font-size: 42upx;
  76. font-family: Source Han Sans CN;
  77. font-weight: bold;
  78. color: #222222;
  79. padding-left: 41upx;
  80. background-color: #FFFFFF;
  81. }
  82. }
  83. .imgbox{
  84. image{
  85. width: 100%;
  86. }
  87. }
  88. .videotop{
  89. width: 100%;
  90. border-radius: 20rpx;
  91. }
  92. </style>