OCRComponent.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. <template>
  2. <view class="page">
  3. <u-popup v-model="ShowModal" :mode="mode" @close="close" :border-radius="borderRadius" :zoom="zoom">
  4. <view class="stips">
  5. <view class="tabs">
  6. <u-tabs style="justify-content: flex-start;" :list="tabslist" :show-bar="false"
  7. active-color="#232832" :is-scroll="false" :current="tabsCurrent" @change="tabschange"
  8. bar-width="60"></u-tabs>
  9. </view>
  10. <view class="upload dis j-s">
  11. <template v-if="checkType=='carInfo'">
  12. <view class="imgOcr-border">
  13. <image :src=" carfrontImg?carfrontImg:'/static/image/car-insure/carfront.png'" mode=""
  14. @click="carfrontChange"></image>
  15. </view>
  16. <view class="imgOcr-border">
  17. <image :src="carbackImg?carbackImg:'/static/image/car-insure/carback.png'" mode=""
  18. @click="carbackChange"></image>
  19. </view>
  20. </template>
  21. <template v-else>
  22. <view class="imgOcr-border">
  23. <image :src=" userfrontImg?userfrontImg:'/static/image/car-insure/userfront.png'" mode=""
  24. @click="userfrontChange"></image>
  25. </view>
  26. <view class="imgOcr-border">
  27. <image :src="userbackImg?userbackImg:'/static/image/car-insure/userback.png'" mode=""
  28. @click="userbackChange"></image>
  29. </view>
  30. </template>
  31. </view>
  32. <view class="operateBtn dis ">
  33. <view class="cancel dis a-c j-c" @click="ShowModal=false">
  34. 关闭
  35. </view>
  36. <view v-if="checkType=='carInfo'" class="confirm dis a-c j-c" @click="ocrInt">
  37. 识别
  38. </view>
  39. <view v-if="checkType=='ownerInfo'" class="confirm dis a-c j-c" @click="userocrInt1">
  40. 识别
  41. </view>
  42. <view v-if="checkType=='policyHolderInfo'" class="confirm dis a-c j-c" @click="userocrInt2">
  43. 识别
  44. </view>
  45. <view v-if="checkType=='insuredPersonInfo'" class="confirm dis a-c j-c" @click="userocrInt3">
  46. 识别
  47. </view>
  48. </view>
  49. </view>
  50. </u-popup>
  51. <view class="mask mask-show" v-if="lodingshow">
  52. <!-- 加载动画开始 -->
  53. <view class="preloader">
  54. <view class="loader"></view>
  55. </view>
  56. <!-- 加载动画结束 -->
  57. <view class="title">加载中...</view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import {
  63. getAgeByIdCard,
  64. addressCode,
  65. } from '@/plugins/utils';
  66. import store from '@/store';
  67. import {
  68. props
  69. } from 'bluebird';
  70. export default {
  71. name: 'name', //插件名称
  72. props: {
  73. showModal: {
  74. type: Boolean,
  75. required: true
  76. },
  77. mode: {
  78. type: String,
  79. default: 'bottom'
  80. },
  81. borderRadius: {
  82. type: String,
  83. default: '16'
  84. },
  85. zoom: {
  86. type: Boolean,
  87. default: false,
  88. },
  89. tabsCurrent: {
  90. type: Number,
  91. default: 0,
  92. },
  93. tabslist: Array,
  94. checkType: {
  95. type: String,
  96. required: true
  97. }
  98. },
  99. computed: {
  100. },
  101. data() {
  102. return {
  103. ShowModal: this.showModal,
  104. Current: this.tabsCurrent,
  105. carfrontImg: "",
  106. carbackImg: "",
  107. carInfoPositiveList: [],
  108. carfront: {},
  109. carback: {},
  110. userfront: {},
  111. userback: {},
  112. userfrontImg: "",
  113. userbackImg: "",
  114. ownerInfoPositiveList: [],
  115. applicantInfoPositiveList: [],
  116. InsuredInfoPositiveList: [],
  117. lodingshow: false,
  118. };
  119. },
  120. watch: {
  121. showModal(newVal) {
  122. this.ShowModal = newVal;
  123. },
  124. },
  125. methods: {
  126. isEmptyObject(obj) {
  127. return JSON.stringify(obj) === '{}';
  128. },
  129. userocrInt1() {
  130. let Info = Object.assign({}, this.userfront, this.userback)
  131. if (this.isEmptyObject(Info)) {
  132. uni.showToast({
  133. icon: 'none',
  134. title: '未检测到图片',
  135. duration: 1500
  136. });
  137. } else {
  138. let ImgList = this.ownerInfoPositiveList;
  139. let img = this.userfrontImg;
  140. this.$emit('ownerInfoCallback', {
  141. Info,
  142. ImgList,
  143. img,
  144. });
  145. this.userfrontImg = '';
  146. this.userbackImg = '';
  147. this.carfrontImg = '';
  148. this.carbackImg = '';
  149. }
  150. },
  151. userocrInt2() {
  152. let Info = Object.assign({}, this.userfront, this.userback)
  153. if (this.isEmptyObject(Info)) {
  154. uni.showToast({
  155. icon: 'none',
  156. title: '未检测到图片',
  157. duration: 1500
  158. });
  159. } else {
  160. let ImgList = this.applicantInfoPositiveList;
  161. let img = this.userfrontImg;
  162. this.$emit('applicantInfoCallback', {
  163. Info,
  164. ImgList,
  165. img,
  166. });
  167. this.userfrontImg = '';
  168. this.userbackImg = '';
  169. this.carfrontImg = '';
  170. this.carbackImg = '';
  171. }
  172. },
  173. userocrInt3() {
  174. let Info = Object.assign({}, this.userfront, this.userback)
  175. if (this.isEmptyObject(Info)) {
  176. uni.showToast({
  177. icon: 'none',
  178. title: '未检测到图片',
  179. duration: 1500
  180. });
  181. } else {
  182. let ImgList = this.InsuredInfoPositiveList;
  183. let img = this.userfrontImg;
  184. this.$emit('InsuredInfoCallback', {
  185. Info,
  186. ImgList,
  187. img,
  188. });
  189. this.userfrontImg = '';
  190. this.userbackImg = '';
  191. this.carfrontImg = '';
  192. this.carbackImg = '';
  193. }
  194. },
  195. ocrInt() {
  196. let Info = Object.assign({}, this.carfront, this.carback)
  197. if (this.isEmptyObject(Info)) {
  198. uni.showToast({
  199. icon: 'none',
  200. title: '未检测到图片',
  201. duration: 1500
  202. });
  203. } else {
  204. let ImgList = this.carInfoPositiveList;
  205. let img = this.carfrontImg;
  206. this.$emit('carCallback', {
  207. Info,
  208. ImgList,
  209. img,
  210. });
  211. this.userfrontImg = '';
  212. this.userbackImg = '';
  213. this.carfrontImg = '';
  214. this.carbackImg = '';
  215. }
  216. },
  217. async carfrontChange() {
  218. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  219. count: 1,
  220. sizeType: ['compressed']
  221. });
  222. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  223. if (!size) {
  224. this.$refs.uToast.show({
  225. title: '上传图片大小不能超过 5MB!',
  226. type: 'error',
  227. })
  228. return false
  229. }
  230. if (chooseImageRes) {
  231. this.lodingshow = true;
  232. this.carfrontImg = chooseImageRes.tempFilePaths[0];
  233. uni.uploadFile({
  234. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  235. filePath: chooseImageRes.tempFilePaths[0],
  236. name: "multipartFile",
  237. formData: {
  238. 'type': 'image',
  239. },
  240. header: {
  241. Authorization: store.state.token,
  242. },
  243. success: (imgRes) => {
  244. let data = JSON.parse(imgRes.data);
  245. if (data.code == '200') {
  246. if (this.carInfoPositiveList.some(v => v.imageType == 'C01')) {
  247. this.carInfoPositiveList.map(val => {
  248. if (val.imageType == 'C01') {
  249. val.imageId = data.data.id;
  250. }
  251. })
  252. } else {
  253. this.carInfoPositiveList.push({
  254. imageId: data.data.id,
  255. imageType: "C01",
  256. })
  257. }
  258. uni.uploadFile({
  259. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  260. filePath: chooseImageRes.tempFilePaths[0],
  261. name: "image1",
  262. header: {
  263. Authorization: store.state.token,
  264. },
  265. success: (uploadFileRes) => {
  266. let data = JSON.parse(uploadFileRes.data).data;
  267. let rdate = '';
  268. if (!!data.carInfo.registerDate) {
  269. rdate = data.carInfo.registerDate.substr(0,
  270. 4) +
  271. '-' + data.carInfo
  272. .registerDate.substr(4, 2) + '-' + data
  273. .carInfo
  274. .registerDate
  275. .substr(6,
  276. 2)
  277. }
  278. let isdate = '';
  279. if (!!data.carInfo.issueDate) {
  280. isdate = data.carInfo.issueDate.substr(0, 4) +
  281. '-' + data.carInfo
  282. .issueDate.substr(4, 2) + '-' + data
  283. .carInfo
  284. .issueDate.substr(6, 2)
  285. }
  286. this.carfront = {
  287. carOwner: data.carInfo.carOwner, //车主
  288. licenseNo: data.carInfo.plateNo, //车牌号
  289. modelcname: data.carInfo.backOcrID, //品牌型号
  290. frameNo: data.carInfo.vin, //车架号
  291. engineNo: data.carInfo.engine, //发动机号
  292. vinNo: data.carInfo.vin, //车架号
  293. issueDate: isdate, //发证日期
  294. registerDate: rdate, //注册日期
  295. cimodelclass: data.carInfo
  296. .plateType, //车辆种类
  297. cartype: data.carInfo.category, //车辆类型
  298. }
  299. this.lodingshow = false;
  300. }
  301. });
  302. }
  303. }
  304. });
  305. } else {
  306. this.lodingshow = false;
  307. }
  308. },
  309. async carbackChange() {
  310. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  311. count: 1,
  312. sizeType: ['compressed']
  313. });
  314. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  315. if (!size) {
  316. this.$refs.uToast.show({
  317. title: '上传图片大小不能超过 5MB!',
  318. type: 'error',
  319. })
  320. return false
  321. }
  322. if (chooseImageRes) {
  323. this.lodingshow = true;
  324. this.carbackImg = chooseImageRes.tempFilePaths[0];
  325. uni.uploadFile({
  326. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  327. filePath: chooseImageRes.tempFilePaths[0],
  328. name: "multipartFile",
  329. formData: {
  330. 'type': 'image',
  331. },
  332. header: {
  333. Authorization: store.state.token,
  334. },
  335. success: (imgRes) => {
  336. let data = JSON.parse(imgRes.data);
  337. if (data.code == '200') {
  338. if (this.carInfoPositiveList.some(v => v.imageType == 'D01')) {
  339. this.carInfoPositiveList.map(val => {
  340. if (val.imageType == 'D01') {
  341. val.imageId = data.data.id;
  342. }
  343. })
  344. } else {
  345. this.carInfoPositiveList.push({
  346. imageId: data.data.id,
  347. imageType: "D01",
  348. })
  349. }
  350. uni.uploadFile({
  351. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  352. filePath: chooseImageRes.tempFilePaths[0],
  353. name: "image2",
  354. header: {
  355. Authorization: store.state.token,
  356. },
  357. success: (uploadFileRes) => {
  358. let data1 = JSON.parse(uploadFileRes.data).data;
  359. this.carback = {
  360. vehicleweight: data1.carInfo
  361. .grossMass, //总质量
  362. completeKerbMass: data1.carInfo
  363. .unladenMass, //整备质量
  364. seatCount: data1.carInfo
  365. .approvedPassengersCapacity, //核定载客数
  366. limitLoad: data1.carInfo
  367. .limitLoad, //核定载质量
  368. }
  369. this.lodingshow = false;
  370. }
  371. });
  372. }
  373. }
  374. });
  375. } else {
  376. this.lodingshow = false;
  377. }
  378. },
  379. async userfrontChange() {
  380. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  381. count: 1,
  382. sizeType: ['compressed']
  383. });
  384. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  385. if (!size) {
  386. this.$refs.uToast.show({
  387. title: '上传图片大小不能超过 5MB!',
  388. type: 'error',
  389. })
  390. return false
  391. }
  392. if (chooseImageRes) {
  393. this.lodingshow = true;
  394. this.userfrontImg = chooseImageRes.tempFilePaths[0];
  395. uni.uploadFile({
  396. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  397. filePath: chooseImageRes.tempFilePaths[0],
  398. name: "multipartFile",
  399. formData: {
  400. 'type': 'image',
  401. },
  402. header: {
  403. Authorization: store.state.token,
  404. },
  405. success: (imgRes) => {
  406. let data = JSON.parse(imgRes.data);
  407. if (data.code == '200') {
  408. switch (this.checkType) {
  409. case 'ownerInfo':
  410. if (this.ownerInfoPositiveList.some(v => v.imageType == 'C02')) {
  411. this.ownerInfoPositiveList.map(val => {
  412. if (val.imageType == 'C02') {
  413. val.imageId = data.data.id;
  414. }
  415. })
  416. } else {
  417. this.ownerInfoPositiveList.push({
  418. imageId: data.data.id,
  419. imageType: "C02",
  420. })
  421. }
  422. break;
  423. case 'applicantInfo':
  424. if (this.applicantInfoPositiveList.some(v => v.imageType ==
  425. 'C03')) {
  426. this.applicantInfoPositiveList.map(val => {
  427. if (val.imageType == 'C03') {
  428. val.imageId = data.data.id;
  429. }
  430. })
  431. } else {
  432. this.applicantInfoPositiveList.push({
  433. imageId: data.data.id,
  434. imageType: "C03",
  435. })
  436. }
  437. break;
  438. case 'InsuredInfo':
  439. if (this.InsuredInfoPositiveList.some(v => v.imageType == 'C04')) {
  440. this.InsuredInfoPositiveList.map(val => {
  441. if (val.imageType == 'C04') {
  442. val.imageId = data.data.id;
  443. }
  444. })
  445. } else {
  446. this.InsuredInfoPositiveList.push({
  447. imageId: data.data.id,
  448. imageType: "C04",
  449. })
  450. }
  451. break;
  452. default:
  453. break;
  454. };
  455. uni.uploadFile({
  456. url: this.$base.baseUrl + '/order/identify/idCard',
  457. filePath: chooseImageRes.tempFilePaths[0],
  458. name: "image1",
  459. header: {
  460. Authorization: store.state.token,
  461. },
  462. success: (uploadFileRes) => {
  463. let data = JSON.parse(uploadFileRes.data).data;
  464. this.userfront = {
  465. age: getAgeByIdCard(data.customerInfo
  466. .identifyNumber),
  467. name: data.customerInfo.name,
  468. gender: data.customerInfo
  469. .identifyIssuedCom,
  470. identifyNumber: data.customerInfo
  471. .identifyNumber,
  472. addr: data.customerInfo.addr,
  473. }
  474. this.lodingshow = false;
  475. }
  476. });
  477. }
  478. }
  479. });
  480. } else {
  481. this.lodingshow = false;
  482. }
  483. },
  484. async userbackChange() {
  485. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  486. count: 1,
  487. sizeType: ['compressed']
  488. });
  489. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  490. if (!size) {
  491. this.$refs.uToast.show({
  492. title: '上传图片大小不能超过 5MB!',
  493. type: 'error',
  494. })
  495. return false
  496. }
  497. if (chooseImageRes) {
  498. this.lodingshow = true;
  499. this.userbackImg = chooseImageRes.tempFilePaths[0];
  500. uni.uploadFile({
  501. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  502. filePath: chooseImageRes.tempFilePaths[0],
  503. name: "multipartFile",
  504. formData: {
  505. 'type': 'image',
  506. },
  507. header: {
  508. Authorization: store.state.token,
  509. },
  510. success: (imgRes) => {
  511. let data = JSON.parse(imgRes.data);
  512. if (data.code == '200') {
  513. switch (this.checkType) {
  514. case 'ownerInfo':
  515. if (this.ownerInfoPositiveList.some(v => v.imageType == 'D02')) {
  516. this.ownerInfoPositiveList.map(val => {
  517. if (val.imageType == 'D02') {
  518. val.imageId = data.data.id;
  519. }
  520. })
  521. } else {
  522. this.ownerInfoPositiveList.push({
  523. imageId: data.data.id,
  524. imageType: "D02",
  525. })
  526. }
  527. break;
  528. case 'applicantInfo':
  529. if (this.applicantInfoPositiveList.some(v => v.imageType ==
  530. 'D03')) {
  531. this.applicantInfoPositiveList.map(val => {
  532. if (val.imageType == 'D03') {
  533. val.imageId = data.data.id;
  534. }
  535. })
  536. } else {
  537. this.applicantInfoPositiveList.push({
  538. imageId: data.data.id,
  539. imageType: "D03",
  540. })
  541. }
  542. break;
  543. case 'InsuredInfo':
  544. if (this.InsuredInfoPositiveList.some(v => v.imageType == 'D04')) {
  545. this.InsuredInfoPositiveList.map(val => {
  546. if (val.imageType == 'D04') {
  547. val.imageId = data.data.id;
  548. }
  549. })
  550. } else {
  551. this.InsuredInfoPositiveList.push({
  552. imageId: data.data.id,
  553. imageType: "D04",
  554. })
  555. }
  556. break;
  557. default:
  558. break;
  559. };
  560. uni.uploadFile({
  561. url: this.$base.baseUrl + '/order/identify/idCard',
  562. filePath: chooseImageRes.tempFilePaths[0],
  563. name: "image2",
  564. header: {
  565. Authorization: store.state.token,
  566. },
  567. success: (uploadFileRes) => {
  568. let data1 = JSON.parse(uploadFileRes.data).data;
  569. let identifyValidDate = '';
  570. if (!!data1.customerInfo
  571. .identifyValidDate) {
  572. identifyValidDate = data1
  573. .customerInfo
  574. .identifyValidDate
  575. .substr(0, 4) +
  576. '-' + data1
  577. .customerInfo
  578. .identifyValidDate
  579. .substr(4, 2) + '-' +
  580. data1
  581. .customerInfo
  582. .identifyValidDate
  583. .substr(6,
  584. 2)
  585. }
  586. let identifyValidEndDate = '';
  587. if (!!data1.customerInfo
  588. .identifyValidEndDate) {
  589. identifyValidEndDate =
  590. data1.customerInfo
  591. .identifyValidEndDate
  592. .substr(0,
  593. 4) + '-' + data1
  594. .customerInfo
  595. .identifyValidEndDate
  596. .substr(4, 2) + '-' +
  597. data1
  598. .customerInfo
  599. .identifyValidEndDate
  600. .substr(6, 2)
  601. }
  602. this.userback = {
  603. identifyValidDate: identifyValidDate, //起期
  604. identifyValidEndDate: identifyValidEndDate, //止期
  605. }
  606. this.lodingshow = false;
  607. }
  608. });
  609. }
  610. }
  611. });
  612. } else {
  613. this.lodingshow = false;
  614. }
  615. },
  616. //弹框关闭
  617. close() {
  618. this.$emit('closePopup');
  619. },
  620. //tab切换
  621. tabschange(e) {
  622. this.$emit('tabschange', e);
  623. }
  624. }
  625. };
  626. </script>
  627. <!--使用scss,只在本组件生效-->
  628. <style lang="scss" scoped>
  629. .tabs {
  630. padding: 0 15px;
  631. border: 1px solid #f2f2f2;
  632. }
  633. .upload {
  634. width: 100%;
  635. height: 146px;
  636. padding: 15px 20px;
  637. background-color: white;
  638. .imgOcr-border {
  639. position: relative;
  640. width: 48%;
  641. height: 100%;
  642. padding: 2px;
  643. background-color: #fff;
  644. box-shadow: 0px 4px 10px 0px #DAE3F4;
  645. image {
  646. width: 100%;
  647. border-radius: 4px;
  648. height: 100%;
  649. }
  650. .del_btn {
  651. position: absolute;
  652. cursor: pointer;
  653. position: absolute;
  654. top: 5rpx;
  655. right: 0;
  656. width: 50rpx;
  657. height: 50rpx;
  658. border-radius: 50%;
  659. z-index: 20;
  660. }
  661. }
  662. }
  663. .operateBtn {
  664. font-weight: bold;
  665. font-size: 16px;
  666. .cancel {
  667. width: 50%;
  668. height: 46px;
  669. color: #0052FF;
  670. background-color: #EAEAEA;
  671. }
  672. .confirm {
  673. width: 50%;
  674. height: 46px;
  675. color: #fff;
  676. background-color: #0052FF;
  677. }
  678. }
  679. .mask {
  680. /* pointer-events: none; */
  681. position: fixed;
  682. z-index: 99999;
  683. top: 0;
  684. left: 0;
  685. right: 0;
  686. bottom: 0;
  687. height: 100vh;
  688. width: 100vw;
  689. display: flex;
  690. flex-direction: column;
  691. justify-content: center;
  692. align-items: center;
  693. flex-wrap: wrap;
  694. }
  695. .mask.mask-show {
  696. background: rgba(255, 255, 255, 0.3);
  697. }
  698. .title {
  699. color: #333;
  700. font-size: 28rpx;
  701. margin-top: 20rpx;
  702. }
  703. .loader {
  704. display: block;
  705. width: 120rpx;
  706. height: 120rpx;
  707. border-radius: 50%;
  708. border: 3rpx solid transparent;
  709. border-top-color: #9370db;
  710. -webkit-animation: spin 2s linear infinite;
  711. animation: spin 2s linear infinite;
  712. }
  713. .loader::before {
  714. content: "";
  715. position: absolute;
  716. top: 5rpx;
  717. left: 5rpx;
  718. right: 5rpx;
  719. bottom: 5rpx;
  720. border-radius: 50%;
  721. border: 3rpx solid transparent;
  722. border-top-color: #ba55d3;
  723. -webkit-animation: spin 3s linear infinite;
  724. animation: spin 3s linear infinite;
  725. }
  726. .loader::after {
  727. content: "";
  728. position: absolute;
  729. top: 15rpx;
  730. left: 15rpx;
  731. right: 15rpx;
  732. bottom: 15rpx;
  733. border-radius: 50%;
  734. border: 3rpx solid transparent;
  735. border-top-color: #ff00ff;
  736. -webkit-animation: spin 1.5s linear infinite;
  737. animation: spin 1.5s linear infinite;
  738. }
  739. @-webkit-keyframes spin {
  740. 0% {
  741. -webkit-transform: rotate(0deg);
  742. -ms-transform: rotate(0deg);
  743. transform: rotate(0deg);
  744. }
  745. 100% {
  746. -webkit-transform: rotate(360deg);
  747. -ms-transform: rotate(360deg);
  748. transform: rotate(360deg);
  749. }
  750. }
  751. @keyframes spin {
  752. 0% {
  753. -webkit-transform: rotate(0deg);
  754. -ms-transform: rotate(0deg);
  755. transform: rotate(0deg);
  756. }
  757. 100% {
  758. -webkit-transform: rotate(360deg);
  759. -ms-transform: rotate(360deg);
  760. transform: rotate(360deg);
  761. }
  762. }
  763. </style>