ggDetail.vue 784 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="content">
  3. <view class="title">{{ info.title }}</view>
  4. <view class="main" v-html="info.content"></view>
  5. </view>
  6. </template>
  7. <script>
  8. import { gginfo } from '@/api/index.js';
  9. import { mapState, mapMutations } from 'vuex';
  10. export default {
  11. data() {
  12. return {
  13. id: '',
  14. info: ''
  15. };
  16. },
  17. computed: {
  18. ...mapState(['baseURL'])
  19. },
  20. onLoad(opt) {
  21. this.id = opt.id;
  22. },
  23. onShow() {
  24. this.loadData();
  25. },
  26. methods: {
  27. loadData() {
  28. gginfo({ id: this.id }).then(({ data }) => {
  29. this.info = data;
  30. });
  31. }
  32. }
  33. };
  34. </script>
  35. <style lang="scss">
  36. page,
  37. .content {
  38. min-height: 100%;
  39. height: auto;
  40. background: #fff;
  41. }
  42. .title {
  43. padding: 0 40rpx;
  44. font-size: 40rpx;
  45. font-weight: bold;
  46. color: #fcd535;
  47. }
  48. .main {
  49. padding: 20rpx 40rpx;
  50. }
  51. </style>