enterprise.vue 2.1 KB

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