chenyi406 2 anos atrás
pai
commit
9570790f99
60 arquivos alterados com 375 adições e 1253 exclusões
  1. 24 14
      app.js
  2. 9 9
      app.json
  3. 14 100
      app.wxss
  4. BIN
      imgs/arrows.png
  5. BIN
      imgs/battery_1.png
  6. BIN
      imgs/battery_2.png
  7. BIN
      imgs/device/default.png
  8. BIN
      imgs/device/phone.png
  9. BIN
      imgs/device/scan.png
  10. BIN
      imgs/set/base.png
  11. BIN
      imgs/set/broadcast.png
  12. BIN
      imgs/set/call.png
  13. BIN
      imgs/set/concats.png
  14. BIN
      imgs/set/device.png
  15. BIN
      imgs/set/volume.png
  16. BIN
      imgs/signal_1.png
  17. BIN
      imgs/signal_2.png
  18. BIN
      imgs/signal_3.png
  19. 0 52
      pages/device/add/add.js
  20. 0 3
      pages/device/add/add.json
  21. 0 16
      pages/device/add/add.wxml
  22. 0 32
      pages/device/add/add.wxss
  23. 0 51
      pages/device/list/list.js
  24. 0 3
      pages/device/list/list.json
  25. 0 13
      pages/device/list/list.wxml
  26. 0 75
      pages/device/list/list.wxss
  27. 108 41
      pages/index/index.js
  28. 8 1
      pages/index/index.json
  29. 55 21
      pages/index/index.wxml
  30. 108 39
      pages/index/index.wxss
  31. 1 61
      pages/my/my.js
  32. 5 1
      pages/my/my.json
  33. 18 43
      pages/my/my.wxml
  34. 9 45
      pages/my/my.wxss
  35. 0 95
      pages/set/broadcast/broadcast.js
  36. 0 3
      pages/set/broadcast/broadcast.json
  37. 0 33
      pages/set/broadcast/broadcast.wxml
  38. 0 53
      pages/set/broadcast/broadcast.wxss
  39. 0 54
      pages/set/contacts/contacts.js
  40. 0 3
      pages/set/contacts/contacts.json
  41. 0 33
      pages/set/contacts/contacts.wxml
  42. 0 3
      pages/set/contacts/contacts.wxss
  43. 0 41
      pages/set/devicename/devicename.js
  44. 0 3
      pages/set/devicename/devicename.json
  45. 0 8
      pages/set/devicename/devicename.wxml
  46. 0 3
      pages/set/devicename/devicename.wxss
  47. 0 41
      pages/set/other/other.js
  48. 0 3
      pages/set/other/other.json
  49. 0 8
      pages/set/other/other.wxml
  50. 0 3
      pages/set/other/other.wxss
  51. 0 51
      pages/set/volume/volume.js
  52. 0 3
      pages/set/volume/volume.json
  53. 0 23
      pages/set/volume/volume.wxml
  54. 0 36
      pages/set/volume/volume.wxss
  55. 0 92
      pages/track/track.js
  56. 0 3
      pages/track/track.json
  57. 0 2
      pages/track/track.wxml
  58. 0 11
      pages/track/track.wxss
  59. 5 4
      pages/welcome/welcome.js
  60. 11 21
      project.config.json

+ 24 - 14
app.js

