index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="phone-ycms-page">
  3. <view class="icon-title-navBar-box">
  4. <view @click="goUpPage" class="nav-bar-icon"></view>
  5. <text class="nav-bar-title">远程面试</text>
  6. </view>
  7. <view class="ycms-body-box">
  8. <view class="ycms-card-box">
  9. <view class="card-title-row">
  10. <text>远程面试</text>
  11. <view @click="handleClose" class="colse-btn" v-if="data.room">关闭房间</view>
  12. </view>
  13. <view class="room-box">
  14. <view class="room-info-box" v-if="data.room">
  15. <view class="room-num">{{ data.room }}</view>
  16. <view class="room-text">房间号</view>
  17. </view>
  18. <view class="room-info-box flex-info" v-else>
  19. <view class="room-wcj">未创建</view>
  20. <view class="room-text">房间号</view>
  21. </view>
  22. <button @click="openUrl" type="default" class="phone-white-btn jr-btn" v-if="data.room">进入房间</button> <!-- 客户uid 4 -->
  23. <!-- <button @click="openUrl2">进入房间2</button> -->
  24. </view>
  25. <!-- phone-white-btn -->
  26. <button @click="yqBtn" type="default" class="phone-green-btn yqkh-btn" v-if="data.room">邀请客户进入面试</button> <!-- 客户uid 1 -->
  27. <button @click="yqBtn" type="default" class="phone-green-btn yqkh-btn" v-if="data.room">邀请阿姨进入面试</button> <!-- 客户uid 2 -->
  28. <button @click="yqBtn" type="default" class="phone-green-btn yqkh-btn" v-if="data.room">邀请旁听进入面试</button> <!-- 客户uid 3 -->
  29. <button @click="handleCreate" type="default" class="phone-green-btn" v-else>创建面试房间</button>
  30. <view class="ycms-tip-box">
  31. <view class="tip-title"><text>小贴士</text><icon></icon></view>
  32. <view class="tip-text">1.创建房间后会生成房间号,生成房间号后,可进入房间,也可以直接分享给客户进入房间。</view>
  33. <view class="tip-text">2. 结束面试后,房间内的人员会被退出,同时面试房间号会失效;</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script setup>
  40. import * as httpApi from '@/api/mianshi.js'
  41. import { ref, reactive } from "vue"
  42. import {onLoad} from "@dcloudio/uni-app";
  43. const data = reactive({
  44. room: '',
  45. })
  46. function goUpPage() {
  47. uni.redirectTo({
  48. url: `/pages/admin/ShouYe/shouye`
  49. })
  50. }
  51. function handleMianshiInfo() {
  52. httpApi.getMianshiInfo().then(res =>{
  53. data.room = res.data.room;
  54. })
  55. }
  56. function handleCreate(){
  57. httpApi.getMianshiCreate().then(res => {
  58. data.room = res.data.room;
  59. uni.showToast({ title: '创建成功', icon: 'none' });
  60. })
  61. .catch(err => {
  62. console.error('创建失败:', err);
  63. uni.showToast({ title: '创建失败,请重试', icon: 'none' });
  64. });
  65. }
  66. function yqBtn(){
  67. }
  68. function handleClose() {
  69. httpApi.getMianshiClose().then(res =>{
  70. if (res.data) {
  71. data.room = null;
  72. uni.showToast({ title: '房间已关闭', icon: 'none' });
  73. }
  74. })
  75. }
  76. const url =
  77. `https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=${data.room}`
  78. function openUrl() {
  79. plus.runtime.openURL(url, (err) => {
  80. if (err) {
  81. console.error('打开浏览器失败: ', err);
  82. uni.showToast({
  83. title: '打开链接失败',
  84. icon: 'none'
  85. });
  86. }
  87. });
  88. }
  89. onLoad(() => {
  90. handleMianshiInfo()
  91. })
  92. </script>