fileList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <view class="">
  3. <view class="navbar">
  4. <view class="back">
  5. <text class="iconfont icon-fanhui " @click="backLast()"></text>
  6. </view>
  7. <text>文件列表</text>
  8. </view>
  9. <view class="list-home">
  10. <view class="list-border" v-for="(item,index) in filelist" @click="fileDetail(item.id)">
  11. <view class="list-box">
  12. <view class="left">
  13. <view class="title">{{item.name}}</view>
  14. <view class="time">日期:{{item.updated_at}}</view>
  15. </view>
  16. <view class="right">
  17. <text>详情</text><text class="iconfont icon-right"></text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="add-box">
  22. <view class="add" @click="upLoad()">
  23. 上传{{steps.name}}
  24. </view>
  25. </view>
  26. <view class="kong" v-show="isShow">
  27. <image src="../../static/images/kong.png" mode=""></image>
  28. <view class="text">
  29. 暂无数据~
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import navBar from '../../components/navBar/navbar.vue';
  37. var app = getApp()
  38. export default {
  39. data() {
  40. return {
  41. filelist: [],
  42. page: 1,
  43. isShow: false,
  44. steps: {}
  45. }
  46. },
  47. components:{
  48. navBar
  49. },
  50. created() {
  51. },
  52. onShow() {
  53. this.filelist = []
  54. uni.showLoading()
  55. let orderList = uni.getStorageSync('steps')
  56. this.steps = orderList
  57. // let orderList = JSON.parse(options.date)
  58. console.log(orderList, '8888888')
  59. this.getList();
  60. },
  61. onReachBottom() {
  62. console.log('触底时间')
  63. uni.showLoading()
  64. this.page++;
  65. let params = {
  66. key: uni.getStorageSync('steps').key,
  67. organization_ids: uni.getStorageSync('userInfo').organization_ids,
  68. page: this.page
  69. }
  70. app.request('/archives', params, 'get').then(res => {
  71. let data = res.data.data.data
  72. this.filelist = this.filelist.concat(data)
  73. uni.hideLoading()
  74. if (data.length == 0) {
  75. uni.showToast({
  76. title: '到底了~',
  77. icon: 'none'
  78. })
  79. }
  80. })
  81. },
  82. methods: {
  83. backLast:function(){
  84. console.log(this.url)
  85. uni.reLaunch({
  86. url:'./index'
  87. })
  88. },
  89. fileDetail: function(id) {
  90. uni.navigateTo({
  91. url: './detail?id=' + id
  92. })
  93. },
  94. upLoad: function() {
  95. uni.navigateTo({
  96. url: './upload'
  97. })
  98. },
  99. getList: function() {
  100. let params = {
  101. key: uni.getStorageSync('steps').key,
  102. organization_ids: uni.getStorageSync('userInfo').organization_ids,
  103. page: this.page
  104. }
  105. app.request('/archives', params, 'get').then(res => {
  106. this.filelist = res.data.data.data
  107. if (this.filelist.length == 0) {
  108. this.isShow = true
  109. }else{
  110. this.isShow=false
  111. }
  112. uni.hideLoading()
  113. })
  114. },
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .navbar {
  120. font-size: 32upx;
  121. height: 100upx;
  122. line-height: 100upx;
  123. color: #888888;
  124. position: relative;
  125. position: fixed;
  126. top: 0;
  127. z-index: 9999999;
  128. width: 100%;
  129. background-color: #FFFFFF;
  130. text-align: center;
  131. border-bottom: solid 2upx #EFF1F6;
  132. .back {
  133. height: 100upx;
  134. width: 100upx;
  135. text-align: center;
  136. // background-color: #007AFF;
  137. position: absolute;
  138. float: left;
  139. left: 0upx;
  140. font-size: 32upx;
  141. }
  142. }
  143. .list-home {
  144. padding:120upx 30upx 20upx 30upx;
  145. background-color: #FFFFFF;
  146. .list-border {
  147. // width: 95%;
  148. margin: 0 auto;
  149. border-radius: 10upx;
  150. background-color: #FFFFFF;
  151. margin-top: 40upx;
  152. box-shadow: 2px 2px 5px #c2c2c2;
  153. padding: 20upx 30upx;
  154. .list {
  155. height: 80;
  156. line-height: 80upx;
  157. display: flex;
  158. .name {
  159. flex: 1;
  160. font-size: 32upx;
  161. }
  162. .operate {
  163. flex: 0 0 100upx;
  164. font-size: 26upx;
  165. text-align: center;
  166. color: #e61916;
  167. .iconfont {
  168. font-size: 24upx;
  169. margin-left: 8upx;
  170. }
  171. }
  172. .time {
  173. font-size: 28upx;
  174. color: #ababab;
  175. flex: 1;
  176. }
  177. .delete {
  178. flex: 0 0 100upx;
  179. border: solid 2upx #f58080;
  180. font-size: 24upx;
  181. text-align: center;
  182. border-radius: 10upx;
  183. height: 40upx;
  184. color: #f59b9b;
  185. line-height: 40upx;
  186. margin-top: 20upx;
  187. }
  188. }
  189. }
  190. .add-box {
  191. position: fixed;
  192. bottom: 50upx;
  193. width: 100%;
  194. left: 0;
  195. text-align: center;
  196. }
  197. .add {
  198. height: 80upx;
  199. margin: 0 auto;
  200. padding: 5upx 0;
  201. width: 85%;
  202. border-radius: 40upx;
  203. text-align: center;
  204. line-height: 80upx;
  205. font-weight: bold;
  206. color: #FFFFFF;
  207. font-size: 30upx;
  208. background-color: #e61916;
  209. }
  210. .kong {
  211. margin-top: 30%;
  212. text-align: center;
  213. image {
  214. width: 300upx;
  215. height: 300upx;
  216. }
  217. .text {
  218. font-size: 34upx;
  219. margin-top: 30upx;
  220. color: #e61916;
  221. }
  222. }
  223. .list-box {
  224. .left {
  225. width: 83%;
  226. display: inline-block;
  227. vertical-align: middle;
  228. .title {
  229. font-size:32upx;
  230. line-height:40upx;
  231. padding: 5upx 0;
  232. display: -webkit-box;
  233. -webkit-box-orient: vertical;
  234. -webkit-line-clamp: 2;
  235. overflow: hidden;
  236. color: #535353;
  237. // max-height: 56px;
  238. }
  239. .time {
  240. font-size: 26upx;
  241. padding-top:20upx;
  242. color: #ababab;
  243. }
  244. }
  245. .right {
  246. width: calc(17% - 1px);
  247. display: inline-block;
  248. font-size: 28upx;
  249. vertical-align: middle;
  250. text-align: right;
  251. color: #e61916;
  252. border-left: 1px dotted #666;
  253. height: 300%;
  254. line-height: 300%;
  255. }
  256. }
  257. }
  258. </style>