guize.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="content">
  3. <rich-text :nodes="couContent" ></rich-text>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. couContent: '',
  11. }
  12. },
  13. onLoad(opt) {
  14. this.getDetailData();
  15. },
  16. methods: {
  17. getDetailData() {
  18. uni.showLoading({
  19. title: '加载中'
  20. })
  21. let url = 'worldKeepCar/worldDistribution/queryDistributionIndexDetail',
  22. params = {
  23. }
  24. this.$http(url, params, 'GET').then(res => {
  25. uni.hideLoading();
  26. var data = res.data
  27. // 处理 undefined和null转为空白字符串
  28. for (const key in data) {
  29. data[key] = this.$praseStrEmpty(data[key])
  30. }
  31. this.detailData = data
  32. if (this.detailData.tSSetting.activityRules) {
  33. this.couContent = this.detailData.tSSetting.activityRules.replace(/\<p/gi, '<p style="display: inline-block"');
  34. }
  35. })
  36. },
  37. }
  38. }
  39. </script>
  40. <style scoped>
  41. .content {
  42. background: #FFFFFF;
  43. min-height: 100vh;
  44. padding: 30rpx 24rpx;
  45. }
  46. </style>