diff --git a/miniprogram/app.js b/miniprogram/app.js
index 4068315..8a58389 100644
--- a/miniprogram/app.js
+++ b/miniprogram/app.js
@@ -1,53 +1,54 @@
App({
- onLaunch: function (options) {
- // 判断是否由分享进入小程序
- if (options.scene == 1007 || options.scene == 1008) {
- this.globalData.share = true
- } else {
- this.globalData.share = false
- };
- //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
- //这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
- //页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
- //虽然最后解决了,但是花费了不少时间
- const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
- wx.getSystemInfo({
- success: (res) => {
- this.globalData.height = res.statusBarHeight
- this.globalData.deviceInfo.statusHeight = res.statusBarHeight
- this.globalData.deviceInfo.navigationHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2
- }
- })
- },
- onShow () {
-
- },
- globalData: {
- flag: false,
- exitApp: false,
- userInfo: null,
- accountState: 0, // 未注册
- share: false, // 分享默认为false
- height: 0,
- infoCompleted: 0, // 0-未完善 1,2,3...-已完善
- tempGridId: '',
- userInfo : { // 当前登陆的用户信息
- userId: '',
- username: '',
- userMobile: '',
- partyFlag: ''
+ onLaunch: function (options) {
+ // 判断是否由分享进入小程序
+ if (options.scene == 1007 || options.scene == 1008) {
+ this.globalData.share = true
+ } else {
+ this.globalData.share = false
+ };
+ //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
+ //这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
+ //页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
+ //虽然最后解决了,但是花费了不少时间
+ const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
+ wx.getSystemInfo({
+ success: (res) => {
+ this.globalData.height = res.statusBarHeight
+ this.globalData.deviceInfo.statusHeight = res.statusBarHeight
+ this.globalData.deviceInfo.navigationHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2
+ }
+ })
},
- groupInfo: { // 友邻社群-当前展示的社群信息
- groupAvatar: '',
- groupLeader: '',
- groupName:'',
- groupId: '',
- lordFlag: ''
+ onShow() {
+
},
- previewImage: false, // 预览图片后会触发onShow,加个状态区分一下
- deviceInfo: {
- statusHeight: 20,
- navigationHeight: 40
+ globalData: {
+ selected: 0,
+ flag: false,
+ exitApp: false,
+ userInfo: null,
+ accountState: 0, // 未注册
+ share: false, // 分享默认为false
+ height: 0,
+ infoCompleted: 0, // 0-未完善 1,2,3...-已完善
+ tempGridId: '',
+ userInfo: { // 当前登陆的用户信息
+ userId: '',
+ username: '',
+ userMobile: '',
+ partyFlag: ''
+ },
+ groupInfo: { // 友邻社群-当前展示的社群信息
+ groupAvatar: '',
+ groupLeader: '',
+ groupName: '',
+ groupId: '',
+ lordFlag: ''
+ },
+ previewImage: false, // 预览图片后会触发onShow,加个状态区分一下
+ deviceInfo: {
+ statusHeight: 20,
+ navigationHeight: 40
+ }
}
- }
})
\ No newline at end of file
diff --git a/miniprogram/app.json b/miniprogram/app.json
index 0aaa1e9..da3a888 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -1,12 +1,7 @@
{
"pages": [
"pages/home/home",
- "pages/redSail/redSail",
- "pages/knight/knight",
- "pages/redGrider/redGrider",
- "pages/pioneer/pioneer",
- "pages/checkIn/checkIn",
- "pages/volunteer/volunteer",
+
"pages/message/message",
"pages/my/my",
"pages/index/index",
@@ -27,6 +22,52 @@
"pages/navigatetoApp/navigatetoApp"
],
"subPackages": [
+ {
+ "root": "subpages/redSail",
+ "name": "redSail",
+ "pages": [
+ "pages/redSail/redSail"
+ ]
+ },
+ {
+ "root": "subpages/knight",
+ "name": "knight",
+ "pages": [
+ "pages/knight/knight"
+ ]
+ },
+ {
+ "root": "subpages/redGrider",
+ "name": "redGrider",
+ "pages": [
+ "pages/redGrider/redGrider"
+ ]
+ },
+ {
+ "root": "subpages/pioneer",
+ "name": "pioneer",
+ "pages": [
+ "pages/pioneer/pioneer"
+ ]
+ },
+ {
+ "root": "subpages/checkIn",
+ "name": "checkIn",
+ "pages": [
+ "pages/checkIn/checkIn"
+ ]
+ },
+ {
+ "root": "subpages/volunteer",
+ "name": "volunteer",
+ "pages": [
+ "pages/volunteer/volunteer"
+ ]
+ },
+
+
+
+
{
"root": "subpages/home",
"name": "home",
@@ -214,10 +255,11 @@
"selectedColor": "#FF0000",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
+ "custom": true,
"list": [
{
"pagePath": "pages/home/home",
- "text": "",
+ "text": "首页",
"iconPath": "images/main/icon01.png",
"selectedIconPath": "images/main/icon01-a.png"
},
diff --git a/miniprogram/custom-tab-bar/index.js b/miniprogram/custom-tab-bar/index.js
new file mode 100644
index 0000000..60787ef
--- /dev/null
+++ b/miniprogram/custom-tab-bar/index.js
@@ -0,0 +1,45 @@
+const app = getApp()
+Component({
+ data: {
+ selected: 0,
+ color: "#7A7E83",
+ selectedColor: "#3cc51f",
+ "list": [
+ {
+ "pagePath": "/pages/home/home",
+ "text": "",
+ "iconPath": "/images/main/icon01.png",
+ "selectedIconPath": "/images/main/icon01-a.png"
+ },
+ {
+ "pagePath": "/pages/message/message",
+ "text": "消息",
+ "iconPath": "/images/main/icon02.png",
+ "selectedIconPath": "/images/main/icon02-a.png"
+ },
+
+ {
+ "pagePath": "/pages/my/my",
+ "text": "我的",
+ "iconPath": "/images/main/icon03.png",
+ "selectedIconPath": "/images/main/icon03-a.png"
+ }
+ ]
+ },
+ attached() {
+ },
+ ready: function() {
+ this.setData({
+ selected: app.globalData.selected
+ })
+ },
+ methods: {
+ switchTab(e) {
+ // console.log(e);
+ const data = e.currentTarget.dataset;
+ const url = data.path;
+ app.globalData.selected = data.index;
+ wx.switchTab({url})
+ }
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/custom-tab-bar/index.json b/miniprogram/custom-tab-bar/index.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/miniprogram/custom-tab-bar/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/miniprogram/custom-tab-bar/index.wxml b/miniprogram/custom-tab-bar/index.wxml
new file mode 100644
index 0000000..3ce2f86
--- /dev/null
+++ b/miniprogram/custom-tab-bar/index.wxml
@@ -0,0 +1,8 @@
+
+
+
+
+
+ {{item.text}}
+
+
diff --git a/miniprogram/custom-tab-bar/index.wxss b/miniprogram/custom-tab-bar/index.wxss
new file mode 100644
index 0000000..dc8a9ee
--- /dev/null
+++ b/miniprogram/custom-tab-bar/index.wxss
@@ -0,0 +1,38 @@
+.tab-bar {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 48px;
+ background: white;
+ display: flex;
+ padding-bottom: env(safe-area-inset-bottom);
+}
+
+.tab-bar-border {
+ background-color: rgba(0, 0, 0, 0.33);
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 1px;
+ transform: scaleY(0.5);
+}
+
+.tab-bar-item {
+ flex: 1;
+ text-align: center;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.tab-bar-item image {
+ width: 27px;
+ height: 27px;
+}
+
+.tab-bar-item view {
+ font-size: 10px;
+}
diff --git a/miniprogram/pages/home/home.js b/miniprogram/pages/home/home.js
index dae0bc7..7050845 100644
--- a/miniprogram/pages/home/home.js
+++ b/miniprogram/pages/home/home.js
@@ -1,3 +1,4 @@
+
const app = getApp()
const api = require("../../utils/api")
const homeApi = require("../../utils/home")
@@ -42,6 +43,7 @@ Page({
isSignUp: 0,
communityId: "" // 社区id
},
+
async onLoad(options) {
wx.showLoading({
title: "加载中,请稍后",
diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml
index 4906a59..ca7e39c 100644
--- a/miniprogram/pages/home/home.wxml
+++ b/miniprogram/pages/home/home.wxml
@@ -6,26 +6,26 @@
-
+
红帆支队
-
+
骑士驿站
-
+
红色网格员
-
+
西海岸先锋
-
+
在职党员
@@ -35,7 +35,7 @@
-
+
红色尖兵
diff --git a/miniprogram/pages/message/message.js b/miniprogram/pages/message/message.js
index f916eb2..857b3a4 100644
--- a/miniprogram/pages/message/message.js
+++ b/miniprogram/pages/message/message.js
@@ -7,7 +7,15 @@ Page({
data: {
},
-
+ getInstance() {
+ if (typeof this.getTabBar === 'function' ) {
+ this.getTabBar((tabBar) => {
+ tabBar.setData({
+ selected: 1
+ })
+ })
+ }
+ },
/**
* 生命周期函数--监听页面加载
*/
diff --git a/miniprogram/images/checkin/01.png b/miniprogram/subpages/checkIn/images/01.png
similarity index 100%
rename from miniprogram/images/checkin/01.png
rename to miniprogram/subpages/checkIn/images/01.png
diff --git a/miniprogram/images/checkin/02.png b/miniprogram/subpages/checkIn/images/02.png
similarity index 100%
rename from miniprogram/images/checkin/02.png
rename to miniprogram/subpages/checkIn/images/02.png
diff --git a/miniprogram/images/checkin/03.png b/miniprogram/subpages/checkIn/images/03.png
similarity index 100%
rename from miniprogram/images/checkin/03.png
rename to miniprogram/subpages/checkIn/images/03.png
diff --git a/miniprogram/subpages/checkIn/images/back.png b/miniprogram/subpages/checkIn/images/back.png
new file mode 100644
index 0000000..74a9654
Binary files /dev/null and b/miniprogram/subpages/checkIn/images/back.png differ
diff --git a/miniprogram/subpages/checkIn/images/back2.png b/miniprogram/subpages/checkIn/images/back2.png
new file mode 100644
index 0000000..0604ff6
Binary files /dev/null and b/miniprogram/subpages/checkIn/images/back2.png differ
diff --git a/miniprogram/images/checkin/right.png b/miniprogram/subpages/checkIn/images/right.png
similarity index 100%
rename from miniprogram/images/checkin/right.png
rename to miniprogram/subpages/checkIn/images/right.png
diff --git a/miniprogram/pages/CheckIn/CheckIn.js b/miniprogram/subpages/checkIn/pages/checkIn/checkIn.js
similarity index 100%
rename from miniprogram/pages/CheckIn/CheckIn.js
rename to miniprogram/subpages/checkIn/pages/checkIn/checkIn.js
diff --git a/miniprogram/pages/CheckIn/CheckIn.json b/miniprogram/subpages/checkIn/pages/checkIn/checkIn.json
similarity index 100%
rename from miniprogram/pages/CheckIn/CheckIn.json
rename to miniprogram/subpages/checkIn/pages/checkIn/checkIn.json
diff --git a/miniprogram/pages/CheckIn/CheckIn.wxml b/miniprogram/subpages/checkIn/pages/checkIn/checkIn.wxml
similarity index 69%
rename from miniprogram/pages/CheckIn/CheckIn.wxml
rename to miniprogram/subpages/checkIn/pages/checkIn/checkIn.wxml
index a633e56..a1657dd 100644
--- a/miniprogram/pages/CheckIn/CheckIn.wxml
+++ b/miniprogram/subpages/checkIn/pages/checkIn/checkIn.wxml
@@ -1,5 +1,5 @@