From 26039dc8d792f5cd05f64762cccf22aa7d411e92 Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Fri, 6 Jun 2025 09:38:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8sdk=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=A5=97=E9=A4=90=E5=9C=B0=E5=9D=80=E5=92=8C?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E5=A2=9E=E5=80=BC=E6=9C=8D=E5=8A=A1=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E8=AF=B7=E6=B1=82=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=9C=A8=E8=A7=86=E9=A2=91=E6=97=A5=E5=BF=97=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E9=9B=86=E6=88=90=E7=9B=B8=E5=85=B3=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/sdk.js | 18 ++++++++++++++++++ pages/p2p/videoLog.vue | 25 +++++++++++++++++-------- 2 files changed, 35 insertions(+), 8 deletions(-) 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 () => {