video.vue 866 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <video :src="info.path" :page-gesture="true" :show-mute-btn="true" :play-strategy="2"></video>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. id: '',
  13. info: {},
  14. };
  15. },
  16. onLoad(e) {
  17. const that = this;
  18. that.$set(that, `id`, e.id || '63c89e92d4f6e2a2ec22d5c8');
  19. that.search()
  20. },
  21. methods: {
  22. async search() {
  23. const that = this;
  24. if (that.id) {
  25. let res = await that.$api(`program/${that.id}`, 'GET', {});
  26. if (res.errcode == '0') {
  27. that.$set(that, `info`, res.data);
  28. uni.setNavigationBarTitle({
  29. title: res.data.name
  30. });
  31. }
  32. }
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. .content {
  39. .one {
  40. text-align: center;
  41. padding: 10px;
  42. video {
  43. width: 100%;
  44. height: 250px;
  45. }
  46. }
  47. }
  48. </style>