detail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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="upload-home">
  10. <view class="imgList">
  11. <view class="img-title">文件预览</view>
  12. <view class="img-box">
  13. <view class="htz-image-upload-list">
  14. <view class="htz-image-upload-Item" v-for="(item,index) in fileDetail.resource" :key="index" @click="enlargeImg(item)">
  15. <image class="img" :src="item" ></image>
  16. <!-- <view class="htz-image-upload-Item-del" v-if="remove" @click="imgDel(index)">×</view> -->
  17. </view>
  18. </view>
  19. <!-- -->
  20. </view>
  21. <view class="frame" v-show="isShow" @click="isShow=false">
  22. <view class="border" >
  23. <image :src="bigImg" mode="aspectFit" :lazy-load="true"></image>
  24. </view>
  25. </view>
  26. <!-- <view class="remark">
  27. 拍摄时确保文件照片<text style="color: red;">边缘完整,字体完整,亮度均匀。</text>
  28. </view> -->
  29. </view>
  30. <view class="table">
  31. <view class="title">文件信息</view>
  32. <view class="text-box">
  33. <text class="input-key">文件名称:</text><text class="input-val">{{fileDetail.name}}</text>
  34. </view>
  35. <view class="text-box">
  36. <text class="input-key">上传时间:</text><text class="input-val">{{fileDetail.updated_at}}</text>
  37. </view>
  38. </view>
  39. <!-- <view class="tips" v-if="tips">
  40. <view class="title">注意事项:</view>
  41. <view class="content">{{tips}}点击下载模板</view>
  42. </view> -->
  43. <view class="submit" @click="deleteSubmit()">
  44. 删除
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. var app = getApp()
  51. import navBar from '../../components/navBar/navbar.vue';
  52. export default {
  53. components:{
  54. navBar
  55. },
  56. data() {
  57. return {
  58. fileDetail: {
  59. updated_at: "",
  60. status_text: "",
  61. user: {
  62. name: ''
  63. },
  64. name: ""
  65. },
  66. isShow: false,
  67. bigImg: "",
  68. id: ""
  69. }
  70. },
  71. onLoad(options) {
  72. uni.showLoading()
  73. let id = options.id
  74. this.id = options.id
  75. app.request('/archives/' + id, '', 'get').then(res => {
  76. this.fileDetail = res.data.data
  77. uni.hideLoading()
  78. console.log(res.data.data, '------------------列表详情')
  79. })
  80. },
  81. methods: {
  82. backLast:function(){
  83. console.log(this.url)
  84. uni.reLaunch({
  85. url:'./fileList'
  86. })
  87. },
  88. enlargeImg: function(e) {
  89. this.bigImg = e
  90. this.isShow = true
  91. },
  92. //删除数据
  93. deleteSubmit: function(id) {
  94. var that = this
  95. uni.showModal({
  96. title: '提示',
  97. content: '该操作将删除此项文件',
  98. success: function(res) {
  99. if (res.confirm) {
  100. uni.showLoading()
  101. app.request('/archives/' + that.id, '', 'delete').then(res => {
  102. console.log(res, "删除")
  103. uni.hideLoading()
  104. if (res.statusCode == 200) {
  105. uni.showToast({
  106. title: '删除成功',
  107. icon: 'none'
  108. })
  109. setTimeout(function(){
  110. uni.navigateBack()
  111. },500)
  112. }else{
  113. uni.showToast({
  114. title: '删除失败,请重试',
  115. icon: 'none'
  116. })
  117. }
  118. })
  119. } else if (res.cancel) {
  120. console.log('用户点击取消');
  121. }
  122. }
  123. });
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss">
  129. page {
  130. background-color: #EFF1F6;
  131. }
  132. .navbar {
  133. font-size: 32upx;
  134. height: 100upx;
  135. line-height: 100upx;
  136. color: #888888;
  137. position: relative;
  138. position: fixed;
  139. top: 0;
  140. z-index: 9999999;
  141. width: 100%;
  142. background-color: #FFFFFF;
  143. text-align: center;
  144. border-bottom: solid 2upx #EFF1F6;
  145. .back {
  146. height: 100upx;
  147. width: 100upx;
  148. text-align: center;
  149. // background-color: #007AFF;
  150. position: absolute;
  151. float: left;
  152. left: 0upx;
  153. font-size: 32upx;
  154. }
  155. }
  156. uni-page-body {
  157. height: 100%;
  158. }
  159. .htz-image-upload-list {
  160. display: flex;
  161. flex-wrap: wrap;
  162. justify-content: start;
  163. }
  164. .htz-image-upload-Item {
  165. // width: 200rpx;
  166. height: 200rpx;
  167. margin: 13rpx;
  168. border-radius: 10rpx;
  169. line-height: 200rpx;
  170. flex: 0 0 30%;
  171. position: relative;
  172. }
  173. .htz-image-upload-Item:first-child {
  174. margin-left: 5upx !important;
  175. }
  176. .htz-image-upload-Item:nth-child(4n) {
  177. margin-left: 5upx !important;
  178. }
  179. .htz-image-upload-Item:nth-child(3n) {
  180. margin-right: 5upx !important;
  181. }
  182. .htz-image-upload-Item image {
  183. width: 100%;
  184. height: 100%;
  185. border-radius: 10rpx;
  186. border: 1px solid #FF0000;
  187. }
  188. .upload-home {
  189. background-color: #EFF1F6;
  190. width: 100%;
  191. height: 100%;
  192. padding-top: 100upx;
  193. .table {
  194. background-color: #FFFFFF;
  195. font-size: 28upx;
  196. margin-top: 30upx;
  197. padding: 30upx;
  198. .title {
  199. color: #666;
  200. font-size: 30upx;
  201. display: block;
  202. padding-bottom: 30upx;
  203. border-bottom: 1px solid #EFF1F6;
  204. }
  205. .text-box {
  206. margin-top: 20upx;
  207. .input-key {
  208. display: inline-block;
  209. height: 80upx;
  210. line-height: 80upx;
  211. width: 160upx;
  212. vertical-align: top;
  213. color: #555;
  214. font-size: 32upx;
  215. }
  216. .input-val {
  217. display: inline-block;
  218. height: 80upx;
  219. line-height: 80upx;
  220. vertical-align: top;
  221. width: calc(100% - 160upx);
  222. text-align: right;
  223. color: #333;
  224. font-size: 32upx;
  225. }
  226. }
  227. }
  228. .imgList {
  229. background-color: #fff;
  230. padding: 30upx;
  231. .remark {
  232. font-size: 26upx;
  233. padding-top: 20upx;
  234. color: #555;
  235. }
  236. .img-title {
  237. color: #666;
  238. font-size: 30upx;
  239. display: block;
  240. position: relative;
  241. .down-tmp {
  242. color: red;
  243. position: absolute;
  244. right: 0;
  245. }
  246. }
  247. .img-box {
  248. margin-top: 20upx;
  249. background-color: #F3F3F3;
  250. border-radius: 10upx;
  251. padding: 15upx;
  252. .list-img {}
  253. }
  254. }
  255. .htz-image-upload-list {
  256. display: flex;
  257. flex-wrap: wrap;
  258. }
  259. .htz-image-upload-Item-add {
  260. font-size: 105rpx;
  261. /* line-height: 160rpx; */
  262. text-align: center;
  263. border: 1px dashed #d9d9d9;
  264. color: #d9d9d9;
  265. }
  266. .htz-image-upload-Item-del {
  267. background-color: #f5222d;
  268. font-size: 24rpx;
  269. position: absolute;
  270. width: 35rpx;
  271. height: 35rpx;
  272. line-height: 35rpx;
  273. text-align: center;
  274. top: 0;
  275. right: 0;
  276. z-index: 100;
  277. color: #fff;
  278. }
  279. .tips {
  280. margin: 90upx auto 0;
  281. border: 1px dashed red;
  282. padding: 20upx;
  283. width: 85%;
  284. border-radius: 15upx;
  285. font-size: 28upx;
  286. color: #555;
  287. }
  288. }
  289. .submit {
  290. position: fixed;
  291. height: 80upx;
  292. color: #FFFFFF;
  293. text-align: center;
  294. line-height: 80upx;
  295. width: 80%;
  296. bottom: 20upx;
  297. left: 10%;
  298. font-size: 32upx;
  299. border-radius: 10upx;
  300. background-color: #f5222d;
  301. }
  302. .frame {
  303. position: fixed;
  304. top: 0;
  305. left: 0;
  306. height: 100%;
  307. background-color: rgba($color: #000000, $alpha: 0.7);
  308. width: 100%;
  309. .border {
  310. width: 90%;
  311. height: 70%;
  312. // background-color: #007AFF;
  313. margin: 0 auto;
  314. margin-top: 100upx;
  315. image {
  316. width: 100%;
  317. height: 100%;
  318. }
  319. }
  320. }
  321. </style>