index copy.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. <template>
  2. <u-popup :show="isShow" @close="close" :closeOnClickOverlay="false">
  3. <view class="page-container">
  4. <view class="errortext" v-if="!startVideoStatus">{{ tip }}</view>
  5. <view class="errortext"><text v-if="errortext != ''">{{ errortext }}</text></view>
  6. <view id="show-content" :class="openCamera == true ? '' : 'show-content-hide'">
  7. <view class="home">
  8. <view :class="bgImgClass">
  9. <img src="../../static/neuralNets/img4.png" />
  10. </view>
  11. </view>
  12. <!-- <view class="uer-camera" @tap="changeUserCamera('hou')" v-if="useCamera == 'qian'">
  13. <img src="../../static/neuralNets/change_camera.png" />
  14. </view>
  15. <view class="uer-camera" @tap="changeUserCamera('qian')" v-if="useCamera == 'hou'">
  16. <img src="../../static/neuralNets/change_camera.png" />
  17. </view> -->
  18. <video
  19. src=""
  20. id="video"
  21. :style="{ width: vwidth + 'px', height: vheight + 'px', display: showVideo }"
  22. playsinline
  23. webkit-playsinline autoplay=true muted=true loop=true controls=false show-center-play-btn=false
  24. object-fit=fill>
  25. </video>
  26. </view>
  27. <view class="main_bottom">
  28. 确认为<text style="color: red;padding: 6rpx;"
  29. v-if="userName">{{ userName }}</text>本人照片<br>保持正脸在取景框中根据屏幕指示完成
  30. <view class="bottom_main">
  31. <view class="bottom_main_list">
  32. <img src="../../static/neuralNets/img3.png" />
  33. <p>正对手机</p>
  34. </view>
  35. <view class="bottom_main_list">
  36. <img src="../../static/neuralNets/img2.png" />
  37. <p>光线充足</p>
  38. </view>
  39. <view class="bottom_main_list">
  40. <img src="../../static/neuralNets/img1.png" />
  41. <p>脸无遮挡</p>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="button-view" :style="{ display: (openCamera == true ? 'flex' : 'none') }">
  46. <view class="click-button">
  47. <u-button type="primary" shape="circle" @click="startVideo"
  48. :disabled="startVideoStatus">{{ !startVideoStatus ? '开始刷脸' : '检测中...' }}</u-button>
  49. <u-button type="error"
  50. shape="circle" @click="close"
  51. :customStyle="{
  52. marginTop: '30rpx'
  53. }">退出</u-button>
  54. </view>
  55. </view>
  56. </view>
  57. </u-popup>
  58. </template>
  59. <script>
  60. import $ from "@/static/collect_face/jquery2.3.js";
  61. import faceFilter from "@/static/neuralNets/jeelizFaceFilter.module.js";
  62. import JeelizCanvas2DHelper from "@/static/neuralNets/JeelizCanvas2DHelper.js";
  63. // 引入uni.webview.1.5.2.js
  64. import '@/static/js/uni.webview.1.5.4.js'
  65. import { compareFace } from '@/api/common/system.js'
  66. import { getToken } from '@/utils/auth'
  67. let VIDEOELEMENT = null;
  68. var CVD = null; // return of Canvas2DDisplay
  69. export default {
  70. props: {
  71. // 用户名
  72. userName: {
  73. type: String,
  74. default: null
  75. },
  76. tip: {
  77. type: String,
  78. default: '需进行人脸验证后再继续学习'
  79. },
  80. querParams: {
  81. type: Object,
  82. default: () => {
  83. return {}
  84. }
  85. },
  86. },
  87. data() {
  88. return {
  89. isShow: false,
  90. isTest: false,
  91. againCount: 0,
  92. openCamera: false,
  93. screenSize: {
  94. width: window.screen.width,
  95. height: window.screen.height,
  96. },
  97. vwidth: 240,
  98. vheight: 240,
  99. scanTip: '',
  100. errortext: '点击开始刷脸按钮开始拍摄',
  101. uploadHeadImg: '',
  102. imgUrl: '',
  103. pauseStatus: false,
  104. startCut: false,
  105. faceCoo: null,
  106. detectState: null,
  107. showVideo: 'block',
  108. appendCss: false,
  109. bgImgClass: 'home_wai',
  110. bgImgClass2: 'home_nei',
  111. mediaStreamTrack: null,
  112. startVideoStatus: false,
  113. useCamera: 'qian', //qian代表前置摄像头 hou代表后置摄像头
  114. }
  115. },
  116. mounted() { },
  117. methods: {
  118. show() {
  119. this.isShow = true;
  120. if (faceFilter && typeof faceFilter.toggle_pause == 'function') {
  121. faceFilter.destroy();
  122. }
  123. var that = this; //a
  124. setTimeout(function () {
  125. //初始化的时候给追加上canvas用作载体
  126. if ($('#jeeFaceFilterCanvas').html() == undefined) {
  127. $('#show-content').append('<canvas class="appendcanvas" width="' + that.vwidth +
  128. '" height="' + that.vheight + '" id="jeeFaceFilterCanvas"></canvas>');
  129. }
  130. if ($('#jeeFaceFilterCanvas2').html() == undefined) {
  131. $('#show-content').append('<canvas class="appendcanvas appendcanvas2" width="' + that
  132. .vwidth + '" height="' + that.vheight + '" id="jeeFaceFilterCanvas2"></canvas>');
  133. }
  134. if (that.appendCss == false) {
  135. $('uni-page-body').append(`<style>
  136. #jeeFaceFilterCanvas{
  137. display:none;
  138. }
  139. #jeeFaceFilterCanvas2{
  140. display:none;
  141. border-radius:50%
  142. }
  143. .uni-video-bar{
  144. display:none !important; //去除底部菜单栏
  145. }
  146. .uni-video-cover{
  147. display:none !important; //去除中间播放按钮
  148. }
  149. video{
  150. transform: rotateY(180deg);
  151. -webkit-transform: rotateY(180deg); /* Safari 和 Chrome */
  152. -moz-transform: rotateY(180deg);
  153. border-radius:50% !important;
  154. }
  155. .uni-video-container{border-radius:50% !important;}
  156. .uni-video-video{border-radius:50% !important;}
  157. </style>`);
  158. that.appendCss = true;
  159. }
  160. //uniapp编译过后无法获取video的dom,此处追加id
  161. $('#video').find('video').prop('id', 'myVideo');
  162. that.showVideo = 'block';
  163. if (that.isTest == true) {
  164. //是否是测试环境 测试环境直接调用视频
  165. that.openCamera = true;
  166. that.main();
  167. } else {
  168. that.openCamera = true;
  169. that.bgImgClass = 'home_wai remove_animation';
  170. that.bgImgClass2 = 'home_nei remove_animation';
  171. that.errortext = '点击开始刷脸按钮开始拍摄';
  172. }
  173. }, 100)
  174. },
  175. close() {
  176. this.startVideoStatus = false;
  177. this.closeVideo();
  178. this.isShow = false
  179. this.$emit('close')
  180. },
  181. closeVideo() {
  182. try {
  183. //页面卸载的时候关闭视频播放
  184. if (this.mediaStreamTrack) {
  185. this.mediaStreamTrack.getTracks()[0].stop();
  186. }
  187. } catch {
  188. console.log('close mediaStreamTrack error')
  189. }
  190. try {
  191. const video = document.getElementsByClassName('uni-video-video')[0];
  192. video.srcObject = null;
  193. } catch {
  194. console.log('close video.srcObject error')
  195. }
  196. try {
  197. faceFilter.toggle_pause(true);
  198. faceFilter.destroy(); //销毁注册对象
  199. } catch {
  200. console.log('close faceFilter toggle_pause error')
  201. }
  202. },
  203. changeUserCamera(type) {
  204. this.useCamera = type;
  205. if (type == 'hou') {
  206. $('uni-page-body').append(`<style>
  207. video{
  208. transform: rotateY(0deg);
  209. -webkit-transform: rotateY(0deg); /* Safari 和 Chrome */
  210. -moz-transform: rotateY(0deg);
  211. border-radius:50% !important;
  212. }
  213. </style>`);
  214. } else {
  215. $('uni-page-body').append(`<style>
  216. video{
  217. transform: rotateY(180deg);
  218. -webkit-transform: rotateY(180deg); /* Safari 和 Chrome */
  219. -moz-transform: rotateY(180deg);
  220. border-radius:50% !important;
  221. }
  222. </style>`);
  223. }
  224. this.playVideo();
  225. },
  226. startVideo() {
  227. if (this.startVideoStatus == false) {
  228. this.playVideo();
  229. } else {
  230. if (this.pauseStatus == false) {
  231. this.$api.msg('当前正在拍照');
  232. return;
  233. }
  234. this.savePause(false)
  235. }
  236. },
  237. savePause(status) {
  238. this.uploadHeadImg = '';
  239. this.imgUrl = '';
  240. this.pauseStatus = status;
  241. if (status == false) {
  242. this.startCut = false;
  243. this.bgImgClass = 'home_wai';
  244. this.bgImgClass2 = 'home_nei';
  245. this.showVideo = 'none';
  246. $('#jeeFaceFilterCanvas2').hide();
  247. } else {
  248. this.showVideo = 'block';
  249. $('#jeeFaceFilterCanvas2').hide();
  250. }
  251. //console.log(status)
  252. //true 暂停 false 继续执行
  253. faceFilter.toggle_pause(status);
  254. },
  255. playVideo() {
  256. var that = this;
  257. that.uploadHeadImg = '';
  258. that.imgUrl = '';
  259. that.startVideoStatus = true;
  260. that.startCut = false;
  261. var thatUseCamera = that.useCamera;
  262. if (thatUseCamera == 'qian') {
  263. var facingMode = 'user';
  264. } else if (thatUseCamera == 'hou') {
  265. var facingMode = {
  266. exact: "environment"
  267. };
  268. }
  269. if (faceFilter && typeof faceFilter.toggle_pause == 'function') {
  270. faceFilter.destroy();
  271. }
  272. setTimeout(function () {
  273. that.getUserMedia({
  274. //摄像头拍摄的区域
  275. video: {
  276. width: 500,
  277. height: 500,
  278. facingMode: facingMode,
  279. },
  280. /* 前置优先 */
  281. },
  282. that.success,
  283. that.error
  284. );
  285. }, 100)
  286. },
  287. // 访问用户媒体设备
  288. getUserMedia(constrains, success, error) {
  289. if (navigator.mediaDevices.getUserMedia) {
  290. navigator.mediaDevices.getUserMedia(constrains).then(success).catch(error); //最新标准API
  291. } else if (navigator.webkitGetUserMedia) {
  292. navigator.webkitGetUserMedia(constrains).then(success).catch(error); //webkit内核浏览器
  293. } else if (navigator.mozGetUserMedia) {
  294. navagator.mozGetUserMedia(constrains).then(success).catch(error); //Firefox浏览器
  295. } else if (navigator.getUserMedia) {
  296. navigator.getUserMedia(constrains).then(success).catch(error); //旧版API
  297. } else {
  298. this.errortext = "你的浏览器不支持访问用户媒体设备";
  299. }
  300. },
  301. success(stream) {
  302. var that = this;
  303. that.bgImgClass = 'home_wai';
  304. that.bgImgClass2 = 'home_nei';
  305. that.openCamera = true;
  306. that.errortext = '请把人脸放在圆圈内拍摄脸部';
  307. that.mediaStreamTrack = stream;
  308. const video = document.getElementsByClassName('uni-video-video')[0];
  309. try {
  310. video.srcObject = stream;
  311. } catch {
  312. this.URL = window.URL || window.webkitURL;
  313. video.src = this.URL.createObjectURL(stream);
  314. }
  315. // webkit内核浏览器
  316. //苹果手机的系统弹框会阻止js的线程的继续执行 手动0.1秒之后自动执行代码
  317. setTimeout(() => {
  318. try {
  319. video.play();
  320. } catch {
  321. that.errortext = '视频流播放失败';
  322. }
  323. that.main();
  324. }, 100);
  325. },
  326. error(e) {
  327. var that = this;
  328. that.startVideoStatus = false;
  329. that.bgImgClass = 'home_wai remove_animation';
  330. that.bgImgClass2 = 'home_nei remove_animation';
  331. if (this.useCamera == 'hou') {
  332. that.errortext = "调用后置摄像头失败:" + (e.name ? e.name : '') + (e.message ? e.message : '');
  333. } else {
  334. that.errortext = "调用前置摄像头失败:" + (e.name ? e.name : '') + (e.message ? e.message : '');
  335. }
  336. },
  337. main() { // entry point
  338. var that = this;
  339. VIDEOELEMENT = document.getElementById('myVideo');
  340. if (VIDEOELEMENT['currentTime'] && VIDEOELEMENT['videoWidth'] && VIDEOELEMENT['videoHeight']) {
  341. that.start();
  342. } else {
  343. setTimeout(function () {
  344. that.main();
  345. }, 100);
  346. }
  347. },
  348. start() { // launched when the video is loaded
  349. var that = this;
  350. faceFilter.init({
  351. canvasId: 'jeeFaceFilterCanvas',
  352. videoSettings: {
  353. videoElement: VIDEOELEMENT
  354. },
  355. rotate: -90,
  356. NNCPath: '../../static/neuralNets/', // root of NN_DEFAULT.json file
  357. callbackReady: function (errCode, spec) {
  358. if (errCode) {
  359. //
  360. that.errortext = '人脸初始化出错' + errCode;
  361. that.startVideoStatus = false;
  362. console.log('AN ERROR HAPPENS. SORRY BRO :( . ERR =', errCode);
  363. return;
  364. }
  365. CVD = JeelizCanvas2DHelper(spec);
  366. CVD.ctx.strokeStyle = 'yellow';
  367. },
  368. callbackTrack: function (detectState) {
  369. //console.log(detectState.detected)
  370. that.detectState = '';
  371. that.faceCoo = '';
  372. if (detectState.detected > 0.9) {
  373. that.detectState = detectState;
  374. that.showVideo = 'block';
  375. $('#jeeFaceFilterCanvas2').hide();
  376. var faceCoo = CVD.getCoordinates(detectState);
  377. that.faceCoo = faceCoo;
  378. CVD.ctx.clearRect(0, 0, CVD.canvas.width, CVD.canvas.height);
  379. CVD.update_canvasTexture();
  380. CVD.draw();
  381. var check = that.checkTrue();
  382. if (check) {
  383. that.errortext = '请保持不动,即将拍照';
  384. if (that.startCut == false) {
  385. that.startCut = true;
  386. setTimeout(function () {
  387. //console.log('setTimeout')
  388. that.savePause(true);
  389. that.cutPhoto();
  390. }, 1000)
  391. }
  392. }
  393. } else {
  394. that.showVideo = 'block';
  395. $('#jeeFaceFilterCanvas2').hide();
  396. that.errortext = '请将完整脸部对准屏幕中央';
  397. }
  398. }
  399. }); //end JEELIZFACEFILTER.init call
  400. },
  401. checkTrue(dump) {
  402. var that = this;
  403. var faceCoo = that.faceCoo;
  404. var faceCooStr = JSON.stringify(faceCoo);
  405. var detectState = that.detectState;
  406. if (!faceCoo || !detectState || detectState == '' || faceCoo == '') {
  407. return false;
  408. }
  409. var x = parseFloat(faceCoo.x).toFixed(2);
  410. var y = parseFloat(faceCoo.y).toFixed(2);
  411. var w = parseFloat(faceCoo.w).toFixed(2);
  412. var h = parseFloat(faceCoo.h).toFixed(2);
  413. var cw = parseFloat(CVD.canvas.width).toFixed(2);
  414. var ch = parseFloat(CVD.canvas.height).toFixed(2);
  415. var xcw = x / cw;
  416. var ycw = y / ch;
  417. if (xcw < 0.25 || xcw > 0.5 || ycw > 0.45 || ycw < 0.1) {
  418. that.errortext = '请将完整脸部对准屏幕中央';
  419. } else {
  420. that.errortext = '';
  421. }
  422. if (that.errortext && that.errortext != '') {
  423. return false;
  424. }
  425. var faceMj = w * h;
  426. var allMj = cw * ch;
  427. var zhanbi = faceMj / allMj;
  428. var mianjiObj = {
  429. faceMj: faceMj,
  430. zhanbi: zhanbi
  431. }
  432. var mianjiobj2 = {
  433. cw: cw,
  434. ch: ch,
  435. allMj: allMj,
  436. }
  437. var mianjiStr = JSON.stringify(mianjiObj);
  438. var mianjiStr2 = JSON.stringify(mianjiobj2);
  439. if (zhanbi < 0.18) {
  440. that.errortext = '请离脸部近一点'
  441. } else if (zhanbi > 0.28) {
  442. that.errortext = '请离脸部远一点'
  443. } else {
  444. return true;
  445. }
  446. return false;
  447. },
  448. cutPhoto(rectparams) {
  449. var that = this;
  450. var check = that.checkTrue(true);
  451. if (check == false) {
  452. that.savePause(false);
  453. return;
  454. }
  455. that.errortext = '拍照成功,请稍后';
  456. that.bgImgClass = 'home_wai remove_animation';
  457. that.bgImgClass2 = 'home_nei remove_animation';
  458. that.showVideo = 'none';
  459. $('#jeeFaceFilterCanvas2').show();
  460. CVD.ctx.clearRect(0, 0, CVD.canvas.width, CVD.canvas.height);
  461. CVD.draw();
  462. var clip = $('#jeeFaceFilterCanvas2')[0];
  463. var context_clip = clip.getContext('2d');
  464. context_clip.drawImage(
  465. $('#jeeFaceFilterCanvas')[0], //规定要使用的图像、画布或视频。
  466. 0, 0, //开始剪切的 x 坐标位置。
  467. CVD.canvas.width, CVD.canvas.height, //被剪切图像的高度。
  468. 0, 0, //在画布上放置图像的 x 、y坐标位置。
  469. this.vwidth, this.vwidth //要使用的图像的宽度、高度
  470. );
  471. //位移来做镜像翻转
  472. if (that.useCamera == 'qian') {
  473. //使用前置摄像头需要反转镜头
  474. context_clip.translate(this.vwidth, 0);
  475. context_clip.scale(-1, 1); //左右镜像翻转
  476. context_clip.drawImage($('#jeeFaceFilterCanvas2')[0], 0, 0, this.vwidth, this.vwidth);
  477. }
  478. this.imgUrl = clip.toDataURL("image/jpeg");
  479. /* clip.toBlob((blob) => {
  480. if (blob) {
  481. this.imgUrl = createObjectURL(blob)
  482. } else {
  483. reject(new Error('Failed to create blob from canvas'));
  484. }
  485. }, 'image/png'); */
  486. this.useImg();
  487. },
  488. useImg() {
  489. this.imgSize();
  490. },
  491. imgSize() {
  492. var that = this;
  493. if (this.imgUrl) {
  494. // 获取base64图片byte大小
  495. const equalIndex = this.imgUrl.indexOf("="); // 获取=号下标
  496. let size;
  497. if (equalIndex > 0) {
  498. const str = this.imgUrl.substring(0, equalIndex); // 去除=号
  499. const strLength = str.length;
  500. const fileLength = strLength - (strLength / 8) * 2; // 真实的图片byte大小
  501. size = Math.floor(fileLength / 1024); // 向下取整
  502. } else {
  503. const strLength = this.imgUrl.length;
  504. const fileLength = strLength - (strLength / 8) * 2;
  505. size = Math.floor(fileLength / 1024); // 向下取整
  506. }
  507. if (size >= 800) {
  508. // 图片超过800k 重新再次压缩
  509. this.imgUrl = $('#jeeFaceFilterCanvas2')[0].toDataURL("image/jpeg", 0.8);
  510. this.imgSize();
  511. } else {
  512. that.faceOpeImg();
  513. }
  514. }
  515. },
  516. async faceOpeImg() {
  517. var that = this;
  518. uni.webView.postMessage({
  519. data: {
  520. photo: this.imgUrl
  521. }
  522. });
  523. console.log(that.imgUrl,'that.imgUrlthat.imgUrl')
  524. return false
  525. $('#jeeFaceFilterCanvas2')[0].toBlob(async (blob) => {
  526. if (blob) {
  527. let newBlobUrl = that.createObjectURL(blob)
  528. const {code,data} = await this.uploadFilePromise(newBlobUrl)
  529. if(code == 0) {
  530. // console.log(data,'datadata')
  531. if(data.data == false) {
  532. that.errortext = '不是有效的人脸,请重新拍照';
  533. that.startVideoStatus = false;
  534. return;
  535. } else {
  536. that.errortext = '人脸识别成功';
  537. that.startVideoStatus = false;
  538. this.$emit('success', data, newBlobUrl, that.imgUrl)
  539. this.close()
  540. return
  541. }
  542. } else {
  543. that.errortext = '比对人脸失败';
  544. that.startVideoStatus = false;
  545. return;
  546. }
  547. } else {
  548. reject(new Error('Failed to create blob from canvas'));
  549. }
  550. }, 'image/png');
  551. },
  552. /**
  553. * blob转url临时访问地址
  554. * @param String blob 对象
  555. */
  556. createObjectURL(blob){
  557. return URL.createObjectURL(blob);
  558. },
  559. uploadFilePromise(url) {
  560. return new Promise((resolve, reject) => {
  561. // console.log(url,'urlurl')
  562. let a = uni.uploadFile({
  563. url: compareFace, // 仅为示例,非真实的接口地址
  564. header: {
  565. 'Authorization': 'Bearer ' + getToken()
  566. },
  567. filePath: url,
  568. name: 'file',
  569. formData: {
  570. ...this.querParams,
  571. },
  572. success: (res) => {
  573. let data = JSON.parse(res.data)
  574. resolve(data)
  575. },
  576. fail: (err) => {
  577. resolve({
  578. code: -1,
  579. msg: '上传失败'
  580. })
  581. }
  582. });
  583. })
  584. },
  585. },
  586. }
  587. </script>
  588. <style lang="scss" scoped>
  589. .page-container {
  590. min-width: 600rpx;
  591. font-size: 28rpx;
  592. height: 100vh;
  593. position: relative;
  594. .contentp1 {
  595. width: 100px;
  596. height: 30px;
  597. background: #EEEEEE;
  598. color: #28A745;
  599. line-height: 30px;
  600. margin-top: 30px;
  601. text-align: center;
  602. }
  603. .contentp {
  604. height: 120px;
  605. }
  606. .errortext {
  607. width: 100%;
  608. height: 40rpx;
  609. line-height: 40rpx;
  610. color: #e03030;
  611. // color: #333333;
  612. text-align: center;
  613. margin-top: 30rpx;
  614. font-size: 30rpx;
  615. }
  616. .img-face {
  617. display: -webkit-box;
  618. /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
  619. display: -moz-box;
  620. /* 老版本语法: Firefox (buggy) */
  621. display: -ms-flexbox;
  622. /* 混合版本语法: IE 10 */
  623. display: -webkit-flex;
  624. /* 新版本语法: Chrome 21+ */
  625. display: flex;
  626. flex-direction: column;
  627. align-items: center;
  628. justify-content: center;
  629. .imgurl {
  630. /* position: fixed;
  631. top: 117.5px;
  632. width: 266px;
  633. height: 266px;
  634. border-radius: 230rpx; */
  635. }
  636. }
  637. #show-content {
  638. width: 100%;
  639. margin-top: 30px;
  640. height: 260px;
  641. display: -webkit-box;
  642. /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
  643. display: -moz-box;
  644. /* 老版本语法: Firefox (buggy) */
  645. display: -ms-flexbox;
  646. /* 混合版本语法: IE 10 */
  647. display: -webkit-flex;
  648. /* 新版本语法: Chrome 21+ */
  649. display: flex;
  650. justify-content: center;
  651. align-items: center;
  652. }
  653. .show-content-hide {
  654. display: none !important;
  655. }
  656. .button-view {
  657. width: 100%;
  658. margin-top: 60rpx;
  659. height: 80rpx;
  660. display: -webkit-box;
  661. /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
  662. display: -moz-box;
  663. /* 老版本语法: Firefox (buggy) */
  664. display: -ms-flexbox;
  665. /* 混合版本语法: IE 10 */
  666. display: -webkit-flex;
  667. /* 新版本语法: Chrome 21+ */
  668. display: flex;
  669. justify-content: center;
  670. align-items: center;
  671. .click-button {
  672. width: 80%;
  673. height: 100%;
  674. }
  675. }
  676. .not-zhuanimg {
  677. width: 17.225rem;
  678. overflow: hidden;
  679. z-index: 10;
  680. position: absolute;
  681. }
  682. .home {
  683. overflow: hidden;
  684. text-align: center;
  685. width: 240px;
  686. height: 240px;
  687. position: absolute;
  688. z-index: 10;
  689. }
  690. .home_wai img {
  691. width: 100%;
  692. overflow: hidden;
  693. animation: myfirst 8s infinite linear;
  694. }
  695. @keyframes myfirst {
  696. 0% {
  697. transform: rotate(0deg) scale(1);
  698. }
  699. 50% {
  700. transform: rotate(360deg) scale(1);
  701. }
  702. 75% {
  703. transform: rotate(540deg) scale(0.9);
  704. }
  705. 100% {
  706. transform: rotate(720deg) scale(1);
  707. }
  708. }
  709. .home_nei {
  710. overflow: hidden;
  711. width: 12.575rem;
  712. margin: 3.69133rem auto;
  713. }
  714. .home_nei img {
  715. width: 100%;
  716. overflow: hidden;
  717. animation: mysecond 8s infinite linear;
  718. }
  719. .remove_animation img {
  720. animation: none;
  721. }
  722. @keyframes mysecond {
  723. 0% {
  724. transform: rotate(0deg) scale(1);
  725. }
  726. 50% {
  727. transform: rotate(-360deg) scale(1);
  728. }
  729. 75% {
  730. transform: rotate(-540deg) scale(0.9);
  731. }
  732. 100% {
  733. transform: rotate(-720deg) scale(1);
  734. }
  735. }
  736. .title {
  737. background: #FFFFFF;
  738. padding: 0.9rem 0;
  739. text-align: center;
  740. box-shadow: 0 0 10px #e5e5e5;
  741. font-size: 0.9rem;
  742. font-weight: bold;
  743. color: #000;
  744. }
  745. .main_top {
  746. padding-top: 2.5rem;
  747. text-align: center;
  748. color: #757575;
  749. font-size: 0.9rem;
  750. font-weight: bold;
  751. }
  752. .main_top_cricle {
  753. margin: 1.25rem auto;
  754. width: 9.2rem;
  755. height: 9.2rem;
  756. position: relative;
  757. overflow: hidden;
  758. }
  759. .main_top_cricle img {
  760. width: 98%;
  761. }
  762. .main_cricle {
  763. position: absolute;
  764. top: 0;
  765. left: 0;
  766. right: 0;
  767. bottom: 0;
  768. overflow: hidden;
  769. z-index: 5;
  770. animation: myfirst 4s infinite linear;
  771. }
  772. @keyframes myfirst {
  773. 0% {
  774. transform: rotate(0deg);
  775. }
  776. 50% {
  777. transform: rotate(360deg);
  778. }
  779. 75% {
  780. transform: rotate(540deg);
  781. }
  782. 100% {
  783. transform: rotate(720deg);
  784. }
  785. }
  786. .main_cricle img {
  787. width: 100%;
  788. height: 100%;
  789. }
  790. .main_bottom {
  791. margin-top: 30rpx;
  792. overflow: hidden;
  793. text-align: center;
  794. font-size: 28rpx;
  795. color: #333;
  796. }
  797. .bottom_main {
  798. margin-top: 1rem;
  799. display: flex;
  800. overflow: hidden;
  801. }
  802. .bottom_main_list {
  803. text-align: center;
  804. flex-grow: 1;
  805. font-size: 28rpx;
  806. color: #333;
  807. }
  808. .bottom_main_list img {
  809. width: 2.5rem;
  810. margin-bottom: 10rpx;
  811. }
  812. .uer-camera {
  813. position: fixed;
  814. top: 200rpx;
  815. right: 42%;
  816. color: #fff;
  817. text-align: center;
  818. font-size: 24rpx;
  819. padding: 6rpx 8rpx 8rpx 6rpx;
  820. border-radius: 24rpx;
  821. height: 88rpx;
  822. width: 88rpx;
  823. overflow: hidden;
  824. }
  825. .uer-camera img {
  826. width: 100%;
  827. height: 100%;
  828. }
  829. }
  830. </style>