nk-select-file.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. <template>
  2. <view class="file-outerBox" @touchmove.prevent v-if="isOpen">
  3. <view style="width: 100%; padding-top: --status-bar-height;"></view>
  4. <view class="file-titel" :style="{backgroundColor: navBgColor}">
  5. <view class="file-nav-leftBox" @click="backAddress">
  6. <image :src="backImg" mode="widthFix" class="file-back-img"></image>
  7. </view>
  8. <text :style="titelStyle">
  9. {{titel}}
  10. </text>
  11. <view class="file-nav-rightBox"></view>
  12. </view>
  13. <view class="file-address">
  14. <view class="root-box" @click="backRoot">
  15. 内部存储
  16. <image :src="directionImg" mode="widthFix" class="to-img-box"></image>
  17. </view>
  18. <scroll-view :scroll-x="true" class="address-scroll">
  19. <view class="address-box" v-for="(item,index) in addressBar" @click="backFolder(item,index)">
  20. {{item.name}}
  21. <image :src="directionImg" mode="widthFix" class="to-img-box"></image>
  22. </view>
  23. </scroll-view>
  24. </view>
  25. <view class="">
  26. <scroll-view :scroll-y="true" :style="{height: 'calc(100vh - ' + (barHeight*2 + 280) + 'rpx)'}">
  27. <view class="select-tips" v-if="inaccessible">
  28. <view style="line-height: 40rpx;">
  29. 无法访问的文件夹
  30. </view>
  31. <view style="line-height: 40rpx;">
  32. 建议前往安卓存储访问框架查看文件
  33. </view>
  34. </view>
  35. <view class="folder-box" v-for="item in folderArr" @click="toFolder(item)">
  36. <view class="folder-name-box">
  37. <image :src="folderImg" mode="widthFix" class="folder-img"></image>
  38. <view class="name-box">{{item.name}}</view>
  39. </view>
  40. <view>
  41. <image :src="enterImg" mode="widthFix" class="toFolder-img"></image>
  42. </view>
  43. </view>
  44. <view class="file-box" v-for="(item,index) in fileArr" @click="selectFile(index)">
  45. <view class="file-name-box">
  46. <image :src="fileImg" mode="widthFix" class="file-img" v-if="item.type == 'file'"></image>
  47. <image :src="txtImg" mode="widthFix" class="file-img" v-if="item.type == 'txt'"></image>
  48. <image :src="docImg" mode="widthFix" class="file-img" v-if="item.type == 'doc'"></image>
  49. <image :src="pdfImg" mode="widthFix" class="file-img" v-if="item.type == 'pdf'"></image>
  50. <view class="name-box">
  51. {{item.name}}
  52. </view>
  53. </view>
  54. <view>
  55. <image :src="selectedImg" mode="widthFix" class="select-img" v-if="item.select"></image>
  56. <image :src="unselectedImg" mode="widthFix" class="select-img" v-else></image>
  57. </view>
  58. </view>
  59. </scroll-view>
  60. </view>
  61. <view class="">
  62. <button type="default" class="select-foot-btn" :style="btnStyle" @click="uploadBtn">{{btnText}}</button>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. /*
  68. *
  69. * {property} 使用 v-model 绑定一个变量来控制组件的开启与关闭
  70. * {property} navBgColor [String] 顶部标题栏背景色
  71. * {property} folderImg [String] 文件夹的图片
  72. * {property} backImg [String] 返回上一级图片
  73. * {property} directionImg [String] 右指向箭头
  74. * {property} enterImg [String] 进入文件夹箭头
  75. * {property} fileImg [String] 未知文件通用图标,当前仅可识别 pdf、doc/docx、txt
  76. * {property} txtImg [String] txt文件图标
  77. * {property} docImg [String] doc/docx文件图标
  78. * {property} pdfImg [String] pdf文件图标
  79. * {property} selectedImg [String] 选中状态下的按钮图标
  80. * {property} unselectedImg [String] 未选中状态下的按钮图标
  81. * {property} titel [String] 标题文字,默认 '选择文件'
  82. * {property} titelSize [String,Number] 标题文字大小,默认 36rpx
  83. * {property} titelWeight [String,Number] 标题文字粗细,默认 600
  84. * {property} titelColor [String] 标题文字颜色,默认 #373737
  85. * {property} btnText [String] 底部按钮文字, 默认 '上传'
  86. * {property} btnSize [String,Number] 底部按钮文字大小, 默认 36rpx
  87. * {property} btnHeight [String,Number] 底部按钮高度, 默认 92rpx
  88. * {property} btnBgColor [String] 底部按钮颜色, 默认 #6521e2
  89. * {property} btnTextColor [String] 底部按钮文字颜色, 默认 #fff
  90. * {property} filterArr [Array] 筛选文件类型,示例:['doc','PDF'],不区分大小写
  91. *
  92. * {event} confirm [Function] 点击上传按钮触发的回调事件,会返回选中文件的地址 event = [{name: name, url: path, sizeMB: sizeMb}]
  93. * name: 文件名 url: 文件地址 sizeMB: 文件大小,单位MB
  94. */
  95. export default {
  96. name:"nk-select-file",
  97. props:{
  98. value:{
  99. type: Boolean,
  100. default: false
  101. },
  102. backImg:{
  103. type: String,
  104. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/c08ef3dc-2514-443d-91aa-a055a098077f.png'
  105. },
  106. directionImg:{
  107. type: String,
  108. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/183fcda4-b046-4723-8356-dded284bdefc.png'
  109. },
  110. enterImg:{
  111. type: String,
  112. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/138ad94e-84e5-460e-a4eb-9e29d2139049.png'
  113. },
  114. folderImg:{
  115. type: String,
  116. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/7f70ee21-bd9c-4630-9a0a-113d78a99335.png'
  117. },
  118. fileImg:{
  119. type: String,
  120. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/24fe2fda-a956-402e-af65-e11f8779c6d1.png'
  121. },
  122. txtImg:{
  123. type: String,
  124. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/10450e01-189b-48c7-9b97-918104fdd701.png'
  125. },
  126. docImg:{
  127. type: String,
  128. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/501660e5-8386-473f-bfcb-34c0b2b4a2f8.png'
  129. },
  130. pdfImg:{
  131. type: String,
  132. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/b1056050-6d27-454e-b2b7-51e3832cfe5e.png'
  133. },
  134. selectedImg:{
  135. type: String,
  136. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/ebaaad9d-4697-42d1-beea-f4c736132b9a.png'
  137. },
  138. unselectedImg:{
  139. type: String,
  140. default: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5c697db4-d920-4af3-90a0-19211379b881/ea5fe3fa-799b-40c9-be01-00d0b7419c4a.png'
  141. },
  142. titel:{
  143. type: String,
  144. default: '选择文件'
  145. },
  146. titelSize: {
  147. type: [String,Number],
  148. default: 36
  149. },
  150. titelWeight: {
  151. type: [String,Number],
  152. default: 600
  153. },
  154. titelColor: {
  155. type: String,
  156. default: '#373737'
  157. },
  158. btnText: {
  159. type: String,
  160. default: '上传'
  161. },
  162. btnSize: {
  163. type: [String,Number],
  164. default: 36
  165. },
  166. btnHeight: {
  167. type: [String,Number],
  168. default: 92
  169. },
  170. btnBgColor: {
  171. type: String,
  172. default: '#6521e2'
  173. },
  174. btnTextColor: {
  175. type: String,
  176. default: '#fff'
  177. },
  178. navBgColor: {
  179. type: String,
  180. default: '#fff'
  181. },
  182. filterArr: {
  183. type: Array,
  184. default () {
  185. return []
  186. }
  187. }
  188. },
  189. data() {
  190. return {
  191. barHeight: '', // 状态栏高度
  192. rootAddress: {}, // 根目录
  193. addressBar: [], // 地址栏记录栈
  194. folderArr: [], // 文件夹
  195. fileArr: [], // 文件
  196. selectArr:[], // 选中文件集合
  197. isExit: true, // 退出
  198. isOpen: false,
  199. inaccessible: false, // 无法访问提示
  200. titelStyle: {
  201. fontSize: this.titelSize + 'rpx',
  202. fontWeight: this.titelWeight,
  203. color: this.titelColor
  204. },
  205. btnStyle: {
  206. height: this.btnHeight + 'rpx',
  207. backgroundColor: this.btnBgColor,
  208. color: this.btnTextColor,
  209. fontSize: this.btnSize + 'rpx'
  210. },
  211. filterReg: ''
  212. };
  213. },
  214. watch:{
  215. value(val){
  216. if(val){
  217. this.open();
  218. }else{
  219. this.close();
  220. }
  221. }
  222. },
  223. mounted() {
  224. if(Object.prototype.toString.call(this.filterArr) === '[object Array]' && this.filterArr.length > 0){
  225. let str = this.filterArr.join("|");
  226. this.filterReg = new RegExp(str,'i');
  227. }
  228. },
  229. methods:{
  230. // 打开组件
  231. open(){
  232. this.isOpen = true;
  233. this.getBarHeight();
  234. this.getRootDirectory();
  235. },
  236. // 关闭组件
  237. close(){
  238. this.isOpen = false;
  239. this.rootAddress = {}; // 根目录
  240. this.addressBar = []; // 地址栏记录栈
  241. this.folderArr = [];
  242. this.fileArr = [];
  243. this.selectArr = []; // 选中文件集合
  244. this.$emit('input', false);
  245. // 放到下一个生命周期,因为双向绑定的value修改父组件状态需要时间,且是异步的
  246. this.$nextTick(() => {
  247. this.$emit('change', false);
  248. })
  249. },
  250. // 获取状态栏高度
  251. getBarHeight(){
  252. var self = this;
  253. uni.getSystemInfo({
  254. success(res) {
  255. self.barHeight = res.statusBarHeight;
  256. }
  257. })
  258. },
  259. // 获取根目录
  260. getRootDirectory(){
  261. this.inaccessible = false;
  262. // 修改退出状态,以便在点击返回按钮时最后一层返回的是根目录,再点击一次才会退出
  263. this.isExit = false;
  264. this.addressBar = [];
  265. var environment = plus.android.importClass("android.os.Environment");
  266. environment.getExternalStorageState() === environment.MEDIA_MOUNTED;
  267. var sdRoot = environment.getExternalStorageDirectory();
  268. var rootName = plus.android.invoke(sdRoot,"getName");
  269. this.rootAddress = {
  270. name: rootName,
  271. file: sdRoot,
  272. };
  273. var files = plus.android.invoke(sdRoot,"listFiles");
  274. if(!(Object.prototype.toString.call(files) === '[object Array]')){
  275. uni.showToast({
  276. icon: 'none',
  277. title: '请确认授权访问',
  278. duration: 2000
  279. });
  280. return;
  281. }
  282. var len = files.length;
  283. for(let i = 0; i < len; i++){
  284. // 过滤隐藏文件
  285. if(!plus.android.invoke(files[i],"isHidden")){
  286. // 判断是文件还是文件夹
  287. if(plus.android.invoke(files[i],"isDirectory")){
  288. var folderName = plus.android.invoke(files[i],"getName")
  289. this.folderArr.push({name: folderName,file: files[i]})
  290. }
  291. else{
  292. var fileName = plus.android.invoke(files[i],"getName")
  293. if(this.filterArr.length > 0){
  294. if(fileName.search(this.filterReg) < 0){
  295. continue;
  296. }
  297. }
  298. if(fileName.search(/txt/i) > -1){
  299. // txt 文件
  300. this.fileArr.push({name: fileName,file: files[i],type: 'txt',select: false})
  301. }
  302. else if(fileName.search(/doc|docx/i) > -1){
  303. // doc/docx 文件
  304. this.fileArr.push({name: fileName,file: files[i],type: 'doc',select: false})
  305. }
  306. else if(fileName.search(/pdf/i) > -1){
  307. // pdf 文件
  308. this.fileArr.push({name: fileName,file: files[i],type: 'pdf',select: false})
  309. }
  310. else{
  311. // 其他文件
  312. this.fileArr.push({name: fileName,file: files[i],type: 'file',select: false})
  313. }
  314. }
  315. }
  316. }
  317. // 排序,不区分大小写
  318. this.folderArr.sort(function(a,b){return a.name.toUpperCase() > b.name.toUpperCase() ? '1' : '-1'});
  319. this.fileArr.sort(function(a,b){return a.name.toUpperCase() > b.name.toUpperCase() ? '1' : '-1'});
  320. this.rootAddress.folderArr = this.folderArr;
  321. this.rootAddress.fileArr = this.fileArr;
  322. },
  323. // 进入文件夹
  324. toFolder(event){
  325. this.isExit = false; // 地址栈中存在新地址,重置退出状态
  326. this.folderArr = [];
  327. this.fileArr = [];
  328. this.addressBar.push(event)
  329. var files = plus.android.invoke(event.file,"listFiles");
  330. if(files == null){
  331. this.inaccessible = true;
  332. }
  333. var len = files.length;
  334. for(let i = 0; i < len; i++){
  335. // 过滤隐藏文件
  336. if(!plus.android.invoke(files[i],"isHidden")){
  337. // 判断是文件还是文件夹
  338. if(plus.android.invoke(files[i],"isDirectory")){
  339. var folderName = plus.android.invoke(files[i],"getName")
  340. this.folderArr.push({name: folderName,file: files[i]})
  341. }
  342. else{
  343. var fileName = plus.android.invoke(files[i],"getName")
  344. if(this.filterArr.length > 0){
  345. if(fileName.search(this.filterReg) < 0){
  346. continue;
  347. }
  348. }
  349. if(fileName.search(/txt/i) > -1){
  350. // txt 文件
  351. this.fileArr.push({name: fileName,file: files[i],type: 'txt',select: false})
  352. }
  353. else if(fileName.search(/doc|docx/i) > -1){
  354. // doc/docx 文件
  355. this.fileArr.push({name: fileName,file: files[i],type: 'doc',select: false})
  356. }
  357. else if(fileName.search(/pdf/i) > -1){
  358. // pdf 文件
  359. this.fileArr.push({name: fileName,file: files[i],type: 'pdf',select: false})
  360. }
  361. else{
  362. // 其他文件
  363. this.fileArr.push({name: fileName,file: files[i],type: 'file',select: false})
  364. }
  365. }
  366. }
  367. }
  368. // 排序,不区分大小写
  369. this.folderArr.sort(function(a,b){return a.name.toUpperCase() > b.name.toUpperCase() ? '1' : '-1'});
  370. this.fileArr.sort(function(a,b){return a.name.toUpperCase() > b.name.toUpperCase() ? '1' : '-1'});
  371. },
  372. // 返回根目录
  373. backRoot(){
  374. this.inaccessible = false;
  375. this.addressBar = [];
  376. this.folderArr = this.rootAddress.folderArr;
  377. this.fileArr = this.rootAddress.fileArr;
  378. },
  379. // 返回上级文件夹
  380. backFolder(event,index){
  381. this.inaccessible = false;
  382. var len = this.addressBar.length;
  383. if(index + 1 == len){
  384. // 点击当前文件夹--无事发生
  385. return;
  386. }
  387. else{
  388. this.folderArr = [];
  389. this.fileArr = [];
  390. this.addressBar.splice(index + 1, len - index + 1)
  391. var files = plus.android.invoke(event.file,"listFiles");
  392. var len = files.length;
  393. for(let i = 0; i < len; i++){
  394. // 过滤隐藏文件
  395. if(!plus.android.invoke(files[i],"isHidden")){
  396. // 判断是文件还是文件夹
  397. if(plus.android.invoke(files[i],"isDirectory")){
  398. var folderName = plus.android.invoke(files[i],"getName")
  399. this.folderArr.push({name: folderName,file: files[i]})
  400. }
  401. else{
  402. var fileName = plus.android.invoke(files[i],"getName");
  403. if(this.filterArr.length > 0){
  404. if(fileName.search(this.filterReg) < 0){
  405. continue;
  406. }
  407. }
  408. if(fileName.search(/txt/i) > -1){
  409. // txt 文件
  410. this.fileArr.push({name: fileName,file: files[i],type: 'txt',select: false})
  411. }
  412. else if(fileName.search(/doc|docx/i) > -1){
  413. // doc/docx 文件
  414. this.fileArr.push({name: fileName,file: files[i],type: 'doc',select: false})
  415. }
  416. else if(fileName.search(/pdf/i) > -1){
  417. // pdf 文件
  418. this.fileArr.push({name: fileName,file: files[i],type: 'pdf',select: false})
  419. }
  420. else{
  421. // 其他文件
  422. this.fileArr.push({name: fileName,file: files[i],type: 'file',select: false})
  423. }
  424. }
  425. }
  426. }
  427. // 排序,不区分大小写
  428. this.folderArr.sort(function(a,b){return a.name.toUpperCase() > b.name.toUpperCase() ? '1' : '-1'});
  429. this.fileArr.sort(function(a,b){return a.name.toUpperCase() > b.name.toUpperCase() ? '1' : '-1'});
  430. }
  431. },
  432. // 选中文件
  433. selectFile(index){
  434. if(this.fileArr[index].select){
  435. // 取消选中
  436. this.$set(this.fileArr[index],'select',false);
  437. let name = this.fileArr[index].name;
  438. for(let i = 0; i < this.selectArr.length; i++){
  439. if(name == this.selectArr[i].name){
  440. this.selectArr.splice(i,1);
  441. break;
  442. }
  443. }
  444. }else{
  445. // 选中
  446. this.$set(this.fileArr[index],'select',true);
  447. // 读文件大小
  448. var FileInputStream = plus.android.importClass("java.io.FileInputStream");
  449. var fileSize = new FileInputStream(this.fileArr[index].file);
  450. var size = fileSize.available();
  451. var sizeMb = size / 1048576;
  452. sizeMb = sizeMb.toFixed(4);
  453. // 获取文件的相对路径
  454. var Path = plus.android.invoke(this.fileArr[index].file,"getPath")
  455. this.selectArr.push({name: this.fileArr[index].name, url: Path, sizeMB: sizeMb})
  456. }
  457. },
  458. // 点击上传按钮
  459. uploadBtn(){
  460. this.$emit("confirm",this.selectArr);
  461. this.close();
  462. },
  463. // 点击返回
  464. backAddress(){
  465. // 先判断地址栈中是否还有地址
  466. var len = this.addressBar.length;
  467. if(len > 1){
  468. // 返回上级文件夹
  469. let index = len - 2;
  470. let event = this.addressBar[index];
  471. this.backFolder(event,index);
  472. }
  473. else{
  474. // 退出文件选择
  475. if(this.isExit){
  476. // 退出文件选择
  477. this.close();
  478. // this.$u.toast('在点击一次退出文件选择')
  479. }
  480. else{
  481. // 返回根目录
  482. this.isExit = true; // 下一次再点击则退出
  483. this.backRoot();
  484. uni.showToast({
  485. title: '再操作一次退出文件选择',
  486. icon: 'none',
  487. duration: 1000
  488. });
  489. }
  490. }
  491. }
  492. }
  493. }
  494. </script>
  495. <style lang="scss">
  496. .file-outerBox{
  497. width: 100%;
  498. height: 100vh;
  499. position: fixed;
  500. top: 0;
  501. left: 0;
  502. right: 0;
  503. bottom: 0;
  504. z-index: 1070;
  505. padding-bottom: 40rpx;
  506. background-color: #fff;
  507. .file-titel{
  508. width: 100%;
  509. height: 80rpx;
  510. line-height: 80rpx;
  511. text-align: center;
  512. // background-color: #FFFFFF;
  513. padding: 0 32rpx;
  514. display: flex;
  515. align-items: center;
  516. justify-content: space-between;
  517. .file-nav-leftBox{
  518. width: 60rpx;
  519. height: 100%;
  520. display: flex;
  521. align-items: center;
  522. justify-content: center;
  523. .file-back-img{
  524. width: 36rpx;
  525. }
  526. }
  527. .file-nav-rightBox{
  528. width: 60rpx;
  529. height: 100%;
  530. }
  531. }
  532. .file-address{
  533. width: 100%;
  534. height: 60rpx;
  535. background-color: #FBFBFB;
  536. padding: 0 32rpx;
  537. display: flex;
  538. color: #373737;
  539. font-size: 24rpx;
  540. .address-scroll{
  541. width: calc(100% - 116rpx);
  542. white-space: nowrap;
  543. height: 100%;
  544. .address-box{
  545. height: 60rpx;
  546. line-height: 60rpx;
  547. display: inline-block;
  548. .to-img-box{
  549. width: 20rpx;
  550. }
  551. }
  552. }
  553. .root-box{
  554. width: 116rpx;
  555. height: 60rpx;
  556. line-height: 60rpx;
  557. display: inline-block;
  558. box-shadow: 10rpx 0 10rpx -10rpx rgba(8,8,8,0.3);
  559. .to-img-box{
  560. width: 20rpx;
  561. }
  562. }
  563. }
  564. .folder-box{
  565. height: 120rpx;
  566. display: flex;
  567. align-items: center;
  568. justify-content: space-between;
  569. margin: 0 32rpx;
  570. border-bottom: 1px solid #EEEEEE;
  571. .folder-name-box{
  572. width: 80%;
  573. display: flex;
  574. align-items: center;
  575. flex-wrap: wrap;
  576. .folder-img{
  577. width: 72rpx;
  578. margin-right: 16rpx;
  579. }
  580. .name-box{
  581. width: calc(100% - 100rpx);
  582. overflow: hidden;
  583. word-wrap: break-word;
  584. text-overflow: ellipsis;
  585. display: -webkit-box;
  586. -webkit-line-clamp: 2;
  587. -webkit-box-orient: vertical;
  588. }
  589. }
  590. .toFolder-img{
  591. width: 28rpx;
  592. }
  593. }
  594. .select-tips{
  595. width: 100%;
  596. height: 160rpx;
  597. text-align: center;
  598. font-size: 32rpx;
  599. color: #888;
  600. padding-top: 60rpx;
  601. }
  602. .file-box{
  603. height: 120rpx;
  604. display: flex;
  605. align-items: center;
  606. justify-content: space-between;
  607. margin: 0 32rpx;
  608. border-bottom: 1px solid #EEEEEE;
  609. .file-name-box{
  610. width: 80%;
  611. display: flex;
  612. align-items: center;
  613. .file-img{
  614. width: 72rpx;
  615. margin-right: 16rpx;
  616. }
  617. // .type-file{
  618. // width: 60rpx;
  619. // margin-left: 10rpx;
  620. // }
  621. .name-box{
  622. width: calc(100% - 100rpx);
  623. overflow: hidden;
  624. word-wrap: break-word;
  625. text-overflow: ellipsis;
  626. display: -webkit-box;
  627. -webkit-line-clamp: 2;
  628. -webkit-box-orient: vertical;
  629. }
  630. }
  631. .select-img{
  632. width: 32rpx;
  633. }
  634. }
  635. .select-foot-btn{
  636. width: calc(100% - 64rpx);
  637. margin-top: 20rpx;
  638. }
  639. }
  640. </style>