2 次代码提交 5659bd74f6 ... b2f734e3c7

作者 SHA1 备注 提交日期
  chenyi406 b2f734e3c7 重构代码 2 年之前
  chenyi406 32af5d2b53 重构代码 2 年之前
共有 76 个文件被更改,包括 779 次插入1090 次删除
  1. 53 132
      app.js
  2. 7 6
      app.json
  3. 82 18
      app.wxss
  4. 二进制
      imgs/My/banner.png
  5. 二进制
      imgs/My/device.png
  6. 二进制
      imgs/My/info.png
  7. 二进制
      imgs/My/set.png
  8. 二进制
      imgs/My/track.png
  9. 0 0
      imgs/arrows.png
  10. 二进制
      imgs/battery_1.png
  11. 二进制
      imgs/battery_2.png
  12. 二进制
      imgs/center.png
  13. 二进制
      imgs/device/default.png
  14. 二进制
      imgs/device/more.png
  15. 二进制
      imgs/navIcon/Location.png
  16. 二进制
      imgs/navIcon/LocationS.png
  17. 二进制
      imgs/refresh.png
  18. 二进制
      imgs/set/arrows.png
  19. 二进制
      imgs/set/base.png
  20. 二进制
      imgs/set/broadcast.png
  21. 0 0
      imgs/set/call.png
  22. 二进制
      imgs/set/concats.png
  23. 二进制
      imgs/set/contacts.png
  24. 二进制
      imgs/set/continue.png
  25. 二进制
      imgs/set/device.png
  26. 二进制
      imgs/set/idioms.png
  27. 二进制
      imgs/set/upload.png
  28. 二进制
      imgs/set/volume.png
  29. 二进制
      imgs/signal_1.png
  30. 二进制
      imgs/signal_2.png
  31. 二进制
      imgs/signal_3.png
  32. 8 11
      pages/device/add/add.js
  33. 0 0
      pages/device/add/add.json
  34. 16 0
      pages/device/add/add.wxml
  35. 32 0
      pages/device/add/add.wxss
  36. 0 13
      pages/device/addition/addition.wxml
  37. 0 46
      pages/device/addition/addition.wxss
  38. 51 0
      pages/device/list/list.js
  39. 0 0
      pages/device/list/list.json
  40. 13 0
      pages/device/list/list.wxml
  41. 75 0
      pages/device/list/list.wxss
  42. 0 123
      pages/device/manager/manager.js
  43. 0 37
      pages/device/manager/manager.wxml
  44. 0 83
      pages/device/manager/manager.wxss
  45. 45 92
      pages/index/index.js
  46. 1 1
      pages/index/index.json
  47. 20 23
      pages/index/index.wxml
  48. 46 59
      pages/index/index.wxss
  49. 52 12
      pages/my/my.js
  50. 1 0
      pages/my/my.json
  51. 39 25
      pages/my/my.wxml
  52. 50 81
      pages/my/my.wxss
  53. 17 16
      pages/set/broadcast/broadcast.js
  54. 1 1
      pages/set/broadcast/broadcast.json
  55. 19 20
      pages/set/broadcast/broadcast.wxml
  56. 6 6
      pages/set/contacts/contacts.js
  57. 26 37
      pages/set/contacts/contacts.wxml
  58. 41 0
      pages/set/devicename/devicename.js
  59. 3 0
      pages/set/devicename/devicename.json
  60. 8 0
      pages/set/devicename/devicename.wxml
  61. 0 0
      pages/set/devicename/devicename.wxss
  62. 13 12
      pages/set/other/other.js
  63. 3 0
      pages/set/other/other.json
  64. 8 0
      pages/set/other/other.wxml
  65. 3 0
      pages/set/other/other.wxss
  66. 0 77
      pages/set/set.js
  67. 0 3
      pages/set/set.json
  68. 0 44
      pages/set/set.wxml
  69. 0 48
      pages/set/set.wxss
  70. 0 3
      pages/set/uploadData/uploadData.json
  71. 0 10
      pages/set/uploadData/uploadData.wxml
  72. 6 6
      pages/set/volume/volume.js
  73. 1 1
      pages/set/volume/volume.json
  74. 16 19
      pages/set/volume/volume.wxml
  75. 6 19
      pages/welcome/welcome.js
  76. 11 6
      project.config.json

+ 53 - 132
app.js

