浏览代码

feature: 整合首页界面

Damon 8 月之前
父节点
当前提交
edd8e3bd0d
共有 9 个文件被更改,包括 1080 次插入756 次删除
  1. 38 7
      app.js
  2. 0 17
      app.json
  3. 159 41
      pages/index/index.js
  4. 3 1
      pages/index/index.json
  5. 141 100
      pages/index/index.wxml
  6. 720 537
      pages/index/index.wxss
  7. 9 7
      pages/login/login.js
  8. 3 46
      pages/me/me.js
  9. 7 0
      project.private.config.json

+ 38 - 7
app.js

@@ -30,7 +30,7 @@ App({
       reconnectPeriod: 1000, //1000毫秒,两次重新连接之间的间隔
       connectTimeout: 30 * 1000, //1000毫秒,两次重新连接之间的间隔
       resubscribe: true, //如果连接断开并重新连接,则会再次自动订阅已订阅的主题(默认true
-      keepalive: 3,//每3秒发送一次心跳
+      keepalive: 3, //每3秒发送一次心跳
     },
   },
   /**
@@ -54,12 +54,21 @@ App({
       const thisPageIsIndex = getCurrentPages().length === 1;
       if (pageinfo.mqttCallback) {
         if (topic.indexOf("status/onoffline") !== -1) {
-          pageinfo.mqttCallback("message_onoffline", { topic, payload });
+          pageinfo.mqttCallback("message_onoffline", {
+            topic,
+            payload
+          });
           if (!thisPageIsIndex) {
-            getCurrentPages()[0].mqttCallback("message_onoffline", { topic, payload })
+            getCurrentPages()[0].mqttCallback("message_onoffline", {
+              topic,
+              payload
+            })
           }
         } else if (topic.indexOf("user/pub_response") !== -1) {
-          pageinfo.mqttCallback("message", { topic, payload });
+          pageinfo.mqttCallback("message", {
+            topic,
+            payload
+          });
         }
       };
     });
@@ -144,7 +153,11 @@ App({
       wx.showLoading({
         title: '请稍后',
       });
-      const data = { "DstDeviceName": option.DstDeviceName, "SrcDeviceName": `ALY_${this.globalData.userInfo.userId}`, "type": option.type };
+      const data = {
+        "DstDeviceName": option.DstDeviceName,
+        "SrcDeviceName": `ALY_${this.globalData.userInfo.userId}`,
+        "type": option.type
+      };
       if (option.other) {
         data.other = option.other;
       };
@@ -202,6 +215,24 @@ App({
   // 获取蓝牙权限
   getBluetoothStatus() {
     const _this = this;
-    
+
   },
-})
+})
+
+
+// "tabBar": {
+//   "borderStyle": "black",
+//   "list": [{
+//       "pagePath": "pages/index/index",
+//       "text": "首页",
+//       "iconPath": "./img/index_unaction.png",
+//       "selectedIconPath": "./img/index_action.png"
+//     },
+//     {
+//       "pagePath": "pages/me/me",
+//       "text": "我的",
+//       "iconPath": "./img/me_unaction.png",
+//       "selectedIconPath": "./img/me_action.png"
+//     }
+//   ]
+// },

+ 0 - 17
app.json

@@ -18,23 +18,6 @@
     "pages/deviceConMode/index",
     "pages/connectBle/connectBle"
   ],
-  "tabBar": {
-    "borderStyle": "black",
-    "list": [
-      {
-        "pagePath": "pages/index/index",
-        "text": "首页",
-        "iconPath": "./img/index_unaction.png",
-        "selectedIconPath": "./img/index_action.png"
-      },
-      {
-        "pagePath": "pages/me/me",
-        "text": "我的",
-        "iconPath": "./img/me_unaction.png",
-        "selectedIconPath": "./img/me_action.png"
-      }
-    ]
-  },
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",

+ 159 - 41
pages/index/index.js

@@ -1,16 +1,26 @@
-// index.ts
 // 获取应用实例
 const app = getApp();
-const { login, listByDevice } = require('./../../utils/api.js');
-const { isCN } = require('./../../utils/util.js');
+const {
+  login,
+  listByDevice
+} = require('../../utils/api.js');
+const {
+  isCN
+} = require('../../utils/util.js');
 let _this = null;
 const interval = null;
 // import routeUtil from '../../utils/route_util.js'
 import routeUtil from '../../utils/route_util'
 import route_constant from '../../utils/route_constant.js'
 
+
 Page({
+
+
   data: {
+    indexPage: 0,
+    showChannel: false,
+    ////首页
     navBarHeight: app.globalData.navBarHeight,
     MenuButtonheight: app.globalData.MenuButtonheight,
     MenuButtonTop: app.globalData.MenuButtonTop,
@@ -28,33 +38,31 @@ Page({
     thisDeviceMac: null,
     battery: 4, // 0≤电量<20,0格
     newVersion: false,
+
+    ////我的界面
+    loginStatus: true,
+    userName: "未登录",
+    userPic: './../../img/head_pic.png',
+    nvabarData: {
+      showCapsule: 0, //是否显示左上角图标   1表示显示    0表示不显示
+      title: '', //导航栏 中间的标题
+    },
+    islogin: false,
   },
+
+  onLoad(options) {
+    var that = this;
+    that.onHomeLoad();
+    that.onMeLoad();
+  },
+
   onShow() {
-    if ((!this.data.isOneLoading)) {
-      wx.getStorage({
-        key: 'userInfo',
-        fail(res) {
-          // 取消订阅
-          if (_this.data.thisDeviceMac !== null) {
-            app.unsubscribe(`/${_this.data.thisDeviceMac}/user/pub_response`);
-          };
-          _this.setData({
-            showLogin: true,
-          });
-        },
-        success() {
-          if (app.globalData.newDeviceId) {
-            // 获取设备本地数据
-            _this.getDeviceData();
-          } else if (_this.data.deviceListIndex !== null) {
-            // 更新
-            _this.actionDevice(_this.data.deviceListIndex);
-          }
-        }
-      });
-    };
+    var that = this;
+    that.onHomeShow();
+    that.onMeShow();
   },
-  onLoad() {
+
+  onHomeLoad() {
     _this = this;
     // 版本自动更新代码
     const updateManager = wx.getUpdateManager();
@@ -94,12 +102,59 @@ Page({
         })
       }
     });
-
     // 登录
-    this.login();
+    this.homeLogin();
+  },
+
+  onMeLoad() {
+    // wx.getStorage("userInfo")
+    const _this = this;
+    wx.getStorage({
+      key: "userInfo",
+      success(res) {
+        if (!res.data.phone) {
+          return;
+        };
+        _this.setData({
+          userName: res.data.nickname || "",
+          userPic: res.data.headUrl || "",
+          islogin: true,
+        })
+      }
+    })
+  },
+
+  onHomeShow() {
+    if ((!this.data.isOneLoading)) {
+      wx.getStorage({
+        key: 'userInfo',
+        fail(res) {
+          // 取消订阅
+          if (_this.data.thisDeviceMac !== null) {
+            app.unsubscribe(`/${_this.data.thisDeviceMac}/user/pub_response`);
+          };
+          _this.setData({
+            showLogin: true,
+          });
+        },
+        success() {
+          if (app.globalData.newDeviceId) {
+            // 获取设备本地数据
+            _this.getHomeDeviceData();
+          } else if (_this.data.deviceListIndex !== null) {
+            // 更新
+            _this.actionDevice(_this.data.deviceListIndex);
+          }
+        }
+      });
+    };
+  },
 
+  onMeShow() {
+    this.onLoad();
   },
-  login() {
+
+  homeLogin() {
     wx.login({
       success: res => {
         let phone = undefined;
@@ -112,7 +167,10 @@ Page({
           // Do something when catch error
         };
         // 请求登录
-        login({ code: res.code, phone }).then((res) => {
+        login({
+          code: res.code,
+          phone
+        }).then((res) => {
 
           app.globalData.userInfo = res;
           wx.setStorage({
@@ -127,7 +185,7 @@ Page({
             return;
           };
           // 获取设备本地数据
-          this.getDeviceData();
+          this.getHomeDeviceData();
 
           _this.setData({
             showLogin: false,
@@ -143,7 +201,8 @@ Page({
       },
     })
   },
-  getDeviceData() {
+
+  getHomeDeviceData() {
     // 获取设备数据
     wx.getStorage({
       key: 'devicelist',
@@ -188,6 +247,7 @@ Page({
       }
     });
   },
+
   // 回调
   mqttCallback(type, option) {
     let payloads = null;
@@ -223,7 +283,10 @@ Page({
           const obj = {
             DstDeviceName: _this.getThisDeviceID()
           }
-          app.PubMsg({ type: "get_position", ...obj });
+          app.PubMsg({
+            type: "get_position",
+            ...obj
+          });
         } else if (payloads.type === "get_dev_info") {
           // 接收设备当前信息
           this.getchannelData(payloads.other.ProdModel);
@@ -266,9 +329,9 @@ Page({
         }
         break;
       default:
-
     }
   },
+
   // 格式化电量
   _battery(battery) {
     let _battery = 0;
@@ -287,10 +350,12 @@ Page({
     };
     return _battery
   },
+
   connectSuccess() {
     // 订阅设备在线信息
     _this.subscribeDevicesStatus();
   },
+
   online(payloads) {
     // 设置在线状态
     _this.data.deviceList.map((v, index) => {
@@ -331,6 +396,7 @@ Page({
       });
     };
   },
+
   // 订阅设备在线状态
   subscribeDevicesStatus() {
     this.data.deviceList.forEach((value) => {
@@ -339,7 +405,6 @@ Page({
     })
   },
 
-  // 订阅消息
   subscribeCurrDevice() {
     if (!(app.globalData.client && app.globalData.client.connected)) {
       console.log("未连接MQTT服务器");
@@ -357,15 +422,18 @@ Page({
     const obj = {
       DstDeviceName: _this.getThisDeviceID()
     };
-    app.PubMsg({ type: "get_dev_info", ...obj });
+    app.PubMsg({
+      type: "get_dev_info",
+      ...obj
+    });
   },
 
   isShowDevicelistFun() {
     this.setData({
       isShowDevicelist: !_this.data.isShowDevicelist
     })
-
   },
+
   actionMusic(e) {
     if (e.currentTarget.dataset.index === this.data.actionIndex) {
       return;
@@ -450,7 +518,9 @@ Page({
     if (this.data.deviceListIndex === null) {
       return;
     };
-    listByDevice({ clientType }).then((res) => {
+    listByDevice({
+      clientType
+    }).then((res) => {
       _this.setData({
         channelData: res
       });
@@ -458,7 +528,10 @@ Page({
       const obj = {
         DstDeviceName: _this.getThisDeviceID()
       }
-      app.PubMsg({ type: "get_position", ...obj });
+      app.PubMsg({
+        type: "get_position",
+        ...obj
+      });
       wx.setStorage({
         key: "channelData",
         data: res
@@ -597,4 +670,49 @@ Page({
     app.globalData.client.end(true);
     app.globalData.client = null;
   },
-})
+
+  onTapIndex(e) {
+    var that = this;
+    var index = e.currentTarget.dataset.index;
+    var indexPage = that.data.indexPage;
+    if (indexPage != index) {
+      that.setData({
+        indexPage: index,
+      });
+    }
+  },
+
+  goMeAbout() {
+    wx.navigateTo({
+      url: './../about/about',
+    })
+  },
+
+  goMeLogin() {
+    const _this = this;
+    if (this.data.islogin) {
+      // 退出登录
+      wx.removeStorage({
+        key: 'userInfo',
+        success(res) {
+          _this.setData({
+            islogin: false,
+            userName: "未登录",
+            userPic: "./../../img/head_pic.png",
+          });
+          wx.switchTab({
+            url: `./../index/index`
+          });
+        }
+      });
+      wx.removeStorage({
+        key: 'token',
+      })
+    } else {
+      // 登录
+      wx.navigateTo({
+        url: './../login/login',
+      });
+    }
+  },
+})

+ 3 - 1
pages/index/index.json

@@ -1,3 +1,5 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "nav-bar": "./../components/navbar/navbar"
+  }
 }

+ 141 - 100
pages/index/index.wxml

@@ -1,27 +1,33 @@
 <!--index.wxml-->
+
+<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" navbar-data='{{nvabarData}}'>
+</nav-bar>
+
 <view class="container">
-  <view class='nav-wrap' style='height: calc({{navBarHeight}}px - {{MenuButtonTop}}px); padding-top: {{MenuButtonTop}}px;'>
-     <view wx:if="{{deviceList && deviceList.length > 0 && !showLogin}}" bindtap="isShowDevicelistFun" class="nav-info" style="height: {{ MenuButtonheight }}px;">
-        <image class="device-pic" mode="heightFix"  src="./../../img/min.png"></image>
+  <view wx:if="{{indexPage==0}}" class="mair" style="height: calc(100vh - 150rpx - {{navBarHeight}}px);">
+    <view class='nav-wrap' style='height: calc({{navBarHeight}}px - {{MenuButtonTop}}px); padding-top: {{MenuButtonTop}}px;'>
+      <view wx:if="{{deviceList && deviceList.length > 0 && !showLogin}}" bindtap="isShowDevicelistFun" class="nav-info" style="height: {{ MenuButtonheight }}px;">
+        <image class="device-pic" mode="heightFix" src="./../../img/min.png"></image>
         <text>{{deviceList[deviceListIndex].devName}}</text>
         <image class="j" mode="heightFix" src="./../../img/{{isShowDevicelist ? 'j_top' : 'j_bottom'}}.png"></image>
-     </view>
-     
-     <view style="height: {{ MenuButtonheight }}px;" bindtap="goDeviceConnect" class="nav-info" wx:elif="{{deviceList && deviceList.length === 0 && !showLogin}}" >
-      <image class="z" mode="heightFix" src="./../../img/z.png"></image>
-      <text>连接设备</text>
+      </view>
+
+      <view style="height: {{ MenuButtonheight }}px;" bindtap="goDeviceConnect" class="nav-info" wx:elif="{{deviceList && deviceList.length === 0 && !showLogin}}">
+        <image class="z" mode="heightFix" src="./../../img/z.png"></image>
+        <text>连接设备</text>
+      </view>
+
+      <view style="height: {{ MenuButtonheight }}px;" wx:elif="{{showLogin}}" class="nav-info">
+        <image class="z" mode="heightFix" src="./../../img/z.png"></image>
+        <text bindtap="goLogin">点击登录</text>
+      </view>
     </view>
-    
-     <view style="height: {{ MenuButtonheight }}px;" wx:elif="{{showLogin}}" class="nav-info" >
-      <image class="z" mode="heightFix" src="./../../img/z.png"></image>
-      <text bindtap="goLogin">点击登录</text>
-     </view>
-  </view>
-  <view class="mair" style="height: calc(100vh - 22rpx - {{navBarHeight}}px);">
+
+    <!--播放信息-->
     <view wx:if="{{isShowDevicelist}}" class="deviceList" catchtap="isShowDevicelistFun">
       <view class="mz">
-        <view class="li-view"  wx:for="{{deviceList}}">
-          <view bindtap="actionDeviceIndex" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.6'}};" data-index="{{index}}"class="li {{deviceListIndex === index ? 'action' : ''}}">
+        <view class="li-view" wx:for="{{deviceList}}">
+          <view bindtap="actionDeviceIndex" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.6'}};" data-index="{{index}}" class="li {{deviceListIndex === index ? 'action' : ''}}">
             <image mode="widthFix" src="./../../img/min.png"></image>
             <text class="deviceName">{{item.devName}}</text>
             <text class="onli">{{item.state && item.state === "online" ? "在线" : "离线"}}</text>
@@ -29,108 +35,144 @@
           </view>
         </view>
         <view class="but" style="width: 100%; float: left;">
-          <view  wx:if="{{!showDelete}}"><text style="background-color: #999;" catchtap="showDelete">删除</text></view>
-          <view  wx:if="{{!showDelete}}"><text bindtap="goDeviceConnect">新增</text></view>
-          <view  wx:else><text catchtap="showDelete">完成</text></view>
+          <view wx:if="{{!showDelete}}"><text style="background-color: #999;" catchtap="showDelete">删除</text></view>
+          <view wx:if="{{!showDelete}}"><text bindtap="goDeviceConnect">新增</text></view>
+          <view wx:else><text catchtap="showDelete">完成</text></view>
         </view>
       </view>
     </view>
-    <view class="play-info">
-      <view class="info">
-        <image src="./../../img/blak.png" class="black" mode="scaleToFill"></image>
-        <image src="./../../img/mm.png" class="mode" mode="scaleToFill"></image>
-        <image class="logo" mode="heightFix" src="./../../img/logo.png"></image>
-        <view wx:if="{{actionIndex !== null}}" style="opacity: 0.8; text-shadow:0px 0px 4px #6D00FF;" class="fm">FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}}</view>
-        <view wx:if="{{actionIndex !== null}}" style="opacity: 1;" class="fm">FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}} 
-          <image class="gochnnalList" mode="heightFix" src="./../../img/a6.png"></image>
+  </view>
+
+  <view wx:else>
+    <!-- 连接设备启用以下版本 -->
+    <view wx:if="{{indexPage==1}}" class="mair" style="height: calc(100vh - 150rpx - {{navBarHeight}}px);">
+      <view class="play-info">
+        <view class="info">
+          <image src="./../../img/blak.png" class="black" mode="scaleToFill"></image>
+          <image src="./../../img/mm.png" class="mode" mode="scaleToFill"></image>
+          <image class="logo" mode="heightFix" src="./../../img/logo.png"></image>
+          <view wx:if="{{actionIndex !== null}}" style="opacity: 0.8; text-shadow:0px 0px 4px #6D00FF;" class="fm">FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}}</view>
+              <view wx:if="{{actionIndex !== null}}" style="opacity: 1;" class="fm">FM.{{actionIndex !== null ? (actionIndex + 1 < 10 ? "0" + (actionIndex + 1) : actionIndex + 1) : 00}} <image class="gochnnalList" mode="heightFix" src="./../../img/a6.png">
+                  </image>
+              </view>
+              <view class="fmMod" bindtap="goChnnel"></view>
+              <view wx:if="{{actionIndex !== null}}" class="thisMusic">
+                <text>当前播放:</text>
+                <view class="scroll-box">
+                  <view class="scroll-wrap">
+                    <view class="scroll-item">{{channelData[actionIndex].channelName}}</view>
+                  </view>
+                </view>
+              </view>
+              <image src="{{'./../../img/dl' + battery + '.png'}}" class="battery" mode="scaleToFill"></image>
+          </view>
+          <view class="wakeMode" bindtap="goWake">
+            <image src="./../../img/woak.png" class="mode" mode="scaleToFill"></image>
+            <image class="wake" mode="heightFix" src="{{isSetWake ? './../../img/n24.png' : './../../img/n23.png' }}"></image>
+            <text>定时</text>
+          </view>
         </view>
-        <view class="fmMod" bindtap="goChnnel"></view>
-        <view wx:if="{{actionIndex !== null}}" class="thisMusic">
-          <text>当前播放:</text>
-          <view class="scroll-box">
-            <view class="scroll-wrap">
-              <view class="scroll-item">{{channelData[actionIndex].channelName}}</view>
+
+        <scroll-view class="pd" scroll-y="true">
+          <view class="conm" wx:if="{{channelData && channelData.length > 0}}">
+            <image mode="scaleToFill" class="cz" src="./../../img/cz.png"></image>
+            <view class="musicList">
+              <view wx:for="{{channelData}}" class="li {{index === actionIndex ? 'action' : ' '}}">
+                <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="zz" src="./../../img/zz.png"></image>
+                <text class="lm">{{luoma[index]}}</text>
+                <view class="musicInfo" data-index="{{index}}" bindtap="actionMusic">
+                  <image mode="scaleToFill" class="pic" src="{{item.channelPic ? item.channelPic : './../../img/head_pic.png'}}"></image>
+                  <text>{{item.channelName}}</text>
+                  <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="svg" src="./../../svg/audio.svg"></image>
+                </view>
+              </view>
             </view>
+            <!-- <image src="./../../svg/audio.svg"></image> -->
           </view>
-        </view>
-        <image src="{{'./../../img/dl' + battery + '.png'}}" class="battery" mode="scaleToFill"></image>
-      </view>
-      <view class="wakeMode" bindtap="goWake">
-        <image src="./../../img/woak.png" class="mode" mode="scaleToFill"></image>
-        <image class="wake" mode="heightFix" src="{{isSetWake ? './../../img/n24.png' : './../../img/n23.png' }}"></image>
-        <text>定时</text>
-      </view>
-    </view>
-    <scroll-view class="pd" scroll-y="true">
-      <view class="conm" wx:if="{{channelData && channelData.length > 0}}">
-        <image mode="scaleToFill" class="cz" src="./../../img/cz.png"></image>
-        <view class="musicList" >
-          <view wx:for="{{channelData}}" class="li {{index === actionIndex ? 'action' : ' '}}">
-           <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="zz" src="./../../img/zz.png"></image>
-            <text class="lm">{{luoma[index]}}</text>
-            <view class="musicInfo" data-index="{{index}}" bindtap="actionMusic">
-              <image mode="scaleToFill" class="pic" src="{{item.channelPic ? item.channelPic : './../../img/head_pic.png'}}"></image>
-              <text>{{item.channelName}}</text>
-              <image mode="scaleToFill" wx:if="{{index === actionIndex}}" class="svg" src="./../../svg/audio.svg"></image> 
+        </scroll-view>
+
+        <!-- 登录启用以下版本 -->
+        <view class="gologin" wx:if="{{showLogin}}">
+          <view class="model">
+            <view bindtap="goLogin" style="position: none; height: auto;" class="loginPic">
+              <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../img/BG_long.png"></image>
+            </view>
+            <view style="position: none; height: calc(100% - 224rpx); overflow: auto;" class="BG_PD">
+              <view>
+                <image style="margin: 0; width: 100vw;" mode="widthFix" src="./../../img/BG_PD.png"></image>
+              </view>
             </view>
           </view>
         </view>
-        <!-- <image src="./../../svg/audio.svg"></image> -->
-      </view>
-    </scroll-view>
-    <!-- 登录 -->
-    <!-- 过审暂时不启用 -->
-    <!-- <view class="gologin" wx:if="{{showLogin}}">
-      <view class="model">
-        <image mode="scaleToFill" src="./../../img/yy.png"></image>
-        <view>
-          <image mode="heightFix" src="./../../img/r.png"></image>
-          <text>享受独有的生活乐趣</text>
-          <view bindtap="goLogin">连接设备</view>
+
+        <view class="gologin goruter" wx:if="{{!showLogin && deviceList && deviceList.length === 0}}">
+          <view class="model">
+            <view bindtap="goDeviceConnect" style="position: none; height: auto;" class="loginPic">
+              <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../img/BG_LJ.png"></image>
+            </view>
+            <view style="position: none; height: calc(100% - 224rpx); overflow: auto;" class="BG_PD">
+              <view>
+                <image style="margin: 0; width: 100vw;" mode="widthFix" src="./../../img/BG_PD.png"></image>
+              </view>
+            </view>
+          </view>
         </view>
       </view>
-    </view> -->
-    <!-- 登录启用以下版本 -->
-    <view class="gologin" wx:if="{{showLogin}}">
-      <view class="model">
-        <view bindtap="goLogin" style="position: none; height: auto;" class="loginPic">
-          <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../img/BG_long.png"></image>
+
+      <view wx:else class="me" style="height: calc(100vh - 132rpx - {{navBarHeight}}px);">
+        <view class="head-logo">
+          <image mode="scaleToFill" src="{{userPic}}"></image>
+          <text class="userName" wx:if="{{userName}}">{{userName}}</text>
         </view>
-        <view style="position: none; height: calc(100% - 224rpx); overflow: auto;" class="BG_PD">
-          <view>
-            <image style="margin: 0; width: 100vw;" mode="widthFix" src="./../../img/BG_PD.png"></image>
+        <view class="br"></view>
+        <view class="list">
+          <view class="li">
+            <view class="icon">
+              <image mode="widthFix" src="./../../img/o.png"></image>
+            </view>
+            <view class="button">
+              <button open-type="feedback">建议与反馈</button>
+              <image class="j" mode="heightFix" src="./../../img/b.png"></image>
+            </view>
           </view>
+          <view class="li">
+            <view class="icon">
+              <image mode="widthFix" src="./../../img/q.png"></image>
+            </view>
+            <view class="button" bindtap="goMeAbout">
+              <text>关于我们</text>
+              <image class="j" mode="heightFix" src="./../../img/b.png"></image>
+            </view>
+          </view>
+        </view>
+        <view wx:if="{{islogin}}" class="login">
+          <view bindtap="goMeLogin" class="{{!islogin ? 'action' : ''}}">{{islogin ? '退出登录' : "登录"}}</view>
         </view>
       </view>
     </view>
-    <!-- 连接设备 -->
-    <!-- 过审暂时不启用 -->
-    <!-- <view class="gologin goruter" wx:if="{{!showLogin && deviceList && deviceList.length === 0}}">
-      <view class="model">
-        <view>
-          <image mode="heightFix" src="./../../img/n.png"></image>
-          <text>开启专属12频道</text>
-          <view bindtap="goDeviceConnect">连接设备</view>
-        </view>
+  </view>
+
+  <view style="height: 130rpx;">
+    <view class="line"></view>
+    <view style="height: 128rpx; text-align: center; display: flex; flex: 1; align-items: center;">
+      <view class="bottom_view" data-index="0" bind:tap="onTapIndex">
+        <image class="bottom_image" mode="widthFix" src="{{indexPage==0?'./../../img/index_action.png':'./../../img/index_unaction.png'}}"></image>
+        <view style="font-size: 30rpx;color: {{indexPage==0?'#A4D099':'black'}}; padding-top: 0rpx;margin-top: 0rpx;"> 首页</view>
       </view>
-    </view> -->
-    <!-- 连接设备启用以下版本 -->
-    <view class="gologin goruter" wx:if="{{!showLogin && deviceList && deviceList.length === 0}}">
-      <view class="model">
-        <view bindtap="goDeviceConnect" style="position: none; height: auto;" class="loginPic">
-          <image style="margin: 20rpx 0 20rpx 0; width: 100vw;" mode="widthFix" src="./../../img/BG_LJ.png"></image>
-        </view>
-        <view style="position: none; height: calc(100% - 224rpx); overflow: auto;" class="BG_PD">
-          <view>
-            <image style="margin: 0; width: 100vw;" mode="widthFix" src="./../../img/BG_PD.png"></image>
-          </view>
-        </view>
+      <view class="bottom_view" data-index="1" bind:tap="onTapIndex">
+        <image class="bottom_image" mode="widthFix" src="{{indexPage==1?'./../../img/me_action.png':'./../../img/me_unaction.png'}}"></image>
+        <view style="font-size: 30rpx;color: {{indexPage==1?'#A4D099':'black'}};"> 频道</view>
+      </view>
+      <view class="bottom_view" data-index="2" bind:tap="onTapIndex">
+        <image class="bottom_image" mode="widthFix" src="{{indexPage==2?'./../../img/me_action.png':'./../../img/me_unaction.png'}}"></image>
+        <view style="font-size: 30rpx;color: {{indexPage==2?'#A4D099':'black'}};"> 我的</view>
       </view>
     </view>
   </view>
+
   <view wx:if="{{newVersion}}" class="updataminiwx">
     <view class="mode">
-      <image class="bg" src="./../../img/BG@2x.png" ></image>
+      <image class="bg" src="./../../img/BG@2x.png"></image>
       <view class="updata-view">
         <image src="./../../img/sj.png"></image>
         <text class="title">更新检测</text>
@@ -140,6 +182,5 @@
           <text bindtap="updata" class="twoBut">确定</text>
         </view>
       </view>
-    </view> 
-  </view>
-</view>
+    </view>
+  </view>

文件差异内容过多而无法显示
+ 720 - 537
pages/index/index.wxss


+ 9 - 7
pages/login/login.js

@@ -1,6 +1,8 @@
 // pages/login/login.ts;
 const app = getApp();
-const { register }=require('./../../utils/api.js')
+const {
+  register
+} = require('./../../utils/api.js')
 Page({
 
   /**
@@ -79,7 +81,7 @@ Page({
   onShareAppMessage() {
 
   },
-  getPhoneNumber (e) {
+  getPhoneNumber(e) {
     console.log(e)
     if (e.detail.errMsg != "getPhoneNumber:ok") {
       wx.showToast({
@@ -89,23 +91,23 @@ Page({
       });
       return;
     }
-    if(e.detail.code) {
+    if (e.detail.code) {
       register({
         openid: app.globalData.userInfo.openid,
         code: e.detail.code,
-      }).then((res)=> {
+      }).then((res) => {
         wx.showToast({
           title: "登陆成功",
           icon: 'success',
           duration: 2000
         });
         wx.setStorage({
-          key:"userInfo",
+          key: "userInfo",
           data: res,
           success() {
-            setTimeout(()=> {
+            setTimeout(() => {
               // 重新登录
-              getCurrentPages()[0].login();
+              getCurrentPages()[0].homeLogin();
               wx.redirectTo({
                 url: './../deviceConnect0/deviceConnect0?isLognlink=0'
               });

+ 3 - 46
pages/me/me.js

@@ -1,5 +1,3 @@
-
-
 // pages/me/me.ts
 const app = getApp();
 
@@ -28,7 +26,7 @@ Page({
     wx.getStorage({
       key: "userInfo",
       success(res) {
-        if(!res.data.phone){
+        if (!res.data.phone) {
           return;
         };
         _this.setData({
@@ -47,11 +45,11 @@ Page({
   gologin() {
     // 
     const _this = this;
-    if(this.data.islogin){
+    if (this.data.islogin) {
       // 退出登录
       wx.removeStorage({
         key: 'userInfo',
-        success (res) {
+        success(res) {
           _this.setData({
             islogin: false,
             userName: "未登录",
@@ -71,13 +69,6 @@ Page({
         url: './../login/login',
       });
     }
-    
-  },
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
   },
 
   /**
@@ -87,40 +78,6 @@ Page({
     this.onLoad();
   },
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  },
   goDownload() {
     wx.navigateTo({
       url: './../download/download',

+ 7 - 0
project.private.config.json

@@ -9,6 +9,13 @@
     "miniprogram": {
       "list": [
         {
+          "name": "pages/indexes/indexes",
+          "pathName": "pages/indexes/indexes",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
           "name": "",
           "pathName": "pages/index/index",
           "query": "",