From 75f457a97c2fd1d14a0f76c19db8bc1844090dcd Mon Sep 17 00:00:00 2001 From: shaojing <2901156235@qq.com> Date: Tue, 16 Apr 2024 10:11:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index/index.js b/pages/index/index.js index c1c7e0d..307d89f 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -84,7 +84,7 @@ Page({ }, 1000) let length = res.data.length if (res.data.length > 1) { - let num = Math.round(Math.random()*length); + let num = Math.round(Math.random()*length)-1; console.log('num',num); this.setData({ startList:res.data[num]