ShootFace.vue 22 KB

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