tanxue vor 1 Woche
Ursprung
Commit
90985f51ad
2 geänderte Dateien mit 41 neuen und 38 gelöschten Zeilen
  1. 7 6
      common/styles/global/pages.scss
  2. 34 32
      pages/admin/mianshi/index.vue

+ 7 - 6
common/styles/global/pages.scss

@@ -1496,10 +1496,10 @@
 		width: 100%;box-sizing: border-box;padding:24rpx;
 	}
 	.ycms-card-box{
-		width: 100%;box-sizing: border-box;padding:0 20rpx 20rpx;
+		width: 100%;box-sizing: border-box;padding:0 32rpx 32rpx;
 		background-color: #fff;border-radius: 8rpx;
 		.card-title-row{
-			padding: 20rpx 0;border-bottom: 1rpx solid #ebebeb;color: #000;
+			padding: 24rpx 0;border-bottom: 1rpx solid #ebebeb;color: #000;
 			display: flex;justify-content: space-between;align-items: center;font-size: 30rpx;
 			.colse-btn{
 				color: #909399;background: #f4f4f5;
@@ -1511,11 +1511,12 @@
 	.room-box{
 		display: flex;justify-content: space-between;align-items: center;color: #222;
 		.room-info-box{
-			min-width: 50%;text-align: center;padding: 50rpx 0;
+			min-width: 50%;text-align: center;padding: 64rpx 0;
 			}
-		.room-wcj{color:#adacb1;font-size: 48rpx;margin-bottom: 8rpx;}
-		.room-num{font-size: 42rpx;}
-		.room-text{font-size: 24rpx;}
+		.flex-info{flex: 1;}
+		.room-wcj{color:#adacb1;font-size: 52rpx;margin-bottom: 12rpx;}
+		.room-num{font-size: 52rpx;color: #444;margin-bottom: 12rpx;}
+		.room-text{font-size: 24rpx;color: #444;}
 		.jr-btn{margin: 0;}
 	}
 	.yqkh-btn{margin-bottom: 24rpx;}

+ 34 - 32
pages/admin/mianshi/index.vue

@@ -8,19 +8,23 @@
 			<view class="ycms-card-box">
 				<view class="card-title-row">
 					<text>远程面试</text>
-					<view @click="handleClose" class="colse-btn">关闭房间</view>
+					<view @click="handleClose" class="colse-btn" v-if="data.room">关闭房间</view>
 				</view>
 				<view class="room-box">
-					<view class="room-info-box">
+					<view class="room-info-box" v-if="data.room">
+						<view class="room-num">{{ data.room }}</view>
+						<view class="room-text">房间号</view>
+					</view>
+					<view class="room-info-box flex-info" v-else>
 						<view class="room-wcj">未创建</view>
-						<view class="room-num" v-if="false">78979</view>
 						<view class="room-text">房间号</view>
 					</view>
-					<button @click="openUrl" type="default" class="phone-green-btn jr-btn">进入房间</button>
+					<button @click="openUrl" type="default" class="phone-white-btn jr-btn" v-if="data.room">进入房间</button>
 					<!-- <button @click="openUrl2">进入房间2</button> -->
 				</view>
-				<button @click="handleCreate" type="default" class="phone-white-btn yqkh-btn">邀请客户进入面试</button>
-				<button @click="handleCreate" type="default" class="phone-green-btn">创建面试房间</button>
+				<!-- phone-white-btn -->
+				<button @click="yqBtn" type="default" class="phone-green-btn yqkh-btn"  v-if="data.room">邀请客户进入面试</button>
+				<button @click="handleCreate" type="default" class="phone-green-btn" v-else>创建面试房间</button>
 				
 				<view class="ycms-tip-box">
 					<view class="tip-title"><text>小贴士</text><icon></icon></view>
@@ -37,6 +41,7 @@
 <script setup>
 	import * as httpApi from '@/api/mianshi.js'
 	import { ref, reactive } from "vue"
+	import {onLoad} from "@dcloudio/uni-app";
 	
 	const data = reactive({
 		room: '',
@@ -48,22 +53,30 @@
 		})
 	}
 	
-	function handleCreate() {
-		httpApi.getMianshiCreate().then(res =>{
-			this.data = res.data.room;
-			uni.showToast({
-				title:'创建成功'
-			})
+	function handleMianshiInfo() {
+		httpApi.getMianshiInfo().then(res =>{
+			data.room = res.data.room;
 		})
 	}
+	function handleCreate(){
+		httpApi.getMianshiCreate().then(res => {
+			data.room = res.data.room;
+			uni.showToast({ title: '创建成功', icon: 'none' });
+		  })
+		  .catch(err => {
+			console.error('创建失败:', err);
+			uni.showToast({ title: '创建失败,请重试', icon: 'none' });
+		  });
+	}
+	function yqBtn(){
+		
+	}
 	
 	function handleClose() {
 		httpApi.getMianshiClose().then(res =>{
 			if (res.data) {
-				data.room = null
-				uni.showToast({
-					title:'关闭成功'
-				})
+				data.room = null;
+				uni.showToast({ title: '房间已关闭', icon: 'none' });
 			}
 		})
 	}
@@ -71,7 +84,7 @@
 	
 	
 	const url =
-		`https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=900803&appId=dehjl65f&uid=1234&userName=654321&token=000eJxjYGBQsA1url798NJZWaZ%2BjcOiqvN85r2sm1VyiP2c42evb%2F1PlRkYGDhSUjOycsxM0zJjN%2BcveXkvIjOe5StQnM3SwMDCwBjIYjE0MjZhYGQYBUMKAACboBuh`
+		`https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=${data.room}`
 
 	function openUrl() {
 		plus.runtime.openURL(url, (err) => {
@@ -84,19 +97,8 @@
 			}
 		});
 	}
-
-	const url2 =
-		`https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=900803&appId=dehjl65f&uid=1145&userName=123456&token=000eJxjYGBQ%2BNqm4zpNb%2FZc1u5tTh9MFtnfjTM5mMo2%2FZebyk3Rbl%2F19wwMDBwpqRlZOWamaZmxmyfwHU9izYxnFQOKs1kaGFgYGANZLIaGJqYMjAyjYEgBADKGGBo%3D`
-
-	function openUrl2() {
-		plus.runtime.openURL(url2, (err) => {
-			if (err) {
-				console.error('打开浏览器失败: ', err);
-				uni.showToast({
-					title: '打开链接失败',
-					icon: 'none'
-				});
-			}
-		});
-	}
+	
+	onLoad(() => {
+		handleMianshiInfo()
+	})
 </script>