versionFunctionList.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div>
  3. <u-collapse v-if="versionData.length !=0">
  4. <u-collapse-item class="version-item" :title="item.versionName" v-for="(item, index) in versionData" :key="index">
  5. <!-- {{item.body}} -->
  6. {{item.content}}
  7. </u-collapse-item>
  8. </u-collapse>
  9. <u-empty class="empty" v-else text="暂无版本信息" mode="list"></u-empty>
  10. </div>
  11. </template>
  12. <script>
  13. import { getAppVersionList } from "@/api/message";
  14. export default {
  15. data() {
  16. return {
  17. versionData: [],
  18. appType: "",
  19. params: {
  20. pageNumber: 1,
  21. pageSize: 10,
  22. },
  23. };
  24. },
  25. mounted() {
  26. const platform = uni.getSystemInfoSync().platform;
  27. /**
  28. * 获取是否是安卓
  29. */
  30. if (platform === "android") {
  31. this.appType = "ANDROID";
  32. } else {
  33. this.IosWhether = true;
  34. this.appType = "IOS";
  35. }
  36. this.getVersionList();
  37. },
  38. methods: {
  39. async getVersionList() {
  40. let res = await getAppVersionList(this.appType, this.params);
  41. if (res.data.success) {
  42. this.versionData = res.data.result.records;
  43. }
  44. },
  45. },
  46. };
  47. </script>
  48. <style scoped lang="scss">
  49. .version-item{
  50. padding: 10rpx;
  51. background: #fff;
  52. }
  53. </style>