xfx-image-upload.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. <template>
  2. <view class="xfx-image-upload-list">
  3. <!-- 上传按钮 -->
  4. <view class="xfx-image-upload-Item xfx-image-upload-Item-add" v-if="uploadLists.length<max && add"
  5. @click="chooseFile">
  6. <!-- <uni-icons type='camera' style="font-size:60rpx"> </uni-icons> -->
  7. <view class="imgAdd" v-if="uploadType === '0'"></view>
  8. <image class="camera-img" src="../../static/images/car/camera.png" mode="widthFix" v-if="uploadType==='1'">
  9. </image>
  10. <image class="camera-img" src="../../static/images/car/vedio.png" mode="widthFix" v-if="uploadType==='2'">
  11. </image>
  12. <!-- <u-icon name='camera-fill' size='45'></u-icon> -->
  13. <text class="text-upload">{{uploadTitle}}</text>
  14. </view>
  15. <view class="xfx-image-upload-Item" v-for="(item,index) in uploadLists" :key="index">
  16. <view class="xfx-image-upload-Item-video" v-if="(!/.(gif|jpg|jpeg|png|gif|jpg|png)$/i.test(item))">
  17. <!-- <image :disabled="false" :controls="false" :src="item+'?x-oss-process=video/snapshot,t_0,f_jpg'"mode=""> -->
  18. <image :disabled="false" :controls="false" :src="item.cover" mode="">
  19. <!-- <image :disabled="false" :controls="false" :src="item.cover" mode=""> -->
  20. <view class="xfx-image-upload-Item-video-fixed" @click="previewVideo(item.url)">
  21. <!-- <uni-icons type='videocam' style="font-size:60rpx"> </uni-icons> -->
  22. <u-icon size='80' name='play-right-fill' color="#ffffff"></u-icon>
  23. </view>
  24. <view class="xfx-image-upload-Item-del-cover" v-if="remove && previewVideoSrc==''"
  25. @click="imgDel(index)">
  26. <image src="../../static/images/user/redClose.png" mode="widthFix"></image>
  27. </view>
  28. </image>
  29. </view>
  30. <image v-else :src="item" @click="imgPreview(item)"></image>
  31. <view class="xfx-image-upload-Item-del" v-if="remove" @click="imgDel(index)">
  32. <image src="../../static/images/user/redClose.png" mode="widthFix"></image>
  33. </view>
  34. </view>
  35. <!-- flex布局 起占位作用 -->
  36. <!-- <view class="xfx-image-upload-Item" v-if="uploadLists.length<max-1">
  37. </view> -->
  38. <!-- <view id="canvas" class="canvas" :prop="newVal" :change:prop="canvas.create"></view> -->
  39. <view class="preview-full" v-if="previewVideoSrc!=''">
  40. <video :autoplay="true" :src="previewVideoSrc" :show-fullscreen-btn="false">
  41. <cover-view class="preview-full-close" @click="previewVideoClose"> ×
  42. </cover-view>
  43. </video>
  44. </view>
  45. <!-- -->
  46. </view>
  47. </template>
  48. <style>
  49. </style>
  50. <script>
  51. //请求头token
  52. import {
  53. getToken
  54. } from '@/utils/auth'
  55. import UniIcons from '@/components/uni-icons/uni-icons.vue'
  56. import config from '@/config.js'
  57. export default {
  58. name: 'xfx-image-upload',
  59. props: {
  60. uploadTitle:{
  61. type: String,
  62. default: '点击上传'
  63. },
  64. // 展示的图片
  65. uploadType: {
  66. type: String,
  67. default: '0'
  68. },
  69. max: { //展示图片最大值
  70. type: Number,
  71. default: 6,
  72. },
  73. chooseNum: { //选择图片数
  74. type: Number,
  75. default: 6,
  76. },
  77. name: { //发到后台的文件参数名
  78. type: String,
  79. default: 'file',
  80. },
  81. remove: { //是否展示删除按钮
  82. type: Boolean,
  83. default: true,
  84. },
  85. add: { //是否展示添加按钮
  86. type: Boolean,
  87. default: true,
  88. },
  89. disabled: { //是否禁用
  90. type: Boolean,
  91. default: false,
  92. },
  93. sourceType: { //选择照片来源 【ps:H5就别费劲了,设置了也没用。不是我说的,官方文档就这样!!!】
  94. type: Array,
  95. default: () => ['album', 'camera'],
  96. },
  97. action: { //上传地址
  98. type: String,
  99. default: config.baseUrl + '/file/upload',
  100. },
  101. headers: { //上传的请求头部
  102. type: Object,
  103. default: () => {
  104. return {
  105. Authorization: getToken()
  106. }
  107. },
  108. },
  109. formData: { //HTTP 请求中其他额外的 form data
  110. type: Object,
  111. default: () => {},
  112. },
  113. compress: { //是否需要压缩
  114. type: Boolean,
  115. default: false,
  116. },
  117. quality: { //压缩质量,范围0~100
  118. type: Number,
  119. default: 80,
  120. },
  121. value: { //受控图片列表
  122. type: Array,
  123. default: () => [],
  124. },
  125. uploadSuccess: {
  126. default: (res) => {
  127. return {
  128. success: false,
  129. url: ''
  130. }
  131. },
  132. },
  133. mediaType: { //文件类型 image/video/all
  134. type: String,
  135. default: 'image',
  136. },
  137. maxDuration: { //拍摄视频最长拍摄时间,单位秒。最长支持 60 秒。 (只针对拍摄视频有用)
  138. type: Number,
  139. default: 60,
  140. },
  141. camera: { //'front'、'back',默认'back'(只针对拍摄视频有用)
  142. type: String,
  143. default: 'back',
  144. },
  145. },
  146. components: {
  147. UniIcons
  148. },
  149. data() {
  150. return {
  151. uploadLists: [],
  152. mediaTypeData: ['image', 'video', 'all'],
  153. previewVideoSrc: '',
  154. newVal:null,
  155. }
  156. },
  157. mounted: function() {
  158. this.headers.Authorization = getToken()
  159. // this.headers.Authorization =
  160. // 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxMDE3Nzg4OTcxNTcxMjM2ODY3LCJ1c2VyX2tleSI6ImQyZWMwNzcwLTU4ZDEtNDFlNS1hNjJhLTAyY2MxODg1MTM4NiIsInVzZXJuYW1lIjoiZ3VhbmxpeXVhbiJ9.wPdKlBle01eXd2Um-5EFs6TeqxMNhWFahODJP2DB1_a6D5ryxgidYavhEqEi49gx4wA7MGswB30T1UaiJmoIzA'
  161. // // console.log(this.headers)
  162. this.$nextTick(function() {
  163. this.uploadLists = this.value;
  164. if (this.mediaTypeData.indexOf(this.mediaType) == -1) {
  165. uni.showModal({
  166. title: '提示',
  167. content: 'mediaType参数不正确',
  168. showCancel: false,
  169. success: function(res) {
  170. if (res.confirm) {
  171. //console.log('用户点击确定');
  172. } else if (res.cancel) {
  173. //console.log('用户点击取消');
  174. }
  175. }
  176. });
  177. }
  178. });
  179. },
  180. watch: {
  181. value(val, oldVal) {
  182. this.uploadLists = val;
  183. },
  184. },
  185. methods: {
  186. previewVideo(src) {
  187. this.previewVideoSrc = src;
  188. // this.previewVideoSrc =
  189. // 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-fbd63a76-dc76-485c-b711-f79f2986daeb/ba804d82-860b-4d1a-a706-5a4c8ce137c3.mp4'
  190. },
  191. previewVideoClose() {
  192. this.previewVideoSrc = ''
  193. // console.log('previewVideoClose', this.previewVideoSrc)
  194. },
  195. imgDel(index) {
  196. // uni.showModal({
  197. // title: '提示',
  198. // content: '您确定要删除么?',
  199. // success: (res) => {
  200. // if (res.confirm) {
  201. // this.uploadLists.splice(index, 1)
  202. // this.$emit("input", this.uploadLists);
  203. // this.$emit("imgDelete", this.uploadLists);
  204. let delUrl = this.uploadLists[index]
  205. this.uploadLists.splice(index, 1)
  206. this.$emit("input", this.uploadLists);
  207. this.$emit("imgDelete", {
  208. del: delUrl,
  209. tempFilePaths: this.uploadLists,
  210. });
  211. // } else if (res.cancel) {}
  212. // }
  213. // });
  214. },
  215. imgPreview(index) {
  216. var imgData = this.uploadLists.filter(item => /.(gif|jpg|jpeg|png|gif|jpg|png)$/i.test(item)) //只预览图片的
  217. uni.previewImage({
  218. urls: imgData,
  219. current: index,
  220. loop: true,
  221. });
  222. },
  223. chooseFile() {
  224. if (this.disabled) {
  225. return false;
  226. }
  227. switch (this.mediaTypeData.indexOf(this.mediaType)) {
  228. case 1: //视频
  229. this.videoAdd();
  230. break;
  231. case 2: //全部
  232. uni.showActionSheet({
  233. itemList: ['相册', '视频'],
  234. success: (res) => {
  235. if (res.tapIndex == 1) {
  236. this.videoAdd();
  237. } else if (res.tapIndex == 0) {
  238. this.imgAdd();
  239. }
  240. },
  241. fail: (res) => {
  242. console.log(res.errMsg);
  243. }
  244. });
  245. break;
  246. default: //图片
  247. this.imgAdd();
  248. break;
  249. }
  250. //if(this.mediaType=='image'){
  251. },
  252. videoAdd() {
  253. let nowNum = Math.abs(this.uploadLists.length - this.max);
  254. let thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量
  255. uni.chooseVideo({
  256. compressed: this.compress,
  257. sourceType: this.sourceType,
  258. camera: this.camera,
  259. maxDuration: this.maxDuration,
  260. success: (res) => {
  261. console.log('我是上传的视频', res)
  262. this.$emit('getVedioName', res.tempFilePath.slice(77))
  263. this.chooseSuccessMethod([res.tempFilePath], 1)
  264. //this.imgUpload([res.tempFilePath]);
  265. //console.log('tempFiles', res)
  266. // if (this.action == '') { //未配置上传路径
  267. // this.$emit("chooseSuccess", res.tempFilePaths);
  268. // } else {
  269. // if (this.compress && (res.tempFiles[0].size / 1024 > 1025)) { //设置了需要压缩 并且 文件大于1M,进行压缩上传
  270. // this.imgCompress(res.tempFilePaths);
  271. // } else {
  272. // this.imgUpload(res.tempFilePaths);
  273. // }
  274. // }
  275. }
  276. });
  277. },
  278. imgAdd() {
  279. // console.log('imgAdd')
  280. let nowNum = Math.abs(this.uploadLists.length - this.max);
  281. let thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量
  282. // console.log('nowNum', nowNum)
  283. // console.log('thisNum', thisNum)
  284. // #ifdef APP-PLUS
  285. if (this.sourceType.length > 1) {
  286. uni.showActionSheet({
  287. itemList: ['拍摄', '从手机相册选择'],
  288. success: (res) => {
  289. if (res.tapIndex == 1) {
  290. this.appGallery(thisNum);
  291. } else if (res.tapIndex == 0) {
  292. this.appCamera();
  293. }
  294. },
  295. fail: (res) => {
  296. console.log(res.errMsg);
  297. }
  298. });
  299. }
  300. if (this.sourceType.length == 1 && this.sourceType.indexOf('album') > -1) {
  301. this.appGallery(thisNum);
  302. }
  303. if (this.sourceType.length == 1 && this.sourceType.indexOf('camera') > -1) {
  304. this.appCamera();
  305. }
  306. // #endif
  307. //#ifndef APP-PLUS
  308. uni.chooseImage({
  309. count: thisNum,
  310. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  311. sourceType: this.sourceType,
  312. success: (res) => {
  313. // console.log(res, 'img');
  314. // console.log(res.tempFiles[0].name, 'name');
  315. this.$emit('getImgName', res.tempFiles[0].name)
  316. this.chooseSuccessMethod(res.tempFilePaths, 0, res.tempFiles[0].name)
  317. //console.log('tempFiles', res)
  318. // if (this.action == '') { //未配置上传路径
  319. // this.$emit("chooseSuccess", res.tempFilePaths);
  320. // } else {
  321. // if (this.compress && (res.tempFiles[0].size / 1024 > 1025)) { //设置了需要压缩 并且 文件大于1M,进行压缩上传
  322. // this.imgCompress(res.tempFilePaths);
  323. // } else {
  324. // this.imgUpload(res.tempFilePaths);
  325. // }
  326. // }
  327. }
  328. });
  329. // #endif
  330. },
  331. appCamera() {
  332. var cmr = plus.camera.getCamera();
  333. var res = cmr.supportedImageResolutions[0];
  334. var fmt = cmr.supportedImageFormats[0];
  335. //console.log("Resolution: " + res + ", Format: " + fmt);
  336. cmr.captureImage((path) => {
  337. //alert("Capture image success: " + path);
  338. this.chooseSuccessMethod([path], 0)
  339. },
  340. (error) => {
  341. //alert("Capture image failed: " + error.message);
  342. console.log("Capture image failed: " + error.message)
  343. }, {
  344. resolution: res,
  345. format: fmt
  346. }
  347. );
  348. },
  349. appGallery(maxNum) {
  350. plus.gallery.pick((res) => {
  351. this.chooseSuccessMethod(res.files, 0)
  352. }, function(e) {
  353. //console.log("取消选择图片");
  354. }, {
  355. filter: "image",
  356. multiple: true,
  357. maximum: maxNum
  358. });
  359. },
  360. chooseSuccessMethod(filePaths, type, name) {
  361. if (this.action == '') { //未配置上传路径
  362. // this.value.push({url:filePaths[0]})
  363. // console.log(this.value)
  364. // this.uploadLists.push({url:filePaths[0]})
  365. this.$emit("chooseSuccess", filePaths, type, name); //filePaths 路径 type 0 为图片 1为视频
  366. } else {
  367. if (type == 1) {
  368. this.imgUpload(filePaths, name);
  369. } else {
  370. if (this.compress) { //设置了需要压缩
  371. this.imgCompress(filePaths);
  372. } else {
  373. this.imgUpload(filePaths, name);
  374. }
  375. }
  376. }
  377. },
  378. imgCompress(tempFilePaths) {
  379. uni.showLoading({
  380. title: '压缩中...'
  381. });
  382. let compressImgs = [];
  383. let results = [];
  384. tempFilePaths.forEach((item, index) => {
  385. compressImgs.push(new Promise((resolve, reject) => {
  386. // #ifndef H5
  387. uni.compressImage({
  388. src: item,
  389. quality: this.quality,
  390. success: res => {
  391. //console.log('compressImage', res.tempFilePath)
  392. results.push(res.tempFilePath);
  393. resolve(res.tempFilePath);
  394. },
  395. fail: (err) => {
  396. //console.log(err.errMsg);
  397. reject(err);
  398. },
  399. complete: () => {
  400. //uni.hideLoading();
  401. }
  402. })
  403. // #endif
  404. // #ifdef H5
  405. this.canvasDataURL(item, {
  406. quality: this.quality / 100
  407. }, (base64Codes) => {
  408. //this.imgUpload(base64Codes);
  409. results.push(base64Codes);
  410. resolve(base64Codes);
  411. })
  412. // #endif
  413. }))
  414. })
  415. Promise.all(compressImgs) //执行所有需请求的接口
  416. .then((results) => {
  417. uni.hideLoading();
  418. // console.log('imgUpload', results)
  419. this.imgUpload(results);
  420. })
  421. .catch((res, object) => {
  422. uni.hideLoading();
  423. });
  424. },
  425. imgUpload(tempFilePaths, name) {
  426. // if (this.action == '') {
  427. // uni.showToast({
  428. // title: '未配置上传地址',
  429. // icon: 'none',
  430. // duration: 2000
  431. // });
  432. // return false;
  433. // }
  434. uni.showLoading({
  435. title: '上传中'
  436. });
  437. // console.log('imgUpload', tempFilePaths)
  438. let uploadImgs = [];
  439. tempFilePaths.forEach((item, index) => {
  440. uploadImgs.push(new Promise((resolve, reject) => {
  441. // console.log(index, item)
  442. const uploadTask = uni.uploadFile({
  443. url: this.action, //仅为示例,非真实的接口地址
  444. filePath: item,
  445. name: this.name,
  446. fileType: 'image',
  447. formData: this.formData,
  448. header: this.headers,
  449. success: (uploadFileRes) => {
  450. //uni.hideLoading();
  451. //console.log(typeof this.uploadSuccess)
  452. //console.log('')
  453. if (typeof this.uploadSuccess == 'function') {
  454. if (this.uploadSuccess(uploadFileRes).success) {
  455. this.value.push(this.uploadSuccess(uploadFileRes)
  456. .url)
  457. this.$emit("input", this.uploadLists);
  458. }
  459. }
  460. resolve(uploadFileRes);
  461. this.$emit("uploadSuccess", uploadFileRes);
  462. },
  463. fail: (err) => {
  464. console.log(err);
  465. //uni.hideLoading();
  466. reject(err);
  467. this.$emit("uploadFail", err);
  468. },
  469. complete: () => {
  470. //uni.hideLoading();
  471. }
  472. });
  473. }))
  474. })
  475. Promise.all(uploadImgs) //执行所有需请求的接口
  476. .then((results) => {
  477. uni.hideLoading();
  478. })
  479. .catch((res, object) => {
  480. uni.hideLoading();
  481. this.$emit("uploadFail", res);
  482. });
  483. // uploadTask.onProgressUpdate((res) => {
  484. // //console.log('',)
  485. // uni.showLoading({
  486. // title: '上传中' + res.progress + '%'
  487. // });
  488. // if (res.progress == 100) {
  489. // uni.hideLoading();
  490. // }
  491. // });
  492. },
  493. canvasDataURL(path, obj, callback) {
  494. var img = new Image();
  495. img.src = path;
  496. img.onload = function() {
  497. var that = this;
  498. // 默认按比例压缩
  499. var w = that.width,
  500. h = that.height,
  501. scale = w / h;
  502. w = obj.width || w;
  503. h = obj.height || (w / scale);
  504. var quality = 0.8; // 默认图片质量为0.8
  505. //生成canvas
  506. var canvas = document.createElement('canvas');
  507. var ctx = canvas.getContext('2d');
  508. // 创建属性节点
  509. var anw = document.createAttribute("width");
  510. anw.nodeValue = w;
  511. var anh = document.createAttribute("height");
  512. anh.nodeValue = h;
  513. canvas.setAttributeNode(anw);
  514. canvas.setAttributeNode(anh);
  515. ctx.drawImage(that, 0, 0, w, h);
  516. // 图像质量
  517. if (obj.quality && obj.quality <= 1 && obj.quality > 0) {
  518. quality = obj.quality;
  519. }
  520. // quality值越小,所绘制出的图像越模糊
  521. var base64 = canvas.toDataURL('image/jpeg', quality);
  522. // 回调函数返回base64的值
  523. callback(base64);
  524. }
  525. },
  526. }
  527. }
  528. </script>
  529. <style>
  530. .camera-img {
  531. width: 61rpx !important;
  532. height: 61rpx !important;
  533. margin-bottom: 23rpx;
  534. }
  535. .imgAdd {
  536. width: 51rpx;
  537. height: 51rpx;
  538. background-image: url(../../static/images/user/add.png);
  539. background-size: 100% 100%;
  540. }
  541. .preview-full {
  542. position: fixed;
  543. top: 0;
  544. left: 0;
  545. bottom: 0;
  546. width: 100%;
  547. height: 100%;
  548. z-index: 1002;
  549. }
  550. .preview-full video {
  551. width: 100%;
  552. height: 100%;
  553. z-index: 1002;
  554. }
  555. .preview-full-close {
  556. position: fixed;
  557. right: 32rpx;
  558. top: 25rpx;
  559. width: 80rpx;
  560. height: 80rpx;
  561. line-height: 60rpx;
  562. text-align: center;
  563. z-index: 1003;
  564. /* background-color: #808080; */
  565. color: #fff;
  566. font-size: 65rpx;
  567. font-weight: bold;
  568. text-shadow: 1px 2px 5px rgb(0 0 0);
  569. }
  570. /* .preview-full-close-before,
  571. .preview-full-close-after {
  572. position: absolute;
  573. top: 50%;
  574. left: 50%;
  575. content: '';
  576. height: 60rpx;
  577. margin-top: -30rpx;
  578. width: 6rpx;
  579. margin-left: -3rpx;
  580. background-color: #FFFFFF;
  581. z-index: 20000;
  582. }
  583. .preview-full-close-before {
  584. transform: rotate(45deg);
  585. }
  586. .preview-full-close-after {
  587. transform: rotate(-45deg);
  588. } */
  589. .xfx-image-upload-list {
  590. display: flex;
  591. flex-wrap: wrap;
  592. justify-content: space-between;
  593. }
  594. .xfx-image-upload-Item {
  595. width: 190rpx;
  596. height: 190rpx;
  597. margin-right: 25rpx;
  598. /* margin: 13rpx; */
  599. border-radius: 12rpx;
  600. position: relative;
  601. margin-bottom: 30rpx;
  602. }
  603. .xfx-image-upload-Item:nth-child(3n) {
  604. margin-right: 0;
  605. }
  606. .xfx-image-upload-Item image {
  607. width: 100%;
  608. height: 100%;
  609. border-radius: 12rpx;
  610. }
  611. .xfx-image-upload-Item-video {
  612. width: 100%;
  613. height: 100%;
  614. border-radius: 12rpx;
  615. position: relative;
  616. }
  617. .xfx-image-upload-Item-video-fixed {
  618. position: absolute;
  619. top: 0;
  620. left: 0;
  621. bottom: 0;
  622. width: 100%;
  623. height: 100%;
  624. border-radius: 12rpx;
  625. display: flex;
  626. justify-content: center;
  627. align-items: center;
  628. z-index: 50;
  629. }
  630. .xfx-image-upload-Item video {
  631. width: 100%;
  632. height: 100%;
  633. border-radius: 10rpx;
  634. }
  635. .xfx-image-upload-Item-add {
  636. /* font-size: 105rpx; */
  637. /* line-height: 160rpx; */
  638. padding-top: 56rpx;
  639. box-sizing: border-box;
  640. text-align: center;
  641. background-color: #F6F7F8;
  642. display: flex;
  643. flex-direction: column;
  644. align-items: center;
  645. }
  646. .text-upload {
  647. font-size: 28rpx;
  648. line-height: 33rpx;
  649. font-weight: 400;
  650. color: #495B93;
  651. display: block;
  652. margin-top: 29rpx;
  653. }
  654. .xfx-image-upload-Item-del {
  655. border-radius: 50%;
  656. /* background-color: #F13629; */
  657. font-size: 24rpx;
  658. position: absolute;
  659. width: 36rpx;
  660. height: 36rpx;
  661. line-height: 35rpx;
  662. text-align: center;
  663. top: -18rpx;
  664. right: -18rpx;
  665. z-index: 51;
  666. /* color: #fff; */
  667. }
  668. .xfx-image-upload-Item-del-cover {
  669. border-radius: 50%;
  670. /* background-color: #F13629; */
  671. font-size: 24rpx;
  672. position: absolute;
  673. width: 36rpx;
  674. height: 36rpx;
  675. text-align: center;
  676. top: -18rpx;
  677. right: -18rpx;
  678. /* color: #fff; */
  679. /* #ifdef APP-PLUS */
  680. line-height: 25rpx;
  681. /* #endif */
  682. /* #ifndef APP-PLUS */
  683. line-height: 35rpx;
  684. /* #endif */
  685. z-index: 51;
  686. }
  687. </style>