upload.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. <template>
  2. <view class="u-upload" v-if="!disabled">
  3. <view v-if="showUploadList" class="u-list-item u-preview-wrap" :class="{'customPreviewStyle':custom}"
  4. v-for="(item, index) in lists" :key="index" :style="{
  5. width: width + 'rpx',
  6. height: width + 'rpx'
  7. }">
  8. <view v-if="deletable" class="u-delete-icon" @tap.stop="deleteItem(index)" :style="{
  9. background: delBgColor
  10. }">
  11. <u-icon class="u-icon" :name="delIcon" size="20" :color="delColor"></u-icon>
  12. </view>
  13. <u-line-progress v-if="showProgress && item.progress > 0 && !item.error" :show-percent="false" height="16"
  14. class="u-progress" :percent="item.progress"></u-line-progress>
  15. <view @tap.stop="retry(index)" v-if="item.error" class="u-error-btn">点击重试</view>
  16. <image @tap.stop="doPreviewImage(item.url || item.path, index)" class="u-preview-image" v-if="!item.isImage"
  17. :src="item.url || item.path" :mode="imageMode"></image>
  18. </view>
  19. <slot name="file" :file="lists"></slot>
  20. <view style="display: inline-block;" :style="{
  21. background:custom?customBack:'transparent',
  22. border:custom?customBorder:'1px solid transparent'
  23. }" :class="custom?'customStyle':'default'"
  24. @tap="selectFile" v-if="maxCount > lists.length">
  25. <slot name="addBtn"></slot>
  26. <img v-if="custom&&options.bgc!=''" :src="options.bgc" alt="" class="imgstyle">
  27. <view class="u-list-item u-add-wrap" hover-class="u-add-wrap__hover" hover-stay-time="150" :style="{
  28. width: width + 'rpx',
  29. height: width + 'rpx'
  30. }">
  31. <u-icon v-if="custom&&!customBtn" name="camera-fill" class="" size="100" color="#617E8B"></u-icon>
  32. <image v-if="custom&&customBtn" :style="{
  33. width: customBtnWidth + 'px',
  34. height: customBtnHeight + 'px'
  35. }" :src="customBtnImage" mode=""></image>
  36. <image v-if="!custom" style='width:23px;height:23px;' src="../static/img/liangmai/xiangji-2.png" mode=""></image>
  37. <view v-if="!custom" class="u-add-tips">{{ uploadText }}</view>
  38. <view v-if="custom" :style="{
  39. color: customBtnColor,
  40. 'font-size':customBtnFontSize+'px',
  41. }" class="u-add-tips">{{ options.text }}</view>
  42. </view>
  43. </view>
  44. <!-- <view class="custom-style" v-if="custom"
  45. :style="{backgroundImage: 'url(' + options.bgc + ')', backgroundSize:'100% 100%'}">
  46. </view> -->
  47. </view>
  48. </template>
  49. <script>
  50. /**
  51. * upload 图片上传
  52. * @description 该组件用于上传图片场景
  53. * @tutorial https://www.uviewui.com/components/upload.html
  54. * @property {String} action 服务器上传地址
  55. * @property {String Number} max-count 最大选择图片的数量(默认99)
  56. * @property {Boolean} custom-btn 如果需要自定义选择图片的按钮,设置为true(默认false)
  57. * @property {Boolean} show-progress 是否显示进度条(默认true)
  58. * @property {Boolean} disabled 是否启用(显示/移仓)组件(默认false)
  59. * @property {String} image-mode 预览图片等显示模式,可选值为uni的image的mode属性值(默认aspectFill)
  60. * @property {String} del-icon 右上角删除图标名称,只能为uView内置图标
  61. * @property {String} del-bg-color 右上角关闭按钮的背景颜色
  62. * @property {String} del-color 右上角关闭按钮图标的颜色
  63. * @property {Object} header 上传携带的头信息,对象形式
  64. * @property {Object} form-data 上传额外携带的参数
  65. * @property {String} name 上传文件的字段名,供后端获取使用(默认file)
  66. * @property {Array<String>} size-type original 原图,compressed 压缩图,默认二者都有(默认['original', 'compressed'])
  67. * @property {Array<String>} source-type 选择图片的来源,album-从相册选图,camera-使用相机,默认二者都有(默认['album', 'camera'])
  68. * @property {Boolean} preview-full-image 是否可以通过uni.previewImage预览已选择的图片(默认true)
  69. * @property {Boolean} multiple 是否开启图片多选,部分安卓机型不支持(默认true)
  70. * @property {Boolean} deletable 是否显示删除图片的按钮(默认true)
  71. * @property {String Number} max-size 选择单个文件的最大大小,单位B(byte),默认不限制(默认Number.MAX_VALUE)
  72. * @property {Array<Object>} file-list 默认显示的图片列表,数组元素为对象,必须提供url属性
  73. * @property {Boolean} upload-text 选择图片按钮的提示文字(默认“选择图片”)
  74. * @property {Boolean} auto-upload 选择完图片是否自动上传,见上方说明(默认true)
  75. * @property {Boolean} show-tips 特殊情况下是否自动提示toast,见上方说明(默认true)
  76. * @property {Boolean} show-upload-list 是否显示组件内部的图片预览(默认true)
  77. * @event {Function} on-oversize 图片大小超出最大允许大小
  78. * @event {Function} on-preview 全屏预览图片时触发
  79. * @event {Function} on-remove 移除图片时触发
  80. * @event {Function} on-success 图片上传成功时触发
  81. * @event {Function} on-change 图片上传后,无论成功或者失败都会触发
  82. * @event {Function} on-error 图片上传失败时触发
  83. * @event {Function} on-progress 图片上传过程中的进度变化过程触发
  84. * @event {Function} on-uploaded 所有图片上传完毕触发
  85. * @event {Function} on-choose-complete 每次选择图片后触发,只是让外部可以得知每次选择后,内部的文件列表
  86. * @example <u-upload :action="action" :file-list="fileList" ></u-upload>
  87. */
  88. import uploadImage from '@/components/ossutil/uploadFile.js';
  89. export default {
  90. name: 'upload',
  91. props: {
  92. //是否显示组件自带的图片预览功能
  93. showUploadList: {
  94. type: Boolean,
  95. default: true
  96. },
  97. // 后端地址
  98. action: {
  99. type: String,
  100. default: ''
  101. },
  102. // 最大上传数量
  103. maxCount: {
  104. type: [String, Number],
  105. default: 52,
  106. },
  107. // 是否显示进度条
  108. showProgress: {
  109. type: Boolean,
  110. default: true
  111. },
  112. // 是否启用
  113. disabled: {
  114. type: Boolean,
  115. default: false
  116. },
  117. // 预览上传的图片时的裁剪模式,和image组件mode属性一致
  118. imageMode: {
  119. type: String,
  120. default: 'aspectFill'
  121. },
  122. // 头部信息
  123. header: {
  124. type: Object,
  125. default () {
  126. return {};
  127. }
  128. },
  129. // 额外携带的参数
  130. formData: {
  131. type: Object,
  132. default () {
  133. return {};
  134. }
  135. },
  136. // 上传的文件字段名
  137. name: {
  138. type: String,
  139. default: 'file'
  140. },
  141. // 所选的图片的尺寸, 可选值为original compressed
  142. sizeType: {
  143. type: Array,
  144. default () {
  145. return ['original', 'compressed'];
  146. }
  147. },
  148. sourceType: {
  149. type: Array,
  150. default () {
  151. return ['album', 'camera'];
  152. }
  153. },
  154. // 是否在点击预览图后展示全屏图片预览
  155. previewFullImage: {
  156. type: Boolean,
  157. default: true
  158. },
  159. // 是否开启图片多选,部分安卓机型不支持
  160. multiple: {
  161. type: Boolean,
  162. default: true
  163. },
  164. // 是否展示删除按钮
  165. deletable: {
  166. type: Boolean,
  167. default: true
  168. },
  169. // 文件大小限制,单位为byte
  170. maxSize: {
  171. type: [String, Number],
  172. default: Number.MAX_VALUE
  173. },
  174. // 显示已上传的文件列表
  175. fileList: {
  176. type: Array,
  177. default () {
  178. return [];
  179. }
  180. },
  181. // 上传区域的提示文字
  182. uploadText: {
  183. type: String,
  184. default: '选择图片'
  185. },
  186. // 是否自动上传
  187. autoUpload: {
  188. type: Boolean,
  189. default: true
  190. },
  191. // 是否显示toast消息提示
  192. showTips: {
  193. type: Boolean,
  194. default: true
  195. },
  196. // 是否通过slot自定义传入选择图标的按钮
  197. customBtn: {
  198. type: Boolean,
  199. default: false
  200. },
  201. customBtnImage: {
  202. type: String,
  203. default: ''
  204. },
  205. customBtnWidth: {
  206. type: Number,
  207. default: 0
  208. },
  209. customBtnHeight: {
  210. type: Number,
  211. default: 0
  212. },
  213. customBtnColor: {
  214. type: String,
  215. default: '#617E8B'
  216. },
  217. customBack:{
  218. type: String,
  219. default: '#F5F6FA'
  220. },
  221. customBorder:{
  222. type: String,
  223. default: '2px dashed #C6CBCE'
  224. },
  225. customBtnFontSize:{
  226. type: String,
  227. default: '18'
  228. },
  229. // 内部预览图片区域和选择图片按钮的区域宽度,高等于宽
  230. width: {
  231. type: [String, Number],
  232. default: 200
  233. },
  234. // 右上角关闭按钮的背景颜色
  235. delBgColor: {
  236. type: String,
  237. default: '#fa3534'
  238. },
  239. // 右上角关闭按钮的叉号图标的颜色
  240. delColor: {
  241. type: String,
  242. default: '#ffffff'
  243. },
  244. // 右上角删除图标名称,只能为uView内置图标
  245. delIcon: {
  246. type: String,
  247. default: 'close'
  248. },
  249. // 如果上传后的返回值为json字符串,是否自动转json
  250. toJson: {
  251. type: Boolean,
  252. default: true
  253. },
  254. // 上传前的钩子,每个文件上传前都会执行
  255. beforeUpload: {
  256. type: Function,
  257. default: null
  258. },
  259. options: {
  260. type: Object,
  261. default: null
  262. },
  263. custom: {
  264. type: Boolean,
  265. default: false
  266. },
  267. imgIndex:{
  268. type: Number,
  269. default: false
  270. }
  271. },
  272. mounted() {},
  273. data() {
  274. return {
  275. lists: [],
  276. isInCount: true,
  277. uploading: false,
  278. isSelectFile: false
  279. };
  280. },
  281. watch: {
  282. fileList: {
  283. immediate: true,
  284. handler(val) {
  285. val.map(value => {
  286. this.lists.push({
  287. url: value.url,
  288. error: false,
  289. progress: 100
  290. });
  291. });
  292. }
  293. }
  294. },
  295. methods: {
  296. // 清除列表
  297. clear() {
  298. this.lists = [];
  299. // 如果是清空形式的话,发出"on-list-change"事件
  300. this.$emit('on-list-change', this.lists);
  301. },
  302. // 重新上传队列中上传失败的所有文件
  303. reUpload() {
  304. this.uploadFile();
  305. },
  306. // 选择图片
  307. selectFile() {
  308. if (this.disabled) return;
  309. const {
  310. name = '', maxCount, multiple, maxSize, sizeType, lists, camera, compressed, maxDuration, sourceType
  311. } = this;
  312. let chooseFile = null;
  313. const newMaxCount = maxCount - lists.length;
  314. // 设置为只选择图片的时候使用 chooseImage 来实现
  315. chooseFile = new Promise((resolve, reject) => {
  316. uni.chooseImage({
  317. count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1,
  318. sourceType: sourceType,
  319. sizeType,
  320. success: resolve,
  321. fail: reject
  322. });
  323. });
  324. chooseFile
  325. .then(res => {
  326. let file = null;
  327. let listOldLength = this.lists.length;
  328. res.tempFiles.map((val, index) => {
  329. // 如果是非多选,index大于等于1或者超出最大限制数量时,不处理
  330. if (!multiple && index >= 1) return;
  331. if (val.size > maxSize) {
  332. this.$emit('on-oversize', val, this.lists);
  333. this.showToast('超出允许的文件大小');
  334. } else {
  335. if (maxCount <= lists.length) {
  336. this.$emit('on-exceed', val, this.lists);
  337. this.showToast('超出最大允许的文件个数');
  338. return;
  339. }
  340. let fileName = '';
  341. let fileNameLength = '';
  342. let fileFormat = '';
  343. //#ifdef H5
  344. fileName = val.name.lastIndexOf(".");
  345. fileNameLength = val.name.length;
  346. fileFormat = val.name.substring(fileName + 1, fileNameLength).toLowerCase();
  347. //#endif
  348. //#ifndef H5
  349. fileName = val.path.lastIndexOf(".");
  350. fileNameLength = val.path.length;
  351. fileFormat = val.path.substring(fileName + 1, fileNameLength).toLowerCase();
  352. //#endif
  353. lists.push({
  354. url: val.path,
  355. fileType: fileFormat,
  356. progress: 0,
  357. error: false
  358. });
  359. // 列表发生改变,发出事件,第二个参数为当前发生变化的项的索引
  360. this.$emit('on-list-change', this.lists);
  361. }
  362. });
  363. // 每次图片选择完,抛出一个事件,并将当前内部选择的图片数组抛出去
  364. this.$emit('on-choose-complete', this.lists);
  365. if (this.autoUpload) this.uploadFile(listOldLength);
  366. })
  367. .catch(error => {
  368. this.$emit('on-error', error);
  369. });
  370. },
  371. // 提示用户消息
  372. showToast(message, force = false) {
  373. if (this.showTips || force) {
  374. uni.showToast({
  375. title: message,
  376. icon: 'none'
  377. });
  378. }
  379. },
  380. // 该方法供用户通过ref调用,手动上传
  381. upload() {
  382. this.uploadFile();
  383. },
  384. // 对失败的图片重新上传
  385. retry(index) {
  386. this.lists[index].progress = 0;
  387. this.lists[index].error = false;
  388. this.lists[index].response = null;
  389. uni.showLoading({
  390. title: '重新上传'
  391. });
  392. this.uploadFile(index);
  393. },
  394. // 上传图片
  395. async uploadFile(index = 0) {
  396. if (this.disabled) return;
  397. if (this.uploading) return;
  398. // 全部上传完成
  399. if (index >= this.lists.length) {
  400. this.isSelectFile = true
  401. this.$emit('on-uploaded', this.lists);
  402. return;
  403. }
  404. // 检查上传地址
  405. if (!this.action) {
  406. this.showToast('请配置上传地址', true);
  407. return;
  408. }
  409. // 检查是否是已上传或者正在上传中
  410. if (this.lists[index].progress == 100) {
  411. if (this.autoUpload == false) this.uploadFile(index + 1);
  412. return;
  413. }
  414. // 执行before-upload钩子
  415. if (this.beforeUpload && typeof(this.beforeUpload) === 'function') {
  416. // 执行回调,同时传入索引和文件列表当作参数
  417. let beforeResponse = this.beforeUpload(index, this.lists);
  418. // 判断是否返回了promise
  419. if (!!beforeResponse && typeof beforeResponse.then === 'function') {
  420. await beforeResponse.then(res => {
  421. // promise返回成功,不进行动作,继续上传
  422. }).catch(err => {
  423. // 进入catch回调的话,继续下一张
  424. return this.uploadFile(index + 1);
  425. })
  426. } else if (beforeResponse === false) {
  427. // 如果返回false,继续下一张图片的上传
  428. return this.uploadFile(index + 1);
  429. }
  430. }
  431. this.lists[index].error = false;
  432. this.uploading = true;
  433. uploadImage(this.lists[index].url, 'appData/',
  434. result => {
  435. console.log
  436. // 上传成功
  437. this.lists[index].response = result;
  438. this.lists[index].progress = 100;
  439. this.lists[index].error = false;
  440. let data = result
  441. this.$emit('on-success', data, index, this.lists,this.imgIndex);
  442. uni.hideLoading();
  443. this.uploading = false;
  444. this.uploadFile(index + 1);
  445. this.$emit('on-change', data, index, this.lists,this.imgIndex);
  446. }
  447. )
  448. // 创建上传对象
  449. // const task = uni.uploadFile({
  450. // url: this.action,
  451. // filePath: this.lists[index].url,
  452. // name: this.name,
  453. // formData: this.formData,
  454. // header: this.header,
  455. // success: res => {
  456. // // 判断是否json字符串,将其转为json格式
  457. // let data = this.toJson && this.checkIsJSON(res.data) ? JSON.parse(res.data) : res
  458. // .data;
  459. // if (![200, 201].includes(res.statusCode)) {
  460. // this.uploadError(index, data);
  461. // } else {
  462. // // 上传成功
  463. // this.lists[index].response = data;
  464. // this.lists[index].progress = 100;
  465. // this.lists[index].error = false;
  466. // // this.$emit('on-success', data, index, this.lists);
  467. // }
  468. // },
  469. // fail: e => {
  470. // this.uploadError(index, e);
  471. // },
  472. // complete: res => {
  473. // uni.hideLoading();
  474. // this.uploading = false;
  475. // this.uploadFile(index + 1);
  476. // this.$emit('on-change', res, index, this.lists);
  477. // }
  478. // });
  479. // task.onProgressUpdate(res => {
  480. // if (res.progress > 0) {
  481. // this.lists[index].progress = res.progress;
  482. // this.$emit('on-progress', res, index, this.lists);
  483. // }
  484. // });
  485. },
  486. // 上传失败
  487. uploadError(index, err) {
  488. this.lists[index].progress = 0;
  489. this.lists[index].error = true;
  490. this.lists[index].response = null;
  491. this.$emit('on-error', err, index, this.lists);
  492. this.showToast('上传失败,请重试');
  493. },
  494. // 删除一个图片
  495. deleteItem(index) {
  496. uni.showModal({
  497. title: '提示',
  498. content: '您确定要删除此项吗?',
  499. success: res => {
  500. if (res.confirm) {
  501. this.isSelectFile = false
  502. if (this.lists[index].process < 100 && this.lists[index].process > 0) {
  503. typeof this.lists[index].uploadTask != 'undefined' && this.lists[index]
  504. .uploadTask.abort();
  505. }
  506. this.lists.splice(index, 1);
  507. this.$forceUpdate();
  508. this.$emit('on-remove', index, this.lists);
  509. this.showToast('移除成功');
  510. // 列表发生改变,发出事件
  511. this.$emit('on-list-change', this.lists);
  512. }
  513. }
  514. });
  515. },
  516. // 用户通过ref手动的形式,移除一张图片
  517. remove(index) {
  518. // 判断索引的合法范围
  519. if (index >= 0 && index < this.lists.length) {
  520. this.lists.splice(index, 1);
  521. this.$emit('on-list-change', this.lists);
  522. }
  523. },
  524. // 预览图片
  525. doPreviewImage(url, index) {
  526. console.log(this.lists,url,index)
  527. if (!this.previewFullImage) return;
  528. const images = this.lists.map(item => item.url || item.path);
  529. uni.previewImage({
  530. urls: images,
  531. current: url,
  532. success: () => {
  533. this.$emit('on-preview', url, this.lists);
  534. },
  535. fail: () => {
  536. uni.showToast({
  537. title: '预览图片失败',
  538. icon: 'none'
  539. });
  540. }
  541. });
  542. },
  543. // 判断是否json字符串
  544. checkIsJSON(str) {
  545. if (typeof str == 'string') {
  546. try {
  547. var obj = JSON.parse(str);
  548. if (typeof obj == 'object' && obj) {
  549. return true;
  550. } else {
  551. return false;
  552. }
  553. } catch (e) {
  554. return false;
  555. }
  556. }
  557. return false;
  558. }
  559. }
  560. };
  561. </script>
  562. <style lang="scss" scoped>
  563. // nvue不能用标签命名样式
  564. /* #ifndef APP-NVUE */
  565. image {
  566. display: inline-block;
  567. // 解决图片加载时可能会瞬间变形的问题
  568. will-change: transform;
  569. }
  570. view,
  571. text {
  572. box-sizing: border-box;
  573. flex-direction: row;
  574. }
  575. /* #endif */
  576. .u-upload {
  577. display: flex;
  578. flex-wrap: wrap;
  579. align-items: center;
  580. }
  581. .u-list-item {
  582. width: 200rpx;
  583. height: 200rpx;
  584. overflow: hidden;
  585. margin: 10rpx;
  586. background: rgb(244, 245, 246);
  587. position: relative;
  588. border-radius: 10rpx;
  589. display: inline-flex;
  590. align-items: center;
  591. justify-content: center;
  592. }
  593. .u-preview-wrap {
  594. border: 1px solid rgb(235, 236, 238);
  595. }
  596. .u-add-wrap {
  597. flex-direction: column;
  598. color: $u-content-color;
  599. font-size: 28rpx;
  600. }
  601. .u-add-tips {
  602. margin-top: 20rpx;
  603. }
  604. .u-add-wrap__hover {
  605. background-color: rgb(235, 236, 238);
  606. }
  607. .u-preview-image {
  608. display: block;
  609. width: 100%;
  610. height: 100%;
  611. border-radius: 10rpx;
  612. }
  613. .u-delete-icon {
  614. position: absolute;
  615. top: 10rpx;
  616. right: 10rpx;
  617. z-index: 10;
  618. background-color: $u-type-error;
  619. border-radius: 100rpx;
  620. width: 44rpx;
  621. height: 44rpx;
  622. display: flex;
  623. align-items: center;
  624. justify-content: center;
  625. }
  626. .u-icon {
  627. display: flex;
  628. align-items: center;
  629. justify-content: center;
  630. }
  631. .u-progress {
  632. position: absolute;
  633. bottom: 10rpx;
  634. left: 8rpx;
  635. right: 8rpx;
  636. z-index: 9;
  637. width: auto;
  638. }
  639. .u-error-btn {
  640. color: #ffffff;
  641. background-color: $u-type-error;
  642. font-size: 20rpx;
  643. padding: 4px 0;
  644. text-align: center;
  645. position: absolute;
  646. bottom: 0;
  647. left: 0;
  648. right: 0;
  649. z-index: 9;
  650. line-height: 1;
  651. }
  652. // .custom-style {
  653. // background: #F5F6FA;
  654. // width: 100%;
  655. // height: 480rpx;
  656. // display: flex;
  657. // justify-content: center;
  658. // align-items: center;
  659. // background: #F2F5FA;
  660. // border-radius: 20rpx;
  661. // border: 2px dashed #C6CBCE;
  662. // }
  663. // .custom-img {
  664. // width: 120rpx;
  665. // height: 100rpx;
  666. // }
  667. // .text {
  668. // font-size: 18px;
  669. // font-weight: 600;
  670. // color: #617E8B;
  671. // }
  672. // .content {
  673. // display: flex;
  674. // justify-content: center;
  675. // flex-direction: column;
  676. // align-items: center;
  677. // }
  678. // .u-preview {
  679. // width: 100%;
  680. // height: 100%;
  681. // // position: absolute;
  682. // background: #F5F6FA;
  683. // }
  684. // .u-list-item-custom {
  685. // margin: 0 !important;
  686. // width: 100% !important;
  687. // height: 100% !important;
  688. // }
  689. .customStyleBgc {
  690. width: 100% !important;
  691. height: 440rpx !important;
  692. display: flex !important;
  693. justify-content: center;
  694. align-items: center;
  695. position: relative;
  696. .u-add-wrap {
  697. width: 100% !important;
  698. height: 100% !important;
  699. background: transparent;
  700. }
  701. .u-add-tips {
  702. font-size: 18px;
  703. font-weight: 600;
  704. color: #617E8B;
  705. }
  706. }
  707. .customStyle {
  708. width: 100% !important;
  709. height: 440rpx !important;
  710. background: #F5F6FA;
  711. border-radius: 20rpx;
  712. border: 2px dashed #C6CBCE;
  713. display: flex !important;
  714. justify-content: center;
  715. align-items: center;
  716. position: relative;
  717. .u-add-wrap {
  718. width: 100% !important;
  719. height: 100% !important;
  720. background: transparent;
  721. }
  722. .u-add-tips {
  723. font-size: 18px;
  724. font-weight: 600;
  725. color: #617E8B;
  726. }
  727. }
  728. .customPreviewStyle {
  729. width: 100% !important;
  730. height: 440rpx !important;
  731. }
  732. .imgstyle {
  733. width: 100% !important;
  734. height: 440rpx !important;
  735. position: absolute;
  736. }
  737. .default{
  738. .u-list-item.u-add-wrap{
  739. background:#fff;
  740. border:1px dashed #AFB3BF;
  741. }
  742. }
  743. </style>