@@ -1,91 +1,40 @@
-const appUrl = "https://www.mang406.top/omp/api/wx/";
-// const appUrl = "http://localhost:8081/omp/api/wx/";
+// const appUrl = "https://www.mang406.top/omp/api/wx/";
+const appUrl = "http://localhost:8081/omp/api/wx/";
 let lock = false;
 App({
   onLaunch: function () { },
 
-  // 自定义页面跳转
-  Route: {
-    path: {
-      my: "/pages/my/my",
-      set: "/pages/set/set",
-      uploadData: "/pages/set/uploadData/uploadData",
-      contacts: "/pages/set/contacts/contacts",
-      volume: "/pages/set/volume/volume",
-      idioms: "/pages/set/idioms/idioms",
-      broadcast: "/pages/set/broadcast/broadcast",
-
-      manager: "/pages/device/manager/manager",
-      addition: "/pages/device/addition/addition",
-      index: "/pages/index/index",
-      location: "/pages/location/location",
-      track: "/pages/track/track",
-    },
-    //跳转页面
-    routeTo: function (path, params) {
-      let url = "";
-      if (params === undefined) url = path;
-      else {
-        const arr = Object.keys(params);
-        url += "?"
-        for (let i = 0; i < arr.length; i++) {
-          url = url + arr[i] + "=" + params[arr[i]] + "&";
-        }
-        url = url.substring(0, url.length - 1);
-      }
-      wx.navigateTo({
-        url: url,
-      })
-    }
-  },
-
   Url: {
-    //登录
+    // 登录
     login: appUrl + "user/login.do",
-
-    // 获取设备位置信息
-    getLocation: appUrl + "location/getLocation.do",
-    // 获取设备位置信息-历史轨迹
-    getLocationHistory: appUrl + "location/getHistory.do",
-
+    // 获取设备最新位置信息
+    getLatestState: appUrl + "device/getLatestState.do",
+    // 获取用户设备集合
+    getDeviceList: appUrl + "device/getListByOpenId.do",
+    //修改默认设备
+    changeDefault: appUrl + "device/changeDefault.do",
     //添加用户设备绑定关系
     bind: appUrl + "device/bind.do",
-    //删除绑定关系
-    unbind: appUrl + "device/unbind.do",
+    //获取默认的设备
+    getDefaultDevice: appUrl + "device/getDefaultDevice.do",
     // 修改设备名称
-    modifyDeviceName: appUrl + "device/updateName.do",
-    //获取设备集合
-    getListByUserId: appUrl + "device/getListByUserId.do",
-    //修改默认设备
-    changeDefaultDevice: appUrl + "device/changeDefault.do",
-
-
-    // 获取用户常用语
-    getUserIdioms: appUrl + "idioms/getList.do",
-    // 添加用户常用语
-    addUserIdioms: appUrl + "idioms/save.do",
-    // 删除用户常用语
-    deleteUserIdioms: appUrl + "idioms/delById.do",
-
+    updateName: appUrl + "device/updateName.do",
     //获取音量设置
     getVolume: appUrl + "setInfo/volume.do",
-    //获取联系人设置
-    getSos: appUrl + "setInfo/sos.do",
-    //获取其他设置
-    getOther: appUrl + "setInfo/other.do",
-
     //设置功能-音量
     setVolume: appUrl + "set/volume.do",
-    //设置功能-自动接听
-    setAutoAnswer: appUrl + "set/autoAnswer.do",
-    //设置功能-持续定位
-    setContinue: appUrl + "set/continue.do",
+    //获取联系人设置
+    getSos: appUrl + "setInfo/sos.do",
     //设置功能-联系人
     setSos: appUrl + "set/sos.do",
-    //设置功能-定位频率
-    setGpsRate: appUrl + "set/gpsRate.do",
     //设置功能-语音播报
     setNews: appUrl + "set/news.do",
+    //获取其他设置
+    getOther: appUrl + "setInfo/other.do",
+    //设置功能-定位频率
+    setGpsRate: appUrl + "set/gpsRate.do",
+    //设置功能-持续定位
+    setContinue: appUrl + "set/continue.do",
   },
 
   /**
@@ -95,32 +44,19 @@ App({
   Get: function (url, params, showLoading) {
     const that = this;
     if (showLoading) wx.showLoading();
+
     return new Promise((resolve, reject) => {
       wx.request({
         url: url,
         header: {
+          "verify": "omp",
           "user": that.globalData.openId
         },
         data: params,
         success: function (res) {
-          console.log(url);
-          console.log(res.data);
-          console.log("-------------------------------------------------------")
-          if (showLoading) wx.hideLoading();
-          //请求成功回调函数
-          switch (res.data.status) {
-            case 200: //成功
-              resolve(res.data);
-              break;
-            case 300: //警告
-              that.Modal.tips(res.data.msg);
-              break;
-            case 500: //服务器异常
-              that.Modal.tips("服务器开小差了");
-              break;
-          }
+          that.success(url, resolve, res);
         },
-        fail: function () { //失败
+        fail: function () {
           console.log("网络异常:" + url);
           that.Modal.tips("网络异常")
         },
@@ -133,12 +69,6 @@ App({
    */
   Post: function (url, params) {
     const that = this;
-    if (lock) {
-      that.Modal.tips("您的请求太快了");
-      return;
-    } else {
-      lock = true; //加锁
-    }
     wx.showLoading();
     return new Promise((resolve, reject) => {
       wx.request({
@@ -147,38 +77,43 @@ App({
         header: {
           "user": that.globalData.openId,
           "Content-Type": "application/x-www-form-urlencoded",
+          "verify": "omp"
         },
         data: params,
         success: function (res) {
-          console.log(url);
-          console.log(res.data);
-          console.log("-------------------------------------------------------")
-          wx.hideLoading();
-          //请求成功回调函数
-          switch (res.data.status) {
-            case 200: //成功
-              resolve(res.data);
-              break;
-            case 300: //警告
-              that.Modal.tips(res.data.msg);
-              break;
-            case 500: //服务器异常
-              console.log(res)
-              that.Modal.tips("服务器开小差了");
-              break;
-          }
+          that.success(url, resolve, res);
         },
-        fail: function () { //失败
+        fail: function () {
           console.log("网络异常:" + url);
           that.Modal.tips("网络异常")
-        },
-        complete: function () {
-          lock = false; //解锁
         }
       })
     })
   },
 
+  /**
+   * 请求成功回调函数
+   */
+  success: function (url, resolve, res) {
+    console.log(url);
+    console.log(res.data);
+    console.log("-------------------------------------------------------")
+    wx.hideLoading();
+    //请求成功回调函数
+    switch (res.data.status) {
+      case 200: //成功
+        resolve(res.data);
+        break;
+      case 300: //警告
+        this.Modal.tips(res.data.msg);
+        break;
+      case 500: //服务器异常
+        console.log(res)
+        this.Modal.tips("服务器开小差了");
+        break;
+    }
+  },
+
   /**
    * 弹出层
    */
@@ -197,21 +132,7 @@ App({
    * 静态数据
    */
   globalData: {
-    openId: null,
-    deviceList: null,
-  },
-
-  /**
-   * 获取设备集合
-   */
-  getDeviceList: function () {
-    return this.globalData.deviceList == null ? [] : this.globalData.deviceList;
-  },
-
-  /**
-   * 获取当前设备的信息
-   */
-  getCurrentDevice: function () {
-    return (this.globalData.deviceList == null || this.globalData.deviceList == []) ? null : this.globalData.deviceList[0];
-  },
+    openId: "O+i+s1mSwU2sVfojgKde6sUW5zgr+q3fCLJaWTDiI1o=",
+    openNum: "867435051513166",
+  }
 })

+ 7 - 6
app.json

@@ -1,20 +1,21 @@
 {
   "pages": [
     "pages/welcome/welcome",
-    "pages/device/manager/manager",
-    "pages/set/set",
+    "pages/set/other/other",
+    "pages/my/my",
+    "pages/set/devicename/devicename",
     "pages/set/broadcast/broadcast",
     "pages/set/contacts/contacts",
     "pages/set/volume/volume",
-    "pages/set/uploadData/uploadData",
+    "pages/device/list/list",
+    "pages/device/add/add",
     "pages/index/index",
-    "pages/track/track",
-    "pages/my/my"
+    "pages/track/track"
   ],
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#5D88FF",
-    "navigationBarTitleText": "华航置云",
+    "navigationBarTitleText": "老人机定位",
     "navigationBarTextStyle": "white"
   },
 

+ 82 - 18
app.wxss

@@ -1,9 +1,73 @@
 page {
   width: 100%;
   height: 100%;
-  color: rgb(15, 15, 15);
+  background-color: var(--White);
+  font-size: 28rpx;
+  color: var(--black);
+
+  --red: #e54d42;
+  --orange: #f37b1d;
+  --yellow: #fbbd08;
+  --olive: #8dc63f;
+  --green: #39b54a;
+  --cyan: #1cbbb4;
+  --blue: #0081ff;
+  --purple: #6739b6;
+  --mauve: #9c26b0;
+  --pink: #e03997;
+  --brown: #a5673f;
+  --grey: #8799a3;
+  --black: #333333;
+  --darkGray: #666666;
+  --gray: #aaaaaa;
+  --ghostWhite: #f1f1f1;
+  --white: #ffffff;
+  --border: #F6F6F6;
+  --theme: #5D88FF;
+  /* 浅色 */
+  --redLight: #fadbd9;
+  --orangeLight: #fde6d2;
+  --yellowLight: #fef2ce;
+  --oliveLight: #e8f4d9;
+  --greenLight: #d7f0db;
+  --cyanLight: #d2f1f0;
+  --blueLight: #cce6ff;
+  --purpleLight: #e1d7f0;
+  --mauveLight: #ebd4ef;
+  --pinkLight: #f9d7ea;
+  --brownLight: #ede1d9;
+  --greyLight: #e7ebed;
+  /* 渐变色 */
+  --gradualRed: linear-gradient(45deg, #f43f3b, #ec008c);
+  --gradualOrange: linear-gradient(45deg, #ff9900c4, #ed1c23c4);
+  --gradualGreen: linear-gradient(45deg, #39b54a, #8dc63f);
+  --gradualPurple: linear-gradient(45deg, #9000ff, #5e00ff);
+  --gradualPink: linear-gradient(45deg, #ec008c, #6739b6);
+  --gradualBlue: linear-gradient(45deg, #0081ff, #1cbbb4);
+  /* 阴影透明色 */
+  --ShadowSize: 6rpx 6rpx 8rpx;
+  --redShadow: rgba(204, 69, 59, 0.2);
+  --orangeShadow: rgba(217, 109, 26, 0.2);
+  --yellowShadow: rgba(224, 170, 7, 0.2);
+  --oliveShadow: rgba(124, 173, 55, 0.2);
+  --greenShadow: rgba(48, 156, 63, 0.2);
+  --cyanShadow: rgba(28, 187, 180, 0.2);
+  --blueShadow: rgba(0, 102, 204, 0.2);
+  --purpleShadow: rgba(88, 48, 156, 0.2);
+  --mauveShadow: rgba(133, 33, 150, 0.2);
+  --pinkShadow: rgba(199, 50, 134, 0.2);
+  --brownShadow: rgba(140, 88, 53, 0.2);
+  --greyShadow: rgba(114, 130, 138, 0.2);
+  --grayShadow: rgba(114, 130, 138, 0.2);
+  --blackShadow: rgba(26, 26, 26, 0.2);
 }
 
+/* 按钮样式 */
+button::after {
+  border: none !important;
+}
+
+
 .wx-switch-input {
   transform: scale(.7);
 }
@@ -39,9 +103,9 @@ button::after {
   text-align: center;
   margin: 50rpx auto 0;
   width: 60%;
-  line-height: 60rpx;
-  height: 60rpx;
-  font-size: 30rpx;
+  line-height: 66rpx;
+  height: 66rpx;
+  font-size: 28rpx;
   color: white;
   background: #5D88FF;
 }
@@ -59,43 +123,43 @@ button::after {
 }
 
 /* 表单空白块 */
-.white-block {
+.form {
+  display: block;
   position: relative;
   background: white;
   width: 100%;
   box-sizing: border-box;
-  padding: 30rpx 30rpx 50rpx;
-  margin-top: 30rpx;
+  padding: 20rpx 30rpx;
 }
 
 /* 表单行 */
 .form-item {
-  overflow: hidden;
-  margin-bottom: 20rpx;
   position: relative;
-  padding-left: 180rpx;
   width: 100%;
-  height: 70rpx;
-  line-height: 70rpx;
+  height: 80rpx;
+  line-height: 80rpx;
   box-sizing: border-box;
+  padding-left: 170rpx;
+  margin-bottom: 10rpx;
 }
 
-.form-item .label {
+.form-item-label {
   position: absolute;
   top: 0;
   left: 0;
-  color: #333;
+  color: var(--darkGray);
   text-align: right;
-  width: 160rpx;
-  font-size: 30rpx;
+  width: 150rpx;
+  font-size: 28rpx;
 }
 
-.form-item .input-normal {
+.form-item-input-normal {
+  color: var(--black);
   width: 100%;
   height: 100%;
   border-bottom: 2rpx dashed #eee;
   box-sizing: border-box;
-  font-size: 28rpx;
+  font-size: 30rpx;
 }
 
 .block-title {

二进制
imgs/My/banner.png


二进制
imgs/My/device.png


二进制
imgs/My/info.png


二进制
imgs/My/set.png


二进制
imgs/My/track.png


+ 0 - 0
imgs/My/arrows.png → imgs/arrows.png


二进制
imgs/battery_1.png


二进制
imgs/battery_2.png


二进制
imgs/center.png


二进制
imgs/device/default.png


二进制
imgs/device/more.png


二进制
imgs/navIcon/Location.png


二进制
imgs/navIcon/LocationS.png


二进制
imgs/refresh.png


二进制
imgs/set/arrows.png


二进制
imgs/set/base.png


二进制
imgs/set/broadcast.png


+ 0 - 0
imgs/set/auto_answer.png → imgs/set/call.png


二进制
imgs/set/concats.png


二进制
imgs/set/contacts.png


二进制
imgs/set/continue.png


二进制
imgs/set/device.png


二进制
imgs/set/idioms.png


二进制
imgs/set/upload.png


二进制
imgs/set/volume.png


二进制
imgs/signal_1.png


二进制
imgs/signal_2.png


二进制
imgs/signal_3.png


+ 8 - 11
pages/device/addition/addition.js → pages/device/add/add.js

@@ -28,28 +28,25 @@ Page({
    */
   submit: function (form) {
     const params = {
-      name: form.detail.value.deviceName,
-      deviceNum: form.detail.value.deviceNum,
+      deviceName: form.detail.value.deviceName,
+      openNum: form.detail.value.openNum,
     }
-    if (params.deviceNum == null || params.deviceNum === "") {
+    if (params.openNum == null || params.openNum == "") {
       APP.Modal.tips("请输入设备码!")
       return;
     }
-    if (params.name == null || params.name === "") {
+    if (params.deviceName == null || params.deviceName == "") {
       APP.Modal.tips("请输入设备名称!")
       return;
     }
     //禁用提交按钮
     this.setData({
-      deviceNum: "",
+      openNum: "",
       deviceName: "",
     })
     APP.Post(APP.Url.bind, params).then(res => {
-      //更新设备集合
-      APP.Get(APP.Url.getListByUserId, params, false).then(res => {
-        APP.globalData.deviceList = res.data;
-        APP.Modal.tips("添加成功!");
-      })
+      APP.Modal.tips("添加成功!");
     })
-  },
+  }
+
 })

+ 0 - 0
pages/device/addition/addition.json → pages/device/add/add.json


+ 16 - 0
pages/device/add/add.wxml

@@ -0,0 +1,16 @@
+<form bindsubmit="submit" class="form">
+  <view class="form-item">
+    <text class="form-item-label">设备IMEI:</text>
+    <input type="text" name="openNum" value="{{openNum}}" class="form-item-input-normal"></input>
+  </view>
+  <view class="form-item">
+    <text class="form-item-label">设备名称:</text>
+    <input type="text" name="deviceName" value="{{deviceName}}" class="form-item-input-normal"></input>
+  </view>
+  <button class="button-small" form-type="submit">添加设备</button>
+</form>
+
+<view class="block">
+  <image src="/imgs/device/scan.png" bindtap="scanCode"></image>
+  <view>点击开始扫码</view>
+</view>

+ 32 - 0
pages/device/add/add.wxss

@@ -0,0 +1,32 @@
+page {
+  box-sizing: border-box;
+  background: #F3F5F9;
+}
+
+.block {
+  width: 710rpx;
+  height: 650rpx;
+  background: white;
+  margin: 20rpx auto;
+  overflow: hidden;
+}
+
+.block image {
+  display: block;
+  width: 420rpx;
+  height: 400rpx;
+  margin: 50rpx auto;
+}
+
+.block view {
+  width: 450rpx;
+  height: 80rpx;
+  margin: 50rpx auto;
+  text-align: center;
+  color: white;
+  background: #5D88FF;
+  line-height: 80rpx;
+  border-radius: 40rpx;
+  font-size: 32rpx;
+
+}

+ 0 - 13
pages/device/addition/addition.wxml

@@ -1,13 +0,0 @@
-<image class="icon" src="/imgs/device/scan.png" bindtap="scanCode"></image>
-
-<form bindsubmit="submit">
-	<view class="item">
-		<image src="/imgs/device/phone.png"></image>
-		<input type="text" name="deviceNum" placeholder="点击上图扫描或输入设备码" value="{{deviceNum}}"></input>
-	</view>
-	<view class="item">
-		<image src="/imgs/device/phone.png"></image>
-		<input type="text" name="deviceName" value="{{deviceName}}" placeholder="请输入设备名称"></input>
-	</view>
-	<button class="button-normal" form-type="submit">添加设备</button>
-</form>

+ 0 - 46
pages/device/addition/addition.wxss

@@ -1,46 +0,0 @@
-page {
-  width: 100%;
-  height: 100%;
-  overflow: hidden;
-}
-
-.icon {
-  display: block;
-  margin: 150rpx auto 80rpx;
-  width: 420rpx;
-  height: 400rpx;
-}
-
-.item {
-  overflow: hidden;
-  box-sizing: border-box;
-  width: 600rpx;
-  height: 90rpx;
-  margin: 0 auto;
-}
-
-.item image {
-  margin-top: 10rpx;
-  float: left;
-  width: 70rpx;
-  height: 70rpx;
-}
-
-.item input {
-  box-sizing: border-box;
-  border-bottom: 2rpx solid #eee;
-  margin-left: 30rpx;
-  float: left;
-  width: 500rpx;
-  height: 90rpx;
-  line-height: 90rpx;
-  font-size: 36rpx;
-  color: #666;
-}
-
-.button-normal {
-  font-size: 38rpx;
-  width: 400rpx !important;
-  height: 90rpx;
-  line-height: 90rpx;
-}

+ 51 - 0
pages/device/list/list.js

@@ -0,0 +1,51 @@
+const APP = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    devices: []
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getList();
+  },
+
+  /**
+   * 设备列表
+   */
+  getList: function () {
+    const param = {
+      openId: APP.globalData.openId
+    }
+    APP.Get(APP.Url.getDeviceList, param).then(res => {
+      this.setData({
+        devices: res.data
+      })
+    })
+  },
+
+  /**
+   * 切换当前设备
+   */
+  changeDevice: function (event) {
+    const params = {
+      openNum: event.currentTarget.dataset.opennum
+    }
+    APP.Post(APP.Url.changeDefault, params).then(res => {
+      APP.Modal.tips("切换成功");
+      this.getList();
+    })
+  },
+
+
+  toAdd: function () {
+    wx.navigateTo({
+      url: '/pages/device/add/add',
+    })
+  }
+})

+ 0 - 0
pages/device/manager/manager.json → pages/device/list/list.json


+ 13 - 0
pages/device/list/list.wxml

@@ -0,0 +1,13 @@
+<view class="item-box" wx:for="{{devices}}" wx:key="openNum" bindtap="changeDevice" data-opennum="{{item.openNum}}">
+  <image src="/imgs/device/phone.png" class="item-box-icon" />
+  <image src="/imgs/device/default.png" class="item-box-default" wx:if="{{item.isDefault==1}}" />
+  <text>{{item.deviceName}}</text>
+  <text>{{item.openNum}}</text>
+</view>
+
+<view class="item-default" wx:if="{{devices.length<1}}">暂无设备</view>
+
+<view class="item-box" bindtap="toAdd">
+  <view class="item-box-add">+</view>
+  <view class="item-box-add-text">添加设备</view>
+</view>

+ 75 - 0
pages/device/list/list.wxss

@@ -0,0 +1,75 @@
+page {
+  box-sizing: border-box;
+  padding-top: 20rpx;
+  background: #F3F5F9;
+}
+
+.item-box {
+  width: 100%;
+  height: 110rpx;
+  background: white;
+  position: relative;
+  overflow: hidden;
+  padding: 15rpx 0 15rpx 120rpx;
+  border-bottom: 2rpx solid #F3F5F9;
+  box-sizing: border-box;
+}
+
+.item-box-icon {
+  position: absolute;
+  left: 30rpx;
+  top: 20rpx;
+  width: 70rpx;
+  height: 70rpx;
+}
+
+.item-box text {
+  color: var(--black);
+  box-sizing: border-box;
+  display: block;
+  height: 40rpx;
+}
+
+.item-box text:last-child {
+  color: var(--darkGray);
+  padding-top: 10rpx;
+  font-size: 20rpx;
+}
+
+.item-box-add {
+  font-size: 70rpx;
+  text-align: center;
+  color: var(--darkGray);
+  line-height: 60rpx;
+  position: absolute;
+  left: 30rpx;
+  top: 20rpx;
+  width: 70rpx;
+  height: 70rpx;
+  border-radius: 100rpx;
+  background-color: var(--greyLight);
+}
+
+.item-box-add-text {
+  width: 100%;
+  height: 100%;
+  line-height: 80rpx;
+  color: var(--darkGray);
+}
+
+.item-box-default {
+  position: absolute;
+  right: 30rpx;
+  top: 35rpx;
+  width: 35rpx;
+  height: 35rpx;
+}
+
+.item-default {
+  width: 100%;
+  font-size: 30rpx;
+  line-height: 180rpx;
+  text-align: center;
+  color: var(--darkGray);
+  background: white;
+}

+ 0 - 123
pages/device/manager/manager.js

@@ -1,123 +0,0 @@
-const APP = getApp();
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    showMore: false,//显示更多
-    showModify: false, //显示修改框
-    deviceList: [],
-    currentDevice: null,//当前选中的设备
-  },
-
-  onShow: function () {
-    this.getDeviceList();
-  },
-
-  /**
-   * 请求设备集合
-   */
-  getDeviceList: function () {
-    APP.Get(APP.Url.getListByUserId, {}, false).then(res => {
-      this.setData({
-        deviceList: res.data,
-      })
-      APP.globalData.deviceList = res.data;
-    })
-  },
-  /**
-   * 切换当前设备
-   */
-  changeDefaultDevice: function (event) {
-    const params = {
-      deviceNum: event.currentTarget.dataset.num
-    }
-    APP.Post(APP.Url.changeDefaultDevice, params).then(res => {
-      APP.Modal.tips("设置成功");
-      this.getDeviceList();
-    })
-  },
-
-  /**
-   * 解除设备
-   */
-  unbind: function () {
-    const that = this;
-    const params = {
-      deviceNum: this.data.currentDevice.deviceNum,
-    }
-    wx.showModal({
-      title: '提示',
-      content: '确定解绑这台设备吗?',
-      success(res) {
-        if (res.confirm) {
-          APP.Post(APP.Url.unbind, params).then(res => {
-            that.hideAll();
-            APP.Modal.tips("解绑成功");
-            that.getDeviceList();
-          })
-        }
-      }
-    })
-  },
-  /**
-   * 显示重命名框
-   */
-  showModify: function () {
-    this.setData({
-      showMore: false,
-      showModify: true,
-    })
-  },
-
-  /**
-   * 修改设备名
-   */
-  modifyName: function (form) {
-    const that = this;
-    const params = {
-      num: this.data.currentDevice.deviceNum,
-      name: form.detail.value.deviceName
-    }
-    APP.Post(APP.Url.modifyDeviceName, params).then(res => {
-      APP.Modal.tips("修改成功");
-      that.hideAll();
-      that.getDeviceList();
-    })
-  },
-
-  /**
-   * 跳转至添加设备
-   */
-  toAddDevice: function () {
-    APP.Route.routeTo(APP.Route.path.addition);
-  },
-
-  /**
-   * 显示更多
-   */
-  showMore: function (event) {
-    let deviceNum = event.currentTarget.dataset.num;
-    for (let i = 0; i < this.data.deviceList.length; i++) {
-      if (this.data.deviceList[i].deviceNum == deviceNum) {
-        this.setData({
-          currentDevice: this.data.deviceList[i],
-          showMore: true,
-          showModify: false,
-        })
-        break;
-      }
-    }
-  },
-
-  /**
-   * 隐藏所有模态框
-   */
-  hideAll: function () {
-    this.setData({
-      showMore: false,
-      showModify: false,
-    })
-  },
-})

+ 0 - 37
pages/device/manager/manager.wxml

@@ -1,37 +0,0 @@
-<view class="white-block">
-	<view class="button">
-		<view bindtap="toAddDevice">添加</view>
-	</view>
-
-	<view class="item-box" wx:for="{{deviceList}}" wx:key="deviceNum">
-		<image src="/imgs/device/default.png" class="default" wx:if="{{item.isDefault==1}}" />
-		<image src="/imgs/device/phone.png" class="phone" data-num="{{item.deviceNum}}" bindtap="changeDefaultDevice" />
-		<view class="title">
-			<text>{{item.name}}</text>
-			<text>{{item.deviceNum}}</text>
-		</view>
-		<image src="/imgs/device/more.png" class="more" data-num="{{item.deviceNum}}" bindtap="showMore" />
-	</view>
-	<view class="noData" wx:if="{{deviceList.length==0}}">暂无设备</view>
-</view>
-
-
-<view class="cy-mask" wx:if="{{showMore||showModify}}" bindtap="hideAll"></view>
-
-<!-- 选项框 -->
-<view class="cy-select" wx:if="{{showMore}}">
-	<view bindtap="showModify">重命名</view>
-	<view class='red' bindtap="unbind">删除</view>
-	<view class="cy-select-cancel" bindtap="hideAll">取消</view>
-</view>
-
-<view class="cy-dialog" wx:if="{{showModify}}">
-	<view class="cy-dialog-title">修改设备名</view>
-	<form bindsubmit="modifyName">
-		<input name="deviceName" placeholder="请输入设备名" value="{{currentDevice.name}}" maxlength="10" class="input"></input>
-		<view class="cy-dialog-btn-area">
-			<button class="cy-dialog-btn-confirm" form-type="submit">确定</button>
-			<button class="cy-dialog-btn-cancel">取消</button>
-		</view>
-	</form>
-</view>

+ 0 - 83
pages/device/manager/manager.wxss

@@ -1,83 +0,0 @@
-page {
-  background: #F3F5F9;
-}
-.button{
-  width: 100%;
-  height: 80rpx;
-}
-
-.button view {
-  box-shadow: 6rpx 6rpx 8rpx rgba(48, 156, 63, 0.2);
-  float: right;
-  border-radius: 10rpx;
-  color: white;
-  text-align: center;
-  line-height: 64rpx;
-  width: 120rpx;
-  height: 64rpx;
-  background: #39b54a;
-}
-
-.item-box {
-  margin-top: 10rpx;
-  position: relative;
-  overflow: hidden;
-  padding: 10rpx 0 10rpx 130rpx;
-  width: 100%;
-  height: 120rpx;
-  border-bottom: 2rpx solid #F5F5F5;
-  box-sizing: border-box;
-}
-
-.item-box .phone {
-  position: absolute;
-  top: 20rpx;
-  left: 30rpx;
-  width: 80rpx;
-  height: 80rpx;
-}
-
-.item-box .default {
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 64rpx;
-  height: 64rpx;
-}
-
-.item-box .more {
-  position: absolute;
-  top: 38rpx;
-  right: 20rpx;
-  width: 45rpx;
-  height: 45rpx;
-}
-
-.item-box .title text {
-  line-height: 40rpx;
-  display: block;
-  font-size: 30rpx;
-}
-
-.item-box .title text:last-child {
-  color: #666;
-  margin-top: 10rpx;
-  font-size: 24rpx;
-}
-
-.noData {
-  width: 100%;
-  height: 120rpx;
-  text-align: center;
-  line-height: 120rpx;
-  color: #666;
-}
-
-.input {
-  width: 450rpx;
-  box-sizing: border-box;
-  border-bottom: 2rpx solid #F1F1F1;
-  height: 70rpx;
-  font-size: 32rpx;
-  margin: 40rpx auto 60rpx;
-}

+ 45 - 92
pages/index/index.js

@@ -1,15 +1,12 @@
 const APP = getApp();
 let mapContext; //地图对象
+//定时刷新位置信息对象
 let clockRefresh = null;
+//持续定位定时任务对象
 let continueRefresh = null;
 Page({
   data: {
-    device: null, //设备信息
-    location: null, //位置信息
-    mapCenter: { //地图聚焦中心 默认北京
-      latitude: 39.9,
-      longitude: 116.6,
-    },
+    stateInfo: null, //设备状态信息
     markers: [], //地图标记 
   },
 
@@ -17,25 +14,21 @@ Page({
   onLoad: function () {
     // 获取地图对象
     mapContext = wx.createMapContext('map');
-    this.setData({
-      device: APP.getCurrentDevice()
-    })
   },
 
   // 监听页面显示
   onShow: function () {
-    const that = this;
-    if (APP.getDeviceList().length < 1) {
+    if (APP.globalData.openNum == null) {
       APP.Modal.tips("您还没有设备可以查看");
       mapContext.moveToLocation({});
       return;
     }
     //请求设备位置
-    this.getLocation(APP.getCurrentDevice().deviceId, false);
-    setTimeout(function () {
-      that.intervalRefresh(APP.getCurrentDevice().deviceId);
-    }, 5000)
-    that.intervalSetContinue(APP.getCurrentDevice().deviceId);
+    this.getLatestState(APP.globalData.openNum);
+    //开启定时任务-定时刷新位置信息
+    this.intervalRefresh(APP.globalData.openNum);
+    //开启定时任务-高频定位模式
+    this.intervalSetContinue(APP.globalData.openNum);
   },
 
   // 监听页面隐藏 
@@ -50,66 +43,60 @@ Page({
   /**
    * 定时刷新
    */
-  intervalRefresh: function (deviceId) {
-    console.log("启动")
+  intervalRefresh: function (openNum) {
+    console.log("启动定时刷新位置")
     const that = this;
     if (clockRefresh != null) return;
     clockRefresh = setInterval(function () {
-      that.getLocationInterval(deviceId);
+      that.getLatestStateInterval(openNum);
     }, 15000)
   },
 
   /**
    * 定时设置持续定位
    */
-  intervalSetContinue: function (deviceId) {
+  intervalSetContinue: function (openNum) {
     console.log("启动持续定位")
     const that = this;
     if (continueRefresh != null) return;
-    that.setContinue(deviceId);
+    that.setContinue(openNum);
     continueRefresh = setInterval(function () {
-      that.setContinue(deviceId);
+      that.setContinue(openNum);
     }, 240000)
   },
 
   /**
    * 设置持续定位
    */
-  setContinue: function (deviceId) {
+  setContinue: function (openNum) {
     const params = {
-      deviceId: deviceId,
+      openNum: openNum,
       highFreq: 1
     }
-    APP.Post(APP.Url.setContinue, params).then(res => {}).catch(res => {
-      console.log(res)
+    APP.Post(APP.Url.setContinue, params).then(res => {
     })
   },
 
-  /**
-   * 聚焦中心
-   */
-  center: function () {
-    if (this.data.location == null) return;
-    this.moveTo(this.data.location.lonGcj, this.data.location.latGcj);
-  },
-
   /**
    * 获取设备位置
    */
-  getLocation: function (deviceId) {
+  getLatestState: function (openNum) {
     const that = this;
     const params = {
-      deviceId: deviceId
+      openNum: openNum
     }
-    APP.Get(APP.Url.getLocation, params, false).then(res => {
-      const location = res.data;
-      if (location == null) {
+    APP.Get(APP.Url.getLatestState, params, false).then(res => {
+      const stateInfo = res.data;
+      if (stateInfo == null) {
         APP.Modal.tips("该设备还没有上传位置信息");
         return;
       }
       //首次加载聚焦中心为当前位置
-      that.moveTo(location.lonGcj, location.latGcj);
-      that.setLocation(location);
+      mapContext.moveToLocation({
+        latitude: parseFloat(stateInfo.latGcj), //纬度 
+        longitude: parseFloat(stateInfo.lonGcj), //经度
+      })
+      that.setStateInfo(stateInfo);
     })
   },
 
@@ -117,30 +104,33 @@ Page({
    * 获取设备位置
    * 定时器
    */
-  getLocationInterval: function (deviceId) {
-    console.log("请求数据")
+  getLatestStateInterval: function (openNum) {
     const params = {
-      deviceId: deviceId
+      openNum: openNum
     }
-    APP.Get(APP.Url.getLocation, params, false).then(res => {
-      this.setLocation(res.data);
+    APP.Get(APP.Url.getLatestState, params, false).then(res => {
+      this.setStateInfo(res.data);
     })
   },
 
   /**
-   * 设置位置信息
+   * 设置位置等状态信息
    */
-  setLocation: function (location) {
-    if (location == null) return;
-    //信号强度
-    location.signal = this.formatSignal(location.signalnum);
+  setStateInfo: function (stateInfo) {
+    if (stateInfo == null) return;
     //定位时间
-    location.latestTime = this.formatTime(location.uploadTime)
+    stateInfo.uploadTimeFormat = this.formatTime(stateInfo.uploadTime)
     this.setData({
-      location: location
+      stateInfo: stateInfo,
+      markers: [{
+        id: 1,
+        iconPath: "/imgs/marker.png",
+        latitude: parseFloat(stateInfo.latGcj),
+        longitude: parseFloat(stateInfo.lonGcj),
+        width: 35,
+        height: 35
+      }]
     })
-    //添加地图标记
-    this.addMarker(location.lonGcj, location.latGcj)
   },
 
   /**
@@ -154,41 +144,4 @@ Page({
     if (diff < 31104000) return parseInt(diff / 86400) + "天前";
     return "1年前";
   },
-
-  /**
-   * 格式化电池信号量
-   */
-  formatSignal: function (num) {
-    if (num > 90) return "信号良好";
-    if (num > 60) return "信号正常";
-    if (num > 30) return "信号较差";
-    if (num == 0) return "无信号";
-    return "信号差"
-  },
-
-  /**
-   * 添加标记
-   */
-  addMarker: function (lng, lat) {
-    this.setData({
-      markers: [{
-        id: 1,
-        iconPath: "/imgs/marker.png",
-        latitude: parseFloat(lat),
-        longitude: parseFloat(lng),
-        width: 35,
-        height: 35
-      }]
-    })
-  },
-
-  /**
-   * 移动地图焦点到某个点
-   */
-  moveTo: function (lng, lat) {
-    mapContext.moveToLocation({
-      latitude: parseFloat(lat), //纬度 
-      longitude: parseFloat(lng), //经度
-    })
-  }
 })

+ 1 - 1
pages/index/index.json

@@ -1,3 +1,3 @@
 {
-  "navigationStyle": "custom"
+  "navigationBarTitleText": "首页"
 }

+ 20 - 23
pages/index/index.wxml

@@ -1,28 +1,25 @@
-<map id="map" longitude="{{mapCenter.longitude}}" latitude="{{mapCenter.latitude}}" scale="17" markers="{{markers}}"
-	show-location polyline="{{polyline}}" class="map"></map>
+<map id="map" longitude="116.3976" latitude="39.909" scale="17" markers="{{markers}}" show-location polyline="{{polyline}}" class="map"></map>
 
-<view class="title-bar">
-	<view>{{device.name}}</view>
-	<view>电量: {{location.batteryNum}}% | 信号强度: {{location.signal}}</view>
-</view>
-
-<view class="siteInfo" wx:if="{{location!=null}}">
-	<view class="address">{{location.site}}</view>
-	<view class="indate">{{location.latestTime}}</view>
-</view>
-
-<view class="circle-nav center" bindtap="center">
-	<image src="/imgs/center.png" />
+<view class="card">
+	<view class="card-bar">
+		<text class="card-bar-name">小明</text>
+		<view class="card-bar-date">{{stateInfo.uploadTimeFormat}}</view>
+		<image src="/imgs/signal_3.png" class="card-bar-img-signal"></image>
+		<text class="sign">信号:</text>
+		<image src="/imgs/battery_2.png" class="card-bar-img-battery"></image>
+		<text class="sign">电量:</text>
+	</view>
+	<view class="card-content">
+		<text>{{stateInfo.site}}</text>
+	</view>
 </view>
 
 <view class="debug">
-	<view>信号: {{location.signalNum}}</view>
-	<view>定位模式: {{location.mode}}</view>
-	<view>经度: {{location.lon}}</view>
-	<view>纬度: {{location.lat}}</view>
-	<view>经度(Gcj): {{location.lonGcj}}</view>
-	<view>纬度(Gcj): {{location.latGcj}}</view>
-	<view>速度: {{location.speed}}</view>
-	<view>卫星颗数: {{location.num}}</view>
-	<view>{{location.uploadTime}}</view>
+	<view>信号: {{stateInfo.signalNum}}</view>
+	<view>定位模式: {{stateInfo.mode}}</view>
+	<view>经度: {{stateInfo.lon}}</view>
+	<view>纬度: {{stateInfo.lat}}</view>
+	<view>速度: {{stateInfo.speed}}</view>
+	<view>卫星颗数: {{stateInfo.num}}</view>
+	<view>{{stateInfo.uploadTime}}</view>
 </view>

+ 46 - 59
pages/index/index.wxss

@@ -1,4 +1,6 @@
 page {
+  box-sizing: border-box;
+  padding-bottom: 180rpx;
   overflow: hidden;
   width: 100%;
   height: 100%;
@@ -10,28 +12,9 @@ page {
   height: 100%;
 }
 
-.title-bar {
-  width: 100%;
-  height: 150rpx;
-  box-sizing: border-box;
-  padding-top: 50rpx;
-  position: absolute;
-  top: 0;
-  z-index: 2;
-  background: #5D88FF;
-}
-
-.title-bar view {
-  color: white;
-  font-size: 26rpx;
-  width: 100%;
-  height: 45rpx;
-  line-height: 45rpx;
-  text-align: center;
-}
-
-.siteInfo {
+.card {
   width: 100%;
+  height: 180rpx;
   z-index: 2;
   box-sizing: border-box;
   padding: 20rpx;
@@ -41,54 +24,58 @@ page {
   box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.12);
 }
 
-.siteInfo .address {
-  width: 550rpx;
+.card-bar {
+  height: 50rpx;
+  line-height: 50rpx;
+}
+
+.card-bar-name {
   font-size: 30rpx;
-  color: rgb(100, 100, 100);
-  line-height: 40rpx;
 }
 
-.siteInfo .indate {
+.card-bar .sign {
+  margin-right: 10rpx;
+  color: var(--grey);
+  font-size: 24rpx;
+  float: right;
+}
+
+.card-bar-img-signal {
+  margin-right: 20rpx;
+  margin-top: 8rpx;
+  float: right;
+  width: 30rpx;
+  height: 30rpx;
+}
+
+.card-bar-img-battery {
+  margin-right: 20rpx;
+  margin-top: 8rpx;
+  float: right;
+  width: 36rpx;
+  height: 36rpx;
+}
+
+.card-bar-date {
+  float: right;
+  margin-top: 5rpx;
   background: rgba(89, 170, 255, 0.2);
   text-align: center;
   font-size: 22rpx;
   color: #2d8cf0;
-  position: absolute;
-  top: 20rpx;
   border-radius: 20rpx;
-  right: 30rpx;
   width: 120rpx;
   height: 40rpx;
   line-height: 40rpx;
 }
 
-.circle-nav {
-  width: 70rpx;
-  height: 70rpx;
-  box-shadow: 0 0 10rpx 0 rgba(0, 0, 0, 0.2);
-  overflow: hidden;
-  position: fixed;
-  border-radius: 100rpx;
-  background: white;
-}
-
-.circle-nav image {
-  display: block;
-  margin: 14rpx;
-  width: 44rpx;
-  height: 44rpx;
-}
-
-.refresh {
-  z-index: 999;
-  left: 20rpx;
-  bottom: 150rpx;
-}
-
-.center {
-  z-index: 999;
-  right: 20rpx;
-  bottom: 150rpx;
+.card-content {
+  color: var(--darkGray);
+  font-size: 28rpx;
+  box-sizing: border-box;
+  width: 100%;
+  height: 100%;
+  padding-top: 10rpx;
 }
 
 .debug {
@@ -99,9 +86,9 @@ page {
   padding: 10rpx;
   width: 280rpx;
   position: absolute;
-  top: 160rpx;
-  right: 20rpx;
-  background: rgba(0, 0, 0, 0.5);
+  top: 30rpx;
+  right: 30rpx;
+  background: rgba(0, 0, 0, .4);
 }
 
 .debug view {

+ 52 - 12
pages/my/my.js

@@ -4,27 +4,67 @@ Page({
   /**
    * 页面的初始数据
    */
-  data: {},
+  data: {
+    device: null
+  },
+
+  onShow: function () {
+    this.getDefaultDevice();
+  },
+
+  getDefaultDevice: function () {
+    const param = {
+      openId: APP.globalData.openId
+    }
+    APP.Get(APP.Url.getDefaultDevice, param).then(res => {
+      this.setData({
+        device: res.data
+      })
+    })
+  },
 
   /**
    * 跳转至子页面页面
    */
-  routeTo: function (event) {
-    const path = event.currentTarget.dataset.path;
-    APP.Route.routeTo(APP.Route.path[path])
+  toDevices: function () {
+    wx.navigateTo({
+      url: '/pages/device/list/list',
+    })
   },
 
   /**
-   * 跳转到设置页面
+   * 跳转至子页面页面
    */
-  toSet: function () {
-    console.log(APP.getDeviceList());
-    if (APP.getDeviceList().length <= 0) {
-      APP.Modal.tips("你还没有设备,请先去设备管理添加一台设备");
-      return;
-    }
+  toContacts: function () {
+    wx.navigateTo({
+      url: '/pages/set/contacts/contacts',
+    })
+  },
+
+  /**
+ * 跳转至子页面页面
+ */
+  toVolume: function () {
+    wx.navigateTo({
+      url: '/pages/set/volume/volume',
+    })
+  },
+
+  /**
+* 跳转至子页面页面
+*/
+  toBroadcast: function () {
+    wx.navigateTo({
+      url: '/pages/set/broadcast/broadcast',
+    })
+  },
+
+  /**
+* 跳转至子页面页面
+*/
+  toUpdateName: function () {
     wx.navigateTo({
-      url: "/pages/set/set",
+      url: '/pages/set/devicename/devicename',
     })
   }
 })

+ 1 - 0
pages/my/my.json

@@ -1,2 +1,3 @@
 {
+  "navigationBarTitleText": "个人中心"
 }

+ 39 - 25
pages/my/my.wxml

@@ -1,33 +1,47 @@
-<view class="banner">
-	<image src="/imgs/My/banner.png" class="bg" />
-	<view class="avatar">
-		<open-data type="userAvatarUrl"></open-data>
+<view class="user-info">
+	<view class="user-info-avatar">
+		<open-data type="userAvatarUrl" />
 	</view>
+	<view class="user-info-devicename">{{device.deviceName}}</view>
+	<view class="user-info-nickname" bindtap="toUpdateName">
+		<text>微信昵称:</text>
+		<open-data type="userNickName"></open-data>
+	</view>
+	<image src="/imgs/arrows.png" class="user-info-arrows"></image>
 </view>
-<view class="nickName">
-	<open-data type="userNickName"></open-data>
+
+<view class="menu" bindtap="toDevices">
+	<image src="/imgs/set/device.png" class="menu-icon" />
+	<text>设备管理</text>
+	<image src="/imgs/arrows.png" class="menu-arrows"></image>
 </view>
 
-<view class="nav device" bindtap="routeTo" data-path="manager">
-	<view class="icon">
-		<image src="/imgs/My/device.png" />
-	</view>
-	<view class="text">设备管理</view>
-	<image src="/imgs/My/arrows.png" class="arrows" />
+<view class="menu" bindtap="toContacts">
+	<image src="/imgs/set/concats.png" class="menu-icon" />
+	<text>联系人设置</text>
+	<image src="/imgs/arrows.png" class="menu-arrows"></image>
 </view>
 
-<view class="nav set" bindtap="toSet">
-	<view class="icon">
-		<image src="/imgs/My/set.png" />
-	</view>
-	<view class="text">设置</view>
-	<image src="/imgs/My/arrows.png" class="arrows" />
+<view class="menu" bindtap="toVolume">
+	<image src="/imgs/set/volume.png" class="menu-icon" />
+	<text>音量设置</text>
+	<image src="/imgs/arrows.png" class="menu-arrows"></image>
 </view>
 
-<!-- <view class="nav personInfo" bindtap="routeTo" data-path="track">
-	<view class="icon">
-		<image src="/imgs/My/track.png" />
-	</view>
-	<view class="text">轨迹</view>
-	<image src="/imgs/My/arrows.png" class="arrows" />
-</view> -->
+<view class="menu" bindtap="toBroadcast">
+	<image src="/imgs/set/broadcast.png" class="menu-icon" />
+	<text>语音播报</text>
+	<image src="/imgs/arrows.png" class="menu-arrows"></image>
+</view>
+
+<view class="menu">
+	<image src="/imgs/set/call.png" class="menu-icon" />
+	<text>通话记录</text>
+	<image src="/imgs/arrows.png" class="menu-arrows"></image>
+</view>
+
+<view class="menu">
+	<image src="/imgs/set/base.png" class="menu-icon" />
+	<text>其他设置</text>
+	<image src="/imgs/arrows.png" class="menu-arrows"></image>
+</view>

+ 50 - 81
pages/my/my.wxss

@@ -1,103 +1,72 @@
-.banner {
-  position: relative;
-  width: 750rpx;
-  height: 373rpx;
+page {
+  background: #F3F5F9;
 }
 
-.banner .bg {
+.user-info {
   width: 100%;
-  height: 100%;
+  height: 220rpx;
+  background: white;
+  position: relative;
+  box-sizing: border-box;
+  padding: 50rpx 0 50rpx 180rpx;
+  margin-bottom: 40rpx;
 }
 
-.banner .avatar {
-  border: 10rpx solid white;
-  bottom: -25rpx;
-  left: 50%;
-  margin-left: -100rpx;
+.user-info-avatar {
   position: absolute;
+  top: 50rpx;
+  left: 30rpx;
   overflow: hidden;
-  width: 160rpx;
-  height: 160rpx;
-  background: white;
-  border-radius: 180rpx;
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 10rpx;
 }
 
-.nickName {
-  width: 100%;
+.user-info-devicename {
+  height: 80rpx;
   font-size: 30rpx;
-  text-align: center;
-  margin-top: 30rpx;
-}
-
-/* 页面导航 */
-.nav {
-  overflow: hidden;
-  box-sizing: border-box;
-  padding: 15rpx;
-  margin: 20rpx auto;
-  width: 650rpx;
-  height: 90rpx;
-  border-bottom: 2rpx solid #eee;
-}
-
-.nav .icon {
-  float: left;
-  border-radius: 60rpx;
-  border-right: 50rpx;
-  width: 60rpx;
-  height: 60rpx;
+  color: var(--black);
+  font-weight: bold;
 }
 
-.nav .icon image {
-  display: block;
-  margin: 12rpx 14rpx;
-  width: 30rpx;
-  height: 32rpx;
-}
-
-.nav .text {
-  float: left;
-  line-height: 60rpx;
-  font-size: 30rpx;
-  margin-left: 15rpx;
+.user-info-nickname {
+  height: 40rpx;
+  font-size: 24rpx;
 }
 
-.nav .arrows {
-  margin-top: 16rpx;
-  width: 18rpx;
+.user-info-arrows {
+  position: absolute;
+  right: 30rpx;
+  top: 130rpx;
+  width: 16rpx;
   height: 30rpx;
-  float: right;
-}
-
-/* 设备管理 */
-.device .icon {
-  background: #75caff;
-}
-
-.device .icon image {
-  margin: 12rpx 14rpx;
-  width: 35rpx;
-  height: 35rpx;
-}
-
-/* 个人信息 */
-.personInfo .icon {
-  background: #c79bfa;
 }
 
-.personInfo .icon image {
-  margin: 12rpx 14rpx;
-  width: 30rpx;
-  height: 32rpx;
+.menu {
+  width: 100%;
+  height: 80rpx;
+  padding: 10rpx 0 10rpx 100rpx;
+  position: relative;
+  background: white;
+  box-sizing: border-box;
+  border-bottom: 2rpx solid #F3F5F9;
+  line-height: 60rpx;
+  font-size: 26rpx;
+  color: var(--darkGray);
 }
 
-/* 设置 */
-.set .icon {
-  background: #ff8297;
+.menu-icon {
+  position: absolute;
+  top: 20rpx;
+  left: 30rpx;
+  width: 40rpx;
+  height: 40rpx;
 }
 
-.set .icon image {
-  margin: 8rpx;
-  width: 42rpx;
-  height: 42rpx;
+.menu-arrows {
+  position: absolute;
+  right: 30rpx;
+  top: 30rpx;
+  width: 16rpx;
+  height: 30rpx;
 }

+ 17 - 16
pages/set/broadcast/broadcast.js

@@ -8,9 +8,9 @@ Page({
     time: "点击选择时间",
     typeIdx: 0,
     typeList: [{
-        id: 1,
-        name: "实时播报"
-      },
+      id: 1,
+      name: "实时播报"
+    },
       //  {
       //   id: 0,
       //   name: "固定播报"
@@ -43,7 +43,7 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {},
+  onLoad: function (options) { },
 
   /**
    * 监听-时间选择切换
@@ -68,27 +68,28 @@ Page({
    */
   setNews: function (form) {
     const data = {
-      deviceId: APP.getCurrentDevice().deviceId,
-      newsType: this.data.typeList[this.data.typeIdx].id,
-      newTime: "",
+      openNum: APP.globalData.openNum,
+      newsType: 1,
       news: form.detail.value.news
+      // newsType: this.data.typeList[this.data.typeIdx].id,
+      // newTime: "",
     }
-    if (data.newsType == 0) {
-      if (this.data.time === "点击选择时间") {
-        APP.Modal.tips("时间不为空!")
-        return;
-      }
-      data.newsTime = this.data.time + ":00";
-    }
+    // if (data.newsType == 0) {
+    //   if (this.data.time === "点击选择时间") {
+    //     APP.Modal.tips("时间不为空!")
+    //     return;
+    //   }
+    //   data.newsTime = this.data.time + ":00";
+    // }
     if (data.news == null || data.news == "") {
       APP.Modal.tips("播报内容不为空!")
       return;
     }
     APP.Post(APP.Url.setNews, data).then(res => {
-      APP.Modal.tips("设置成功!")
+      APP.Modal.tips("发送成功!")
     }).catch(res => {
       console.log(res)
-      APP.Modal.tips("设置失败!")
+      APP.Modal.tips("发送失败!")
     })
   },
 })

+ 1 - 1
pages/set/broadcast/broadcast.json

@@ -1,3 +1,3 @@
 {
-  "usingComponents": {}
+  "navigationBarTitleText": "语音播报"
 }

+ 19 - 20
pages/set/broadcast/broadcast.wxml

@@ -1,14 +1,22 @@
-<form bindsubmit="setNews">
-  <view class='white-block'>
-    <view class="form-item">
-      <view class="label">播报类型:</view>
-      <picker bindchange="bindTypeChange" value="{{typeIdx}}" range="{{typeList}}" range-key="name">
-        <view class="picker">{{typeList[typeIdx].name}}</view>
-      </picker>
-    </view>
+<form bindsubmit="setNews" class="form">
+  <view class="form-item">
+    <view class="form-item-label">播报类型:</view>
+    <picker bindchange="bindTypeChange" value="{{typeIdx}}" range="{{typeList}}" range-key="name">
+      <view class="picker">{{typeList[typeIdx].name}}</view>
+    </picker>
+  </view>
+
+  <view class="form-item content">
+    <view class="form-item-label">播报内容:</view>
+    <textarea name="news" placeholder="100字以内" maxlength="100" class="form-item-input-normal "></textarea>
+  </view>
+
+  <button class="button-normal" form-type="submit">发送</button>
+</form>
 
-    <view class="form-item" style="height:140rpx" wx:if="{{typeIdx==1}}">
-      <view class="label">播报周期:</view>
+
+<!-- <view class="form-item" style="height:140rpx" wx:if="{{typeIdx==1}}">
+      <view class="form-item-label">播报周期:</view>
       <checkbox-group bindchange="checkboxChange">
         <label wx:for="{{weekList}}" class="checkBox">
           <checkbox value="{{item.id}}" />
@@ -22,13 +30,4 @@
       <picker mode="time" value="{{time}}" start="00:00" end="23:59" bindchange="bindTimeChange">
         <view class="picker">{{time}}</view>
       </picker>
-    </view>
-
-    <view class="form-item content">
-      <view class="label">播报内容:</view>
-      <textarea name="news" placeholder="100字以内" maxlength="100" class="input-normal "></textarea>
-    </view>
-
-    <button class="button-normal" form-type="submit">发送</button>
-  </view>
-</form>
+    </view> -->

+ 6 - 6
pages/set/contacts/contacts.js

@@ -12,7 +12,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function () {
-    this.getSetInfo(APP.getCurrentDevice().deviceId);
+    this.getSetInfo(APP.globalData.openNum);
   },
 
   /**
@@ -21,7 +21,7 @@ Page({
   setSos: function (form) {
     const that = this;
     const params = {
-      deviceId: this.data.setInfo.deviceId,
+      openNum: this.data.setInfo.openNum,
       key0Name: form.detail.value.key0Name,
       key0Phone: form.detail.value.key0Phone,
       key1Name: form.detail.value.key1Name,
@@ -30,7 +30,7 @@ Page({
       key2Phone: form.detail.value.key2Phone,
     }
     APP.Post(APP.Url.setSos, params).then(res => {
-      that.getSetInfo(params.deviceId)
+      that.getSetInfo(params.openNum)
       APP.Modal.tips("设置成功!")
     }).catch(res => {
       APP.Modal.tips("设置失败!")
@@ -40,11 +40,11 @@ Page({
   /**
    * 获取设备设置信息
    */
-  getSetInfo: function (deviceId) {
+  getSetInfo: function (openNum) {
     const params = {
-      deviceId: deviceId,
+      openNum: openNum,
     }
-    APP.Get(APP.Url.getSos, params,false).then(res => {
+    APP.Get(APP.Url.getSos, params, false).then(res => {
       this.setData({
         setInfo: res.data
       })

+ 26 - 37
pages/set/contacts/contacts.wxml

@@ -1,44 +1,33 @@
-<form bindsubmit="setSos">
-	<view class='white-block'>
-		<view class="block-title">
-			<text>按键 SOS 设置</text>
-		</view>
-		<view class="form-item">
-			<view class="label">姓名:</view>
-			<input type="text" value="{{setInfo.key0Name}}" name="key0Name" placeholder="姓名" class="input-normal"></input>
-		</view>
-		<view class=" form-item">
-			<view class="label">电话号码:</view>
-			<input type="text" value="{{setInfo.key0Phone}}" name="key0Phone" placeholder="电话号码" class="input-normal"></input>
-		</view>
+<form bindsubmit="setSos" class="form">
+	<view>按键 SOS 设置</view>
+	<view class="form-item">
+		<view class="form-item-label">姓名:</view>
+		<input type="text" value="{{setInfo.key0Name}}" name="key0Name" placeholder="姓名" class="form-item-input-normal"></input>
 	</view>
 
-	<view class='white-block'>
-		<view class="block-title">
-			<text>按键 1 设置</text>
-		</view>
-		<view class="form-item">
-			<view class="label">姓名:</view>
-			<input type="text" value="{{setInfo.key1Name}}" name="key1Name" placeholder="姓名" class="input-normal"></input>
-		</view>
-		<view class=" form-item">
-			<view class="label">电话号码:</view>
-			<input type="text" value="{{setInfo.key1Phone}}" name="key1Phone" placeholder="电话号码" class="input-normal"></input>
-		</view>
+	<view class="form-item">
+		<view class="form-item-label">电话号码:</view>
+		<input type="text" value="{{setInfo.key0Phone}}" name="key0Phone" placeholder="电话号码" class="form-item-input-normal"></input>
 	</view>
 
-	<view class='white-block'>
-		<view class="block-title">
-			<text>按键 2 设置</text>
-		</view>
-		<view class="form-item">
-			<view class="label">姓名:</view>
-			<input type="text" value="{{setInfo.key2Name}}" name="key2Name" placeholder="姓名" class="input-normal"></input>
-		</view>
-		<view class=" form-item">
-			<view class="label">电话号码:</view>
-			<input type="text" value="{{setInfo.key2Phone}}" name="key2Phone" placeholder="电话号码" class="input-normal"></input>
-		</view>
+	<view>按键 1 设置</view>
+	<view class="form-item">
+		<view class="form-item-label">姓名:</view>
+		<input type="text" value="{{setInfo.key1Name}}" name="key1Name" placeholder="姓名" class="form-item-input-normal"></input>
+	</view>
+	<view class=" form-item">
+		<view class="form-item-label">电话号码:</view>
+		<input type="text" value="{{setInfo.key1Phone}}" name="key1Phone" placeholder="电话号码" class="form-item-input-normal"></input>
+	</view>
+
+	<view>按键 2 设置</view>
+	<view class="form-item">
+		<view class="form-item-label">姓名:</view>
+		<input type="text" value="{{setInfo.key2Name}}" name="key2Name" placeholder="姓名" class="form-item-input-normal"></input>
+	</view>
+	<view class="form-item">
+		<view class="form-item-label">电话号码:</view>
+		<input type="text" value="{{setInfo.key2Phone}}" name="key2Phone" placeholder="电话号码" class="form-item-input-normal"></input>
 	</view>
 	<button class="button-normal" form-type="submit">保存</button>
 </form>

+ 41 - 0
pages/set/devicename/devicename.js

@@ -0,0 +1,41 @@
+const APP = getApp();
+Page({
+
+  data: {
+    device: null //设置信息
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getDefaultDevice();
+  },
+
+
+  getDefaultDevice: function () {
+    const param = {
+      openId: APP.globalData.openId
+    }
+    APP.Get(APP.Url.getDefaultDevice, param).then(res => {
+      this.setData({
+        device: res.data
+      })
+    })
+  },
+
+
+  /**
+   * 设置名称
+   */
+  updateName: function (form) {
+    const param = {
+      openNum: APP.globalData.openNum,
+      deviceName: form.detail.value.deviceName
+    }
+    APP.Post(APP.Url.updateName, param).then(res => {
+      APP.Modal.tips("设置成功");
+      this.getDefaultDevice();
+    })
+  }
+})

+ 3 - 0
pages/set/devicename/devicename.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "修改名称"
+}

+ 8 - 0
pages/set/devicename/devicename.wxml

@@ -0,0 +1,8 @@
+<form bindsubmit="updateName" class="form">
+	<view class="form-item">
+		<view class="form-item-label">设备名称:</view>
+		<input type="text" value="{{device.deviceName}}" name="deviceName" placeholder="请输入设备名称" class="form-item-input-normal"></input>
+	</view>
+
+	<button class="button-normal" form-type="submit">保存</button>
+</form>

+ 0 - 0
pages/set/uploadData/uploadData.wxss → pages/set/devicename/devicename.wxss


+ 13 - 12
pages/set/uploadData/uploadData.js → pages/set/other/other.js

@@ -2,39 +2,40 @@ const APP = getApp();
 Page({
 
   data: {
-    setInfo: null //设置信息
+    device: null //设置信息
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.getSetInfo(APP.getCurrentDevice().deviceId);
+    this.getOther();
   },
-  /**
-   *  获取设备设置信息
-   */
-  getSetInfo: function (deviceId) {
+
+
+  getOther: function () {
     const param = {
-      deviceId: deviceId
+      openNum: APP.globalData.openNum
     }
-    APP.Get(APP.Url.getOther, param, false).then(res => {
+    APP.Get(APP.Url.getOther, param).then(res => {
       this.setData({
-        setInfo: res.data
+        gpsRate: res.data.gpsRate
       })
     })
   },
+
+
   /**
-   * 设置定位频率
+   * 设置名称
    */
   setGpsRate: function (form) {
     const param = {
-      deviceId: this.data.setInfo.deviceId,
+      openNum: APP.globalData.openNum,
       gpsRate: form.detail.value.gpsRate
     }
     APP.Post(APP.Url.setGpsRate, param).then(res => {
       APP.Modal.tips("设置成功");
-      this.getSetInfo(param.deviceId);
+      this.getOther();
     })
   }
 })

+ 3 - 0
pages/set/other/other.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "其他设置"
+}

+ 8 - 0
pages/set/other/other.wxml

@@ -0,0 +1,8 @@
+<form bindsubmit="setGpsRate" class="form">
+	<view class="form-item">
+		<view class="form-item-label">定位频率:</view>
+		<input type="text" value="{{gpsRate}}" name="gpsRate" placeholder="小时" class="form-item-input-normal"></input>
+	</view>
+
+	<button class="button-normal" form-type="submit">保存</button>
+</form>

+ 3 - 0
pages/set/other/other.wxss

@@ -0,0 +1,3 @@
+page {
+  background: #F3F5F9;
+}

+ 0 - 77
pages/set/set.js

@@ -1,77 +0,0 @@
-const APP = getApp()
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    setInfo: null,//设置信息
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function () {
-    this.getOther(APP.getCurrentDevice().deviceId);
-  },
-
-  /**
-   * 获取设备自动接听设置
-   */
-  getOther: function (deviceId) {
-    const that = this;
-    const params = {
-      deviceId: deviceId,
-    }
-    APP.Get(APP.Url.getOther, params).then(res => {
-      that.setData({
-        setInfo: res.data,
-      })
-    })
-  },
-
-  /**
-   * 监听自动接听开关
-   */
-  handleAutoAnswerChange: function (event) {
-    const that = this;
-    const params = {
-      deviceId: that.data.setInfo.deviceId,
-      autoAnswer: event.detail.value === true ? 1 : 0
-    }
-    APP.Post(APP.Url.setAutoAnswer, params).then(res => {
-      that.getOther(params.deviceId)
-      APP.Modal.tips("设置成功!")
-    }).catch(res => {
-      console.log(res)
-      APP.Modal.tips("设置失败!")
-    })
-  },
-
-  /**
-   * 监听持续定位
-   */
-  handleContinueChange: function (event) {
-    const that = this;
-    const params = {
-      deviceId: that.data.setInfo.deviceId,
-      // highFreq: event.detail.value === true ? 1 : 0,
-      highFreq: 1
-    }
-    APP.Post(APP.Url.setContinue, params).then(res => {
-      that.getOther(params.deviceId)
-      APP.Modal.tips("设置成功!")
-    }).catch(res => {
-      console.log(res)
-      APP.Modal.tips("设置失败!")
-    })
-  },
-
-  /**
-   * 跳转至子页面页面
-   */
-  routeTo: function (event) {
-    const path = event.currentTarget.dataset.path;
-    APP.Route.routeTo(APP.Route.path[path])
-  },
-})

+ 0 - 3
pages/set/set.json

@@ -1,3 +0,0 @@
-{
-  "navigationBarTitleText": "设置"
-}

+ 0 - 44
pages/set/set.wxml

@@ -1,44 +0,0 @@
-<view class="white-black">
-	<view class="item-bar" bindtap="routeTo" data-path="uploadData">
-		<image src="/imgs/set/upload.png" class="icon" />
-		<text>数据上传设置</text>
-		<image src="/imgs/Set/arrows.png" class="arrows" />
-	</view>
-	<view class="item-bar" bindtap="routeTo" data-path="contacts">
-		<image src="/imgs/set/contacts.png" class="icon" />
-		<text>联系人设置</text>
-		<image src="/imgs/Set/arrows.png" class="arrows" />
-	</view>
-	<view class="item-bar" bindtap="routeTo" data-path="volume">
-		<image src="/imgs/set/volume.png" class="icon" />
-		<text>声音设置</text>
-		<image src="/imgs/Set/arrows.png" class="arrows" />
-	</view>
-</view>
-
-<view class="white-black">
-	<view class="item-bar" bindtap="routeTo" data-path="idioms">
-		<image src="/imgs/set/idioms.png" class="icon" />
-		<text>常用语设置</text>
-		<image src="/imgs/Set/arrows.png" class="arrows" />
-	</view>
-	<view class="item-bar" bindtap="routeTo" data-path="broadcast">
-		<image src="/imgs/set/broadcast.png" class="icon" />
-		<text>语音播报</text>
-		<image src="/imgs/set/arrows.png" class="arrows" />
-	</view>
-</view>
-
-<view class="white-black">
-	<view class="item-bar">
-		<image src="/imgs/set/auto_answer.png" class="icon" />
-		<text>自动接听</text>
-		<switch checked="{{setInfo.autoAnswer==1}}" bindchange="handleAutoAnswerChange" color="#477EEE" class="switch" />
-	</view>
-
-	<view class="item-bar">
-		<image src="/imgs/set/continue.png" class="icon" />
-		<text>持续定位</text>
-		<switch checked="{{setInfo.highFreq==1}}" bindchange="handleContinueChange" color="#477EEE" class="switch" />
-	</view>
-</view>

+ 0 - 48
pages/set/set.wxss

@@ -1,48 +0,0 @@
-page {
-  background: #F3F5F9;
-}
-
-.white-black {
-  background: white;
-  box-sizing: border-box;
-  padding: 0 30rpx;
-  width: 100%;
-  margin-top: 40rpx;
-}
-
-
-.item-bar {
-  overflow: hidden;
-  width: 100%;
-  height: 100rpx;
-  box-sizing: border-box;
-  border-bottom: 2rpx solid #F0F0F0;
-}
-
-.item-bar .icon {
-  float: left;
-  margin-top: 28rpx;
-  width: 48rpx;
-  height: 48rpx;
-}
-
-.item-bar text {
-  float: left;
-  margin-left: 20rpx;
-  color: #333;
-  line-height: 100rpx;
-  font-size: 30rpx;
-}
-
-.item-bar .arrows {
-  margin-right: 30rpx;
-  margin-top: 36rpx;
-  float: right;
-  width: 16rpx;
-  height: 30rpx;
-}
-
-.switch {
-  margin-top: 20rpx;
-  float: right;
-}

+ 0 - 3
pages/set/uploadData/uploadData.json

@@ -1,3 +0,0 @@
-{
-  "usingComponents": {}
-}

+ 0 - 10
pages/set/uploadData/uploadData.wxml

@@ -1,10 +0,0 @@
-<view class='white-block'>
-  <form bindsubmit="setGpsRate">
-		<view class="form-item">
-			<view class="label">定位频率:</view>
-			<input type="text" value="{{setInfo.gpsRate}}" name="gpsRate" placeholder="单位(小时)" class="input-normal"></input>
-		</view>
-
-		<button class="button-normal" form-type="submit">保存</button>
-	</form>
-</view>

+ 6 - 6
pages/set/volume/volume.js

@@ -12,7 +12,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function () {
-    this.getVolume(APP.getCurrentDevice().deviceId);
+    this.getVolume(APP.globalData.openNum);
   },
 
   /**
@@ -20,13 +20,13 @@ Page({
    */
   submit: function (form) {
     const parmas = {
-      deviceId: this.data.setInfo.deviceId,
+      openNum: this.data.setInfo.openNum,
       ringVol: form.detail.value.ringVol === "" ? 0 : form.detail.value.ringVol,
       msgVol: form.detail.value.msgVol === "" ? 0 : form.detail.value.msgVol,
       phoneVol: form.detail.value.phoneVol === "" ? 0 : form.detail.value.phoneVol,
     }
     APP.Post(APP.Url.setVolume, parmas).then(res => {
-      this.getVolume(parmas.deviceId);
+      this.getVolume(parmas.openNum);
       APP.Modal.tips("设置成功!")
     }).catch(res => {
       console.log(res)
@@ -37,12 +37,12 @@ Page({
   /**
    * 获取设备音量设置
    */
-  getVolume: function (deviceId) {
+  getVolume: function (openNum) {
     const that = this;
     const params = {
-      deviceId: deviceId,
+      openNum: openNum,
     }
-    APP.Get(APP.Url.getVolume, params,false).then(res => {
+    APP.Get(APP.Url.getVolume, params, false).then(res => {
       that.setData({
         setInfo: res.data
       })

+ 1 - 1
pages/set/volume/volume.json

@@ -1,3 +1,3 @@
 {
-  "navigationBarTitleText": "音设置"
+  "navigationBarTitleText": "音设置"
 }

+ 16 - 19
pages/set/volume/volume.wxml

@@ -1,26 +1,23 @@
-<form catchsubmit="submit">
-	<view class="white-block">
-		<view class="form-item">
-			<view class="label">通话音量:</view>
-			<view class="slider">
-				<slider name="phoneVol" value="{{setInfo.phoneVol}}" show-value activeColor="#5D88FF" block-size="24" max="6" />
-			</view>
+<form catchsubmit="submit" class="form">
+	<view class="form-item">
+		<view class="form-item-label">通话音量:</view>
+		<view class="slider">
+			<slider name="phoneVol" value="{{setInfo.phoneVol}}" show-value activeColor="#5D88FF" block-size="24" max="6" />
 		</view>
-		<view class="form-item">
-			<view class="label">系统音量:</view>
-			<view class="slider">
-				<slider name="msgVol" value="{{setInfo.msgVol}}" show-value activeColor="#5D88FF" block-size="24" max="6" />
-			</view>
+	</view>
+	<view class="form-item">
+		<view class="form-item-label">系统音量:</view>
+		<view class="slider">
+			<slider name="msgVol" value="{{setInfo.msgVol}}" show-value activeColor="#5D88FF" block-size="24" max="6" />
 		</view>
+	</view>
 
-		<view class="form-item">
-			<view class="label">铃声音量:</view>
-			<view class="slider">
-				<slider name="ringVol" value="{{setInfo.ringVol}}" show-value activeColor="#5D88FF" block-size="24" max="6" />
-			</view>
+	<view class="form-item">
+		<view class="form-item-label">铃声音量:</view>
+		<view class="slider">
+			<slider name="ringVol" value="{{setInfo.ringVol}}" show-value activeColor="#5D88FF" block-size="24" max="6" />
 		</view>
-
 	</view>
-
+	
 	<button class="button-normal" form-type="submit">保存</button>
 </form>

+ 6 - 19
pages/welcome/welcome.js

@@ -10,7 +10,6 @@ Page({
    * 登录
    */
   login: function () {
-    const that = this;
     wx.login({
       success: res => {
         const params = {
@@ -18,26 +17,14 @@ Page({
         }
         //登录
         APP.Post(APP.Url.login, params).then(res => {
-          APP.globalData.openId = res.data;
-          //请求设备集合
-          that.getDeviceList(res.data);
+          APP.globalData.openId = res.data.userId;
+          APP.globalData.openNum = res.data.openNum;
+        })
+        wx.switchTab({
+          url: '/pages/index/index',
         })
       }
     })
-  },
-
-  /**
-   * 获取设备列表
-   */
-  getDeviceList: function (userId) {
-    const params = {
-      userId: userId,
-    }
-    APP.Get(APP.Url.getListByUserId, params).then(res => {
-      APP.globalData.deviceList = res.data;
-      wx.switchTab({
-        url: '/pages/index/index',
-      })
-    })
   }
+
 })

+ 11 - 6
project.config.json

@@ -6,16 +6,21 @@
   "setting": {
     "urlCheck": false,
     "es6": true,
+    "enhance": false,
     "postcss": true,
+    "preloadBackgroundData": false,
     "minified": true,
     "newFeature": true,
     "coverView": true,
+    "nodeModules": false,
     "autoAudits": false,
     "showShadowRootInWxmlPanel": true,
     "scopeDataCheck": false,
+    "uglifyFileName": false,
     "checkInvalidKey": true,
     "checkSiteMap": true,
     "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
     "useMultiFrameRuntime": true,
     "useApiHook": true,
     "useApiHostProcess": true,
@@ -24,19 +29,19 @@
       "disablePlugins": [],
       "outputPath": ""
     },
-    "bundle": false,
+    "enableEngineNative": false,
     "useIsolateContext": true,
-    "useCompilerModule": true,
-    "userConfirmedUseCompilerModuleSwitch": false,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
-    "minifyWXSS": true
+    "minifyWXSS": true,
+    "showES6CompileOption": false,
+    "minifyWXML": true
   },
   "compileType": "miniprogram",
-  "libVersion": "2.17.0",
+  "libVersion": "2.17.3",
   "appid": "wxe90699b45e28a0b6",
-  "projectname": "4G-talk",
+  "projectname": "OMP",
   "debugOptions": {
     "hidedInDevtools": []
   },