feat: 添加监控相关功能
This commit is contained in:
parent
d7c5ad4102
commit
88b512aa7f
@ -2,9 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
"@/*": ["./*"]
|
||||
},
|
||||
"target": "es2020",
|
||||
"module": "esnext",
|
||||
@ -15,14 +13,6 @@
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.jsx",
|
||||
"**/*.vue"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"unpackage",
|
||||
"dist"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.jsx", "**/*.vue", "pages/p2p/p2pPlayer.nvue"],
|
||||
"exclude": ["node_modules", "unpackage", "dist"]
|
||||
}
|
||||
133
manifest.json
133
manifest.json
@ -1,75 +1,74 @@
|
||||
{
|
||||
"name" : "星星锁Lite",
|
||||
"appid" : "__UNI__933D519",
|
||||
"description" : "",
|
||||
"versionName" : "1.3.0",
|
||||
"versionCode" : "37",
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx9829a39e65550757",
|
||||
"setting" : {
|
||||
"urlCheck" : true,
|
||||
"minified" : true
|
||||
"name": "星星锁Lite",
|
||||
"appid": "__UNI__933D519",
|
||||
"description": "",
|
||||
"versionName": "1.3.0",
|
||||
"versionCode": "37",
|
||||
"mp-weixin": {
|
||||
"appid": "wx9829a39e65550757",
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"minified": true
|
||||
},
|
||||
"permission" : {
|
||||
"scope.bluetooth" : {
|
||||
"desc" : "蓝牙将用于控制和管理您的智能门锁"
|
||||
"permission": {
|
||||
"scope.bluetooth": {
|
||||
"desc": "蓝牙将用于控制和管理您的智能门锁"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos" : [ "getLocation" ],
|
||||
"usingComponents" : true,
|
||||
"lazyCodeLoading" : "requiredComponents",
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
"usingComponents": true,
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"optimization": {
|
||||
"subPackages": true
|
||||
},
|
||||
"plugins" : {
|
||||
"wmpf-voip" : {
|
||||
"version" : "latest",
|
||||
"provider" : "wxf830863afde621eb",
|
||||
"genericsImplementation" : {
|
||||
"call-page-plugin" : {
|
||||
"custombox" : "pages/main/customBox"
|
||||
"plugins": {
|
||||
"wmpf-voip": {
|
||||
"version": "latest",
|
||||
"provider": "wxf830863afde621eb",
|
||||
"genericsImplementation": {
|
||||
"call-page-plugin": {
|
||||
"custombox": "pages/main/customBox"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vueVersion" : "3",
|
||||
"app-plus" : {
|
||||
"distribute" : {
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
"vueVersion": "3",
|
||||
"app-plus": {
|
||||
"distribute": {
|
||||
"icons": {
|
||||
"android": {
|
||||
"hdpi": "unpackage/res/icons/72x72.png",
|
||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
"ios": {
|
||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||
"ipad": {
|
||||
"app": "unpackage/res/icons/76x76.png",
|
||||
"app@2x": "unpackage/res/icons/152x152.png",
|
||||
"notification": "unpackage/res/icons/20x20.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||
"settings": "unpackage/res/icons/29x29.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"spotlight": "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
"iphone": {
|
||||
"app@2x": "unpackage/res/icons/120x120.png",
|
||||
"app@3x": "unpackage/res/icons/180x180.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"android": {
|
||||
"permissions": [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
@ -93,19 +92,19 @@
|
||||
"<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\" />"
|
||||
]
|
||||
},
|
||||
"ios" : {
|
||||
"dSYMs" : false
|
||||
"ios": {
|
||||
"dSYMs": false
|
||||
}
|
||||
},
|
||||
"modules" : {
|
||||
"Bluetooth" : {},
|
||||
"VideoPlayer" : {},
|
||||
"LivePusher" : {},
|
||||
"Camera" : {},
|
||||
"Record" : {}
|
||||
"modules": {
|
||||
"Bluetooth": {},
|
||||
"VideoPlayer": {},
|
||||
"LivePusher": {},
|
||||
"Camera": {},
|
||||
"Record": {}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"waiting" : false
|
||||
"splashscreen": {
|
||||
"waiting": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,13 +38,6 @@
|
||||
"navigationBarTitleText": "门锁记录",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "appPlayer",
|
||||
"style": {
|
||||
"navigationBarTitleText": "监控",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"plugins": {
|
||||
|
||||
@ -310,12 +310,7 @@
|
||||
})
|
||||
|
||||
const jumpToPlayer = () => {
|
||||
// #ifdef MP
|
||||
$basic.routeJump({ name: 'p2pPlayer' })
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
$basic.routeJump({ name: 'appPlayer' })
|
||||
// #endif
|
||||
}
|
||||
|
||||
const openDoorOperate = async type => {
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<video v-if="url" autoplay :src="url" :is-live="true" :controls="false" class="w-full" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// #ifdef APP-PLUS
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { passthrough } from '@/api/sdk'
|
||||
import { useBluetoothStore } from '@/stores/bluetooth'
|
||||
import { useBasicStore } from '@/stores/basic'
|
||||
import { startService, getLiveUrl } from '@/uni_modules/xhj-tencent-xp2p'
|
||||
|
||||
const $bluetooth = useBluetoothStore()
|
||||
const $basic = useBasicStore()
|
||||
|
||||
const deviceInfo = ref()
|
||||
|
||||
const url = ref()
|
||||
|
||||
onMounted(async () => {
|
||||
// const callback = new XP2PCallback1()
|
||||
// setCallback(callback)
|
||||
|
||||
const { code, data, message } = await passthrough({
|
||||
request_method: 'GET',
|
||||
request_uri: '/api/v1/tencentYun/getDeviceDetailData',
|
||||
post_args: {
|
||||
lockId: $bluetooth.currentLockInfo.lockId
|
||||
}
|
||||
})
|
||||
|
||||
if (code === 0) {
|
||||
deviceInfo.value = data
|
||||
console.log(1)
|
||||
const result = await startService({
|
||||
appKey: 'aanuJXFtISXFYVVsd',
|
||||
appSecret: 'SsnOMHJUcazCvpULSVWY',
|
||||
productId: deviceInfo.value.productId,
|
||||
deviceName: deviceInfo.value.deviceName,
|
||||
xp2pInfo: deviceInfo.value.xp2pInfo
|
||||
})
|
||||
if (result.code === 0) {
|
||||
setTimeout(async () => {
|
||||
const urlResult = await getLiveUrl({
|
||||
id: `${deviceInfo.value.productId}/${deviceInfo.value.deviceName}`
|
||||
})
|
||||
console.log(12, urlResult)
|
||||
if (urlResult.code === 0) {
|
||||
uni.request({
|
||||
url: urlResult.data.url,
|
||||
method: 'GET',
|
||||
success: res => {
|
||||
console.log(13, res)
|
||||
}
|
||||
})
|
||||
url.value = urlResult.data.url
|
||||
}
|
||||
}, 200)
|
||||
}
|
||||
} else {
|
||||
$basic.backAndToast(message)
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
</script>
|
||||
@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<iot-p2p-player-with-mjpg
|
||||
v-if="deviceInfo"
|
||||
id="playerRef"
|
||||
@ -19,30 +21,47 @@
|
||||
@playsuccess="handlePlaySuccess"
|
||||
>
|
||||
</iot-p2p-player-with-mjpg>
|
||||
<view
|
||||
v-if="buttonInfo"
|
||||
:style="{
|
||||
top: buttonInfo.bottom + 15 + 'px'
|
||||
}"
|
||||
class="bg-[rgba(0,0,0,0.35)] rounded-full px-2 py-1.5 fixed right-32"
|
||||
>
|
||||
<picker :value="index" mode="selector" :range="range" range-key="name" @change="changeEvent">
|
||||
<up-icon
|
||||
:label="range[index].name"
|
||||
color="#ffffff"
|
||||
label-color="#ffffff"
|
||||
labelPos="left"
|
||||
name="arrow-down-fill"
|
||||
size="32rpx"
|
||||
space="16rpx"
|
||||
></up-icon>
|
||||
</picker>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<video
|
||||
autoplay
|
||||
id="playerRef"
|
||||
v-if="url"
|
||||
:muted="isMute"
|
||||
:src="urlPrefix"
|
||||
object-fit="cover"
|
||||
class="w-[100vw] h-[100vh]"
|
||||
:is-live="true"
|
||||
:play-strategy="2"
|
||||
:controls="false"
|
||||
:show-progress="false"
|
||||
:show-fullscreen-btn="false"
|
||||
:show-play-btn="false"
|
||||
:enable-progress-gesture="false"
|
||||
:vslide-gesture="true"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<image
|
||||
v-if="!isVideoLoaded"
|
||||
src="https://oss-lock.xhjcn.ltd/mp/background_monitor.png"
|
||||
class="w-full h-full absolute top-0 left-0"
|
||||
></image>
|
||||
|
||||
<cover-view
|
||||
v-if="isApp || buttonInfo"
|
||||
:style="{
|
||||
top: isApp ? '60px' : buttonInfo.bottom + 15 + 'px'
|
||||
}"
|
||||
class="bg-[rgba(0,0,0,0.35)] rounded-full px-4 py-1.5 fixed right-32"
|
||||
>
|
||||
<cover-view class="text-white text-xs" @click="showQualitySelector">
|
||||
{{ range[index].name }}
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<iot-p2p-voice
|
||||
v-if="deviceInfo"
|
||||
id="voiceComponent"
|
||||
@ -51,58 +70,94 @@
|
||||
voiceType="Pusher"
|
||||
>
|
||||
</iot-p2p-voice>
|
||||
<!-- #endif -->
|
||||
|
||||
<view
|
||||
<cover-view
|
||||
v-if="isVideoLoaded"
|
||||
class="fixed bottom-[calc(32rpx+env(safe-area-inset-bottom))] bg-[rgba(0,0,0,0.3)] rounded-xl p-4 shadow-lg left-1/2 -translate-x-1/2 w-622"
|
||||
>
|
||||
<view class="flex items-center justify-around mx-15">
|
||||
<image
|
||||
@click="isMute = !isMute"
|
||||
:src="
|
||||
isMute
|
||||
? 'https://oss-lock.xhjcn.ltd/mp/icon_mute.png'
|
||||
: 'https://oss-lock.xhjcn.ltd/mp/icon_not_mute.png'
|
||||
"
|
||||
class="w-48 h-48 p-2"
|
||||
></image>
|
||||
<image
|
||||
@click="handleScreenshot"
|
||||
<cover-view class="flex items-center justify-around mx-15">
|
||||
<cover-view class="relative">
|
||||
<cover-image
|
||||
v-show="isMute"
|
||||
src="https://oss-lock.xhjcn.ltd/mp/icon_mute.png"
|
||||
:class="isApp ? 'size-48' : 'size-48 p-2'"
|
||||
></cover-image>
|
||||
<cover-image
|
||||
v-show="!isMute"
|
||||
src="https://oss-lock.xhjcn.ltd/mp/icon_not_mute.png"
|
||||
:class="isApp ? 'size-48' : 'size-48 p-2'"
|
||||
></cover-image>
|
||||
<cover-view
|
||||
@click="toggleMute"
|
||||
class="absolute top-0 left-0 w-full h-full size-48 p-2"
|
||||
></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="relative">
|
||||
<cover-image
|
||||
src="https://oss-lock.xhjcn.ltd/mp/icon_screenshot.png"
|
||||
class="w-48 h-48 p-2"
|
||||
></image>
|
||||
</view>
|
||||
<view class="flex items-center justify-between text-white mt-2 px-10">
|
||||
<view class="flex flex-col items-center" @longpress="startVoice" @touchend="stopVoice">
|
||||
<view class="bg-white w-80 h-80 rounded-full flex items-center justify-center">
|
||||
<image
|
||||
:class="isApp ? 'size-48' : 'size-48 p-2'"
|
||||
></cover-image>
|
||||
<cover-view
|
||||
@click="handleScreenshot"
|
||||
class="absolute top-0 left-0 w-full h-full"
|
||||
></cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="flex items-center justify-between text-white mt-2 px-10">
|
||||
<cover-view class="flex flex-col items-center">
|
||||
<cover-view
|
||||
class="bg-white w-80 h-80 rounded-full flex items-center justify-center relative"
|
||||
>
|
||||
<cover-image
|
||||
:src="
|
||||
isVoice
|
||||
? 'https://oss-lock.xhjcn.ltd/mp/icon_microphone.png'
|
||||
: 'https://oss-lock.xhjcn.ltd/mp/icon_no_microphone.png'
|
||||
"
|
||||
class="w-55 h-55"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mt-2 text-center whitespace-nowrap text-xs">长按说话</view>
|
||||
</view>
|
||||
<view class="flex flex-col items-center" @click="handleHangUp">
|
||||
<view class="bg-[#eb292b] w-80 h-80 rounded-full flex items-center justify-center">
|
||||
<image src="https://oss-lock.xhjcn.ltd/mp/icon_hang_up.png" class="w-60 h-60"></image>
|
||||
</view>
|
||||
<view class="mt-2 text-center whitespace-nowrap text-xs">挂断</view>
|
||||
</view>
|
||||
<view class="flex flex-col items-center" @click="handleLock">
|
||||
<view class="bg-[#63b8af] w-80 h-80 rounded-full flex items-center justify-center">
|
||||
<image
|
||||
></cover-image>
|
||||
<cover-view
|
||||
@click="toggleVoice"
|
||||
class="absolute top-0 left-0 w-full h-full"
|
||||
></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="mt-2 text-center whitespace-nowrap text-xs">{{
|
||||
isVoice ? '点击停止' : '点击说话'
|
||||
}}</cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="flex flex-col items-center">
|
||||
<cover-view
|
||||
class="bg-[#eb292b] w-80 h-80 rounded-full flex items-center justify-center relative"
|
||||
>
|
||||
<cover-image
|
||||
src="https://oss-lock.xhjcn.ltd/mp/icon_hang_up.png"
|
||||
class="w-60 h-60"
|
||||
></cover-image>
|
||||
<cover-view
|
||||
@click="handleHangUp"
|
||||
class="absolute top-0 left-0 w-full h-full"
|
||||
></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="mt-2 text-center whitespace-nowrap text-xs">挂断</cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="flex flex-col items-center">
|
||||
<cover-view
|
||||
class="bg-[#63b8af] w-80 h-80 rounded-full flex items-center justify-center relative"
|
||||
>
|
||||
<cover-image
|
||||
src="https://oss-lock.xhjcn.ltd/mp/icon_lock_white.png"
|
||||
class="w-60 h-60"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mt-2 text-center whitespace-nowrap text-xs">开锁</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
></cover-image>
|
||||
<cover-view
|
||||
@click="handleLock"
|
||||
class="absolute top-0 left-0 w-full h-full"
|
||||
></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="mt-2 text-center whitespace-nowrap text-xs">开锁</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<view
|
||||
v-if="!isVideoLoaded"
|
||||
class="fixed bottom-[calc(48rpx+env(safe-area-inset-bottom))] w-full flex justify-center"
|
||||
@ -119,7 +174,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onMounted, ref, computed } from 'vue'
|
||||
import { onUnload } from '@dcloudio/uni-app'
|
||||
import { useBluetoothStore } from '@/stores/bluetooth'
|
||||
import { useBasicStore } from '@/stores/basic'
|
||||
@ -131,17 +186,20 @@
|
||||
import * as B from './exportForPlayerPlugin'
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
import { startService, getLiveUrl, stopService } from '@/uni_modules/xhj-tencent-xp2p'
|
||||
// #endif
|
||||
|
||||
const $bluetooth = useBluetoothStore()
|
||||
const $basic = useBasicStore()
|
||||
const $user = useUserStore()
|
||||
const buttonInfo = ref(null)
|
||||
|
||||
const isApp = ref(false)
|
||||
|
||||
const onlineToken = ref('0')
|
||||
|
||||
const lockId = ref()
|
||||
|
||||
const time = ref(0)
|
||||
|
||||
const pending = ref(false)
|
||||
|
||||
const index = ref(1)
|
||||
@ -153,13 +211,20 @@
|
||||
|
||||
const deviceInfo = ref()
|
||||
const xp2pInfo = ref()
|
||||
|
||||
const url = ref()
|
||||
const isVoice = ref(false)
|
||||
|
||||
const isMute = ref(false)
|
||||
const isVideoLoaded = ref(false)
|
||||
|
||||
const urlPrefix = computed(() => {
|
||||
return url.value + `ipc.flv?action=live&channel=0&quality=${range.value[index.value].value}`
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
// #ifdef APP-PLUS
|
||||
isApp.value = true
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
console.log(A, B)
|
||||
// #endif
|
||||
@ -173,6 +238,7 @@
|
||||
}
|
||||
})
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (code === 0) {
|
||||
deviceInfo.value = {
|
||||
deviceId: `${data.productId}/${data.deviceName}`,
|
||||
@ -183,23 +249,65 @@
|
||||
} else {
|
||||
$basic.backAndToast(message)
|
||||
}
|
||||
|
||||
await getServeTime()
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
if (code === 0) {
|
||||
deviceInfo.value = data
|
||||
const result = await startService({
|
||||
appKey: 'aanuJXFtISXFYVVsd',
|
||||
appSecret: 'SsnOMHJUcazCvpULSVWY',
|
||||
productId: deviceInfo.value.productId,
|
||||
deviceName: deviceInfo.value.deviceName,
|
||||
xp2pInfo: deviceInfo.value.xp2pInfo
|
||||
})
|
||||
if (result.code === 0) {
|
||||
setTimeout(async () => {
|
||||
const urlResult = await getLiveUrl({
|
||||
id: `${deviceInfo.value.productId}/${deviceInfo.value.deviceName}`
|
||||
})
|
||||
if (urlResult.code === 0) {
|
||||
url.value = urlResult.data.url
|
||||
handlePlaySuccess()
|
||||
} else {
|
||||
$basic.backAndToast(message)
|
||||
}
|
||||
}, 200)
|
||||
} else {
|
||||
$basic.backAndToast(message)
|
||||
}
|
||||
} else {
|
||||
$basic.backAndToast(message)
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
// #ifdef APP-PLUS
|
||||
stopService({
|
||||
id: `${deviceInfo.value.productId}/${deviceInfo.value.deviceName}`
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
const page = getCurrentPages().pop()
|
||||
const player = page.selectComponent('#playerRef')
|
||||
if (player.stopAll) {
|
||||
player.stopAll()
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
|
||||
const changeEvent = e => {
|
||||
index.value = e.detail.value
|
||||
const showQualitySelector = () => {
|
||||
uni.showActionSheet({
|
||||
itemList: range.value.map(item => item.name),
|
||||
success: res => {
|
||||
index.value = res.tapIndex
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleScreenshot = () => {
|
||||
// #ifdef MP-WEIXIN
|
||||
const page = getCurrentPages().pop()
|
||||
const player = page.selectComponent('#playerRef')
|
||||
|
||||
@ -220,14 +328,26 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content:
|
||||
'由于技术限制,APP端无法直接截取视频画面。请使用手机系统截图功能:\n\niOS:同时按下电源键+音量上键\nAndroid:同时按下电源键+音量下键',
|
||||
confirmText: '我知道了',
|
||||
showCancel: false
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
const handleHangUp = () => {
|
||||
// #ifdef MP-WEIXIN
|
||||
const page = getCurrentPages().pop()
|
||||
const player = page.selectComponent('#playerRef')
|
||||
if (player.stopAll) {
|
||||
player.stopAll()
|
||||
}
|
||||
// #endif
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
@ -340,24 +460,35 @@
|
||||
return false
|
||||
}
|
||||
|
||||
const startVoice = () => {
|
||||
const toggleVoice = () => {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (isVoice.value) {
|
||||
isVoice.value = false
|
||||
const page = getCurrentPages().pop()
|
||||
const voice = page.selectComponent('#voiceComponent')
|
||||
if (voice) {
|
||||
voice.stopVoice()
|
||||
}
|
||||
} else {
|
||||
uni.vibrateLong()
|
||||
isVoice.value = true
|
||||
const page = getCurrentPages().pop()
|
||||
const voice = page.selectComponent('#voiceComponent')
|
||||
if (voice) {
|
||||
voice.startVoice()
|
||||
}
|
||||
|
||||
const stopVoice = () => {
|
||||
isVoice.value = false
|
||||
const page = getCurrentPages().pop()
|
||||
const voice = page.selectComponent('#voiceComponent')
|
||||
voice.stopVoice()
|
||||
}
|
||||
// #endif
|
||||
console.log(1111)
|
||||
}
|
||||
|
||||
const handlePlaySuccess = () => {
|
||||
isVideoLoaded.value = true
|
||||
}
|
||||
|
||||
const toggleMute = () => {
|
||||
isMute.value = !isMute.value
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -431,11 +431,6 @@ const pages = [
|
||||
name: 'safeVerify',
|
||||
path: '/pages/user/safeVerify',
|
||||
tabBar: false
|
||||
},
|
||||
{
|
||||
name: 'appPlayer',
|
||||
path: '/pages/p2p/appPlayer',
|
||||
tabBar: false
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "bundler"
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx", "**/*.uts", "**/*.vue"],
|
||||
"include": ["**/*.vue", "**/*.js", "**/*.uts", "uni_modules/**/*.uts"],
|
||||
"exclude": ["node_modules", "unpackage", "dist"]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user