index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. }
  41. this.loadData();
  42. },
  43. methods: {
  44. loadData() {
  45. let data = {
  46. type: this.type,
  47. };
  48. post("v1/my/article", data).then((res) => {
  49. if (res.code == 0) {
  50. this.content = res.data.data.content;
  51. }
  52. });
  53. },
  54. },
  55. components: {
  56. mpHtml,
  57. },
  58. };
  59. </script>
  60. <style lang="scss" scoped>
  61. // 用户须知
  62. .container {
  63. border-top: 20rpx solid #f5f5f5;
  64. padding: 0 20rpx;
  65. box-sizing: border-box;
  66. }
  67. // 用户须知-end
  68. </style>