indexOld.nvue 24 KB

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