浏览代码

feature:修改AI耳机的UI,文案

zeng.chen 8 小时之前
父节点
当前提交
0029432ffd

+ 14 - 11
pages/pageB/deviceConnect0/deviceConnect0.js

@@ -12,7 +12,8 @@ Page({
     scopeBluetooth: false,
     userFuzzyLocation: true,
     isNotruter: false,
-    isFromRootPage: true,
+    _isFromRootPage: true,
+    isAiDevice: false,
     connectDevice: {},
     imageUrl: "./../../../img/c.png",
   },
@@ -34,7 +35,9 @@ Page({
 
       if (Object.keys(param).length <= 1) {
         // 扫描进来的只有一个参数
-        that.data.isFromRootPage = false;
+        that.setData({
+          isAiDevice: true,
+        })
 
         var classifyProducts = constant.app.globalData.classifyProducts;
         if (!constant.strings.isEmpty(classifyProducts)) {
@@ -78,17 +81,11 @@ Page({
   updateDeviceUrl(param) {
     var that = this
     that.data.connectDevice = param;
-
     var typeList = param["typeList"] ?? [];
-    console.log("找到设备5", typeList);
-
     if (!constant.strings.isEmpty(typeList)) {
-      console.log("找到设备3");
-
       typeList = typeList.filter((v) => v.connectType == 3);
       if (!constant.strings.isEmpty(typeList)) {
         console.log("找到设备4", typeList);
-
         that.setData({
           imageUrl: typeList[0].deviceLinkResp.icon1,
         });
@@ -100,7 +97,7 @@ Page({
     // 重置小程序界面到首页
     console.log("返回界面4", constant.routePath.index);
 
-    if (this.data.isFromRootPage) {
+    if (this.data._isFromRootPage) {
       constant.routeUtil.goBack();
     } else {
       console.log("返回界面4", constant.routePath.index);
@@ -170,13 +167,19 @@ Page({
           constant.routeUtil.jumpParam(constant.routePath.deviceConnect1, param);
         }
       },
-      fail(res) {
-        if (res.errCode === 10001) {
+      fail(err) {
+        if (err.errCode === 10001) {
           wx.showToast({
             title: '手机蓝牙未打开',
             icon: "none",
             duration: 2000
           })
+        } else {
+          wx.showToast({
+            title: err,
+            icon: "none",
+            duration: 2000
+          })
         }
       }
     });

+ 2 - 2
pages/pageB/deviceConnect0/deviceConnect0.wxml

@@ -1,12 +1,12 @@
 <view class="deviceRoter deviceRoter0">
-  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" bind:tap="callback" navbar-data='{{nvabarData}}'>
-  </nav-bar>
+  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" bind:tap="callback" navbar-data='{{nvabarData}}'></nav-bar>
   <view class="roterps">
     <view class="devicePic">
       <image mode="widthFix" src="{{imageUrl}}"></image>
     </view>
     <text>开启设备并将开关打至WiFi模式,指示灯亮
       起后,即可进入下一步</text>
+    <text wx:if="{{!isAiDevice}}" style="color: #D42B2B;">\n(请确认已打开蓝牙,设备调整至WIFI模式)</text>
     <view wx:if="{{!scopeBluetooth && userFuzzyLocation}}" class="qx">
       <text bindtap="setBluetooth">开启蓝牙权限</text>
       <image src="./../../../img/a.png" style="width: 16rpx;height: 28rpx;"></image>

+ 3 - 0
pages/pageB/deviceConnect3/deviceConnect3.wxml

@@ -12,6 +12,9 @@
       <image style="height:48rpx; width:48rpx;" mode="aspectFit" src="./../../../img/h.png"></image>
       <text>连接成功</text>
     </view>
+    <view class="suAIRuter" wx:elif="{{ruterStatus === 1}}">
+      <text>请呼叫“小猫小猫”,让AI小猫给您播放音乐吧!</text>
+    </view>
     <view class="suRuter" wx:elif="{{ruterStatus === 2}}">
       <image style="height:48rpx; width:48rpx;" mode="aspectFit" src="./../../../img/i.png"></image>
       <text>连接失败</text>

+ 8 - 0
pages/pageB/deviceConnect3/deviceConnect3.wxss

@@ -15,6 +15,14 @@
   justify-content: center;
 }
 
+.suAIRuter {
+  margin-top: 27rpx;
+  display: flex;
+  justify-content: center;
+  color: #D42B2B;
+}
+
+
 .suRuter image {
   width: 48rpx;
 }