diff --git a/api/sdk.js b/api/sdk.js index c4dc3f4..210c5a4 100644 --- a/api/sdk.js +++ b/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 + }) +} diff --git a/pages/p2p/videoLog.vue b/pages/p2p/videoLog.vue index 4cff9e5..c004a54 100644 --- a/pages/p2p/videoLog.vue +++ b/pages/p2p/videoLog.vue @@ -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 () => {