index.vue 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <u-parse :content="info.content"></u-parse>
  6. </view>
  7. </view>
  8. </mobile-frame>
  9. </template>
  10. <script>
  11. import uParse from "@/components/u-parse/u-parse.vue";
  12. export default {
  13. components: {
  14. uParse,
  15. },
  16. data() {
  17. return {
  18. id: "",
  19. info: {},
  20. };
  21. },
  22. onLoad: function (e) {
  23. const that = this;
  24. that.$set(that, `id`, e.id || "");
  25. },
  26. onShow: function () {
  27. const that = this;
  28. that.search();
  29. },
  30. methods: {
  31. async search() {
  32. const that = this;
  33. const res = await that.$api(`/banner/${that.id}`, "GET");
  34. if (res.errcode == "0") {
  35. that.$set(that, `info`, res.data);
  36. } else {
  37. uni.showToast({
  38. title: res.errmsg,
  39. icon: "none",
  40. });
  41. }
  42. },
  43. },
  44. };
  45. </script>
  46. <style lang="scss">
  47. .main {
  48. display: flex;
  49. flex-direction: column;
  50. width: 100vw;
  51. height: 100vh;
  52. .one {
  53. padding: 2vw;
  54. }
  55. }
  56. </style>