detail.vue 1021 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="content" v-if="detail">
  3. <view class="acitve-content">
  4. <video autoplay :src="content" style="width: 100%;height: 350px;" controls></video>
  5. </view>
  6. <view class="titles">{{detail.title}}</view>
  7. </view>
  8. </template>
  9. <script>
  10. import { promoTerminalDetail } from '@/api/video.js'
  11. export default {
  12. data() {
  13. return {
  14. detail: null,
  15. style: {
  16. p: ''
  17. },
  18. promoActiveSn: null
  19. }
  20. },
  21. computed: {
  22. content() {
  23. return this.detail && this.detail.content
  24. }
  25. },
  26. onLoad(opts) {
  27. this.promoActiveSn = opts.sn
  28. this.getDetail()
  29. },
  30. methods: {
  31. getDetail(){
  32. promoTerminalDetail({sn:this.promoActiveSn}).then(res => {
  33. this.detail = res.data
  34. uni.setNavigationBarTitle({
  35. title: res.data.name || '活动内容'
  36. })
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="less">
  43. .content{
  44. .titles{
  45. text-align: center;
  46. padding: 20rpx;
  47. border-top: 1px solid #eee;
  48. font-weight: bold;
  49. }
  50. .acitve-content{
  51. padding: 0;
  52. }
  53. }
  54. </style>