Pārlūkot izejas kodu

feature: 添加关于分包

332777428@qq.com 6 mēneši atpakaļ
vecāks
revīzija
a75fb91450

+ 11 - 6
app.json

@@ -2,19 +2,17 @@
   "pages": [
     "pages/pageA/index/index",
     "pages/pageA/login/login",
-    
-    "pages/about/about",
+    "pages/pageA/deviceList/deviceList",
     "pages/repeat/repeat",
     "pages/deviceWake/deviceWake",
     "pages/channelDetails/channelDetails",
-    "pages/deviceConnect3/deviceConnect3",
     "pages/deviceConnect0/deviceConnect0",
-    "pages/deviceConnect2/deviceConnect2",
     "pages/deviceConnect1/deviceConnect1",
+    "pages/deviceConnect2/deviceConnect2",
+    "pages/deviceConnect3/deviceConnect3",
     "pages/download/download",
     "pages/wakeList/wakeList",
     "pages/aboutInfo/aboutInfo",
-    "pages/deviceList/deviceList",
     "pages/deviceConMode/index",
     "pages/connectBle/connectBle",
     "pages/deviceDetail/detail",
@@ -23,7 +21,14 @@
     "pages/piano/cropper/cropper",
     "pages/setWifi/setWifi"
   ],
-
+  "subPackages": [
+    {
+      "root": "pages/pageB/",
+      "pages": [
+        "about/about"
+      ]
+    }
+  ],
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",

+ 0 - 73
pages/about/about.js

@@ -1,73 +0,0 @@
-// pages/about/about.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    nvabarData: {
-      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
-      title: '关于我们', //导航栏 中间的标题
-    },
-  },
-  go(e) {
-    wx.navigateTo({
-      url: './../aboutInfo/aboutInfo?type=' + e.currentTarget.dataset.index,
-    })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
-})

+ 0 - 5
pages/about/about.json

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

+ 0 - 6
pages/deviceList/deviceList.json

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

+ 6 - 6
pages/deviceList/deviceList.js

@@ -1,10 +1,10 @@
 const app = getApp()
-import dRequest from '../../request/deviceListRequest'
-import routeUtil from '../../utils/route_util'
-import route_constant from '../../utils/route_constant.js'
-import strings from '../../utils/strings.js';
-import store from '../../utils/store.js';
-import lexin_devices from '../../utils/lexin/devices';
+import dRequest from '../../../request/deviceListRequest'
+import routeUtil from '../../../utils/route_util'
+import route_constant from '../../../utils/route_constant.js'
+import strings from '../../../utils/strings.js';
+import store from '../../../utils/store.js';
+import lexin_devices from '../../../utils/lexin/devices';
 
 Page({
   data: {

+ 5 - 0
pages/pageA/deviceList/deviceList.json

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

pages/deviceList/deviceList.wxml → pages/pageA/deviceList/deviceList.wxml


pages/deviceList/deviceList.wxss → pages/pageA/deviceList/deviceList.wxss


+ 8 - 0
pages/pageA/login/login.js

@@ -17,6 +17,14 @@ Page({
     isAgree: false,
   },
 
+  onLoad(options) {
+    const pages = getCurrentPages(); // 获取当前页面栈
+    const pageCount = pages.length; // 页面栈中的页面数量
+    for (var i = pageCount - 1; i > -1; i--) {
+      console.log("gasdfqwerqwerq====" + JSON.stringify(pages[i]));
+    }
+  },
+
   egree() {
     this.setData({
       isAgree: !this.data.isAgree

+ 18 - 0
pages/pageB/about/about.js

@@ -0,0 +1,18 @@
+Page({
+  data: {
+    nvabarData: {
+      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
+      title: '关于我们', //导航栏 中间的标题
+    },
+  },
+
+  onLoad(options) {
+
+  },
+
+  go(e) {
+    wx.navigateTo({
+      url: './../aboutInfo/aboutInfo?type=' + e.currentTarget.dataset.index,
+    })
+  },
+})

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

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

+ 3 - 3
pages/about/about.wxml

@@ -5,11 +5,11 @@
   <view class="page-view">
     <view class="about-li" data-index="0" bindtap="go">
       <text>猫王用户协议</text>
-      <image class="j" mode="heightFix" src="./../../img/b.png"></image>
+      <image class="j" mode="heightFix" src="../../../img/b.png"></image>
     </view>
     <view class="about-li" data-index="1" bindtap="go">
       <text>猫王隐私政策</text>
-      <image class="j" mode="heightFix" src="./../../img/b.png"></image>
+      <image class="j" mode="heightFix" src="../../../img/b.png"></image>
     </view>
   </view>
-</view>
+</view>

pages/about/about.wxss → pages/pageB/about/about.wxss


+ 8 - 4
utils/route_constant.js

@@ -1,20 +1,24 @@
 ///路由
 const indexRoot = "pages/pageA/index/index";
-const loginRoot = "pages/login/login";
+const loginRoot = "pages/pageA/login/login";
 const connectBleRoot = "pages/connectBle/connectBle";
 
 ///跳转路径
+///****************** pageA ********************/
 const index = "../index/index";
 const login = "../login/login";
-const about = "../about/about";
+const deviceList = "../deviceList/deviceList";
+
+///****************** pageB ********************/
+const about = "./../../pageB/about/about";
+
 const deviceConnect0 = "../deviceConnect0/deviceConnect0";
 const deviceConnect1 = "../deviceConnect1/deviceConnect1";
 const deviceConnect2 = "../deviceConnect2/deviceConnect2";
 
 const setWifi = "../setWifi/setWifi";
 
-/// 抽奖记录
-const deviceList = "../deviceList/deviceList";
+
 const connectMode = "../deviceConMode/index";
 const connectBle = "../connectBle/connectBle";