index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="container">
  3. <mp-html :content="content" class="mar_t50"></mp-html>
  4. </view>
  5. </template>
  6. <script>
  7. import { post } from "@/request/api.js";
  8. import mpHtml from "@/uni_modules/mp-html/components/mp-html/mp-html.vue"
  9. export default {
  10. data() {
  11. return {
  12. content: "",
  13. type: 5,
  14. };
  15. },
  16. onLoad(option) {
  17. if (option.type == 1) {
  18. this.type = 18;
  19. } else if (option.type == 2) {
  20. this.type = 19;
  21. } else if (option.type == 3) {
  22. this.type = 21;
  23. } else if (option.type == 4) {
  24. this.type = 22;
  25. } else if (option.type == 5) {
  26. this.type = 23;
  27. uni.setNavigationBarTitle({
  28. title: "兑换协议",
  29. });
  30. }else if(option.type == 6){
  31. this.type = 20;
  32. uni.setNavigationBarTitle({
  33. title: "天天捡漏协议",
  34. });
  35. } else if(option.type == 7) {
  36. this.type = 29;
  37. uni.setNavigationBarTitle({
  38. title: "消费券兑换协议",
  39. });
  40. } else if(option.type == 8) {
  41. this.type = 5;
  42. uni.setNavigationBarTitle({
  43. title: "OE兑换协议",
  44. });
  45. }
  46. this.loadData();
  47. },
  48. methods: {
  49. loadData() {
  50. let data = {
  51. type: this.type,
  52. };
  53. post("v1/my/article", data).then((res) => {
  54. if (res.code == 0) {
  55. this.content = res.data.data.content;
  56. }
  57. });
  58. },
  59. },
  60. components: {
  61. mpHtml,
  62. },
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. // 用户须知
  67. .container {
  68. border-top: 20rpx solid #f5f5f5;
  69. padding: 0 20rpx;
  70. box-sizing: border-box;
  71. }
  72. // 用户须知-end
  73. </style>