htc 1 giorno fa
parent
commit
267a08fca7

+ 1 - 1
components/deviceBox/index.vue

@@ -65,7 +65,7 @@ export default {
 		},
 		changeWifi(item) {
 			uni.navigateTo({
-				url: '/pagesMy/wifiSearch'
+				url: '/pagesMy/wifiSearch?type=jpw'
 			});
 		},
 		unbindDevice(item) {

+ 2 - 1
pages/role.vue

@@ -111,6 +111,8 @@
 				this.$api.get(`/device/bindOther/${this.agentId}`).then(res=>{
 					if(res.data.code!==0) return this.$showToast(res.data.msg)
 					this.deviceList = [res.data.data];
+					if(res.data.data.length>0) this.show = true;
+					else this.$showToast('暂无已绑定的设备')
 				})
 			},
 			addDevice(){
@@ -154,7 +156,6 @@
 			},
 			toBindDevice(item){
 				this.agentId = item.id;
-				this.show = true;
 				this.getDeviceList();
 				// if(item.deviceCount>0){
 				// 	uni.showModal({

+ 11 - 3
pagesMy/scanResult.vue

@@ -3,8 +3,14 @@
 		<cus-header :title='htitle'></cus-header>
 		<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/ea285d8f-ad96-447e-8f4a-77d495f2fac6.png"></image>
 		<p>{{title}}</p>
-		<p class="tip">设备已就绪,需添加角色才能使用<br>快去创建角色吧~</p>
-		<div class="zt_btn" @tap="addRole">为设备添加角色</div>
+		<template v-if="type=='jpw'">
+			<p class="tip">设备配网成功<br>快去首页使用吧~</p>
+			<div class="zt_btn" @tap="goBack">返回首页</div>
+		</template>
+		<template v-else>
+			<p class="tip">设备已就绪,需添加角色才能使用<br>快去创建角色吧~</p>
+			<div class="zt_btn" @tap="addRole">为设备添加角色</div>
+		</template>
 	</view>
 </template>
 
@@ -14,10 +20,12 @@
 			return {
 				scanParams:'',
 				htitle:'扫码结果',
-				title:'扫码成功'
+				title:'扫码成功',
+				type:''
 			}
 		},
 		onLoad(option) {
+			this.type = option.pwtype||'';
 			if(option.scanParams) this.scanParams = JSON.parse(option.scanParams);
 			if(option.type&&option.type=='lanya'){
 				this.htitle = '配网结果';

+ 6 - 2
pagesMy/wifiSearch.vue

@@ -51,6 +51,7 @@
 				lanya:null,
 				devicesList: [],
 				searching: false,
+				type:''
 			}
 		},
 		onShow() {
@@ -58,7 +59,8 @@
 			// this.show = false;
 			// this.Search();
 		},
-		onLoad: function() {
+		onLoad: function(option) {
+			this.type = option.type || '';
 			_this = this;
 			this.Search();
 			// xBlufi.initXBlufi(1);
@@ -114,6 +116,7 @@
 							let ly = _this.devicesList.find(d=>d.name.indexOf('cx-')>-1);
 							if(!ly) ly = _this.devicesList.find(d=>d.name.indexOf('BLUFI_DEVICE')>-1);
 							if(ly){
+								console.log(ly,'找到设备')
 								_this.lanya = ly;
 								_this.nodevice = false;
 								_this.show = true;
@@ -126,9 +129,10 @@
 								title: '连接成功',
 								icon: 'none'
 							})
+							console.log(options.data,'连接成功')
 							wx.navigateTo({
 								url: '/pagesMy/wifiSet?deviceId=' + options.data.deviceId + '&name=' + options
-									.data.name
+									.data.name+ '&type=' + _this.type
 							});
 						} else {
 							wx.hideLoading()

+ 5 - 2
pagesMy/wifiSet.vue

@@ -72,10 +72,12 @@
 				wifiPWD:'',
 				isPwd:true,
 				show:false,
-				wifiList:[]
+				wifiList:[],
+				type:'', // 配网类型
 			}
 		},
 		onLoad: function(options) {
+			this.type = options.type || '';
 			var that = this
 			this.name = options.name;
 			this.connectedDeviceId = options.deviceId;
@@ -131,8 +133,9 @@
 									"board": this.name||"cx-mxb-wifi", 
 									"appVersion": "1.8.2" ,
 								};
+								console.log(result,'配网成功')
 								uni.navigateTo({
-									url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)+'&type=lanya'
+									url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)+'&type=lanya'+'&pwtype='+this.type
 								})
 							}
 						}

+ 4 - 3
pagesRole/voice.vue

@@ -20,8 +20,8 @@
 						<text>{{item.name}}</text>
 					</div>
 					<div class="ir">
-						<image @tap.stop="playOnOff(0,item,index)" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/07/04/fbfe67d5-a69b-4bb1-81a5-83d19403b88e.png" v-if="item.play"></image>
-						<image @tap.stop="playOnOff(1,item,index)" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/07/04/9ef5fc85-05b2-4681-b37e-47cf843f5b6c.png" v-else></image>
+						<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/07/04/fbfe67d5-a69b-4bb1-81a5-83d19403b88e.png" v-if="item.play"></image>
+						<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/07/04/9ef5fc85-05b2-4681-b37e-47cf843f5b6c.png" v-else></image>
 					</div>
 				</div>
 			</div>
@@ -69,6 +69,7 @@
 			selectVoice(item,index){
 				this.voice = item;
 				this.idx = index;
+				this.playOnOff(item.play?0:1,item,index)
 			},
 			playOnOff(type,item,index){
 				let idx = this.list.findIndex(l=>l.play);
@@ -117,7 +118,7 @@
 		box-sizing: border-box;
 		
 		.top{
-			margin-top: 18rpx;
+			margin-top: 32rpx;
 			border-radius: 16rpx;
 			border: 1rpx solid #EEEEEE;
 			padding: 16rpx 24rpx;