htc hace 1 día
padre
commit
87fc59b55f

+ 9 - 17
components/bindDevice/index.vue

@@ -34,23 +34,15 @@
 				let that = this;
 				uni.scanCode({
 					success: (res) => {
-						let result = JSON.parse(res.result);
-						if(res.errMsg==='scanCode:ok'){
-							uni.navigateTo({
-								url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
-							})
-							
-							// that.$api.post('/device/bind',{
-							// 	...result,
-							// 	"type": "",
-							// 	"userId": 0,
-							// 	"agentId": ""
-							// }).then(res=>{
-							// 	if(res.data.code!==0) return that.$showToast(res.data.msg)
-							// 	uni.navigateTo({
-							// 		url:'/pagesMy/scanResult?deviceId='+res.data.data
-							// 	})
-							// })
+						try{
+							let result = JSON.parse(res.result);
+							if(res.errMsg==='scanCode:ok'){
+								uni.navigateTo({
+									url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
+								})
+							}
+						}catch(e){
+							that.$showModal('扫码失败,请检查设备二维码。')
 						}
 					}
 				})

+ 2 - 1
components/deviceBox/index.vue

@@ -1,7 +1,8 @@
 <template>
 	<div class="l_box box">
 		<div class="l_top adfacjb">
-			<div class="lt_l">{{item.alias||item.board||''}}</div>
+			<!-- <div class="lt_l">{{item.alias||item.board||''}}</div> -->
+			<div class="lt_l">{{item.id||''}}</div>
 			<div class="lt_r adfac">
 				<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/8a203ba4-2e9e-4379-89ec-dc7fc9caa3d4.png" v-if="item.state===1"></image>
 				<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/5ed3a1fc-9a05-4f13-8449-fd3183b00355.png" v-else-if="item.state===0"></image>

+ 9 - 9
manifest.json

@@ -102,10 +102,10 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxb9a6bbfcc8449c16",
-		"networkTimeout": {
-		    "request": 30000
-		},
+        "appid" : "wxb9a6bbfcc8449c16",
+        "networkTimeout" : {
+            "request" : 30000
+        },
         "setting" : {
             "urlCheck" : false,
             "es6" : false,
@@ -124,11 +124,11 @@
             "scope.userLocation" : {
                 "desc" : "获取WiFi列表进行设备连接"
             }
-        },
-		// 允许使用本地IP(关键配置)
-		"android": {
-			"allowLocalNetworking": true
-		}
+        },
+        // 允许使用本地IP(关键配置)
+        "android" : {
+            "allowLocalNetworking" : true
+        }
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 1 - 1
pages/role.vue

@@ -42,7 +42,7 @@
 			</template>
 		<cus-tabbar :tabbarIndex="1"></cus-tabbar>
 		<bind-device ref="bdRef"></bind-device>
-		<u-picker :itemHeight="88" title="设备" :show="show" :columns="deviceList" keyName="board"
+		<u-picker :itemHeight="88" title="设备" :show="show" :columns="deviceList" keyName="id"
 			@cancel="show=false" @confirm="confirm" :immediateChange="true" style="height: 500rpx;">
 		</u-picker>
 	</view>

+ 9 - 16
pagesMy/device.vue

@@ -67,22 +67,15 @@
 				let that = this;
 				uni.scanCode({
 					success: (res) => {
-						let result = JSON.parse(res.result);
-						if(res.errMsg==='scanCode:ok'){
-							uni.navigateTo({
-								url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
-							})
-							// that.$api.post('/device/bind',{
-							// 	...result,
-							// 	"type": "",
-							// 	"userId": 0,
-							// 	"agentId": ""
-							// }).then(res=>{
-							// 	if(res.data.code!==0) return that.$showToast(res.data.msg)
-							// 	uni.navigateTo({
-							// 		url:'/pagesMy/scanResult?deviceId='+res.data.data
-							// 	})
-							// })
+						try{
+							let result = JSON.parse(res.result);
+							if(res.errMsg==='scanCode:ok'){
+								uni.navigateTo({
+									url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
+								})
+							}
+						}catch(e){
+							that.$showModal('扫码失败,请检查设备二维码。')
 						}
 					}
 				})

+ 9 - 16
pagesMy/wifiSuccess.vue

@@ -21,22 +21,15 @@
 				let that = this;
 				uni.scanCode({
 					success: (res) => {
-						let result = JSON.parse(res.result);
-						if(res.errMsg==='scanCode:ok'){
-							uni.navigateTo({
-								url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
-							})
-							// that.$api.post('/device/bind',{
-							// 	...result,
-							// 	"type": "",
-							// 	"userId": 0,
-							// 	"agentId": ""
-							// }).then(res=>{
-							// 	if(res.data.code!==0) return that.$showToast(res.data.msg)
-							// 	uni.navigateTo({
-							// 		url:'/pagesMy/scanResult?deviceId='+res.data.data
-							// 	})
-							// })
+						try{
+							let result = JSON.parse(res.result);
+							if(res.errMsg==='scanCode:ok'){
+								uni.navigateTo({
+									url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
+								})
+							}
+						}catch(e){
+							that.$showModal('扫码失败,请检查设备二维码。')
 						}
 					}
 				})

+ 1 - 1
pagesRole/addRole.vue

@@ -87,7 +87,7 @@
 					"chatHistoryConf": ""
 				},
 				imageUrl:'',
-				resultUrl:'',
+				resultUrl:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/12/c1c0caa2-3f0f-4df3-bfe5-567b0963f0aa.png',
 				scanParams:''
 			}
 		},