|
@@ -1,232 +1,235 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { Socket, io } from 'socket.io-client';
|
|
|
|
|
-import { onMounted, onUnmounted, watch } from 'vue';
|
|
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
-const sleep = (ms:number) => new Promise((res) => setTimeout(res, ms));
|
|
|
|
|
|
|
+import { Socket, io } from 'socket.io-client'
|
|
|
|
|
+import {
|
|
|
|
|
+ onMounted, onUnmounted, watch, ref
|
|
|
|
|
+} from 'vue'
|
|
|
|
|
+import Login from '@/components/login.vue'
|
|
|
|
|
+import Gauge from '@/components/gauge.vue'
|
|
|
|
|
+import Record from '@/components/record.vue'
|
|
|
|
|
+import Battery from '@/components/battery.vue'
|
|
|
|
|
+
|
|
|
|
|
+const sleep = (ms: number) => new Promise((res) => setTimeout(res, ms))
|
|
|
const socket = ref(null as null | Socket)
|
|
const socket = ref(null as null | Socket)
|
|
|
-const HOST = ref("wss://car.caner.top")
|
|
|
|
|
|
|
+const HOST = ref('wss://car.caner.top')
|
|
|
const Peer = ref(null as null | RTCPeerConnection | undefined)
|
|
const Peer = ref(null as null | RTCPeerConnection | undefined)
|
|
|
const isLogin = ref(false)
|
|
const isLogin = ref(false)
|
|
|
-const error = ref("")
|
|
|
|
|
|
|
+const error = ref('')
|
|
|
const remoteVideo = ref()
|
|
const remoteVideo = ref()
|
|
|
const showLoading = ref(true)
|
|
const showLoading = ref(true)
|
|
|
const contrlState = ref(false)
|
|
const contrlState = ref(false)
|
|
|
const audioState = ref(false)
|
|
const audioState = ref(false)
|
|
|
const mutedState = ref(true)
|
|
const mutedState = ref(true)
|
|
|
const warnAudio = ref(false)// 鸣笛
|
|
const warnAudio = ref(false)// 鸣笛
|
|
|
-const speed = ref(1) //1低速档 | 2 高速档
|
|
|
|
|
|
|
+const speed = ref(1) // 1低速档 | 2 高速档
|
|
|
const muted = ref(true)// 是否静音
|
|
const muted = ref(true)// 是否静音
|
|
|
const SpeedValue = ref(0)
|
|
const SpeedValue = ref(0)
|
|
|
const iceServers = ref([
|
|
const iceServers = ref([
|
|
|
{
|
|
{
|
|
|
- urls: ["stun:caner.top:3478"],
|
|
|
|
|
|
|
+ urls: [ 'stun:caner.top:3478' ]
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- urls: "turn:caner.top:3478",
|
|
|
|
|
- username: "admin",
|
|
|
|
|
- credential: "123456",
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ urls: 'turn:caner.top:3478',
|
|
|
|
|
+ username: 'admin',
|
|
|
|
|
+ credential: '123456'
|
|
|
|
|
+ }
|
|
|
])
|
|
])
|
|
|
const num = ref(0)
|
|
const num = ref(0)
|
|
|
|
|
|
|
|
|
|
+// 发送语音
|
|
|
|
|
+function sendAudio(blob: Blob) {
|
|
|
|
|
+ if (!socket.value && !socket.value!.connected) return
|
|
|
|
|
+ socket.value?.emit('msg', {
|
|
|
|
|
+ type: 'Meadia',
|
|
|
|
|
+ Meadia: blob
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 挡位
|
|
|
|
|
+function Gear(speed: number, num: number) {
|
|
|
|
|
+ // 低速档
|
|
|
|
|
+ if (speed === 1) {
|
|
|
|
|
+ if (num < 116) {
|
|
|
|
|
+ // 前
|
|
|
|
|
+ num = 120
|
|
|
|
|
+ } else if (num >= 120 && num <= 131) {
|
|
|
|
|
+ num = 128
|
|
|
|
|
+ } else if (num > 140) {
|
|
|
|
|
+ // 后
|
|
|
|
|
+ num = 140
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 高速档
|
|
|
|
|
+ if (speed === 2) {
|
|
|
|
|
+ if (num < 96) {
|
|
|
|
|
+ num = 96
|
|
|
|
|
+ } else if (num >= 120 && num <= 131) {
|
|
|
|
|
+ num = 128
|
|
|
|
|
+ } else if (num > 160) {
|
|
|
|
|
+ num = 160
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return num
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 登录
|
|
|
|
|
+function login(data: { name: string, roomID: string }) {
|
|
|
|
|
+ if (socket.value) {
|
|
|
|
|
+ socket.value.auth = {
|
|
|
|
|
+ roomID: data.roomID,
|
|
|
|
|
+ name: data.name
|
|
|
|
|
+ }
|
|
|
|
|
+ socket.value.connect()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ error.value = '服务器连接失败'
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 手柄数据
|
|
|
|
|
+function ControlData() {
|
|
|
|
|
+ const data = navigator.getGamepads()
|
|
|
|
|
+ const db = data[0]
|
|
|
|
|
+ if (!db) return
|
|
|
|
|
+ // 挡位选择AB
|
|
|
|
|
+ if (db.buttons[1].touched) speed.value = 2
|
|
|
|
|
+ if (db.buttons[0].touched) speed.value = 1
|
|
|
|
|
+ // 语音按键R2
|
|
|
|
|
+ audioState.value = db.buttons[7].touched
|
|
|
|
|
+ // 静音X3
|
|
|
|
|
+ mutedState.value = db.buttons[3].touched
|
|
|
|
|
+ // 播放警笛Y2
|
|
|
|
|
+ warnAudio.value = db.buttons[2].touched
|
|
|
|
|
+ // console.log(db.buttons);
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ v0: Math.floor(db.axes[0] * 128 + 128),
|
|
|
|
|
+ v1: Math.floor(db.axes[1] * 128 + 128),
|
|
|
|
|
+ v2: Math.floor(db.axes[2] * 128 + 128),
|
|
|
|
|
+ v3: Gear(speed.value, Math.floor(db.axes[3] * 128 + 128))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (socket.value && socket.value.connected) socket.value.emit('msg', { type: 'conctrl', conctrl: params })
|
|
|
|
|
+ requestAnimationFrame(ControlData)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 手柄连接
|
|
|
|
|
+function conControl() {
|
|
|
|
|
+ contrlState.value = true
|
|
|
|
|
+ ControlData()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 手柄断开连接
|
|
|
|
|
+function disControl() {
|
|
|
|
|
+ contrlState.value = false
|
|
|
|
|
+ cancelAnimationFrame(ControlData as any)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 关闭
|
|
|
|
|
+function close(err?: string) {
|
|
|
|
|
+ if (Peer.value) Peer.value?.close()
|
|
|
|
|
+ if (remoteVideo.value) remoteVideo.value.srcObject = null
|
|
|
|
|
+ if (socket.value) socket.value?.disconnect()
|
|
|
|
|
+ isLogin.value = false
|
|
|
|
|
+ showLoading.value = false
|
|
|
|
|
+ error.value = err || ''
|
|
|
|
|
+ socket.value = null
|
|
|
|
|
+ Peer.value = null
|
|
|
|
|
+ num.value = 0
|
|
|
|
|
+ cancelAnimationFrame(ControlData as any)
|
|
|
|
|
+ window.removeEventListener('gamepadconnected', conControl)
|
|
|
|
|
+ window.removeEventListener('gamepaddisconnected', disControl)
|
|
|
|
|
+}
|
|
|
/**
|
|
/**
|
|
|
* 网络连接
|
|
* 网络连接
|
|
|
- * @param host
|
|
|
|
|
|
|
+ * @param host
|
|
|
*/
|
|
*/
|
|
|
function intSoketRtc(host: string) {
|
|
function intSoketRtc(host: string) {
|
|
|
// int socket
|
|
// int socket
|
|
|
socket.value = io(host, {
|
|
socket.value = io(host, {
|
|
|
autoConnect: false,
|
|
autoConnect: false,
|
|
|
- transports: ["websocket"],
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ transports: [ 'websocket' ]
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
// socket
|
|
// socket
|
|
|
- socket.value.on("connect", () => {
|
|
|
|
|
|
|
+ socket.value.on('connect', () => {
|
|
|
try {
|
|
try {
|
|
|
- isLogin.value = true;
|
|
|
|
|
|
|
+ isLogin.value = true
|
|
|
// init webrtc
|
|
// init webrtc
|
|
|
Peer.value = new RTCPeerConnection({
|
|
Peer.value = new RTCPeerConnection({
|
|
|
iceServers: iceServers.value,
|
|
iceServers: iceServers.value,
|
|
|
- bundlePolicy: "max-bundle",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ bundlePolicy: 'max-bundle'
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
// listen state
|
|
// listen state
|
|
|
Peer.value.onicegatheringstatechange = () => {
|
|
Peer.value.onicegatheringstatechange = () => {
|
|
|
- console.log("GatheringState: ", Peer.value?.iceGatheringState);
|
|
|
|
|
- if (Peer.value?.iceGatheringState === "complete") {
|
|
|
|
|
- const answer = Peer.value.localDescription;
|
|
|
|
|
- socket.value?.emit("msg", answer);
|
|
|
|
|
|
|
+ console.log('GatheringState: ', Peer.value?.iceGatheringState)
|
|
|
|
|
+ if (Peer.value?.iceGatheringState === 'complete') {
|
|
|
|
|
+ const answer = Peer.value.localDescription
|
|
|
|
|
+ socket.value?.emit('msg', answer)
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// listen track
|
|
// listen track
|
|
|
Peer.value.ontrack = async (evt) => {
|
|
Peer.value.ontrack = async (evt) => {
|
|
|
- console.log("track", evt);
|
|
|
|
|
- remoteVideo.value.srcObject = evt.streams[0];
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ console.log('track', evt)
|
|
|
|
|
+ remoteVideo.value.srcObject = evt.streams[0]
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// listen changestate·
|
|
// listen changestate·
|
|
|
Peer.value.oniceconnectionstatechange = async () => {
|
|
Peer.value.oniceconnectionstatechange = async () => {
|
|
|
- const state = Peer.value?.iceConnectionState;
|
|
|
|
|
- console.log("ICE状态", state);
|
|
|
|
|
|
|
+ const state = Peer.value?.iceConnectionState
|
|
|
|
|
+ console.log('ICE状态', state)
|
|
|
if (
|
|
if (
|
|
|
- state === "failed" ||
|
|
|
|
|
- state === "disconnected" ||
|
|
|
|
|
- state === "closed"
|
|
|
|
|
|
|
+ state === 'failed'
|
|
|
|
|
+ || state === 'disconnected'
|
|
|
|
|
+ || state === 'closed'
|
|
|
) {
|
|
) {
|
|
|
- close("P2P通信失败");
|
|
|
|
|
|
|
+ close('P2P通信失败')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ICE连接成功|初始化摇杆
|
|
// ICE连接成功|初始化摇杆
|
|
|
- if (state === "connected") {
|
|
|
|
|
|
|
+ if (state === 'connected') {
|
|
|
// init Control
|
|
// init Control
|
|
|
- window.addEventListener("gamepadconnected", conControl);
|
|
|
|
|
- window.addEventListener("gamepaddisconnected", disControl);
|
|
|
|
|
- await sleep(3000);
|
|
|
|
|
- showLoading.value = false;
|
|
|
|
|
|
|
+ window.addEventListener('gamepadconnected', conControl)
|
|
|
|
|
+ window.addEventListener('gamepaddisconnected', disControl)
|
|
|
|
|
+ await sleep(3000)
|
|
|
|
|
+ showLoading.value = false
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
close('webrtc初始化失败')
|
|
close('webrtc初始化失败')
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- socket.value.on("msg", async (data) => {
|
|
|
|
|
|
|
+ socket.value.on('msg', async (data) => {
|
|
|
const key = data.type
|
|
const key = data.type
|
|
|
if (key === 'offer') {
|
|
if (key === 'offer') {
|
|
|
- await Peer.value?.setRemoteDescription(data);
|
|
|
|
|
- const answer = await Peer.value?.createAnswer();
|
|
|
|
|
- await Peer.value?.setLocalDescription(answer);
|
|
|
|
|
|
|
+ await Peer.value?.setRemoteDescription(data)
|
|
|
|
|
+ const answer = await Peer.value?.createAnswer()
|
|
|
|
|
+ await Peer.value?.setLocalDescription(answer)
|
|
|
} else if (key === 'power') {
|
|
} else if (key === 'power') {
|
|
|
- console.log("电量", data);
|
|
|
|
|
|
|
+ console.log('电量', data)
|
|
|
} else if (key === 'speed') {
|
|
} else if (key === 'speed') {
|
|
|
const d = Math.floor(data.data)
|
|
const d = Math.floor(data.data)
|
|
|
SpeedValue.value = d
|
|
SpeedValue.value = d
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- socket.value.on("joined", async () =>
|
|
|
|
|
- socket.value?.emit("msg", { type: "startRTC" })
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ socket.value.on('joined', async () => socket.value?.emit('msg', { type: 'startRTC' }))
|
|
|
|
|
|
|
|
- socket.value.on("leaved", () => close("车端断开"));
|
|
|
|
|
|
|
+ socket.value.on('leaved', () => close('车端断开'))
|
|
|
|
|
|
|
|
- socket.value.on("connect_error", () => close('服务器连接失败'));
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 手柄数据
|
|
|
|
|
-function ControlData() {
|
|
|
|
|
- const data = navigator.getGamepads();
|
|
|
|
|
- const db = data[0];
|
|
|
|
|
- if (!db) return;
|
|
|
|
|
- // 挡位选择AB
|
|
|
|
|
- if (db.buttons[1].touched) speed.value = 2;
|
|
|
|
|
- if (db.buttons[0].touched) speed.value = 1;
|
|
|
|
|
- // 语音按键R2
|
|
|
|
|
- audioState.value = db.buttons[7].touched
|
|
|
|
|
- // 静音X3
|
|
|
|
|
- mutedState.value = db.buttons[3].touched
|
|
|
|
|
- // 播放警笛Y2
|
|
|
|
|
- warnAudio.value = db.buttons[2].touched
|
|
|
|
|
- // console.log(db.buttons);
|
|
|
|
|
- const params = {
|
|
|
|
|
- v0: Math.floor(db.axes[0] * 128 + 128),
|
|
|
|
|
- v1: Math.floor(db.axes[1] * 128 + 128),
|
|
|
|
|
- v2: Math.floor(db.axes[2] * 128 + 128),
|
|
|
|
|
- v3: Gear(speed.value, Math.floor(db.axes[3] * 128 + 128)),
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- if (socket.value && socket.value.connected) socket.value.emit("msg", { type: "conctrl", conctrl: params });
|
|
|
|
|
- requestAnimationFrame(ControlData);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 发送语音
|
|
|
|
|
-function sendAudio(blob:Blob) {
|
|
|
|
|
- if (!socket.value && !socket.value!.connected) return;
|
|
|
|
|
- socket.value?.emit("msg", {
|
|
|
|
|
- type: "Meadia",
|
|
|
|
|
- Meadia: blob,
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 挡位
|
|
|
|
|
-function Gear(speed:number, num:number) {
|
|
|
|
|
- // 低速档
|
|
|
|
|
- if (speed === 1) {
|
|
|
|
|
- if (num < 116) {
|
|
|
|
|
- // 前
|
|
|
|
|
- num = 120;
|
|
|
|
|
- } else if (num >= 120 && num <= 131) {
|
|
|
|
|
- num = 128;
|
|
|
|
|
- } else if (num > 140) {
|
|
|
|
|
- // 后
|
|
|
|
|
- num = 140;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- // 高速档
|
|
|
|
|
- if (speed === 2) {
|
|
|
|
|
- if (num < 96) {
|
|
|
|
|
- num = 96;
|
|
|
|
|
- } else if (num >= 120 && num <= 131) {
|
|
|
|
|
- num = 128;
|
|
|
|
|
- } else if (num > 160) {
|
|
|
|
|
- num = 160;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return num;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 登录
|
|
|
|
|
-function login(data: { name: string, roomID: string }) {
|
|
|
|
|
- if (socket.value) {
|
|
|
|
|
- socket.value.auth = {
|
|
|
|
|
- roomID: data.roomID,
|
|
|
|
|
- name: data.name,
|
|
|
|
|
- };
|
|
|
|
|
- socket.value.connect();
|
|
|
|
|
- } else {
|
|
|
|
|
- error.value = "服务器连接失败";
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 关闭
|
|
|
|
|
-function close(err?: string) {
|
|
|
|
|
- if (Peer) Peer.value?.close();
|
|
|
|
|
- if (remoteVideo) remoteVideo.value.srcObject = null;
|
|
|
|
|
- if (socket) socket.value?.disconnect();
|
|
|
|
|
- isLogin.value = false;
|
|
|
|
|
- showLoading.value = false;
|
|
|
|
|
- error.value = err || "";
|
|
|
|
|
- socket.value = null;
|
|
|
|
|
- Peer.value = null
|
|
|
|
|
- num.value = 0
|
|
|
|
|
- cancelAnimationFrame(ControlData as any);
|
|
|
|
|
- window.removeEventListener("gamepadconnected", conControl);
|
|
|
|
|
- window.removeEventListener("gamepaddisconnected", disControl);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 手柄连接
|
|
|
|
|
-function conControl() {
|
|
|
|
|
- contrlState.value = true;
|
|
|
|
|
- ControlData();
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 手柄断开连接
|
|
|
|
|
-function disControl() {
|
|
|
|
|
- contrlState.value = false;
|
|
|
|
|
- cancelAnimationFrame(ControlData as any);
|
|
|
|
|
|
|
+ socket.value.on('connect_error', () => close('服务器连接失败'))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
watch(() => mutedState.value, (v) => {
|
|
watch(() => mutedState.value, (v) => {
|
|
|
if (v) {
|
|
if (v) {
|
|
|
const state = !!(num.value % 2)
|
|
const state = !!(num.value % 2)
|
|
|
muted.value = state
|
|
muted.value = state
|
|
|
- if (socket.value && socket.value.connected) socket.value.emit("msg", { type: "contrlAudio", contrlAudio: state });
|
|
|
|
|
|
|
+ if (socket.value && socket.value.connected) socket.value.emit('msg', { type: 'contrlAudio', contrlAudio: state })
|
|
|
num.value++
|
|
num.value++
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
watch(() => warnAudio.value, (v) => {
|
|
watch(() => warnAudio.value, (v) => {
|
|
|
- if (v && socket.value && socket.value.connected) socket.value.emit("msg", { type: "warnAudio", warnAudio: v });
|
|
|
|
|
|
|
+ if (v && socket.value && socket.value.connected) socket.value.emit('msg', { type: 'warnAudio', warnAudio: v })
|
|
|
})
|
|
})
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
intSoketRtc(HOST.value)
|
|
intSoketRtc(HOST.value)
|
|
@@ -237,24 +240,48 @@ onUnmounted(() => {
|
|
|
</script>
|
|
</script>
|
|
|
<template>
|
|
<template>
|
|
|
<template v-if="isLogin">
|
|
<template v-if="isLogin">
|
|
|
- <video ref="remoteVideo" autoplay playsinline muted></video>
|
|
|
|
|
|
|
+ <video
|
|
|
|
|
+ ref="remoteVideo"
|
|
|
|
|
+ autoplay
|
|
|
|
|
+ playsinline
|
|
|
|
|
+ muted
|
|
|
|
|
+ />
|
|
|
<div class="marke">
|
|
<div class="marke">
|
|
|
<!-- 手柄状态 -->
|
|
<!-- 手柄状态 -->
|
|
|
- <div class="marke-contrl" :style="`color:${contrlState ? '#00CED1' : 'rgba(0, 0, 0, 0.3)'}`"></div>
|
|
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ name="gemePad"
|
|
|
|
|
+ :size="25"
|
|
|
|
|
+ :color="contrlState ? '#00CED1' : 'rgba(0, 0, 0, 0.3)'"
|
|
|
|
|
+ />
|
|
|
<!-- 音频状态 -->
|
|
<!-- 音频状态 -->
|
|
|
- <Record class="marke-audio" @callBack="sendAudio" :audioState="audioState" />
|
|
|
|
|
|
|
+ <Record
|
|
|
|
|
+ class="marke-audio"
|
|
|
|
|
+ :audio-state="audioState"
|
|
|
|
|
+ @callBack="sendAudio"
|
|
|
|
|
+ />
|
|
|
<!-- 喇叭状态 -->
|
|
<!-- 喇叭状态 -->
|
|
|
- <div class="marke-arcode" :style="`color:${muted ? '#00CED1' : 'rgba(0, 0, 0, 0.3)'}`"></div>
|
|
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ name="audio"
|
|
|
|
|
+ :size="25"
|
|
|
|
|
+ :color="contrlState ? '#00CED1' : 'rgba(0, 0, 0, 0.3)'"
|
|
|
|
|
+ />
|
|
|
<!-- 电量状态 -->
|
|
<!-- 电量状态 -->
|
|
|
<Battery :quantity="60" />
|
|
<Battery :quantity="60" />
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 码数 -->
|
|
<!-- 码数 -->
|
|
|
<div class="gauge">
|
|
<div class="gauge">
|
|
|
- <Gauge :value="SpeedValue" :gears="speed" />
|
|
|
|
|
|
|
+ <Gauge
|
|
|
|
|
+ :value="SpeedValue"
|
|
|
|
|
+ :gears="speed"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<Loading v-if="showLoading" />
|
|
<Loading v-if="showLoading" />
|
|
|
</template>
|
|
</template>
|
|
|
- <Login v-else :err="error" @loginBack="login" />
|
|
|
|
|
|
|
+ <Login
|
|
|
|
|
+ v-else
|
|
|
|
|
+ :err="error"
|
|
|
|
|
+ @loginBack="login"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
|
video {
|
|
video {
|
|
@@ -268,7 +295,7 @@ video {
|
|
|
top: 0;
|
|
top: 0;
|
|
|
left: 0;
|
|
left: 0;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- padding: 5px 0;
|
|
|
|
|
|
|
+ padding: 0.05rem 0;
|
|
|
z-index: 1;
|
|
z-index: 1;
|
|
|
background: rgba(0, 0, 0, 0.25);
|
|
background: rgba(0, 0, 0, 0.25);
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -276,22 +303,9 @@ video {
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
- &>div {
|
|
|
|
|
|
|
+ &>* {
|
|
|
margin: 0 0.18rem;
|
|
margin: 0 0.18rem;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- &-audio,
|
|
|
|
|
- &-arcode {
|
|
|
|
|
- font-size: 24px;
|
|
|
|
|
- color: rgba(0, 0, 0, 0.3);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-contrl {
|
|
|
|
|
- font-size: 32px;
|
|
|
|
|
- color: rgba(0, 0, 0, 0.3);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.gauge {
|
|
.gauge {
|
|
@@ -299,12 +313,11 @@ video {
|
|
|
bottom: 0;
|
|
bottom: 0;
|
|
|
left: 50%;
|
|
left: 50%;
|
|
|
transform: translate(-50%, 0);
|
|
transform: translate(-50%, 0);
|
|
|
- width: 500px;
|
|
|
|
|
- height: 185px;
|
|
|
|
|
|
|
+ width: 5rem;
|
|
|
|
|
+ height: 1.85rem;
|
|
|
z-index: 9;
|
|
z-index: 9;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/* 隐藏滚动条 */
|
|
/* 隐藏滚动条 */
|
|
|
::-webkit-scrollbar {
|
|
::-webkit-scrollbar {
|
|
|
width: 0 !important;
|
|
width: 0 !important;
|