xfx-image-upload.vue 22 KB

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