Browse Source

feature: 隐私政策和用户协议分包

332777428@qq.com 6 months ago
parent
commit
b58d169d7f

+ 6 - 4
pages/deviceDetail/detail.js

@@ -42,8 +42,8 @@ Page({
 
 
   goToWallpaper: function () {
-    let newParam = JSON.stringify(this.data.device);
-    route_util.jumpParam('/pages/piano/wallpaper/wallpaper', newParam)
+    var param = '?param=' + JSON.stringify(this.data.device);
+    route_util.jumpParam('/pages/piano/wallpaper/wallpaper', param)
   },
 
   goToOta: function () {
@@ -58,11 +58,13 @@ Page({
       "device": this.data.device,
       "otaData": this.data.updateData,
     }
-    let newParam = JSON.stringify(param);
+
     // wx.navigateTo({
     //   url: '/pages/ota/ota' + "?param=" + param
     // });
-    route_util.jumpParam('/pages/ota/ota', newParam)
+
+    var param = '?param=' + JSON.stringify(param);
+    route_util.jumpParam('/pages/ota/ota', param);
   },
   powerTap(e) {
     console.log(e)

+ 4 - 2
pages/pageA/index/index.js

@@ -7,8 +7,9 @@ const {
 import timeUtil from '../../../utils/time_util.js';
 import strings from '../../../utils/strings.js';
 import store from '../../../utils/store.js';
-import route_constant from '../../../utils/route_constant.js';
+
 import route_util from '../../../utils/route_util.js';
+import route_constant from '../../../utils/route_constant.js';
 
 /// 乐鑫相关
 import lexin_util from '../../../utils/lexin/util.js';
@@ -517,7 +518,8 @@ Page({
 
     ///去蓝牙连接处理
     if (index === deviceListSelect) {
-      route_util.jumpParam('/pages/deviceDetail/detail', JSON.stringify(device))
+      var param = '?param=' + JSON.stringify(device);
+      route_util.jumpParam('/pages/deviceDetail/detail', param);
     } else if (device.state === "offline") {
       console.log("去连接蓝牙", device)
       device.name = device.devName;

+ 4 - 3
pages/pageB/about/about.js

@@ -1,3 +1,5 @@
+import route_util from '../../../utils/route_util.js';
+import route_constant from '../../../utils/route_constant.js';
 Page({
   data: {
     nvabarData: {
@@ -7,8 +9,7 @@ Page({
   },
 
   go(e) {
-    wx.navigateTo({
-      url: './../aboutInfo/aboutInfo?type=' + e.currentTarget.dataset.index,
-    })
+    var param = '?type=' + e.currentTarget.dataset.index;
+    route_util.jumpParam(route_constant.aboutInfo, param);
   },
 })

File diff suppressed because it is too large
+ 207 - 0
pages/pageB/connectBle/connectBle.js


+ 5 - 0
pages/pageB/connectBle/connectBle.json

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

+ 9 - 0
pages/pageB/connectBle/connectBle.wxml

@@ -0,0 +1,9 @@
+<view class="container">
+  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
+  <image class="device_pic" src="{{deviceImg}}" mode="aspectFill" />
+  <view class="top_tips main_black">{{searchTips}}</view>
+  <view style="font-size: 28rpx; color: #666666; margin-top: 32rpx; display: flex; justify-content: center; align-items: center;margin-inline: 32rpx;">
+    {{subTips}}
+  </view>
+  <view class="main_color connect_button" bind:tap="connectDeviceTap">{{buttonTips}}</view>
+</view>

+ 39 - 0
pages/pageB/connectBle/connectBle.wxss

@@ -0,0 +1,39 @@
+/* pages/connectBle/connectBle.wxss */
+.container {
+	position: relative;
+	height: 100vh;
+}
+
+.device_pic {
+	margin-top: 128rpx;
+	margin-left: 140rpx;
+	/* margin-right: 140rpx; */
+	width: 470rpx;
+	height: 432rpx;
+	background: #F2F5F7;
+	border-radius: 24rpx;
+}
+
+.top_tips {
+	margin-top: 128rpx;
+	margin-inline: 20rpx;
+	font-size: 28rpx;
+	text-align: center;
+	justify-content: center;
+	align-items: center;
+
+}
+
+.connect_button {
+	margin-top: 456rpx;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	margin-inline: 64rpx;
+	font-size: 32rpx;
+	font-weight: Medium;
+	color: white;
+	text-align: center;
+	border-radius: 44rpx;
+	height: 88rpx;
+}

+ 148 - 0
pages/pageB/deviceConMode/deviceConMode.js

@@ -0,0 +1,148 @@
+import routeUtil from '../../../utils/route_util'
+import route_constant from '../../../utils/route_constant.js'
+Page({
+
+  data: {
+    scopeBluetooth: false,
+    userFuzzyLocation: true,
+    nvabarData: {
+      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
+      title: '配网模式选择', //导航栏 中间的标题
+    },
+    isNotruter: false,
+    model: "",
+    connectDevice: {},
+    typeList: [{
+        "icon": "../../images/device/mode_2.png",
+        "text": "WiFi模式",
+        "type": 2,
+      },
+      {
+        "icon": "../../images/device/mode_1.png",
+        "text": "蓝牙模式",
+        "type": 1,
+      },
+      {
+        "icon": "../../images/device/mode_4.png",
+        "text": "4G模式",
+        "type": 4,
+      },
+    ],
+  },
+
+  getModeName(curItem) {
+    // 设备类型:1-蓝牙,2-Wifi,3-传统蓝牙,4-4G
+    var str = "";
+    if (curItem.type == 4) {
+      str = "移动数据模式";
+    } else if (curItem.type == 2) {
+      str = "WiFi模式";
+    } else if (curItem.type == 1) {
+      str = "蓝牙模式";
+    }
+    return str;
+  },
+
+  nextTap(e) {
+    if (this.nullTips()) {
+      return
+    }
+    let device = this.data.typeList[0];
+    let type = device.type ?? 0;
+    console.log("选择模式", type)
+    ///蓝牙模式
+    if (type == 1) {
+      // let device = e.currentTarget.dataset.data
+      let json = JSON.stringify(this.data.connectDevice)
+      routeUtil.jumpParam(route_constant.connectBle, json)
+      // wx.navigateTo({
+      //   url: './../deviceDetail/detail',
+      // });
+    }
+    ///Wifi模式
+    else if (type == 2) {
+      wx.navigateTo({
+        url: './../deviceConnect0/deviceConnect0',
+      });
+    } else if (type == 3) {
+      // btHelper.stopSearch()
+    }
+    ///4G模式
+    else {
+
+    }
+  },
+
+  async selectDeviceModelTap(e) {
+    let device = e.currentTarget.dataset.device;
+    // console.log(e)
+    let type = device.type;
+    if (type == 1) {
+      // this.getConnectedDevices()
+    } else if (type == 2) {
+
+    } else if (type == 3) {
+      // btHelper.stopSearch()
+    } else {
+
+    }
+    var list = []
+    list.push(device)
+    this.data.typeList.forEach(element => {
+      if (element.type != type) {
+        list.push(element)
+      }
+    });
+    this.setData({
+      typeList: list,
+      model: this.getModeName(device)
+    })
+
+  },
+  nullTips() {
+    if (this.data.typeList.length === 0) {
+      wx.showToast({
+        title: '暂不支持该设备配网',
+        icon: 'none',
+      })
+      return true
+    }
+    return false
+  },
+  onLoad: function (options) {
+    let device = JSON.parse(options.param) || {}
+    console.log("配网配对的设备:", device)
+    if (Object.keys(device).length === 0) {
+      wx.showToast({
+        title: '设备数据为空,返回刷新列表试试看',
+      })
+      return;
+    }
+    let _this = this
+    let isWifi = device.clientType != "MW-S2";
+    let isS2 = device.clientType === "MW-S2";
+
+    let _typeList = device.typeList
+      .filter(e => (isWifi && e.type == 2) || isS2)
+      .map(e => ({
+        icon: "../../images/device/mode_" + e.type + ".png",
+        text: _this.getModeName(e),
+        type: e.type
+      }));
+
+    var list = []
+
+    this.data.typeList.forEach(element => {
+      if (_typeList.find(_type => _type.type === element.type)) {
+        list.push(element)
+      }
+    });
+    this.setData({
+      typeList: list,
+      connectDevice: device
+    })
+    this.nullTips()
+
+  },
+
+})

+ 5 - 0
pages/pageB/deviceConMode/deviceConMode.json

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

+ 20 - 0
pages/pageB/deviceConMode/deviceConMode.wxml

@@ -0,0 +1,20 @@
+<view class="main">
+  <nav-bar class="nav_bar_c" bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
+  <image class="model_bg" src="../../../images/device/mode_bg.png" mode="aspectFill" />
+  <view class="select_tips">
+    <view class="setDeviceModel main_green">开启设备选择{{model}}</view>
+    <view wx:if="{{typeList.length > 0}}" class="deviceList">
+      <block wx:for="{{typeList}}" wx:key="item">
+        <view class="devicePicItem devicePicItem_{{index}}" bindtap="selectDeviceModelTap" data-device="{{item}}">
+          <image class="select_icon" src="{{index === 0 ? '../../../images/device/pay_select.png' : '../../../images/device/wake_select_no.png'}}"></image>
+          <view class="device_text">
+            <image class="model_icon" src="{{item.icon}}"></image>
+            <text class="model_text">{{item.text}}</text>
+          </view>
+        </view>
+      </block>
+    </view>
+  </view>
+  <view wx:if="{{typeList.length > 0}}" class="setDeviceModelTips">开启后点击“下一步”</view>
+  <view class="main_color connect_button" bind:tap="nextTap">连接设备</view>
+</view>

+ 117 - 0
pages/pageB/deviceConMode/deviceConMode.wxss

@@ -0,0 +1,117 @@
+.main {
+  position: relative;
+  height: 100vh;
+}
+
+.model_bg {
+  top: 80;
+  left: 0;
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  z-index: -1;
+  background-size: cover;
+
+}
+
+.select_tips {
+  position: relative;
+  z-index: 1;
+  padding: 20px;
+}
+
+.devicePicItem {
+  display: flex;
+  align-items: center;
+  padding: 10px;
+
+}
+
+.setDeviceModel {
+  padding: 10px;
+  text-align: center;
+  left: 0;
+  font-size: 32rpx;
+}
+
+.setDeviceModelTips {
+  color: #FFFFFFB3;
+  text-align: center;
+  font-size: 24rpx;
+}
+
+.deviceList {
+  margin-top: 60px;
+}
+
+.devicePicItem {
+  position: relative;
+
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: center;
+
+  border-radius: 5px;
+  height: 100rpx;
+  margin-top: 32rpx;
+  background-color: #ffffff0d;
+}
+
+.select_icon {
+  width: 32rpx;
+  height: 32rpx;
+  position: absolute;
+  z-index: 1;
+  top: 16rpx;
+  right: 16rpx;
+}
+
+.device_text {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: center;
+}
+
+.model_icon {
+  width: 48rpx;
+  height: 48rpx;
+  margin-right: 10rpx;
+}
+
+.model_text {
+  font-size: 32rpx;
+  color: white;
+}
+
+.devicePicItem_0 {
+  margin-left: 32rpx;
+  margin-right: 32rpx;
+}
+
+.devicePicItem_1 {
+  margin-left: 64rpx;
+  margin-right: 64rpx;
+}
+
+.devicePicItem_2 {
+  margin-left: 96rpx;
+  margin-right: 96rpx;
+}
+
+.connect_button {
+  position: fixed;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  bottom: 100rpx;
+  left: 60rpx;
+  right: 60rpx;
+  font-size: 32rpx;
+  font-weight: Medium;
+  color: white;
+  text-align: center;
+  border-radius: 44rpx;
+  height: 88rpx;
+}

+ 3 - 1
pages/pageB/deviceConnect1/deviceConnect1.js

@@ -123,7 +123,9 @@ Page({
 
     app.globalData.ssid = that.data.ssid;
     app.globalData.pwdData = that.data.pwdData;
-    route_util.jumpParam(route_constant.deviceConnect2, that.data.connectDevice);
+
+    var param = '?param=' + that.data.connectDevice;
+    route_util.jumpParam(route_constant.deviceConnect2, param);
 
   },
 

+ 84 - 0
pages/pageC/aboutInfo/aboutInfo.js

@@ -0,0 +1,84 @@
+
+const { protocol, privacy } = require('./text.js');
+const app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    navBarHeight: app.globalData.navBarHeight,
+    MenuButtonTop: app.globalData.MenuButtonTop,
+    nvabarData: {
+      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
+      title: '关于我们', //导航栏 中间的标题
+    },
+    data: [],
+    text: {
+      0: protocol,
+      1: privacy
+    },
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.setData({
+      data: this.data.text[options.type].info,
+      nvabarData: {
+        showCapsule: 1,
+        title: this.data.text[options.type].title
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 5 - 0
pages/pageC/aboutInfo/aboutInfo.json

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

+ 10 - 0
pages/pageC/aboutInfo/aboutInfo.wxml

@@ -0,0 +1,10 @@
+
+<view class="aboutInfo">
+  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'>
+  </nav-bar>
+  <view class="content" style="height: calc(100vh - {{navBarHeight}}px - 62rpx);">
+    <view class="time">本版更新时间:2022年10月31日</view>
+    <view class="time">本版生效时间:2022年10月31日</view>
+    <text wx:for="{{data}}" class="{{item.fontWeight ? 'fontWeight' : ''}}">{{item.text}}</text>
+  </view>
+</view>

+ 27 - 0
pages/pageC/aboutInfo/aboutInfo.wxss

@@ -0,0 +1,27 @@
+/* pages/aboutInfo/aboutInfo.wxss */
+.aboutInfo{
+  background-color: #fffaf3;
+}
+.content{
+  display: flex;
+  flex-direction: column;
+  padding: 30rpx;
+  overflow: auto;
+}
+.aboutInfo .content .time{
+  text-align: center;
+}
+.aboutInfo .content text{
+  text-align: justify;
+}
+.aboutInfo .content .time, .aboutInfo .content text{
+  line-height: 44rpx;
+  font-size: 30rpx;
+  margin: 0 0 30rpx;
+  font-weight: 400;
+  color: #000;
+}
+.aboutInfo .content .fontWeight{
+  font-weight: 700;
+  font-size: 36rpx;
+}

File diff suppressed because it is too large
+ 887 - 0
pages/pageC/aboutInfo/text.js


+ 13 - 10
pages/piano/wallpaper/wallpaper.js

@@ -1,5 +1,7 @@
 // pages/piano/wallpaper/wallpaper.js
-const { deviceWallPaper } = require('../../../request/deviceListRequest')
+const {
+  deviceWallPaper
+} = require('../../../request/deviceListRequest')
 // const sharp = require('sharp');
 // const fs = require('fs');
 
@@ -25,13 +27,11 @@ Page({
    * 页面的初始数据
    */
   data: {
-    topImg:
-    {
+    topImg: {
       //      pic: "",
       //      id: "",
     },
-    imageList: [
-    ],
+    imageList: [],
     selectIndex: 0,
     navbarData: {
       showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
@@ -44,7 +44,8 @@ Page({
 
   },
   footerTap() {
-    route_util.jumpParam("../cropper/cropper", JSON.stringify(this.data.topImg ?? {}))
+    var param = '?param=' + JSON.stringify(this.data.topImg ?? {});
+    route_util.jumpParam("../cropper/cropper", param);
   },
   imageTopTap() {
     this.setData({
@@ -66,7 +67,8 @@ Page({
       })
     }
 
-  }, wallpaperList() {
+  },
+  wallpaperList() {
     let _this = this;
     deviceWallPaper().then(res => {
       console.log("壁纸列表", res);
@@ -94,7 +96,9 @@ Page({
 
     this.setData({
       showCropImg: true,
-      topImg: { "pic": img.path }
+      topImg: {
+        "pic": img.path
+      }
     })
 
   },
@@ -135,8 +139,7 @@ Page({
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload() {
-  },
+  onUnload() {},
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作

+ 1 - 1
utils/route_util.js

@@ -26,7 +26,7 @@ async function jump(url) {
 async function jumpParam(url, param) {
   if (param) {
     await wx.navigateTo({
-      url: url + "?param=" + param,
+      url: url + param,
     });
   } else {
     await jump(url);