index.vue 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view class="content" v-if="detail">
  3. <view class="titles">{{detail.title}}</view>
  4. <view class="acitve-content">
  5. <u-parse :html="content" :tag-style="style"></u-parse>
  6. </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. padding: 30rpx;
  45. .titles{
  46. text-align: center;
  47. padding: 20rpx 0;
  48. border-bottom: 1px solid #eee;
  49. font-weight: bold;
  50. }
  51. .acitve-content{
  52. padding: 20rpx 0;
  53. }
  54. }
  55. </style>