uploadVNormalTaskPhoto.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. <template>
  2. <div class="questionNamep">
  3. <!-- 0=企业微信,1=H5相机 -->
  4. <!-- 企业微信拍照 -->
  5. <div class="cameraDiv" @click="uploadImg" v-if="userInfo.photoMethod == '0'">
  6. <van-icon class="photo photos" name="plus" size="22px" color="#969696" />
  7. <span style="font-size: 10px">添加图片</span>
  8. </div>
  9. <!-- 原生自带拍照 -->
  10. <H5Camera
  11. @getImg="getImg"
  12. ref="H5Camera"
  13. :objectType="objectType"
  14. :capture="pictureSource == '1' ? '' : 'camera'"
  15. v-else />
  16. <div id="allmap"></div>
  17. <imageAIVerifyErr
  18. v-if="imageAIVerifyFlag"
  19. :imageAIVerifyFlag="imageAIVerifyFlag"
  20. :imageAIVerifyData="imageAIVerifyData"
  21. @confirmUpload="confirmUpload"
  22. @uploadImgFun="uploadImgFun"
  23. :source="'visit'"
  24. @normalFlow="normalFlow"
  25. @close="close"></imageAIVerifyErr>
  26. <!-- 图像识别白名单弹框提示 -->
  27. <imageWhiteStore
  28. v-if="imageWhiteStoreFlag"
  29. :imageWhiteStoreFlag="imageWhiteStoreFlag"
  30. :imageWhiteStoreData="imageWhiteStoreData"
  31. @normalFlow="normalFlow"
  32. @close="close">
  33. </imageWhiteStore>
  34. <!-- 上传动画 -->
  35. <div class="uploadImgDemoMask" v-show="uploadImgFlag">
  36. <div class="uploadImgDemo">
  37. <div class="ring-area" id="d2area" style="display: flex">
  38. <div class="ring-wrap">
  39. <svg width="90" height="90" viewBox="0 0 90 90">
  40. <circle class="ring-bg" cx="45" cy="45" r="40" />
  41. <circle class="ring-progress" id="d2ring" cx="45" cy="45" r="40" />
  42. </svg>
  43. <div class="ring-text">
  44. <span class="ring-pct" id="d2pct">0%</span>
  45. <span class="ring-sub" id="d2sub">上传中</span>
  46. </div>
  47. </div>
  48. <div class="ring-info">
  49. <div class="ring-filename" id="d2name"></div>
  50. <div class="ring-list" id="d2dots">
  51. <div
  52. v-for="(value, index) in uploadImgTotal"
  53. class="ring-dot"
  54. :id="`dot${index}`"></div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import { addPhotoBatch, addVisitsPosition, addPhotoToDB, buryingPoint } from '@/api/index';
  64. import imageAIVerifyErr from './imageAIVerifyErr';
  65. import imageWhiteStore from './imageWhiteStore';
  66. import H5Camera from '@/components/H5Camera';
  67. import axios from 'axios';
  68. import uploadAliOss from '@/utils/uploadAliOss';
  69. import { addH5Photo } from '@/api/H5Camera';
  70. import { mapState } from 'vuex';
  71. export default {
  72. name: 'uploadImg',
  73. components: { imageAIVerifyErr, H5Camera, imageWhiteStore },
  74. props: {
  75. storeGroupId: {
  76. type: String,
  77. default: '',
  78. },
  79. visitsId: {
  80. type: String,
  81. default: '',
  82. },
  83. taskList: {
  84. type: Array,
  85. default() {
  86. return [];
  87. },
  88. },
  89. objectType: {
  90. type: String,
  91. default: '',
  92. },
  93. putInCode: {
  94. type: String,
  95. default: '',
  96. },
  97. photoIdentifyType: {
  98. // 图匠识别目的(1:店招内容识别(不能连拍和多选),3:调色机识别(不能连拍和多选),6:陈列SKU图片识别(不需要图匠实时识别))
  99. type: String,
  100. default: '',
  101. },
  102. pictureSource: {
  103. // 是否允许从相册选择图片 1:允许;0:不允许
  104. type: String,
  105. default: '0',
  106. },
  107. continuousShoot: {
  108. // 是否允许连拍/相册多选 1:允许;0:不允许
  109. type: String,
  110. default: '0',
  111. },
  112. collectionItemId: {
  113. type: [String, Number],
  114. default: '',
  115. },
  116. formData: {
  117. type: Object,
  118. default() {
  119. return {};
  120. },
  121. },
  122. },
  123. computed: {
  124. ...mapState({
  125. userInfo: (state) => state.user.userInfo,
  126. }),
  127. },
  128. data() {
  129. return {
  130. shows: false,
  131. url: '',
  132. imageAIVerifyFlag: false,
  133. imageAIVerifyData: null, //图匠校验返回的数据
  134. mediaId: '', //当前上传图片id
  135. addressesRemark: '', //当前位置信息
  136. controller: null, //取消请求状态
  137. fileUrl: '',
  138. imageWhiteStoreData: null,
  139. imageWhiteStoreFlag: false,
  140. localIdsArr: [],
  141. interfaceUsageTime: null,
  142. uploadImgFlag: false, //上传图片中
  143. uploadImgTotal: 0, // 上传图片总数
  144. d2running: false,
  145. d2count: 0,
  146. d2timer: null,
  147. };
  148. },
  149. methods: {
  150. // 原生H5拍照图片
  151. // url: base64
  152. getImg(base64) {
  153. // 图片名称:用户名-时间戳
  154. let username = localStorage.getItem('loginName');
  155. let imgName = username + '-' + new Date().getTime();
  156. uploadAliOss(base64, imgName)
  157. .then((res) => {
  158. if (res.url && res.url.indexOf('http') != -1) {
  159. this.fileUrl = res.url;
  160. this.uploadImagev();
  161. }
  162. })
  163. .catch((err) => {
  164. console.log('err:' + err);
  165. });
  166. },
  167. uploadImgFun() {
  168. // 0=企业微信,1=H5相机
  169. if (this.userInfo.photoMethod == '0') {
  170. this.uploadImg();
  171. } else {
  172. this.$refs.H5Camera.camera();
  173. }
  174. },
  175. uploadImg() {
  176. var map = new TMap.Map('allmap', {
  177. zoom: 14,
  178. center: new TMap.LatLng(39.986785, 116.301012),
  179. });
  180. var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
  181. var markers = new TMap.MultiMarker({
  182. map: map,
  183. geometries: [],
  184. });
  185. markers.setGeometries([]);
  186. let url = window.location.href;
  187. let that = this;
  188. let wx = this.wx;
  189. let qiyeData;
  190. this.addressesRemark = '';
  191. const instance = axios.create();
  192. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  193. instance
  194. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  195. params: {
  196. url: url,
  197. },
  198. })
  199. .then((response) => {
  200. if (response.status == 200) {
  201. qiyeData = response.data.data;
  202. wx.config({
  203. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  204. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  205. appId: qiyeData.appId, // 必填,企业微信的corpID
  206. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  207. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  208. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  209. jsApiList: ['ready', 'chooseImage', 'uploadImage', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  210. });
  211. wx.ready(function () {
  212. wx.getLocation({
  213. type: 'gcj02',
  214. success: function (res) {
  215. var location = new TMap.LatLng(res.latitude, res.longitude);
  216. map.setCenter(location);
  217. markers.updateGeometries([
  218. {
  219. id: 'main', // 点标注数据数组
  220. position: location,
  221. },
  222. ]);
  223. geocoder.getAddress({ location: location }).then(
  224. function (result) {
  225. var addresses = result.result.formatted_addresses;
  226. that.addressesRemark = addresses.recommend;
  227. },
  228. function (err) {
  229. that.addressesRemark = '';
  230. },
  231. );
  232. },
  233. fail: function () {
  234. that.$dialog.alert({
  235. message: 'GPS未开启',
  236. });
  237. },
  238. });
  239. console.log(that.pictureSource);
  240. let sourceType = that.pictureSource == '1' ? ['album', 'camera'] : ['camera'];
  241. let count = 1;
  242. // 1:店招内容识别(不能连拍和多选),3:调色机识别(不能连拍和多选) 需要实时识别的不支持连拍和多选
  243. if (that.photoIdentifyType != 1 && that.photoIdentifyType != 3) {
  244. count = that.continuousShoot == '1' ? 20 : 1; //是否允许连拍/相册多选 最多5张
  245. }
  246. wx.chooseImage({
  247. count: count,
  248. sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
  249. sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
  250. defaultCameraMode: count == 1 ? 'normal' : 'batch', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
  251. // defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
  252. isSaveToAlbum: 0, //整型值,0表示拍照时不保存到系统相册,1表示自动保存,默认值是1
  253. success: function (res) {
  254. that.toastLoading(0, '上传中...', true);
  255. let localIds = res.localIds;
  256. that.interfaceUsageTime = Date.now();
  257. that.localIdsArr = [];
  258. // that.$emit('newimgarr', {
  259. // localIds: localIds,
  260. // locationRemark: that.addressesRemark,
  261. // collectionItemId: that.collectionItemId,
  262. // source: 'weixin',
  263. // });
  264. that.uploadImgFlag = true;
  265. that.uploadImgTotal = localIds.length;
  266. that.startDemo2();
  267. that.syncUpload(localIds);
  268. },
  269. });
  270. });
  271. }
  272. });
  273. },
  274. syncUpload(localIds) {
  275. if (!localIds.length) {
  276. this.uploadImagev();
  277. } else {
  278. var localId = localIds.pop();
  279. wx.uploadImage({
  280. localId: localId,
  281. isShowProgressTips: 0, // 默认为1,显示进度提示
  282. success: (res) => {
  283. this.localIdsArr.push(res.serverId);
  284. this.syncUpload(localIds);
  285. },
  286. });
  287. }
  288. },
  289. uploadImagev() {
  290. this.close();
  291. var that = this;
  292. var form = {
  293. mediaIds: [], // 是 List<String> 图片素材id集合
  294. visitSource: '1', // 是 Long 拜访模式
  295. storeGroupId: that.storeGroupId, // 是 string 门店任务组,多个用逗号隔开
  296. visitsId: that.visitsId, // 是 string 拜访id
  297. taskList: that.taskList, // 是 List 任务id数组
  298. collectionItemId: that.collectionItemId, // 是 string 采集项id
  299. objectType: that.objectType, // 是 string 照片类型,取任务上的照片类型,如果没有则取手动选择的照片类型
  300. locationRemark: that.addressesRemark, // 是 String 当前地址信息
  301. firstCollectionId: '', // 否 Long 第一级采集项id,取当前采集项的字段就行
  302. secondCollectionId: '', // 否 Long 第二级采集项id,取当前采集项的字段就行
  303. putInCode: that.putInCode, //投放编号
  304. deviceCode: '', // 否 String 当前任务对应的设备编号
  305. photoIdentifyType: that.photoIdentifyType, // 否 String 图片识别类型:字典-photo_identify_type
  306. equipmentCode: '', // 否 String 当前任务对应的资产编号
  307. inStore: '否', // 否 String 机器是否在店:传选项中文内容,是、否
  308. };
  309. // 0=企业微信,1=H5相机
  310. if (this.userInfo.photoMethod == '0') {
  311. form.mediaIds = this.localIdsArr; // string 图片素材id
  312. } else {
  313. form.fileUrl = this.fileUrl; // string 图片素材id
  314. }
  315. this.controller = null;
  316. // 需要图匠校验的添加参数和loading
  317. if (
  318. this.photoIdentifyType &&
  319. (this.photoIdentifyType == '1' || this.photoIdentifyType == '3')
  320. ) {
  321. form.photoIdentifyType = this.photoIdentifyType;
  322. this.controller = new AbortController(); //取消请求
  323. } else {
  324. this.toastLoading(0, '上传中...', true);
  325. }
  326. addPhotoBatch(form, this.controller ? this.controller.signal : null)
  327. .then((res) => {
  328. if (this.userInfo.photoMethod == '0') {
  329. if (this.interfaceUsageTime) {
  330. this.interfaceUsageTime = Number(
  331. ((Date.now() - this.interfaceUsageTime) / 1000).toFixed(0),
  332. );
  333. }
  334. buryingPoint({
  335. systemModel: '门店拜访',
  336. buryingPointType: 8,
  337. buryingPointValue: form.mediaIds.length,
  338. buryingPointName: '陈列奖励案图片上传',
  339. buryingPointPosition: '门店拜访-陈列奖励案任务',
  340. interfaceUsageTime: this.interfaceUsageTime,
  341. });
  342. }
  343. this.requestThen(res);
  344. })
  345. .catch((error) => {
  346. this.requestCatch(error);
  347. });
  348. },
  349. // 公用请求then
  350. requestThen(res) {
  351. this.toastLoading().clear();
  352. if (res.code == -1) {
  353. // 图匠图片校验接口超时
  354. this.requestTimeOut(res);
  355. } else if (res.code == 200) {
  356. // 图匠校验结果返回
  357. if (
  358. this.photoIdentifyType &&
  359. (this.photoIdentifyType == '1' || this.photoIdentifyType == '3')
  360. ) {
  361. this.imageAIVerifyFlag = true;
  362. this.imageAIVerifyData = res.data[0];
  363. } else {
  364. // 正常流程
  365. // 图像识别白名单用户弹出框提示
  366. if (res.data[0].whiteStore) {
  367. this.imageWhiteStoreFlag = true;
  368. this.imageWhiteStoreData = res.data[0];
  369. } else {
  370. this.normalFlow(res);
  371. }
  372. }
  373. } else {
  374. that.$toast('上传失败!');
  375. }
  376. },
  377. // 公用请求catch
  378. requestCatch(error) {
  379. if (error.message === 'canceled') {
  380. this.$toast('取消上传');
  381. console.log('请求被取消:', error.message);
  382. }
  383. },
  384. // 正常流程
  385. normalFlow(res) {
  386. this.runD2(100, false, () => {
  387. clearTimeout(this.d2timer);
  388. this.d2running = false;
  389. this.d2count = 0;
  390. document.getElementById('d2ring').style.strokeDashoffset = 251.2;
  391. document.getElementById('d2pct').textContent = '0%';
  392. document.getElementById('d2sub').textContent = '上传中';
  393. this.uploadImgFlag = false;
  394. this.$toast('上传成功!');
  395. let fileInfoList = [];
  396. res.data.forEach((val) => {
  397. fileInfoList.push({
  398. fileUrl: val.url,
  399. id: val.fileId,
  400. type: 2,
  401. });
  402. });
  403. this.$emit('newimgarr', {
  404. fileInfoList: fileInfoList,
  405. photoIdentifyType: this.photoIdentifyType,
  406. source: 'H5',
  407. });
  408. });
  409. },
  410. // 照片是否入库,1.照片识别三次不通过仍要上传,2.照片识别通过
  411. // isUpdate:是否更新店招照片,只有门店店招需要更新
  412. confirmUpload(res) {
  413. if (
  414. this.photoIdentifyType &&
  415. (this.photoIdentifyType != '6' || this.photoIdentifyType != '7')
  416. ) {
  417. var form = {
  418. mediaIds: [], // 是 List<String> 图片素材id集合
  419. visitSource: '1', // 是 Long 拜访模式
  420. storeGroupId: this.storeGroupId, // 是 string 门店任务组,多个用逗号隔开
  421. visitsId: that.visitsId, // 是 string 拜访id
  422. taskList: this.taskList, // 是 List 任务id数组
  423. collectionItemId: that.collectionItemId, // 是 string 采集项id
  424. objectType: that.objectType, // 是 string 照片类型,取任务上的照片类型,如果没有则取手动选择的照片类型
  425. locationRemark: this.addressesRemark, // 是 String 当前地址信息
  426. firstCollectionId: '', // 否 Long 第一级采集项id,取当前采集项的字段就行
  427. secondCollectionId: '', // 否 Long 第二级采集项id,取当前采集项的字段就行
  428. putInCode: that.putInCode, //投放编号
  429. deviceCode: '', // 否 String 当前任务对应的设备编号
  430. photoIdentifyType: that.photoIdentifyType, // 否 String 图片识别类型:字典-photo_identify_type
  431. equipmentCode: '', // 否 String 当前任务对应的资产编号
  432. inStore: '否', // 否 String 机器是否在店:传选项中文内容,是、否
  433. };
  434. // 0=企业微信,1=H5相机
  435. if (this.userInfo.photoMethod == '0') {
  436. form.mediaIds = this.localIdsArr; // string 图片素材id
  437. } else {
  438. form.fileUrl = this.fileUrl; // string 图片素材id
  439. }
  440. if (res.isUpdate) {
  441. form.isUpdate = 'true';
  442. }
  443. addPhotoToDB(form).then((resData) => {
  444. if (resData.code == 200) {
  445. console.log(resData);
  446. res.data.fileId = resData.data[0].fileId;
  447. res.data = [res.data];
  448. this.normalFlow(res);
  449. }
  450. });
  451. }
  452. },
  453. close() {
  454. this.imageAIVerifyFlag = false;
  455. this.imageWhiteStoreFlag = false;
  456. },
  457. requestTimeOut(res) {
  458. this.close();
  459. this.$dialog
  460. .confirm({
  461. title: '系统提示',
  462. message: res.msg,
  463. showCancelButton: false,
  464. })
  465. .then(() => {
  466. this.confirmUpload(res);
  467. });
  468. },
  469. // ===== Demo 2 =====
  470. startDemo2() {
  471. if (this.d2running) return;
  472. this.d2running = true;
  473. this.d2count = 0;
  474. this.runD2(1200, true);
  475. },
  476. runD2(delay, isFirst, callback) {
  477. // this.NAMES = Array.from(
  478. // { length: this.uploadImgTotal },
  479. // (_, i) => `IMG_${String(2001 + i).padStart(4, '0')}.jpg`,
  480. // );
  481. if (this.d2count >= this.uploadImgTotal) {
  482. document.getElementById('d2sub').textContent = '完成';
  483. document.getElementById('d2name').textContent = '全部上传成功 ✅';
  484. callback && callback();
  485. return;
  486. }
  487. if (this.uploadImgTotal >= 2) {
  488. this.d2timer = setTimeout(() => {
  489. if (this.d2count > 0) {
  490. document.getElementById(`dot${this.d2count - 1}`).className = 'ring-dot done';
  491. }
  492. document.getElementById(`dot${this.d2count}`).className = 'ring-dot active';
  493. document.getElementById('d2name').textContent = '正在上传。。。';
  494. this.d2count++;
  495. const pct = Math.round((this.d2count / this.uploadImgTotal) * 100);
  496. document.getElementById('d2pct').textContent = pct + '%';
  497. const offset = 251.2 * (1 - this.d2count / this.uploadImgTotal);
  498. document.getElementById('d2ring').style.strokeDashoffset = offset;
  499. document.getElementById('d2sub').textContent = `${this.d2count}/${this.uploadImgTotal}`;
  500. if (this.d2count >= Math.floor(this.uploadImgTotal * 0.8) && isFirst) {
  501. clearTimeout(this.d2timer);
  502. return;
  503. }
  504. this.runD2(delay, isFirst, callback);
  505. }, delay);
  506. } else {
  507. this.$nextTick(() => {
  508. document.getElementById(`dot0`).className = 'ring-dot active';
  509. document.getElementById('d2name').textContent = '正在上传。。。';
  510. this.d2count++;
  511. document.getElementById('d2pct').textContent = '50%';
  512. document.getElementById('d2ring').style.strokeDashoffset = 50;
  513. document.getElementById('d2sub').textContent = `0/${this.uploadImgTotal}`;
  514. });
  515. }
  516. },
  517. },
  518. };
  519. </script>
  520. <style lang="scss" scoped>
  521. .questionNamep {
  522. font-size: 16px;
  523. color: #484848;
  524. box-sizing: border-box;
  525. position: relative;
  526. .cameraDiv {
  527. flex: 1;
  528. display: flex;
  529. flex-direction: column;
  530. align-items: center;
  531. justify-content: center;
  532. .photo {
  533. /*margin-top: 9px;*/
  534. float: right;
  535. }
  536. .camera {
  537. width: 60px;
  538. height: 100%;
  539. position: absolute;
  540. right: 0;
  541. top: 0;
  542. opacity: 0;
  543. z-index: 89;
  544. }
  545. }
  546. }
  547. #allmap {
  548. width: 10px;
  549. height: 10px;
  550. left: -1000px;
  551. position: absolute;
  552. }
  553. </style>
  554. <style lang="scss">
  555. /* ===== 样例2:圆形进度环 ===== */
  556. .uploadImgDemoMask {
  557. position: fixed;
  558. inset: 0;
  559. background: rgba(0, 0, 0, 0.5);
  560. z-index: 9998;
  561. }
  562. .uploadImgDemo {
  563. width: 90%;
  564. position: fixed;
  565. top: 50%;
  566. left: 50%;
  567. transform: translate(-50%, -50%);
  568. z-index: 9999;
  569. background: #fff;
  570. padding: 10px 0;
  571. }
  572. .uploadImgDemo .ring-area {
  573. display: none;
  574. margin-top: 16px;
  575. align-items: center;
  576. gap: 20px;
  577. }
  578. .uploadImgDemo .ring-wrap {
  579. position: relative;
  580. width: 90px;
  581. height: 90px;
  582. flex-shrink: 0;
  583. }
  584. .uploadImgDemo .ring-wrap svg {
  585. transform: rotate(-90deg);
  586. }
  587. .uploadImgDemo .ring-bg {
  588. fill: none;
  589. stroke: #e0f7f4;
  590. stroke-width: 8;
  591. }
  592. .uploadImgDemo .ring-progress {
  593. fill: none;
  594. stroke: url(#greenGrad);
  595. stroke-width: 8;
  596. stroke-linecap: round;
  597. stroke-dasharray: 251.2;
  598. stroke-dashoffset: 251.2;
  599. transition: stroke-dashoffset 0.35s ease;
  600. }
  601. .uploadImgDemo .ring-text {
  602. position: absolute;
  603. inset: 0;
  604. display: flex;
  605. flex-direction: column;
  606. align-items: center;
  607. justify-content: center;
  608. }
  609. .uploadImgDemo .ring-pct {
  610. font-size: 18px;
  611. font-weight: 700;
  612. color: #11998e;
  613. }
  614. .uploadImgDemo .ring-sub {
  615. font-size: 10px;
  616. color: #aaa;
  617. }
  618. .uploadImgDemo .ring-info {
  619. flex: 1;
  620. }
  621. .uploadImgDemo .ring-filename {
  622. font-size: 13px;
  623. font-weight: 500;
  624. color: #333;
  625. margin-bottom: 6px;
  626. white-space: nowrap;
  627. overflow: hidden;
  628. text-overflow: ellipsis;
  629. max-width: 160px;
  630. }
  631. .uploadImgDemo .ring-list {
  632. display: flex;
  633. flex-wrap: wrap;
  634. gap: 4px;
  635. margin-top: 8px;
  636. }
  637. .uploadImgDemo .ring-dot {
  638. width: 10px;
  639. height: 10px;
  640. border-radius: 50%;
  641. background: #e0e0e0;
  642. transition: background 0.3s;
  643. }
  644. .uploadImgDemo .ring-dot.done {
  645. background: #11998e;
  646. }
  647. .uploadImgDemo .ring-dot.active {
  648. background: #38ef7d;
  649. animation: pulse2 0.8s infinite;
  650. }
  651. @keyframes pulse2 {
  652. 0%,
  653. 100% {
  654. transform: scale(1);
  655. }
  656. 50% {
  657. transform: scale(1.4);
  658. }
  659. }
  660. </style>