From 29680cb7a4f5654b5921d06f46443f60230d2fee Mon Sep 17 00:00:00 2001 From: 17792275749 <812100002@qq.com> Date: Thu, 14 May 2026 13:41:50 +0800 Subject: [PATCH] =?UTF-8?q?[AI=20Generated]:=20feat(Views):=20=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E8=BF=9E=E6=8E=A5=E8=AE=BE=E5=A4=87=E9=A1=B5=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E9=80=BB=E8=BE=91=E3=80=81=E6=B3=A2=E7=BA=B9=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E5=8F=8A=E4=B8=AD=E5=BF=83=E5=9B=BE=E6=A0=87=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/claudeCodeTabState.xml | 6 + miniprogram/images/connectedDevice/icon.png | Bin 0 -> 2535 bytes .../connectedDevice/connectedDevice.less | 253 ++++-------------- .../pages/connectedDevice/connectedDevice.ts | 12 +- .../connectedDevice/connectedDevice.wxml | 17 +- 5 files changed, 83 insertions(+), 205 deletions(-) create mode 100644 .idea/claudeCodeTabState.xml create mode 100644 miniprogram/images/connectedDevice/icon.png diff --git a/.idea/claudeCodeTabState.xml b/.idea/claudeCodeTabState.xml new file mode 100644 index 0000000..ba4c915 --- /dev/null +++ b/.idea/claudeCodeTabState.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/miniprogram/images/connectedDevice/icon.png b/miniprogram/images/connectedDevice/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1df92b34ab86e68a86abbb4e6edb20ea4e168300 GIT binary patch literal 2535 zcmVL000001b5ch_0Itp) z=>Px;p-DtRRA@uZn+c5FRTaj+qu_$LZ@41vI|?p2Z>tDe0+_9wX_Il6Fe^horwr`irEyCEYLS@BGco zcJ%wTtlu|ucYwTE(o{*W4uB7nw40=dN@5dO{|&$oO8U2?dnDZ;=@*iI6~Axm7wE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zjd>*eae3ZNYz6RQ)J34l-fs-_#&B;rpHN-O1R9$m)pOSgzy(jODqA4gf`M{jkJp#OB-4vr>FQ7INbtj3LA$j5X%CIZ%G4WkcI7SrTgC z)krP~O~c^A?*7~~&Rix53R_ObF$^;3hRQJINCK-;X2`VVVGB4ab#+lc8|Gd%Eowh1 zJ#`b!D_@n&IX|Dumq7WQ(Hv%n5|#rTCftlH&hPY)L@z*EUE}T~OET;{NgO-K7hwkF zBm91uhgsd&5N1I<)=j#(DQ%SjcudAVr)psSRb8|x}VEzqzka|}Q(j)804AqkihlQuR4 z7II&|%1@LJ21l?pK+-qo%%=iNTy6@&v(e0`5Mx$TpaB+3BA$_ekQ3{`a$}?s6u6b_ zXnJVNLsxBFlu;zj1s*j!X0c58nmwCw2~&o(OwF3zyCu*7i^Puv0-xmkK(o_aq;;|~ z>LJHZ`Gg8A%Y{%3-P_;*+dembnTGps*xEFo?{^7{6p9nS3o(gx-Dy61C6-F0=OH=Vp^#D69pK6NS4e$Np`pO zatgaApqV?P)j+Nhrf_FQko>Lg5JxvwXWWNQg^G_>i~6y7JlfT`fM$TMqSZx-nW*_3vJ= xHVFw}r~qVVC?)ZSia{NQvu^F?D0w?~`5zr{YOQ?l!)5>g002ovPDHLkV1jy&)QA88 literal 0 HcmV?d00001 diff --git a/miniprogram/pages/connectedDevice/connectedDevice.less b/miniprogram/pages/connectedDevice/connectedDevice.less index c28cd89..b1365a7 100644 --- a/miniprogram/pages/connectedDevice/connectedDevice.less +++ b/miniprogram/pages/connectedDevice/connectedDevice.less @@ -5,12 +5,64 @@ padding: 48rpx 30rpx 0; box-sizing: border-box; + /* 三层同心圆波纹动画 */ .ripple { + position: relative; width: 300rpx; height: 300rpx; - border-radius: 50%; margin: 0 auto 48rpx; - background-color: red; + display: flex; + align-items: center; + justify-content: center; + + /* 波纹圆环 */ + .ripple-ring { + position: absolute; + width: 300rpx; + height: 300rpx; + border-radius: 50%; + background-color: #1385FA; + animation: ripple-expand 2.4s ease-out infinite; + } + + .ripple-ring--delay1 { + animation-delay: 0.8s; + } + + .ripple-ring--delay2 { + animation-delay: 1.6s; + } + + /* 中心实心圆 + 图标 */ + .ripple-core { + position: relative; + z-index: 1; + width: 140rpx; + height: 140rpx; + padding: 30rpx; + box-sizing: border-box; + border-radius: 50%; + background-color: #1385FA; + display: flex; + align-items: center; + justify-content: center; + + image { + width: 80rpx; + height: 80rpx; + } + } + } + + @keyframes ripple-expand { + 0% { + transform: scale(0.46); + opacity: 1; + } + 100% { + transform: scale(1); + opacity: 0; + } } .title { @@ -157,7 +209,7 @@ overflow: hidden; border-radius: 24rpx; margin-right: 24rpx; - background-color: red; + background-color: rgba(19, 133, 250, 0.1); } .card-info { @@ -225,198 +277,3 @@ } } } - -/* 三层同心圆动画占位(搜索中态后续接入波纹动画) */ -//.ripple { - -///* 主按钮:开始搜索 / 重新搜索 */ -//.searchBtn { -// margin-top: 40rpx; -// width: 580rpx; -// height: 88rpx; -// line-height: 88rpx; -// border-radius: 44rpx; -// background-color: #1385FA; -// color: #FFFFFF; -// font-size: 32rpx; -// font-weight: 700; -// text-align: center; -//} -// -///* 帮助行 */ -// -///* 搜索结果区:左标题 + 右计数 */ -//.resultHeader { -// margin-top: 59rpx; -// width: 689rpx; -// display: flex; -// justify-content: space-between; -// align-items: center; -// -// &__title { -// font-size: 32rpx; -// font-weight: 700; -// color: #252535; -// line-height: 32rpx; -// } -// -// &__count { -// display: flex; -// align-items: center; -// } -// -// &__countText { -// font-size: 28rpx; -// color: #808080; -// line-height: 28rpx; -// } -// -// &__countNum { -// font-size: 28rpx; -// font-weight: 500; -// color: #1385FA; -// line-height: 28rpx; -// } -//} -// -///* 空状态:暂未搜索到设备 */ -//.empty { -// margin-top: 199rpx; -// display: flex; -// flex-direction: column; -// align-items: center; -// -// &__image { -// width: 193rpx; -// height: 138rpx; -// background-color: #F5F5F5; -// border-radius: 16rpx; -// } -// -// &__text { -// margin-top: 40rpx; -// font-size: 30rpx; -// color: #808080; -// line-height: 30rpx; -// } -//} -// -///* 已连接设备卡片 */ -//.connectedCard { -// margin-top: 39rpx; -// width: 690rpx; -// height: 150rpx; -// display: flex; -// align-items: center; -// background-color: #FFFFFF; -// border: 2rpx solid #E6E6EA; -// border-radius: 16rpx; -// box-sizing: border-box; -// padding: 0 30rpx; -// -// &__info { -// flex: 1; -// margin-left: 24rpx; -// display: flex; -// flex-direction: column; -// justify-content: center; -// } -// -// &__name { -// font-size: 32rpx; -// font-weight: 500; -// color: #252535; -// line-height: 32rpx; -// } -// -// &__status { -// margin-top: 16rpx; -// display: flex; -// align-items: center; -// } -// -// &__dot { -// width: 12rpx; -// height: 12rpx; -// border-radius: 50%; -// background-color: #2AC79F; -// margin-right: 15rpx; -// } -// -// &__statusText { -// font-size: 28rpx; -// font-weight: 500; -// color: #2AC79F; -// line-height: 28rpx; -// } -// -// &__btn { -// width: 120rpx; -// height: 48rpx; -// line-height: 44rpx; -// text-align: center; -// border: 2rpx solid #F24439; -// border-radius: 8rpx; -// color: #F24439; -// font-size: 24rpx; -// font-weight: 500; -// box-sizing: border-box; -// } -//} -// -///* 未连接设备列表 */ -//.deviceList { -// margin-top: 24rpx; -// width: 690rpx; -// display: flex; -// flex-direction: column; -//} -// -///* 设备卡片(已连接 + 未连接通用图标样式) */ -//.deviceCard { -// width: 690rpx; -// height: 150rpx; -// display: flex; -// align-items: center; -// background-color: #FFFFFF; -// border: 2rpx solid #E6E6EA; -// border-radius: 16rpx; -// box-sizing: border-box; -// padding: 0 30rpx; -// margin-bottom: 24rpx; -// -// &__icon { -// width: 90rpx; -// height: 90rpx; -// border-radius: 24rpx; -// background-color: rgba(19, 133, 250, 0.1); -// flex-shrink: 0; -// } -// -// &__name { -// flex: 1; -// margin-left: 23rpx; -// font-size: 32rpx; -// font-weight: 500; -// color: #252535; -// line-height: 32rpx; -// } -// -// &__btn { -// width: 88rpx; -// height: 48rpx; -// line-height: 48rpx; -// text-align: center; -// border-radius: 8rpx; -// background-color: #2AC79F; -// color: #FFFFFF; -// font-size: 24rpx; -// font-weight: 500; -// } -//} -// -///* 已连接卡片复用 deviceCard__icon 的尺寸 */ -//.connectedCard .deviceCard__icon { -// width: 90rpx; -// height: 90rpx; -//} diff --git a/miniprogram/pages/connectedDevice/connectedDevice.ts b/miniprogram/pages/connectedDevice/connectedDevice.ts index 20d6e03..15a2966 100644 --- a/miniprogram/pages/connectedDevice/connectedDevice.ts +++ b/miniprogram/pages/connectedDevice/connectedDevice.ts @@ -47,9 +47,17 @@ Page({ lefuService.onConnectState((state) => { const plugin = lefuService['_plugin'] if (!plugin) return - // 连接成功后跳转配网页 - if (state === plugin.BLUE_STATE.CONNECTSUCCESS || state === plugin.BLUE_STATE.WIFISUCCESS) { + + if (state === plugin.BLUE_STATE.CONNECTSUCCESS) { + // 蓝牙连接成功,存储设备信息后跳配网页 + const connected = this.data.deviceList.find(d => d.connected) + if (connected) { + wx.setStorageSync('connectDeviceInfo', { name: connected.name }) + } wx.navigateTo({ url: '/pages/connectedWifi/connectedWifi' }) + } else if (state === plugin.BLUE_STATE.WIFISUCCESS) { + // 设备已配网,直接进首页 + wx.reLaunch({ url: '/pages/home/home' }) } }) diff --git a/miniprogram/pages/connectedDevice/connectedDevice.wxml b/miniprogram/pages/connectedDevice/connectedDevice.wxml index b752ade..c0f6322 100644 --- a/miniprogram/pages/connectedDevice/connectedDevice.wxml +++ b/miniprogram/pages/connectedDevice/connectedDevice.wxml @@ -1,7 +1,14 @@ - - + + + + + + + + + @@ -9,7 +16,7 @@ - 请确保蓝牙已开启,设备处于待机状态 + 请确保蓝牙已开启,设备处于待机状态 @@ -60,10 +67,10 @@ - 断开连接 + 断开连接 - 连接 + 连接