updateList.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view>
  3. <view class="updataList_ul" v-if="listData.length">
  4. <view class="updataList_list" @click="defails(item.app_desc)" v-for="item in listData">
  5. <view ref="listTxt" class="updataList_listTxt">版本{{ item.app_version }} 更新 {{ item.create_time }}</view>
  6. <u-icon name="arrow-right" color="#666" size="28"></u-icon>
  7. </view>
  8. </view>
  9. <view class="notDataBox" v-else>
  10. 暂无版本更新记录哦~
  11. </view>
  12. <!-- 弹框 -->
  13. <u-modal v-model="show" title="更新内容" :content="content"></u-modal>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. show: false,
  21. content: '',
  22. title: '',
  23. listData: [], //数据数组
  24. }
  25. },
  26. methods: {
  27. defails(app_desc) {
  28. this.content = app_desc
  29. this.show = true
  30. },
  31. async listAxios() {
  32. const res = await this.$myRequest({
  33. url: '/api/api_gateway?method=back_source.appupdate.get_app_Update_history',
  34. })
  35. console.log(res)
  36. this.listData = res
  37. },
  38. },
  39. // 滚动到底翻页
  40. onReachBottom() {
  41. this.listAxios()
  42. },
  43. // 监听下拉动作
  44. onPullDownRefresh() {
  45. setTimeout(() => {
  46. this.listData = [],
  47. this.listAxios()
  48. uni.stopPullDownRefresh()
  49. }, 2000)
  50. },
  51. onLoad() {
  52. this.listAxios()
  53. },
  54. }
  55. </script>
  56. <style lang="scss">
  57. .updataList_ul {
  58. background: #fff;
  59. margin: 15rpx 0 0 0;
  60. .updataList_list {
  61. height: 90rpx;
  62. display: flex;
  63. width: 700rpx;
  64. margin: 0 auto;
  65. justify-content: space-between;
  66. border-bottom: 1px solid #dcd7d7;
  67. .updataList_listTxt {
  68. color: #5d5d5d;
  69. padding: 25rpx 0 25rpx 0;
  70. }
  71. .updataList_listName {
  72. color: #5d5d5d;
  73. }
  74. .updataList_listRight {
  75. width: 50rpx;
  76. height: 50rpx;
  77. margin: 20rpx 0 0 0;
  78. }
  79. }
  80. }
  81. // 暂无数据
  82. .notDataBox {
  83. text-align: center;
  84. font-size:34rpx;
  85. line-height: 200rpx;
  86. }
  87. </style>