feat: 在sdk中添加获取套餐地址和上报增值服务购买请求的功能,并在视频日志组件中集成相关逻辑
This commit is contained in:
parent
1e04659c79
commit
26039dc8d7
18
api/sdk.js
18
api/sdk.js
@ -28,3 +28,21 @@ export function deleteVideo(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取套餐地址
|
||||
export function getPackageUrl(data) {
|
||||
return request({
|
||||
url: '/v2/service/getPackageUrl',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 上报增值服务购买请求
|
||||
export function reportBuyRequest(data) {
|
||||
return request({
|
||||
url: '/service/reportBuyRequest',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
import { onMounted, ref, computed } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { useBluetoothStore } from '@/stores/bluetooth'
|
||||
import { passthrough } from '@/api/sdk'
|
||||
import { passthrough, getPackageUrl, reportBuyRequest } from '@/api/sdk'
|
||||
import { useBasicStore } from '@/stores/basic'
|
||||
|
||||
const $bluetooth = useBluetoothStore()
|
||||
@ -157,13 +157,22 @@
|
||||
})
|
||||
}
|
||||
|
||||
const toWebview = () => {
|
||||
$basic.routeJump({
|
||||
name: 'webview',
|
||||
params: {
|
||||
url: encodeURIComponent('https://www.baidu.com')
|
||||
}
|
||||
})
|
||||
const toWebview = async () => {
|
||||
const result = await Promise.all([
|
||||
getPackageUrl({}),
|
||||
reportBuyRequest({ type: 'cloud_storage', lockId: $bluetooth.currentLockInfo.lockId })
|
||||
])
|
||||
|
||||
const urls = result[0].data
|
||||
|
||||
if (urls?.cloud_storage) {
|
||||
$basic.routeJump({
|
||||
name: 'webview',
|
||||
params: {
|
||||
url: encodeURIComponent(urls.cloud_storage)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const resetLog = async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user