index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view class="content" v-if="detail">
  3. <!-- <view class="titles">{{detail.bannerName}}</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 { shopBannerDetail } from '@/api/video.js'
  11. export default {
  12. data() {
  13. return {
  14. detail: null,
  15. style: {
  16. p: 'margin-bottom:10px;'
  17. },
  18. bannerSn: null
  19. }
  20. },
  21. computed: {
  22. content() {
  23. return this.detail && this.detail.content
  24. }
  25. },
  26. onLoad(opts) {
  27. this.bannerSn = opts.sn
  28. this.getDetail()
  29. },
  30. methods: {
  31. getDetail(){
  32. uni.showLoading({
  33. title: "正在加载..."
  34. })
  35. shopBannerDetail({bannerSn:this.bannerSn}).then(res => {
  36. this.detail = res.data
  37. uni.setNavigationBarTitle({
  38. title: res.data.bannerName || '活动内容'
  39. })
  40. uni.hideLoading()
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="less">
  47. .content{
  48. padding: 30rpx;
  49. .titles{
  50. text-align: center;
  51. padding: 20rpx 0;
  52. border-bottom: 1px solid #eee;
  53. font-weight: bold;
  54. }
  55. .acitve-content{
  56. padding: 20rpx 0;
  57. }
  58. }
  59. </style>