绿满眶商城微信小程序-uniapp
xiangpei
6 天以前 70738d032bd80f5b13075f8a13045ff4de57c2c3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
  <div class="wrapper">
    <u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content" v-if="res"></u-parse>
 
  </div>
</template>
<script>
import '@/components/uview-components/uview-ui';
 
import { getArticleDetailByType } from "@/api/article";
export default {
 
  data() {
    return {
      res: "",
      way: {
        USER_AGREEMENT: {
          title: "服务协议",
          type: "USER_AGREEMENT",
        },
        PRIVACY_POLICY: {
          title: "隐私政策",
          type: "PRIVACY_POLICY",
        },
        LICENSE_INFORMATION: {
          title: "证照信息",
          type: "LICENSE_INFORMATION",
        },
        ABOUT: {
          title: "关于我们",
          type: "ABOUT",
        },
        STORE_REGISTER: {
          title: "店铺入驻协议",
          type: "STORE_REGISTER",
        },
      },
    };
  },
  mounted() {},
  onLoad(option) {
    console.log(this.way)
    uni.setNavigationBarTitle({
      title: this.way[option.type].title,
    });
    this.init(option);
  },
 
  methods: {
    init(option) {
      getArticleDetailByType(this.way[option.type].type).then((res) => {
        if (res.data.success) {
          this.res = res.data.result;
          console.log(res)
        }
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.wrapper {
  padding: 16rpx;
}
</style>