record.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view>
  3. <view class="records">
  4. <view class="records_itemtf" v-if="dataTF">
  5. 暂无更新记录
  6. </view>
  7. <u-collapse>
  8. <u-collapse-item :title="item.head" v-for="(item, index) in itemList" :key="index">
  9. <p v-for="items,indexs in item.body" :key="indexs">{{indexs+1+"、"+items}}</p>
  10. </u-collapse-item>
  11. </u-collapse>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. recordsdata: [],
  20. indexnum: 0,
  21. dataTF: false,
  22. itemList: [],
  23. }
  24. },
  25. methods: {
  26. async getEquipList() {
  27. const res = await this.$myRequest({
  28. url: '/api/api_gateway?method=home.homes.app_version_record'
  29. })
  30. console.log(res)
  31. this.recordsdata = res
  32. var ids = Number(plus.runtime.version.match(/\d+/g).join(""))
  33. for (var i = 0; i < res.length; i++) {
  34. var appnum = Number(res[i].app_num.match(/\d+/g).join(""))
  35. if (appnum > ids) {
  36. console.log(appnum, ids)
  37. } else {
  38. var obj = {
  39. head: "版本" + res[i].app_num + "主要更新",
  40. body: res[i].app_desc,
  41. }
  42. this.itemList.push(obj)
  43. }
  44. }
  45. if (res.length == 0) {
  46. this.dataTF = true
  47. } else {
  48. this.dataTF = false
  49. }
  50. },
  51. showtf(index) {
  52. this.indexnum = index
  53. console.log(this.indexnum)
  54. }
  55. },
  56. onLoad() {
  57. this.getEquipList()
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. page {
  63. background-color: #f1f1f1;
  64. }
  65. .u-collapse-item {
  66. width: 100%;
  67. // height: 110rpx;
  68. padding: 10rpx 28rpx;
  69. justify-content: space-between;
  70. box-sizing: border-box;
  71. margin-bottom: 20rpx;
  72. background-color: #FFFFFF;
  73. }
  74. .records {
  75. margin-top: 20rpx;
  76. .records_itemtf {
  77. font-size: 30rpx;
  78. width: 100%;
  79. height: 100rpx;
  80. line-height: 100rpx;
  81. text-align: center;
  82. }
  83. }
  84. </style>