files.vue 5.6 KB

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