@@ -1,5 +1,5 @@
-// 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 () { },
@@ -7,26 +7,34 @@ App({
   Url: {
     // 登录
     login: appUrl + "user/login.do",
+
     // 获取设备最新位置信息
-    getLatestState: appUrl + "device/getLatestState.do",
+    getLatestLocation: appUrl + "device/getLatestDetail.do",
     // 获取用户设备集合
-    getDeviceList: appUrl + "device/getListByOpenId.do",
+    listBindDevices: appUrl + "device/listBindDevices.do",
     //修改默认设备
-    changeDefault: appUrl + "device/changeDefault.do",
+    switchDefaultDevice: appUrl + "device/switchDefault.do",
+
     //添加用户设备绑定关系
     bind: appUrl + "device/bind.do",
-    //获取默认的设备
-    getDefaultDevice: appUrl + "device/getDefaultDevice.do",
-    // 修改设备名称
-    updateName: appUrl + "device/updateName.do",
+    //解绑
+    unbind: appUrl + "device/unbind.do",
+
+    //修改绑定信息
+    updateBindInfo: appUrl + "device/updateBindInfo.do",
+    //获取绑定信息
+    getBindInfo: appUrl + "device/getBindInfo.do",
+
     //获取音量设置
     getVolume: appUrl + "setInfo/volume.do",
     //设置功能-音量
     setVolume: appUrl + "set/volume.do",
+
     //获取联系人设置
     getSos: appUrl + "setInfo/sos.do",
     //设置功能-联系人
     setSos: appUrl + "set/sos.do",
+
     //设置功能-语音播报
     setNews: appUrl + "set/news.do",
     //获取其他设置
@@ -44,7 +52,6 @@ App({
   Get: function (url, params, showLoading) {
     const that = this;
     if (showLoading) wx.showLoading();
-
     return new Promise((resolve, reject) => {
       wx.request({
         url: url,
@@ -55,8 +62,10 @@ App({
         data: params,
         success: function (res) {
           that.success(url, resolve, res);
+          wx.hideLoading();
         },
         fail: function () {
+          wx.hideLoading();
           console.log("网络异常:" + url);
           that.Modal.tips("网络异常")
         },
@@ -82,8 +91,10 @@ App({
         data: params,
         success: function (res) {
           that.success(url, resolve, res);
+          wx.hideLoading();
         },
         fail: function () {
+          wx.hideLoading();
           console.log("网络异常:" + url);
           that.Modal.tips("网络异常")
         }
@@ -97,8 +108,7 @@ App({
   success: function (url, resolve, res) {
     console.log(url);
     console.log(res.data);
-    console.log("-------------------------------------------------------")
-    wx.hideLoading();
+    console.log("-------------------------------------------------------");
     //请求成功回调函数
     switch (res.data.status) {
       case 200: //成功
@@ -132,7 +142,7 @@ App({
    * 静态数据
    */
   globalData: {
-    openId: "O+i+s1mSwU2sVfojgKde6sUW5zgr+q3fCLJaWTDiI1o=",
-    openNum: "867435051513166",
+    openId: null,
+    openNum: null,
   }
 })

+ 9 - 9
app.json

@@ -1,16 +1,16 @@
 {
   "pages": [
     "pages/welcome/welcome",
-    "pages/set/other/other",
-    "pages/my/my",
-    "pages/set/devicename/devicename",
-    "pages/set/broadcast/broadcast",
-    "pages/set/contacts/contacts",
-    "pages/set/volume/volume",
-    "pages/device/list/list",
-    "pages/device/add/add",
+    "pages/menu/bindDevice/bindDevice",
     "pages/index/index",
-    "pages/track/track"
+    "pages/my/my",
+    "pages/menu/devices/devices",
+    "pages/menu/volume/volume",
+    "pages/menu/broadcast/broadcast",
+    "pages/menu/contacts/contacts",
+    "pages/menu/other/other",
+    "pages/menu/personInfo/personInfo",
+    "pages/menu/track/track"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 14 - 100
app.wxss

@@ -62,111 +62,25 @@ page {
   --blackShadow: rgba(26, 26, 26, 0.2);
 }
 
-/* 按钮样式 */
-button::after {
-  border: none !important;
-}
-
-
-.wx-switch-input {
-  transform: scale(.7);
-}
-
-slider {
-  transform: scale(.9);
-}
-
-
-/* 按钮样式 */
-button::after {
-  border: none !important;
-}
-
-.button-normal {
-  font-weight: normal;
-  padding: 0;
-  border-radius: 80rpx;
-  text-align: center;
-  margin: 60rpx auto 0;
-  width: 70%;
-  line-height: 80rpx;
-  height: 80rpx;
-  font-size: 34rpx;
-  color: white;
-  background: #5D88FF;
-}
-
-.button-small {
-  font-weight: normal;
-  padding: 0;
-  border-radius: 80rpx;
-  text-align: center;
-  margin: 50rpx auto 0;
-  width: 60%;
-  line-height: 66rpx;
-  height: 66rpx;
-  font-size: 28rpx;
-  color: white;
-  background: #5D88FF;
-}
-
-.button-text {
-  display: inline;
-  line-height: 40rpx;
-  font-weight: normal;
-  padding: 0 !important;
-  margin: 0 !important;
-  border-radius: 0;
-  font-size: 34rpx;
-  color: #5D88FF;
-  background: none;
-}
-
-/* 表单空白块 */
-.form {
-  display: block;
-  position: relative;
-  background: white;
-  width: 100%;
-  box-sizing: border-box;
-  padding: 20rpx 30rpx;
-}
-
-/* 表单行 */
-.form-item {
-  position: relative;
+/*按钮样式 */
+.btn-form-wapper {
   width: 100%;
-  height: 80rpx;
-  line-height: 80rpx;
-  box-sizing: border-box;
-  padding-left: 170rpx;
-  margin-bottom: 10rpx;
+  overflow: hidden;
 }
 
-.form-item-label {
-  position: absolute;
-  top: 0;
-  left: 0;
-  color: var(--darkGray);
-  text-align: right;
-  width: 150rpx;
-  font-size: 28rpx;
-}
-
-.form-item-input-normal {
-  color: var(--black);
-  width: 100%;
-  height: 100%;
-  border-bottom: 2rpx dashed #eee;
-  box-sizing: border-box;
-  font-size: 30rpx;
+.btn-form {
+  width: 120rpx !important;
+  height: 60rpx !important;
+  font-size: 24rpx !important;
+  line-height: 100rpx !important;
+  padding: 0 !important;
+  border-radius: 8rpx !important;
+  float: right;
+  margin: 30rpx !important;
 }
 
-.block-title {
-  width: 100%;
-  line-height: 40rpx;
-  font-size: 26rpx;
-  color: #333;
+slider {
+  transform: scale(.85);
 }
 
 /*遮罩层*/

BIN
imgs/arrows.png


BIN
imgs/battery_1.png


BIN
imgs/battery_2.png


BIN
imgs/device/default.png


BIN
imgs/device/phone.png


BIN
imgs/device/scan.png


BIN
imgs/set/base.png


BIN
imgs/set/broadcast.png


BIN
imgs/set/call.png


BIN
imgs/set/concats.png


BIN
imgs/set/device.png


BIN
imgs/set/volume.png


BIN
imgs/signal_1.png


BIN
imgs/signal_2.png


BIN
imgs/signal_3.png


+ 0 - 52
pages/device/add/add.js

@@ -1,52 +0,0 @@
-const APP = getApp();
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    deviceNum: "",
-  },
-  /**
-   * 扫码
-   */
-  scanCode: function () {
-    const that = this;
-    wx.scanCode({
-      success(res) {
-        that.setData({
-          deviceNum: res.result
-        })
-      },
-      fail: function () {
-        console.log("调用摄像头失败")
-      }
-    })
-  },
-  /**
-   * 提交表单
-   */
-  submit: function (form) {
-    const params = {
-      deviceName: form.detail.value.deviceName,
-      openNum: form.detail.value.openNum,
-    }
-    if (params.openNum == null || params.openNum == "") {
-      APP.Modal.tips("请输入设备码!")
-      return;
-    }
-    if (params.deviceName == null || params.deviceName == "") {
-      APP.Modal.tips("请输入设备名称!")
-      return;
-    }
-    //禁用提交按钮
-    this.setData({
-      openNum: "",
-      deviceName: "",
-    })
-    APP.Post(APP.Url.bind, params).then(res => {
-      APP.Modal.tips("添加成功!");
-    })
-  }
-
-})

+ 0 - 3
pages/device/add/add.json

@@ -1,3 +0,0 @@
-{
-  "navigationBarTitleText": "添加设备"
-}

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

@@ -1,16 +0,0 @@
-<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>

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

@@ -1,32 +0,0 @@
-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 - 51
pages/device/list/list.js

@@ -1,51 +0,0 @@
-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 - 3
pages/device/list/list.json

@@ -1,3 +0,0 @@
-{
-  "navigationBarTitleText": "设备管理"
-}

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

@@ -1,13 +0,0 @@
-<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>

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

@@ -1,75 +0,0 @@
-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;
-}

+ 108 - 41
pages/index/index.js

@@ -1,11 +1,18 @@
 const APP = getApp();
-let mapContext; //地图对象
+//地图对象
+let mapContext;
 //定时刷新位置信息对象
-let clockRefresh = null;
+let locationInterval = null;
 //持续定位定时任务对象
-let continueRefresh = null;
+let freqInterval = null;
+//倒计时定时任务对象
+let countDownInterval = null;
+
 Page({
   data: {
+    schedule: 0,
+    circle: false,
+    loading: false,
     stateInfo: null, //设备状态信息
     markers: [], //地图标记 
   },
@@ -24,7 +31,7 @@ Page({
       return;
     }
     //请求设备位置
-    this.getLatestState(APP.globalData.openNum);
+    this.getLatestLocation(APP.globalData.openNum);
     //开启定时任务-定时刷新位置信息
     this.intervalRefresh(APP.globalData.openNum);
     //开启定时任务-高频定位模式
@@ -34,10 +41,10 @@ Page({
   // 监听页面隐藏 
   onHide: function () {
     //清除定时
-    clearInterval(clockRefresh);
-    clearInterval(continueRefresh);
-    clockRefresh = null;
-    continueRefresh = null;
+    clearInterval(locationInterval);
+    clearInterval(freqInterval);
+    locationInterval = null;
+    freqInterval = null;
   },
 
   /**
@@ -46,29 +53,36 @@ Page({
   intervalRefresh: function (openNum) {
     console.log("启动定时刷新位置")
     const that = this;
-    if (clockRefresh != null) return;
-    clockRefresh = setInterval(function () {
-      that.getLatestStateInterval(openNum);
-    }, 15000)
+    if (locationInterval == null) {//不为空说明已经被初始化,则不做处理
+      that.countDown(14);
+      locationInterval = setInterval(function () {
+        APP.Get(APP.Url.getLatestLocation, { openNum: openNum }, false).then(res => {
+          that.countDown(14);
+          that.updateStateInfo(res.data);
+        })
+      }, 15000)
+    }
   },
 
   /**
-   * 定时设置持续定位
+   * 定时开启高频定位
    */
   intervalSetContinue: function (openNum) {
     console.log("启动持续定位")
     const that = this;
-    if (continueRefresh != null) return;
-    that.setContinue(openNum);
-    continueRefresh = setInterval(function () {
-      that.setContinue(openNum);
-    }, 240000)
+    if (freqInterval == null) {
+      that.startHighFreq(openNum)
+      freqInterval = setInterval(function () {
+        that.startHighFreq(openNum);
+      }, 240000)
+    }
+
   },
 
   /**
-   * 设置持续定位
+   * 开启高频定位
    */
-  setContinue: function (openNum) {
+  startHighFreq: function (openNum) {
     const params = {
       openNum: openNum,
       highFreq: 1
@@ -80,43 +94,31 @@ Page({
   /**
    * 获取设备位置
    */
-  getLatestState: function (openNum) {
+  getLatestLocation(openNum) {
     const that = this;
     const params = {
       openNum: openNum
     }
-    APP.Get(APP.Url.getLatestState, params, false).then(res => {
-      const stateInfo = res.data;
-      if (stateInfo == null) {
+    APP.Get(APP.Url.getLatestLocation, params, false).then(res => {
+      const detail = res.data;
+      if (detail == null) {
         APP.Modal.tips("该设备还没有上传位置信息");
         return;
       }
       //首次加载聚焦中心为当前位置
       mapContext.moveToLocation({
-        latitude: parseFloat(stateInfo.latGcj), //纬度 
-        longitude: parseFloat(stateInfo.lonGcj), //经度
+        latitude: detail.latGcj, //纬度 
+        longitude: detail.lonGcj, //经度
       })
-      that.setStateInfo(stateInfo);
-    })
-  },
-
-  /**
-   * 获取设备位置
-   * 定时器
-   */
-  getLatestStateInterval: function (openNum) {
-    const params = {
-      openNum: openNum
-    }
-    APP.Get(APP.Url.getLatestState, params, false).then(res => {
-      this.setStateInfo(res.data);
+      //更新位置数据
+      that.updateStateInfo(detail);
     })
   },
 
   /**
    * 设置位置等状态信息
    */
-  setStateInfo: function (stateInfo) {
+  updateStateInfo(stateInfo) {
     if (stateInfo == null) return;
     //定位时间
     stateInfo.uploadTimeFormat = this.formatTime(stateInfo.uploadTime)
@@ -144,4 +146,69 @@ Page({
     if (diff < 31104000) return parseInt(diff / 86400) + "天前";
     return "1年前";
   },
+
+  /**
+   * 倒计时
+   */
+  countDown(second) {
+    const that = this;
+    if (countDownInterval == null) {
+      //系数
+      let factor = 100 / second;
+      //初始化步数
+      let step = 1;
+      //初始化进度条进度
+      this.setData({
+        schedule: 0,
+        circle: true,
+        loading: false
+      })
+
+      //定时器
+      countDownInterval = setInterval(() => {
+        //如果到达指定步数,则关闭定时
+        if (step >= second) {
+          clearInterval(countDownInterval);
+          countDownInterval = null;
+          this.setData({
+            schedule: 0,
+            circle: false,
+            loading: true
+          })
+        }
+        //进度条增加
+        that.setData({
+          schedule: factor * step
+        })
+        //步数增加
+        step = step + 1;
+      }, 1000);
+    }
+  },
+
+  /**
+   * 刷新
+   */
+  refresh() {
+    wx.showLoading({
+      title: '正在刷新',
+    })
+    setTimeout(function () {
+      wx.hideLoading();
+      APP.Modal.tips("刷新成功");
+    }, 600)
+  },
+
+  call() {
+    APP.Modal.tips("功能暂未开通");
+  },
+
+  openMapApp() {
+    const params = {
+      longitude: this.data.stateInfo.lonGcj,
+      latitude: this.data.stateInfo.latGcj,
+      destination: "手机所在位置"
+    }
+    mapContext.openMapApp(params);
+  }
 })

+ 8 - 1
pages/index/index.json

@@ -1,3 +1,10 @@
 {
-  "navigationBarTitleText": "首页"
+  "navigationBarTitleText": "首页",
+  "usingComponents": {
+    "van-dropdown-menu": "/@vant/dropdown-menu/index",
+    "van-dropdown-item": "/@vant/dropdown-item/index",
+    "van-icon": "/@vant/icon/index",
+    "van-circle": "/@vant/circle/index",
+    "van-loading": "/@vant/loading/index"
+  }
 }

+ 55 - 21
pages/index/index.wxml

@@ -1,25 +1,59 @@
-<map id="map" longitude="116.3976" latitude="39.909" scale="17" markers="{{markers}}" show-location polyline="{{polyline}}" class="map"></map>
-
-<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 class="count">
+  <van-circle value="{{ schedule }}" size="25" color="#5CA5F9" speed="8" wx:if="{{circle}}" />
+  <van-loading type="spinner" size="25" color="#5CA5F9" wx:if="{{loading}}" />
+</view>
+
+<map id="map" longitude="116.3976" latitude="39.909" scale="17" markers="{{markers}}" show-location class="map"></map>
+
+<view class="panel">
+
+  <view class="panel-base">
+    <image src="/imgs/avatar.png" class="panel-base-avatar" />
+
+    <view class="panel-base-name">{{stateInfo.deviceName}}</view>
+
+    <view class="panel-base-battery">
+      <image src="/imgs/battery/100.png" wx:if="{{stateInfo.batteryNum>=90}}" />
+      <image src="/imgs/battery/75.png" wx:if="{{stateInfo.batteryNum >= 60 && stateInfo.batteryNum < 90}}" />
+      <image src="/imgs/battery/50.png" wx:if="{{stateInfo.batteryNum >= 30 && stateInfo.batteryNum < 60}}"/>
+      <image src="/imgs/battery/25.png" wx:if="{{stateInfo.batteryNum < 30}}" />
+      <text>{{stateInfo.batteryNum == null ? '' : stateInfo .batteryNum + "%"}}</text>
+    </view>
+
+    <view class="panel-base-call" bindtap="call">
+      <van-icon name="phone" />
+      <text>电话</text>
+    </view>
+
+  </view>
+
+  <view class="panel-site">
+
+    <view class="panel-site-text">
+      <view class="panel-site-nav" bindtap="openMapApp">
+        <image src="/imgs/guide.png"></image>
+        <text>导航</text>
+      </view>
+      <text>{{stateInfo.site}}</text>
+    </view>
+
+    <view class="panel-site-refresh" bindtap="refresh">
+      <van-icon name="replay" size="45rpx" />
+    </view>
+
+    <view class="panel-site-date">{{stateInfo.uploadTimeFormat}}</view>
+
+  </view>
+
 </view>
 
 <view class="debug">
-	<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>信号: {{stateInfo.signalNum}}</view>
+  <view>电量: {{stateInfo.batteryNum}}</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>

+ 108 - 39
pages/index/index.wxss

@@ -1,64 +1,123 @@
 page {
+  position: relative;
   box-sizing: border-box;
-  padding-bottom: 180rpx;
+  padding-bottom: 250rpx;
   overflow: hidden;
   width: 100%;
   height: 100%;
 }
 
-.map {
-  z-index: 1;
+.count {
+  z-index: 99;
+  position: fixed;
+  top: 30rpx;
+  left: 30rpx;
+}
+
+
+.panel {
+  box-sizing: border-box;
+  padding-top: 10rpx;
   width: 100%;
-  height: 100%;
+  height: 250rpx;
 }
 
-.card {
+.panel-base {
+  position: relative;
   width: 100%;
-  height: 180rpx;
-  z-index: 2;
+  height: 120rpx;
   box-sizing: border-box;
-  padding: 20rpx;
-  position: fixed;
-  bottom: 0;
-  background: white;
-  box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.12);
+  padding-left: 120rpx;
 }
 
-.card-bar {
-  height: 50rpx;
-  line-height: 50rpx;
+.panel-base-avatar {
+  position: absolute;
+  top: 15rpx;
+  left: 15rpx;
+  width: 90rpx;
+  height: 90rpx;
 }
 
-.card-bar-name {
-  font-size: 30rpx;
+.panel-base-name {
+  box-sizing: border-box;
+  width: 100%;
+  height: 60rpx;
+  line-height: 60rpx;
+  font-size: 28rpx;
 }
 
-.card-bar .sign {
-  margin-right: 10rpx;
-  color: var(--grey);
+.panel-base-battery {
+  box-sizing: border-box;
+  line-height: 20rpx;
+}
+
+.panel-base-battery image {
+  vertical-align: text-top;
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.panel-base-battery text {
+  margin-left: 10rpx;
   font-size: 24rpx;
-  float: right;
 }
 
-.card-bar-img-signal {
-  margin-right: 20rpx;
-  margin-top: 8rpx;
-  float: right;
-  width: 30rpx;
-  height: 30rpx;
+.panel-base-call {
+  text-align: center;
+  line-height: 60rpx;
+  color: white;
+  top: 25rpx;
+  right: 20rpx;
+  border-radius: 100rpx;
+  position: absolute;
+  width: 120rpx;
+  height: 60rpx;
+  background: linear-gradient(45deg, rgb(135, 235, 111), rgb(18, 220, 123));
 }
 
-.card-bar-img-battery {
-  margin-right: 20rpx;
-  margin-top: 8rpx;
-  float: right;
-  width: 36rpx;
-  height: 36rpx;
+.panel-site {
+  margin-top: 10rpx;
+  overflow: hidden;
+  width: 100%;
+  height: 100rpx;
+}
+
+.panel-site-text {
+  display: inline-block;
+  position: relative;
+  box-sizing: border-box;
+  padding-left: 20rpx;
+  width: 480rpx;
+  height: 100rpx;
+  color: var(--darkGray);
+  font-size: 26rpx;
+  line-height: 40rpx;
+  text-indent: 100rpx;
+}
+
+.panel-site-nav {
+  position: absolute;
+  top: 0;
+  left: 15rpx;
+  width: 90rpx;
+  height: 40rpx;
+  background: var(--greyLight);
+  border-radius: 100rpx;
+  font-size: 22rpx;
+  line-height: 40rpx;
+  color: var(--black);
+  text-indent: 0;
+  text-align: center;
+}
+
+.panel-site-nav image {
+  width: 20rpx;
+  height: 20rpx;
 }
 
-.card-bar-date {
+.panel-site-date {
   float: right;
-  margin-top: 5rpx;
+  margin-right: 10rpx;
   background: rgba(89, 170, 255, 0.2);
   text-align: center;
   font-size: 22rpx;
@@ -69,13 +128,23 @@ page {
   line-height: 40rpx;
 }
 
-.card-content {
-  color: var(--darkGray);
-  font-size: 28rpx;
+.panel-site-refresh {
   box-sizing: border-box;
+  padding-top: 12rpx;
+  text-align: center;
+  float: right;
+  width: 70rpx;
+  height: 70rpx;
+  background: var(--greyLight);
+  border-radius: 70rpx;
+  margin: 15rpx 30rpx;
+
+}
+
+.map {
+  z-index: 1;
   width: 100%;
   height: 100%;
-  padding-top: 10rpx;
 }
 
 .debug {

+ 1 - 61
pages/my/my.js

@@ -5,66 +5,6 @@ Page({
    * 页面的初始数据
    */
   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
-      })
-    })
-  },
-
-  /**
-   * 跳转至子页面页面
-   */
-  toDevices: function () {
-    wx.navigateTo({
-      url: '/pages/device/list/list',
-    })
-  },
-
-  /**
-   * 跳转至子页面页面
-   */
-  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/devicename/devicename',
-    })
   }
+
 })

+ 5 - 1
pages/my/my.json

@@ -1,3 +1,7 @@
 {
-  "navigationBarTitleText": "个人中心"
+  "navigationBarTitleText": "个人中心",
+  "usingComponents": {
+    "van-grid": "/@vant/grid/index",
+    "van-grid-item": "/@vant/grid-item/index"
+  }
 }

+ 18 - 43
pages/my/my.wxml

@@ -1,47 +1,22 @@
 <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 class="user-info-avatar">
+    <open-data type="userAvatarUrl" />
+  </view>
+  <view class="user-info-nickname">
+    <open-data type="userNickName"></open-data>
+  </view>
 </view>
 
-<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="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="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="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-title"><text>功能应用</text></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>
+<van-grid column-num="4">
+  <van-grid-item icon="/imgs/set/person.png" text="设备信息" link-type="navigateTo" url="/pages/menu/personInfo/personInfo" />
+  <van-grid-item icon="/imgs/set/scan.png" text="绑定设备" link-type="navigateTo" url="/pages/menu/bindDevice/bindDevice" />
+  <van-grid-item icon="/imgs/set/switch.png" text="设备管理" link-type="navigateTo" url="/pages/menu/devices/devices" />
+  <van-grid-item icon="/imgs/set/contact.png" text="通讯录" link-type="navigateTo" url="/pages/menu/contacts/contacts" />
+  <van-grid-item icon="/imgs/set/volume.png" text="音量设置" link-type="navigateTo" url="/pages/menu/volume/volume" />
+  <van-grid-item icon="/imgs/set/broadcast.png" text="语音播报" link-type="navigateTo" url="/pages/menu/broadcast/broadcast" />
+  <!-- <van-grid-item icon="/imgs/set/phone.png" text="通话记录" link-type="navigateTo" url="/pages/menu/personInfo/personInfo" /> -->
+  <!-- <van-grid-item icon="/imgs/set/foot.png" text="历史轨迹" link-type="navigateTo" url="/pages/menu/track/track" /> -->
+  <van-grid-item icon="/imgs/set/set.png" text="系统设置" link-type="navigateTo" url="/pages/menu/other/other" />
+</van-grid>

+ 9 - 45
pages/my/my.wxss

@@ -4,7 +4,7 @@ page {
 
 .user-info {
   width: 100%;
-  height: 220rpx;
+  height: 200rpx;
   background: white;
   position: relative;
   box-sizing: border-box;
@@ -17,56 +17,20 @@ page {
   top: 50rpx;
   left: 30rpx;
   overflow: hidden;
-  width: 120rpx;
-  height: 120rpx;
+  width: 110rpx;
+  height: 110rpx;
   border-radius: 10rpx;
 }
 
-.user-info-devicename {
-  height: 80rpx;
-  font-size: 30rpx;
-  color: var(--black);
-  font-weight: bold;
-}
-
 .user-info-nickname {
   height: 40rpx;
-  font-size: 24rpx;
-}
-
-.user-info-arrows {
-  position: absolute;
-  right: 30rpx;
-  top: 130rpx;
-  width: 16rpx;
-  height: 30rpx;
+  font-size: 30rpx;
 }
 
-.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;
+.menu-title {
   color: var(--darkGray);
-}
-
-.menu-icon {
-  position: absolute;
-  top: 20rpx;
-  left: 30rpx;
-  width: 40rpx;
-  height: 40rpx;
-}
-
-.menu-arrows {
-  position: absolute;
-  right: 30rpx;
-  top: 30rpx;
-  width: 16rpx;
-  height: 30rpx;
+  box-sizing: border-box;
+  padding-left: 20rpx;
+  line-height: 50rpx;
+  font-size: 22rpx;
 }

+ 0 - 95
pages/set/broadcast/broadcast.js

@@ -1,95 +0,0 @@
-const APP = getApp();
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    time: "点击选择时间",
-    typeIdx: 0,
-    typeList: [{
-      id: 1,
-      name: "实时播报"
-    },
-      //  {
-      //   id: 0,
-      //   name: "固定播报"
-      // }
-    ],
-    weekList: [{
-      id: 7,
-      name: "日"
-    }, {
-      id: 1,
-      name: "一"
-    }, {
-      id: 2,
-      name: "二"
-    }, {
-      id: 3,
-      name: "三"
-    }, {
-      id: 4,
-      name: "四"
-    }, {
-      id: 5,
-      name: "五"
-    }, {
-      id: 6,
-      name: "六"
-    }]
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) { },
-
-  /**
-   * 监听-时间选择切换
-   */
-  bindTimeChange: function (event) {
-    this.setData({
-      time: event.detail.value,
-    })
-  },
-
-  /**
-   * 监听-播报类型切换
-   */
-  bindTypeChange: function (event) {
-    this.setData({
-      typeIdx: event.detail.value,
-    })
-  },
-
-  /**
-   * 发送播报消息
-   */
-  setNews: function (form) {
-    const data = {
-      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.news == null || data.news == "") {
-      APP.Modal.tips("播报内容不为空!")
-      return;
-    }
-    APP.Post(APP.Url.setNews, data).then(res => {
-      APP.Modal.tips("发送成功!")
-    }).catch(res => {
-      console.log(res)
-      APP.Modal.tips("发送失败!")
-    })
-  },
-})

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

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

+ 0 - 33
pages/set/broadcast/broadcast.wxml

@@ -1,33 +0,0 @@
-<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="form-item-label">播报周期:</view>
-      <checkbox-group bindchange="checkboxChange">
-        <label wx:for="{{weekList}}" class="checkBox">
-          <checkbox value="{{item.id}}" />
-          <text>{{item.name}}</text>
-        </label>
-      </checkbox-group>
-    </view>
-
-    <view class="form-item" wx:if="{{typeIdx==1}}">
-      <view class="label">时间:</view>
-      <picker mode="time" value="{{time}}" start="00:00" end="23:59" bindchange="bindTimeChange">
-        <view class="picker">{{time}}</view>
-      </picker>
-    </view> -->

+ 0 - 53
pages/set/broadcast/broadcast.wxss

@@ -1,53 +0,0 @@
-page {
-  background: #F3F5F9;
-}
-
-.form-item picker {
-  font-size: 28rpx;
-  color: #666;
-  width: 500rpx;
-  height: 70rpx;
-  box-sizing: border-box;
-  border-bottom: 2rpx dashed #eee;
-}
-
-picker view {
-  width: 500rpx;
-  height: 70rpx;
-}
-
-.content {
-  height: 200rpx;
-}
-
-.content textarea {
-  box-sizing: border-box;
-  padding-top: 20rpx;
-  line-height: 30rpx;
-}
-
-.checkBox {
-  margin-left: 20rpx;
-}
-
-
-.mask {
-  width: 100%;
-  height: 100%;
-  position: fixed;
-  top: 0;
-  left: 0;
-  background: rgba(0, 0, 0, .4);
-}
-
-.dialog {
-  box-sizing: border-box;
-  padding: 30rpx 20rpx 30rpx 0;
-  border-radius: 15rpx;
-  left: 50rpx;
-  top: 300rpx;
-  position: fixed;
-  width: 650rpx;
-  background: white;
-  z-index: 99;
-}

+ 0 - 54
pages/set/contacts/contacts.js

@@ -1,54 +0,0 @@
-const APP = getApp();
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    setInfo: null,//设置信息
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function () {
-    this.getSetInfo(APP.globalData.openNum);
-  },
-
-  /**
-   * 设置按键
-   */
-  setSos: function (form) {
-    const that = this;
-    const params = {
-      openNum: this.data.setInfo.openNum,
-      key0Name: form.detail.value.key0Name,
-      key0Phone: form.detail.value.key0Phone,
-      key1Name: form.detail.value.key1Name,
-      key1Phone: form.detail.value.key1Phone,
-      key2Name: form.detail.value.key2Name,
-      key2Phone: form.detail.value.key2Phone,
-    }
-    APP.Post(APP.Url.setSos, params).then(res => {
-      that.getSetInfo(params.openNum)
-      APP.Modal.tips("设置成功!")
-    }).catch(res => {
-      APP.Modal.tips("设置失败!")
-    })
-  },
-
-  /**
-   * 获取设备设置信息
-   */
-  getSetInfo: function (openNum) {
-    const params = {
-      openNum: openNum,
-    }
-    APP.Get(APP.Url.getSos, params, false).then(res => {
-      this.setData({
-        setInfo: res.data
-      })
-    })
-  },
-
-})

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

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

+ 0 - 33
pages/set/contacts/contacts.wxml

@@ -1,33 +0,0 @@
-<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="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>按键 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>

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

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

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

@@ -1,41 +0,0 @@
-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();
-    })
-  }
-})

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

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

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

@@ -1,8 +0,0 @@
-<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 - 3
pages/set/devicename/devicename.wxss

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

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

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

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

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

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

@@ -1,8 +0,0 @@
-<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>

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

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

+ 0 - 51
pages/set/volume/volume.js

@@ -1,51 +0,0 @@
-const APP = getApp();
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    setInfo: null //设置信息
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function () {
-    this.getVolume(APP.globalData.openNum);
-  },
-
-  /**
-   * 提交表单
-   */
-  submit: function (form) {
-    const parmas = {
-      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.openNum);
-      APP.Modal.tips("设置成功!")
-    }).catch(res => {
-      console.log(res)
-      APP.Modal.tips("设置失败!")
-    })
-  },
-
-  /**
-   * 获取设备音量设置
-   */
-  getVolume: function (openNum) {
-    const that = this;
-    const params = {
-      openNum: openNum,
-    }
-    APP.Get(APP.Url.getVolume, params, false).then(res => {
-      that.setData({
-        setInfo: res.data
-      })
-    })
-  },
-})

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

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

+ 0 - 23
pages/set/volume/volume.wxml

@@ -1,23 +0,0 @@
-<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>
-	<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="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>

+ 0 - 36
pages/set/volume/volume.wxss

@@ -1,36 +0,0 @@
-page {
-  background: #F3F5F9;
-}
-
-.form-item .slider {
-  overflow: hidden;
-  height: 100%;
-  width: 100%;
-  box-sizing: border-box;
-}
-
-.slider slider {
-  margin: 0 !important;
-}
-
-.list {
-  display: block;
-  padding-left: 30rpx;
-  font-size: 28rpx;
-  margin-top: 10rpx;
-  line-height: 70rpx;
-  width: 100%;
-  height: 70rpx;
-  box-sizing: border-box;
-  border-bottom: 2rpx dashed #eee;
-}
-
-.list radio {
-  float: right;
-}
-
-radio .wx-radio-input {
-  width: 35rpx;
-  height: 35rpx;
-
-}

+ 0 - 92
pages/track/track.js

@@ -1,92 +0,0 @@
-const APP = getApp();
-let mapContext; //地图对象
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    mapCenter: { //地图聚焦中心 默认北京
-      latitude: 39.5395312,
-      longitude: 116.7265250,
-    },
-    markers: [
-      {
-        id: 1,
-        iconPath: "/imgs/marker.png",
-        latitude: 39.54843965881564,
-        longitude: 116.77418632902149,
-        width: 35,
-        height: 35
-      },
-      {
-        id: 2,
-        iconPath: "/imgs/marker.png",
-        latitude: 39.547527631306934,
-        longitude: 116.77166040587744,
-        width: 35,
-        height: 35
-      },
-      {
-        id: 3,
-        iconPath: "/imgs/marker.png",
-        latitude: 39.5434256,
-        longitude: 116.7548242,
-        width: 35,
-        height: 35
-      }, {
-        id: 4,
-        iconPath: "/imgs/marker.png",
-        latitude: 39.5395312,
-        longitude: 116.7265250,
-        width: 35,
-        height: 35
-      }
-      , {
-        id: 5,
-        iconPath: "/imgs/marker.png",
-        latitude: 39.5368093,
-        longitude: 116.7186292,
-        width: 35,
-        height: 35
-      }],
-    polyline: [{
-      points: [
-        {
-          latitude: 39.54843965881564,
-          longitude: 116.77418632902149
-        }, {
-          latitude: 39.547527631306934,
-          longitude: 116.77166040587744
-        }, {
-          latitude: 39.5434256,
-          longitude: 116.7548242
-        }, {
-          latitude: 39.5395312,
-          longitude: 116.7265250
-        },
-        {
-          latitude: 39.5368093,
-          longitude: 116.7186292
-        }],
-      width: 5,
-      arrowLine: true,
-      color: "#5D88FF"
-    }],
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    // 获取地图对象
-    mapContext = wx.createMapContext('map');
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-})

+ 0 - 3
pages/track/track.json

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

+ 0 - 2
pages/track/track.wxml

@@ -1,2 +0,0 @@
-<map id="map" longitude="{{mapCenter.longitude}}" latitude="{{mapCenter.latitude}}" scale="13" markers="{{markers}}"
-  show-location polyline="{{polyline}}" class="map"></map>

+ 0 - 11
pages/track/track.wxss

@@ -1,11 +0,0 @@
-page {
-  overflow: hidden;
-  width: 100%;
-  height: 100%;
-}
-
-.map {
-  z-index: 1;
-  width: 100%;
-  height: 100%;
-}

+ 5 - 4
pages/welcome/welcome.js

@@ -6,10 +6,11 @@ Page({
   onLoad: function (options) {
     this.login();
   },
+
   /**
    * 登录
    */
-  login: function () {
+  login() {
     wx.login({
       success: res => {
         const params = {
@@ -19,9 +20,9 @@ Page({
         APP.Post(APP.Url.login, params).then(res => {
           APP.globalData.openId = res.data.userId;
           APP.globalData.openNum = res.data.openNum;
-        })
-        wx.switchTab({
-          url: '/pages/index/index',
+          wx.switchTab({
+            url: '/pages/index/index',
+          })
         })
       }
     })

+ 11 - 21
project.config.json

@@ -1,7 +1,8 @@
 {
   "description": "项目配置文件",
   "packOptions": {
-    "ignore": []
+    "ignore": [],
+    "include": []
   },
   "setting": {
     "urlCheck": false,
@@ -21,6 +22,7 @@
     "checkSiteMap": true,
     "uploadWithSourceMap": true,
     "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
     "useMultiFrameRuntime": true,
     "useApiHook": true,
     "useApiHostProcess": true,
@@ -30,37 +32,25 @@
       "outputPath": ""
     },
     "enableEngineNative": false,
-    "useIsolateContext": true,
+    "useIsolateContext": false,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": true,
+    "disableUseStrict": false,
+    "minifyWXML": true,
     "showES6CompileOption": false,
-    "minifyWXML": true
+    "useCompilerPlugins": false
   },
   "compileType": "miniprogram",
   "libVersion": "2.17.3",
   "appid": "wxe90699b45e28a0b6",
   "projectname": "OMP",
-  "debugOptions": {
-    "hidedInDevtools": []
-  },
-  "isGameTourist": false,
   "simulatorType": "wechat",
   "simulatorPluginLibVersion": {},
-  "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
-    "game": {
-      "currentL": -1,
-      "list": []
-    },
-    "miniprogram": {
-      "list": []
-    }
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
   }
 }