绿满眶商城微信小程序-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
<template>
  <div>
    <u-collapse v-if="versionData.length !=0">
      <u-collapse-item class="version-item" :title="item.versionName" v-for="(item, index) in versionData" :key="index">
        <!-- {{item.body}} -->
 
        {{item.content}}
      </u-collapse-item>
 
    </u-collapse>
    <u-empty class="empty" v-else text="暂无版本信息" mode="list"></u-empty>
  </div>
</template>
 
<script>
import '@/components/uview-components/uview-ui'
import { getAppVersionList } from "@/api/message";
export default {
  data() {
    return {
      versionData: [],
      appType: "",
      params: {
        pageNumber: 1,
        pageSize: 10,
      },
    };
  },
  mounted() {
    const platform = uni.getSystemInfoSync().platform;
    /**
     * 获取是否是安卓
     */
    if (platform === "android") {
      this.appType = "ANDROID";
    } else {
      this.IosWhether = true;
      this.appType = "IOS";
    }
    this.getVersionList();
  },
  methods: {
    async getVersionList() {
      let res = await getAppVersionList(this.appType, this.params);
      if (res.data.success) {
        this.versionData = res.data.result.records;
      }
    },
  },
};
</script>
 
<style scoped lang="scss">
.version-item{
    padding: 10rpx;
    background: #fff;
}
 
</style>