facePhoto.nvue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. <template>
  2. <view class="live-pusher-box" :style="{width: width + 'px',height: height + 'px'}">
  3. <Ba-CameraView ref="cameraView" :load="loadData" :style="{flex: 1,width: width + 'px', height: cameraHeight + 'px',display:'none'}" ></Ba-CameraView>
  4. <cover-view class="cover-view" :style="{width: width + 'px',height: height + 'px'}">
  5. <cover-view class="uni-nav-bar" :style="{width: width + 'px'}">
  6. <cover-view class="uni-nav-bar" :style="{width: width + 'px',top:statusBarHeight}">
  7. <!-- <cover-view :style="{height: statusBarHeight,width: width + 'px'}"></cover-view> -->
  8. <cover-view class="uni-nav-barbox">
  9. <cover-view class="flex-center" @click="back">
  10. <cover-image class="uni-nav-back" src="@/static/image/new/icon_back1.png" mode="aspectFill"></cover-image>
  11. <text class="uni-nav-title-t">返回</text>
  12. </cover-view>
  13. </cover-view>
  14. <cover-view class="title-box" :style="{width: width + 'px'}">
  15. <cover-view :style="{height: statusBarHeight,width: width + 'px'}"></cover-view>
  16. <text class="title">请您正对摄像头</text>
  17. <text class="tips">确保正脸在辅助框内,保持面部无遮挡,表情自然</text>
  18. </cover-view>
  19. <!-- <cover-view :style="{height: statusBarHeight,width: width + 'px'}"></cover-view> -->
  20. <cover-view class="uni-nav-barbox">
  21. <cover-view class="flex-center" @click="showConfirmModal">
  22. <cover-image class="uni-nav-back" src="@/static/image/new/icon_home.png" mode="aspectFill"></cover-image>
  23. <text class="uni-nav-title-t">首页</text>
  24. </cover-view>
  25. </cover-view>
  26. </cover-view>
  27. </cover-view>
  28. <!-- <cover-view class="title-box" :style="{width: width + 'px'}">
  29. <cover-view :style="{height: statusBarHeight,width: width + 'px'}"></cover-view>
  30. <text class="title">请您正对摄像头</text>
  31. <text class="tips">确保正脸在辅助框内,保持面部无遮挡,表情自然</text>
  32. </cover-view> -->
  33. <cover-view class="imagebox" :style="{width:width + 'px',height: height+ 'px'}">
  34. <!-- <view v-if="width<height" :style="{width:width + 'px',height: height/4+ 'px'}" style="background:#262523 ;"></view> -->
  35. <image class="face" :style="{width:width + 'px',height: height+ 'px'}" src="@/static/image/new/mask_face.png" mode="aspectFill"></image>
  36. <cover-view class="countdown-box" :style="{width:width + 'px',height: height+ 'px'}">
  37. <text class="title" v-if="countdownTimer && currentCount > 0">{{ currentCount }}</text>
  38. <image v-if="isResult" class="success" src="@/static/image/new/icon_success.png" mode="aspectFill"></image>
  39. <text v-if="isResult" class="desc">即将开始舌诊检测 {{countDown2}}s</text>
  40. <text v-if="hasTakenPhoto" class="error" @click="handleReScan">重新扫描</text>
  41. </cover-view>
  42. </cover-view>
  43. <!-- <cover-view class="box" :style="{width:width + 'px',height: height + 'px'}">
  44. <cover-view class="imagebox" :style="{width:width + 'px'}">
  45. <cover-image class="face" :style="{width:width + 'px'}" src="@/static/image/device/facial_photography_mask_bg.png" mode="aspectFill"></cover-image>
  46. </cover-view>
  47. </cover-view> -->
  48. </cover-view>
  49. <!-- <view class="camera-footer" id="camera-footer" :style="{width: width + 'px'}">
  50. <view class="camera-options" :style="{width: width + 'px'}">
  51. <view class="camera-options-left camera-item" @click="handleAlbum">
  52. <image src="@/static/image/device/album_icon24.png" mode="scaleToFill" style="width: 34rpx;height:34rpx;margin-bottom: 5rpx;"></image>
  53. <text class="camera-item-t">相册上传</text>
  54. </view>
  55. <view class="camera-options-center camera-item" @click="handleShutter">
  56. <view class="photograph-btn"></view>
  57. </view>
  58. <view class="camera-options-ritht camera-item" @click="handleReversal">
  59. <image src="@/static/image/device/switch_camera_icon24.png" mode="scaleToFill" style="width: 34rpx;height:34rpx;margin-bottom: 5rpx;"></image>
  60. <text class="camera-item-t">切换摄像头</text>
  61. </view>
  62. </view>
  63. </view> -->
  64. </view>
  65. </template>
  66. <script>
  67. import { isAgreePrivacy } from '@/utils/common.js'
  68. import shareBox from "@/components/share-box/share-boxN.vue"
  69. import {getCount,add,addFace} from '@/api/healthTongue.js'
  70. import { premissionCheck } from "@/js_sdk/wa-permission/permission.js"
  71. // 这个组件仅限APP使用!!!
  72. export default {
  73. components: {
  74. shareBox
  75. },
  76. data() {
  77. // 在data初始化时就进行设备检测
  78. const systemInfo = uni.getSystemInfoSync();
  79. console.log('设备信息:', systemInfo);
  80. // // 判断是否为平板设备
  81. // const isTabletBySize = systemInfo.screenWidth > 800 && systemInfo.screenHeight > 1200;
  82. const isTabletByModel = systemInfo.brand && (
  83. //systemInfo.model.toLowerCase().includes('tablet') ||
  84. //systemInfo.model.toLowerCase().includes('pad') ||
  85. systemInfo.brand.toLowerCase().includes('shimeta')
  86. );
  87. const isTablet = isTabletByModel;
  88. const defaultCameraFacing = isTablet ? false : true; // 平板默认后置,手机默认前置
  89. console.log('设备检测结果:', {
  90. isTablet,
  91. defaultCameraFacing: defaultCameraFacing ? '前置' : '后置',
  92. screenSize: `${systemInfo.screenWidth}x${systemInfo.screenHeight}`,
  93. model: systemInfo.model
  94. });
  95. return {
  96. baseUrl:uni.getStorageSync('requestPath'),
  97. height: uni.getSystemInfoSync().screenHeight,
  98. width: uni.getSystemInfoSync().screenWidth,
  99. cameraHeight: uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().statusBarHeight - 100,
  100. statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
  101. livePusher: null,
  102. ready: true,
  103. cameraHeight: '', //相机画面宽度
  104. coverImage: null,
  105. counts: 0,
  106. marginTop: uni.getSystemInfoSync().statusBarHeight + uni.upx2px(130),
  107. device: 'back',
  108. cameraContext: null,
  109. shutterShow: false,
  110. menuLeft: '100%',
  111. // 设备类型检测
  112. isTablet: isTablet,
  113. isShimeta: isTablet,
  114. loadData: { //配置
  115. isToast: false,
  116. isShowVibrate:false,
  117. isFacingFront: defaultCameraFacing, // 根据设备类型设置默认摄像头
  118. captureQuality:"HIGH", //摄像头清晰度 **HIGH**: 1920x1080 (高清) **MEDIUM**: 1280x720 (中等) **LOW**: 640x480 (低清)
  119. autoZoomEnabled: true, // 启用自动变焦
  120. autoZoomMode: "FACE", // 变焦模式:FACE(面部) 或 TONGUE(舌诊)
  121. isTablet: isTablet // 设备类型配置
  122. },
  123. currentQuality:0,
  124. currentZoomMode:"FACE", // 默认使用舌诊模式
  125. statusMessage:"",
  126. windowResizeCallback:null,
  127. cameraReady: false, // 相机是否初始化完成
  128. countdown: 5, // 倒计时总时长(秒)
  129. currentCount: 0, // 当前剩余倒计时
  130. countdownTimer: null, // 倒计时定时器实例(用于后续清除)
  131. hasTakenPhoto: false, // 是否已完成拍照,避免重复触发
  132. user:{},
  133. isResult:false,//结果
  134. countDown2: 3, // 初始倒计时5秒
  135. timer: null ,// 定时器标识
  136. isShow:false//中途退出
  137. }
  138. },
  139. created(){
  140. let that=this;
  141. // uni.$on('navigateBack', function(data) {
  142. // that.handleReversal();
  143. // });
  144. },
  145. onLoad() {
  146. //this.getCount();
  147. this.setListener();
  148. },
  149. mounted() {
  150. // 强制应用配置,确保平板设备使用后置摄像头
  151. // this.$nextTick(() => {
  152. // this.forceApplyConfig();
  153. // });
  154. },
  155. onShow() {
  156. this.user=JSON.parse(uni.getStorageSync('userInfo'));
  157. console.log("用户缓存",this.user)
  158. this.windowResizeCallback = (res) => {
  159. // 重新获取屏幕尺寸
  160. this.getScreenSize(res.size);
  161. }
  162. uni.onWindowResize(this.windowResizeCallback);
  163. },
  164. onReady() {
  165. setTimeout(()=>{
  166. this.switchZoomMode(this.loadData.autoZoomMode);
  167. },200);
  168. },
  169. onUnload() {
  170. this.clearCountdownTimer();
  171. clearInterval(this.timer);
  172. this.timer = null;
  173. if (this.windowResizeCallback) {
  174. uni.offWindowResize(this.windowResizeCallback);
  175. this.windowResizeCallback = null;
  176. }
  177. // uni.$off('navigateBack');
  178. },
  179. methods: {
  180. showConfirmModal() {
  181. this.clearCountdownTimer()
  182. uni.showModal({
  183. title: "提示", // 弹窗标题
  184. content: "确定要中断当前操作,返回首页吗~", // 弹窗内容
  185. showCancel: true, // 是否显示取消按钮(默认 true)
  186. cancelText: "取消", // 取消按钮文本
  187. confirmText: "确定", // 确认按钮文本
  188. cancelColor: "#37C3A0", // 取消按钮颜色
  189. confirmColor: "#37C3A0", // 确认按钮颜色
  190. success: (res) => {
  191. // 回调:用户点击确认/取消
  192. if (res.confirm) {
  193. uni.reLaunch({
  194. url: '/pages/index/index',
  195. animationType: 'none',
  196. animationDuration: 2000
  197. })
  198. console.log("用户点击确定");
  199. // 执行后续业务逻辑(如删除数据)
  200. } else if (res.cancel) {
  201. console.log("用户点击取消");
  202. }
  203. }
  204. });
  205. },
  206. // 清除倒计时定时器
  207. clearCountdownTimer() {
  208. if (this.countdownTimer) {
  209. clearInterval(this.countdownTimer);
  210. this.countdownTimer = null;
  211. //this.hasTakenPhoto=true
  212. }
  213. },
  214. // 倒计时逻辑
  215. startCountDown() {
  216. this.timer = setInterval(() => {
  217. if (this.countDown2 > 0) {
  218. this.countDown2--;
  219. } else {
  220. // 倒计时结束,清除定时器
  221. clearInterval(this.timer);
  222. this.timer = null;
  223. this.isResult=false;
  224. this.hasTakenPhoto = false;
  225. uni.redirectTo({
  226. url:"/pages/device/tongue/indexOld"
  227. });
  228. }
  229. }, 1000);
  230. },
  231. //重新扫描
  232. handleReScan() {
  233. this.isResult = false;
  234. this.hasTakenPhoto = false;
  235. this.startCountdownTakePhoto();
  236. },
  237. getScreenSize(res) {
  238. this.width = res.windowWidth
  239. this.height = res.windowHeight
  240. if (this.$refs.cameraView) {
  241. this.switchZoomMode(this.loadData.autoZoomMode);
  242. } else {
  243. }
  244. },
  245. switchZoomMode(currentMode) {
  246. //启动舌诊模式自动变焦
  247. this.$refs.cameraView.setAutoZoom((result) => {
  248. if (result.ok) {
  249. console.log('自动变焦设置成功:', this.loadData.autoZoomMode);
  250. this.cameraReady=true
  251. this.startCountdownTakePhoto();
  252. } else {
  253. console.error('自动变焦模式:', result.msg);
  254. }
  255. }, {
  256. enabled: this.loadData.autoZoomEnabled,
  257. mode: currentMode
  258. });
  259. },
  260. getCount(){
  261. getCount().then(
  262. res => {
  263. if(res.code==200){
  264. this.counts=res.data;
  265. }else{
  266. uni.showToast({
  267. icon:'none',
  268. title: "请求失败",
  269. });
  270. }
  271. },
  272. rej => {}
  273. );
  274. },
  275. // 快门
  276. handleShutter() {
  277. if (this.ready) {
  278. this.ready = false;
  279. let options={scaleW:403,scaleH:620,isCrop:false};
  280. this.$refs.cameraView.takePicture((res) => {
  281. this.ready = true;
  282. const filePath=res.data.path;
  283. console.log("qxj takePicture",res);
  284. plus.io.resolveLocalFileSystemURL(filePath, (entry) => {
  285. let url= entry.toLocalURL();
  286. this.startDetectionFace(url)
  287. // uni.navigateTo({
  288. // url:"/pages/device/tongue/index?rightUrl="+url
  289. // })
  290. }, (error) => {
  291. console.error('Failed to resolve file system URL:', error);
  292. });
  293. },options);
  294. }
  295. },
  296. //面诊
  297. startDetectionFace(url){
  298. if(!url){
  299. uni.showToast({
  300. title: '扫描失败,请重试',
  301. icon: 'none'
  302. });
  303. return;
  304. }
  305. uni.showLoading({
  306. title:"扫描中...",
  307. mask:true
  308. })
  309. uni.uploadFile({
  310. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  311. filePath: url,
  312. name: 'file',
  313. formData: {
  314. 'user': 'test' // 上传附带参数
  315. },
  316. success: (uploadFileRes) => {
  317. console.log('---',this.user)
  318. // console.log('---',JSON.parse(uploadFileRes.data).url)
  319. var data={
  320. userId:this.user.fsUserId,
  321. sex:this.user.sex,
  322. name:this.user.username,
  323. surfaceUrl:JSON.parse(uploadFileRes.data).url,
  324. }
  325. addFace(data).then(res => {
  326. console.log('zaiFC',data,res)
  327. if(res.code==200){
  328. uni.hideLoading();
  329. this.isResult=true
  330. this.startCountDown()
  331. }else{
  332. uni.hideLoading();
  333. this.errMsg= res.msg;
  334. this.hasTakenPhoto=true
  335. uni.showToast({
  336. icon:'none',
  337. title: res.msg,
  338. });
  339. }
  340. },
  341. rej => {}
  342. );
  343. },fail: (err) => {
  344. uni.hideLoading();
  345. uni.showToast({
  346. title: '上传失败,请重试',
  347. icon: 'none'
  348. });
  349. console.error('上传失败:', err);
  350. }
  351. });
  352. },
  353. // 相册
  354. async handleAlbum() {
  355. // #ifdef APP-PLUS
  356. uni.chooseImage({
  357. count: 1, //默认9
  358. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  359. sourceType: ['album'], //从相册选择
  360. success: (res) => {
  361. uni.setStorageSync("tongueUrl",res.tempFilePaths[0])
  362. let url= res.tempFilePaths[0]
  363. uni.redirectTo({
  364. url:"/pages/device/tongue/index?rightUrl="+url
  365. })
  366. }
  367. });
  368. // #endif
  369. },
  370. // 反转摄像头
  371. handleReversal() {
  372. if(this.isShimeta){
  373. uni.showToast({
  374. title:"该设备不支持切换摄像头",
  375. icon:"none"
  376. });
  377. return;
  378. }
  379. this.switchZoomMode(this.loadData.autoZoomMode)
  380. this.$refs.cameraView.switchCamera((result) => {
  381. if (result.ok) {
  382. this.loadData.isFacingFront = !this.loadData.isFacingFront;
  383. this.statusMessage = `已切换到${this.loadData.isFacingFront ? '前置' : '后置'}摄像头`;
  384. uni.showToast({
  385. title: "切换成功",
  386. icon: 'none'
  387. });
  388. } else {
  389. this.statusMessage = '切换摄像头失败: ' + result.msg;
  390. }
  391. });
  392. },
  393. // 强制应用当前配置(确保平板设备配置生效)
  394. forceApplyConfig() {
  395. console.log('强制应用配置:', this.loadData);
  396. // 如果是平板设备,确保使用后置摄像头
  397. if (this.isTablet && this.loadData.isFacingFront) {
  398. console.log('检测到平板设备使用前置摄像头,强制切换到后置');
  399. this.loadData.isFacingFront = false;
  400. this.statusMessage = '平板设备强制使用后置摄像头';
  401. // 调用底层API确保配置生效
  402. this.setRearCamera();
  403. // 平板设备切换摄像头后,重新应用自动变焦设置
  404. if (this.loadData.autoZoomEnabled) {
  405. setTimeout(() => {
  406. this.reapplyAutoZoom();
  407. }, 1000); // 等待摄像头切换完成
  408. }
  409. }
  410. // 更新状态显示
  411. this.statusMessage = this.isTablet ?
  412. '平板设备 - 后置摄像头' :
  413. (this.loadData.isFacingFront ? '手机设备 - 前置摄像头' : '手机设备 - 后置摄像头');
  414. },
  415. // 重新应用自动变焦设置
  416. reapplyAutoZoom() {
  417. console.log('重新应用自动变焦设置:', {
  418. enabled: this.loadData.autoZoomEnabled,
  419. mode: this.currentZoomMode
  420. });
  421. this.$refs.cameraView.setAutoZoom((result) => {
  422. if (result.ok) {
  423. this.statusMessage = `平板设备 - 自动变焦已重新应用 (${this.currentZoomMode}模式)`;
  424. console.log('平板设备自动变焦重新应用成功');
  425. } else {
  426. this.statusMessage = '重新应用自动变焦失败: ' + result.msg;
  427. console.error('Failed to reapply auto zoom:', result.msg);
  428. }
  429. }, {
  430. enabled: this.loadData.autoZoomEnabled,
  431. mode: this.currentZoomMode
  432. });
  433. },
  434. // 舌诊记录
  435. handleReportlist() {
  436. uni.navigateTo({
  437. url: "/pages/user/tongue/tongueList"
  438. })
  439. },
  440. // 启动5秒倒计时,结束后拍照
  441. startCountdownTakePhoto() {
  442. // 边界判断:相机未就绪、已拍照、定时器已存在,直接返回
  443. if (!this.cameraReady || this.countdownTimer) {
  444. return;
  445. }
  446. // 初始化当前剩余倒计时
  447. this.currentCount = this.countdown;
  448. console.log(`倒计时开始:${this.currentCount} 秒`);
  449. // 启动倒计时定时器(每秒执行一次)
  450. this.countdownTimer = setInterval(() => {
  451. // 倒计时递减
  452. this.currentCount--;
  453. console.log(`剩余:${this.currentCount} 秒`);
  454. // 倒计时结束
  455. if (this.currentCount <= 0) {
  456. this.clearCountdownTimer(); // 清除定时器
  457. this.handleShutter(); // 触发自动拍照
  458. }
  459. }, 1000); // 1000毫秒 = 1秒
  460. // 可选:如果不需要可视倒计时,直接延迟5秒拍照(更简洁)
  461. // setTimeout(() => {
  462. // this.autoTakePhoto();
  463. // }, 5000);
  464. },
  465. setListener() {
  466. this.$refs.cameraView.setListener((res) => {
  467. console.log("qxj setListener",res);
  468. if (res.action == "error") {
  469. this.showToast(res.msg)
  470. }else{ // 新增:监听相机初始化就绪事件(需子组件支持)
  471. this.cameraReady = true;
  472. console.log("相机初始化完成,即将开始5秒倒计时");
  473. // 相机就绪后,启动倒计时拍照
  474. }
  475. });
  476. },
  477. showToast(msg) {
  478. uni.showToast({
  479. title: msg,
  480. icon: 'none'
  481. });
  482. },
  483. navTo() {
  484. uni.navigateTo({
  485. url: "/pages/device/tongue/ques"
  486. })
  487. },
  488. // 返回
  489. back(){
  490. uni.navigateBack();
  491. },
  492. }
  493. }
  494. </script>
  495. <style lang="scss" scoped>
  496. @mixin u-flex($flexD, $alignI, $justifyC) {
  497. display: flex;
  498. flex-direction: $flexD;
  499. align-items: $alignI;
  500. justify-content: $justifyC;
  501. }
  502. /* 遮罩层样式 */
  503. .mask {
  504. position: fixed;
  505. top: 0;
  506. left: 0;
  507. right: 0;
  508. bottom: 0;
  509. background-color: rgba(0, 0, 0, 0.5);
  510. display: flex;
  511. justify-content: center;
  512. align-items: center;
  513. z-index: 999;
  514. animation: fadeIn 0.3s ease;
  515. }
  516. /* 弹窗容器样式 */
  517. .popup-container {
  518. //width: 50%;
  519. width: 620px;
  520. height: 352px;
  521. background: #FFFFFF;
  522. border-radius: 39px 39px 39px 39px;
  523. animation: scaleIn 0.3s ease;
  524. overflow: hidden;
  525. display: flex;
  526. flex-direction: column;
  527. align-items: center;
  528. justify-content: space-between;
  529. padding:43px;
  530. position: relative;
  531. .bg{
  532. width: 1005;
  533. height: 244px;
  534. position: absolute;
  535. top:0
  536. }
  537. .title-t {
  538. image{
  539. width: 153px;
  540. height: 25px;
  541. }
  542. text{
  543. font-family: PingFang SC, PingFang SC;
  544. font-weight: 500;
  545. font-size: 32px;
  546. color: #333333;
  547. margin: 0 10px;
  548. }
  549. }
  550. .title-r {
  551. font-family: PingFang SC, PingFang SC;
  552. font-weight: 400;
  553. font-size: 28px;
  554. color: #333333;
  555. }
  556. .btn-l{
  557. display: flex;
  558. align-items: center;
  559. justify-content: center;
  560. font-family: PingFang SC, PingFang SC;
  561. font-weight: 600;
  562. font-size: 28px;
  563. color: #37C3A0;
  564. width: 220px;
  565. height: 64px;
  566. border-radius: 121px 121px 121px 121px;
  567. border: 2px solid #37C3A0;
  568. margin-right: 40px;
  569. }
  570. .btn-r {
  571. display: flex;
  572. align-items: center;
  573. justify-content: center;
  574. width: 220px;
  575. height: 64px;
  576. background: #37C3A0;
  577. border-radius: 121px 121px 121px 121px;
  578. font-family: PingFang SC, PingFang SC;
  579. font-weight: 600;
  580. font-size: 28px;
  581. color: #FFFFFF;
  582. }
  583. }
  584. .flex-center {
  585. @include u-flex(row, center, center);
  586. }
  587. .live-pusher-box {
  588. background: #666;
  589. @include u-flex(column, center, center);
  590. }
  591. .imagebox {
  592. // margin-top: 200px;
  593. // top:0;
  594. // left: 0;
  595. // right: 0; // 新增:让容器铺满屏幕宽度,确保文本居中生效
  596. // overflow: hidden;
  597. display: flex;
  598. flex-direction: column;
  599. align-items: center;
  600. justify-content: center;
  601. position: relative;
  602. // padding-bottom: 100rpx;
  603. .desc{
  604. margin-top: 20px;
  605. font-family: PingFang SC, PingFang SC;
  606. font-weight: 500;
  607. font-size: 24px;
  608. color: #fff;
  609. }
  610. }
  611. .face {
  612. width: 100%;
  613. height: 100%;
  614. }
  615. .countdown-box{
  616. position: absolute;
  617. display: flex;
  618. align-items: center;
  619. justify-content: center;
  620. top:0;
  621. z-index: 99;
  622. .title{
  623. font-family: PingFang SC, PingFang SC;
  624. font-weight: 500;
  625. font-size: 240px;
  626. line-height: 300px !important;
  627. color: #fff;
  628. }
  629. .success{
  630. width: 180px;
  631. height: 180px;
  632. }
  633. .error{
  634. text-align: center;
  635. line-height:68px;
  636. width: 200px;
  637. height: 68px;
  638. background: #37C3A0;
  639. border-radius: 69px 69px 69px 69px;
  640. font-family: PingFang SC, PingFang SC;
  641. font-weight: 600;
  642. font-size: 28px;
  643. color: #FFFFFF;
  644. }
  645. }
  646. .cover-view {
  647. width: 100%;
  648. position: absolute;
  649. top: 0;
  650. left: 0;
  651. @include u-flex(column, center, center);
  652. }
  653. .title-box{
  654. position: fixed;
  655. left: 0;
  656. right: 0; // 新增:让容器铺满屏幕宽度,确保文本居中生效
  657. z-index: 998; // 低于导航栏 z-index:999,避免遮挡导航栏
  658. width: 100%;
  659. }
  660. .title {
  661. // margin-top: calc(var(--status-bar-height) + 130rpx);
  662. font-family: PingFang SC, PingFang SC;
  663. font-weight: 500;
  664. font-size: 36px;
  665. color: #FFFFFF;
  666. // line-height: 54px;
  667. text-align: center;
  668. }
  669. .tips {
  670. margin-top: 20px;
  671. // margin-bottom: 60rpx;
  672. font-family: PingFang SC, PingFang SC;
  673. font-weight: 400;
  674. font-size: 28px;
  675. color: #FFFFFF;
  676. text-align: center;
  677. }
  678. .boder-box{
  679. width: 66rpx;
  680. height: 32rpx;
  681. background: rgba(255,255,255,0.2);
  682. border-radius: 8rpx;
  683. border: 1px solid #FFFFFF;
  684. }
  685. .uni-nav-bar {
  686. position: fixed;
  687. left: 0px;
  688. width: 100%;
  689. z-index: 999;
  690. overflow: hidden;
  691. font-family: PingFang SC, PingFang SC;
  692. font-weight: 500;
  693. color: #fff;
  694. padding-left: 28px;
  695. padding-right: 28px;
  696. // background-color: #000;
  697. @include u-flex(row, center, space-between);
  698. .uni-nav-barbox {
  699. width: 140px;
  700. height: 48px;
  701. background: rgba(2,2,2,0.15);
  702. border-radius: 41px 41px 41px 41px;
  703. border: 1px solid rgba(255,255,255,0.3);
  704. @include u-flex(row, center, center);
  705. }
  706. .uni-nav-title-t {
  707. font-family: SourceHanSansSC;
  708. font-weight: 400;
  709. margin-left: 5rpx;
  710. color: #fff;
  711. /* #ifdef APP-PLUS */
  712. font-size: 14rpx;
  713. /* #endif */
  714. /* #ifndef APP-PLUS */
  715. font-size: 14rpx;
  716. /* #endif */
  717. }
  718. .uni-nav-title {
  719. font-family: PingFang SC, PingFang SC;
  720. font-weight: 500;
  721. font-size: 22px;
  722. color: #FFFFFF;
  723. text-align: left;
  724. @include u-flex(row, center, center);
  725. .ques {
  726. // flex-shrink: 0;
  727. width: 33rpx;
  728. height: 33rpx;
  729. margin-left: 9rpx;
  730. }
  731. }
  732. .uni-nav-back {
  733. width: 16rpx;
  734. height: 16rpx;
  735. }
  736. }
  737. .uni-nav-bar2 {
  738. position: fixed;
  739. top: 28px;
  740. right: 28px;
  741. width: 100%;
  742. z-index: 999;
  743. overflow: hidden;
  744. font-family: PingFang SC, PingFang SC;
  745. font-weight: 500;
  746. color: #fff;
  747. // background-color: #000;
  748. .uni-nav-barbox {
  749. width: 140px;
  750. height: 48px;
  751. background: rgba(2,2,2,0.15);
  752. border-radius: 41px 41px 41px 41px;
  753. border: 1px solid rgba(255,255,255,0.3);
  754. @include u-flex(row, center, center);
  755. }
  756. .uni-nav-title-t {
  757. font-family: SourceHanSansSC;
  758. font-weight: 400;
  759. margin-left: 5rpx;
  760. color: #fff;
  761. /* #ifdef APP-PLUS */
  762. font-size: 14rpx;
  763. /* #endif */
  764. /* #ifndef APP-PLUS */
  765. font-size: 14rpx;
  766. /* #endif */
  767. }
  768. .uni-nav-title {
  769. font-family: PingFang SC, PingFang SC;
  770. font-weight: 500;
  771. font-size: 22px;
  772. color: #FFFFFF;
  773. text-align: left;
  774. @include u-flex(row, center, center);
  775. .ques {
  776. // flex-shrink: 0;
  777. width: 33rpx;
  778. height: 33rpx;
  779. margin-left: 9rpx;
  780. }
  781. }
  782. .uni-nav-back {
  783. width: 16rpx;
  784. height: 16rpx;
  785. }
  786. }
  787. // .center-box{
  788. // width: 100%;
  789. // display: flex;
  790. // align-items: center;
  791. // justify-content: space-around;
  792. // }
  793. .camera-footer {
  794. background-color: #000;
  795. overflow: hidden;
  796. position: fixed;
  797. bottom: 0;
  798. left: 0;
  799. }
  800. .usenum {
  801. text-align: center;
  802. @include u-flex(row, center, center);
  803. .usenum-t {
  804. font-family: SourceHanSansCN;
  805. font-weight: 400;
  806. font-size: 24rpx;
  807. color: #FFFFFF;
  808. padding: 14rpx;
  809. }
  810. }
  811. .camera-options {
  812. width: 100%;
  813. padding-top: 15rpx;
  814. padding-bottom: 15rpx;
  815. // box-sizing: border-box;
  816. @include u-flex(row, center, space-around);
  817. }
  818. .camera-item {
  819. display: flex;
  820. flex-direction: column;
  821. align-items: center;
  822. }
  823. .camera-item-t {
  824. font-family: SourceHanSansCN;
  825. font-weight: 400;
  826. font-size: 16rpx;
  827. color: #FFFFFF;
  828. }
  829. .camera-options-center {
  830. width: 52rpx;
  831. height: 52rpx;
  832. border-radius: 50%;
  833. border-radius: 50%;
  834. border: 3px solid #FFFFFF;
  835. display: flex;
  836. align-items: center;
  837. justify-content: center;
  838. }
  839. .photograph-btn {
  840. width: 45rpx;
  841. height: 45rpx;
  842. background: #8F6726;
  843. border-radius: 50%;
  844. }
  845. </style>