From 3091df43ee54c7a2d671c6db7718fa6c310366a7 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 25 Aug 2025 16:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7=EF=BC=8C?= =?UTF-8?q?=E7=94=9F=E6=88=90=E8=AE=A2=E5=8D=95=E5=8F=B7=E7=AD=89=E5=BE=85?= =?UTF-8?q?300-600ms=E5=86=8D=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 1 + components/my-video-list/my-video-list.vue | 25 ++++++++++++++++++++++ manifest.json | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 576f2b0..4e300b3 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,6 +2,7 @@ "version" : "1.0", "configurations" : [ { + "customPlaygroundType" : "local", "playground" : "custom", "type" : "uni-app:app-android" }, diff --git a/components/my-video-list/my-video-list.vue b/components/my-video-list/my-video-list.vue index 1827560..0b0c878 100644 --- a/components/my-video-list/my-video-list.vue +++ b/components/my-video-list/my-video-list.vue @@ -607,6 +607,23 @@ async function goldPay(data) { }); } } + +/** + * 异步等待函数:随机等待 300-600ms(包含边界值) + * @returns {Promise} 成功后返回实际等待的毫秒数(方便调试或日志记录) + */ +function randomWait() { + // 1. 生成 300-600 之间的随机整数(含 300 和 600) + const waitTime = Math.floor(Math.random() * (600 - 300 + 1)) + 300; + + // 2. 返回 Promise,延迟 waitTime 后 resolve + return new Promise((resolve) => { + setTimeout(() => { + resolve(waitTime); // resolve 实际等待时间,便于后续使用 + }, waitTime); + }); +} + //确认支付 async function payConfirm() { const [type, num] = popup.payType.split('-'); @@ -636,6 +653,14 @@ async function payConfirm() { }); } if (res) { + uni.showLoading() + console.log('等待开始'); + const start=Date.now() + await randomWait() + const end=Date.now() + console.log('等待结束'); + console.log('等待时间',end-start); + uni.hideLoading() if (type == 'gold') { goldPay({ orderId: res.orders.ordersId diff --git a/manifest.json b/manifest.json index b8fc114..25498b8 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "斯耀短剧", "appid" : "__UNI__E0B05B1", "description" : "", - "versionName" : "1.3.2", - "versionCode" : 132, + "versionName" : "1.3.3", + "versionCode" : 133, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : {