Selaa lähdekoodia

feature: 对隐私协议和用户协议进行分包

332777428@qq.com 4 kuukautta sitten
vanhempi
commit
2a6e2ada2e

+ 2 - 3
app.json

@@ -3,13 +3,11 @@
     "pages/pageA/index/index",
     "pages/pageA/login/login",
     "pages/pageA/deviceList/deviceList",
-    "pages/about/about",
     "pages/repeat/repeat",
     "pages/deviceWake/deviceWake",
     "pages/channelDetail/channelDetail",
     "pages/download/download",
     "pages/wakeList/wakeList",
-    "pages/aboutInfo/aboutInfo",
     "pages/deviceMode/deviceMode",
     "pages/connectBle/connectBle",
     "pages/ota/ota",
@@ -32,7 +30,8 @@
     {
       "root": "pages/pageC/",
       "pages": [
-        "about/about"
+        "about/about",
+        "aboutInfo/aboutInfo"
       ]
     },
     {

+ 0 - 66
pages/about/about.js

@@ -1,66 +0,0 @@
-// pages/about/about.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
-})

+ 0 - 2
pages/about/about.wxml

@@ -1,2 +0,0 @@
-<!--pages/about/about.wxml-->
-<text>pages/about/about.wxml</text>

+ 0 - 5
pages/aboutInfo/aboutInfo.json

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

+ 2 - 2
pages/pageA/index/index.wxml

@@ -9,7 +9,7 @@
 
       <view wx:if="{{bannerList.length>0}}" class="banner_container">
         <swiper class="swiper" indicator-dots="{{bannerList.length>1}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" indicator-active-color="#FFFFFF" indicator-color="#999999">
-          <block wx:for="{{bannerList}}" wx:key="index">
+          <block wx:for="{{bannerList}}" wx:key="key">
             <swiper-item>
               <image mode="widthFix" class="swiper_image" src="{{item.pic}}" data-item="{{item}}" bind:tap="onTapBanner" />
             </swiper-item>
@@ -23,7 +23,7 @@
       </view>
 
       <scroll-view scroll-y="true" style="height: calc(100vh - 152rpx - 296rpx - 46rpx - 105rpx - {{safeBottomHeight}}rpx - 5rpx - {{navBarHeight}}px);">
-        <block wx:key="key" wx:for-item="item" wx:for-index="index" wx:for="{{deviceList}}">
+        <block wx:for="{{deviceList}}" wx:key="key" wx:for-item="item" wx:for-index="index">
 
           <view class="item_public" style="border: {{item.state && item.state === 'online'&&deviceListSelect === index  ? '6rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}};  flex-direction: row; display: flex; margin-top: 10rpx; margin-bottom: {{index==0?deviceList.length-1:0}}rpx; " data-item="{{item}}" data-index="{{index}}" bind:tap="onTapItem">
 

+ 2 - 3
pages/pageA/login/login.js

@@ -24,9 +24,8 @@ Page({
   },
 
   goabout(e) {
-    wx.navigateTo({
-      url: './../aboutInfo/aboutInfo?type=' + e.currentTarget.dataset.index,
-    })
+    var param = '?type=' + e.currentTarget.dataset.index;
+    routeUtil.jumpParam(routePath.aboutInfo, param);
   },
 
   getPhoneNumber(e) {

+ 5 - 4
pages/pageC/about/about.js

@@ -1,5 +1,7 @@
-Page({
+import routePath from '../../../utils/routePath.js';
+import routeUtil from '../../../utils/routeUtil.js';
 
+Page({
   data: {
     nvabarData: {
       showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
@@ -8,9 +10,8 @@ Page({
   },
 
   go(e) {
-    wx.navigateTo({
-      url: './../aboutInfo/aboutInfo?type=' + e.currentTarget.dataset.index,
-    })
+    var param = '?type=' + e.currentTarget.dataset.index;
+    routeUtil.jumpParam(routePath.aboutInfo, param);
   },
 
 })

+ 0 - 1
pages/pageC/about/about.wxml

@@ -1,4 +1,3 @@
-<!--pages/about/about.wxml-->
 <view class="about">
   <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>

+ 4 - 8
pages/aboutInfo/aboutInfo.js

@@ -1,11 +1,10 @@
-// pages/aboutInfo/aboutInfo.js
-const { protocol, privacy } = require('./text.js');
+const {
+  protocol,
+  privacy
+} = require('./text.js');
 const app = getApp();
 Page({
 
-  /**
-   * 页面的初始数据
-   */
   data: {
     navBarHeight: app.globalData.navBarHeight,
     MenuButtonTop: app.globalData.MenuButtonTop,
@@ -20,9 +19,6 @@ Page({
     },
   },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
   onLoad(options) {
     this.setData({
       data: this.data.text[options.type].info,

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

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

+ 2 - 3
pages/aboutInfo/aboutInfo.wxml

@@ -1,10 +1,9 @@
-<!--pages/aboutInfo/aboutInfo.wxml-->
 <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>
+    <text wx:for="{{data}}" wx:key="key" wx:for-item="item" wx:for-index="index" class="{{item.fontWeight ? 'fontWeight' : ''}}">{{item.text}}</text>
   </view>
-</view>
+</view>

+ 12 - 7
pages/aboutInfo/aboutInfo.wxss

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

pages/aboutInfo/text.js → pages/pageC/aboutInfo/text.js


+ 2 - 0
utils/routePath.js

@@ -14,6 +14,7 @@ const deviceConnect4 = "../../pageB/deviceConnect4/deviceConnect4";
 
 /// C
 const about = "../../pageC/about/about";
+const aboutInfo = "../../pageC/aboutInfo/aboutInfo";
 
 /// pageD
 const webview = "../../pageD/webview/webview";
@@ -41,6 +42,7 @@ module.exports = {
   deviceConnect4: deviceConnect4,
   /// C
   about: about,
+  aboutInfo: aboutInfo,
   /// D
   webview: webview,