Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
try merge admin and custom tabbar
Browse files Browse the repository at this point in the history
  • Loading branch information
zzsqwq committed Dec 20, 2021
1 parent 17d0d6b commit 582c962
Show file tree
Hide file tree
Showing 22 changed files with 1,154 additions and 13 deletions.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
App({
data : {
is_admin : false,
},
onLaunch() {

},
Expand Down
26 changes: 14 additions & 12 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"pages": [
"pages/index/index",
"pages/test/index",
"pages/logs/index"
"pages/admin/admin"
],
"window": {
"navigationBarTextStyle": "black",
Expand All @@ -16,24 +16,24 @@
"color": "#7F8389",
"selectedColor": "#0097E6",
"backgroundColor": "#FFFFFF",
"list": [
{
"pagePath": "pages/test/index",
"iconPath": "images/tabbar/icon-testing.png",
"selectedIconPath": "images/tabbar/icon-testing-selected.png",
"text": "测试"
},
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "images/tabbar/icon-home.png",
"selectedIconPath": "images/tabbar/icon-home-selected.png",
"text": "首页"
"text": "提交订单"
},
{
"pagePath": "pages/logs/index",
"pagePath": "pages/admin/admin",
"iconPath": "images/tabbar/icon-admin.png",
"selectedIconPath": "images/tabbar/icon-admin-selected.png",
"text":"审核与发布"
},
{
"pagePath": "pages/test/index",
"iconPath": "images/tabbar/icon-log.png",
"selectedIconPath": "images/tabbar/icon-log-selected.png",
"text": "日志"
"text": "相关与反馈"
}
]
},
Expand All @@ -48,5 +48,7 @@
"123456",
"34356576",
"457658769"
]
],
"usingComponents": {
}
}
9 changes: 9 additions & 0 deletions app.qss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 10rpx 0;
box-sizing: border-box;
}
22 changes: 22 additions & 0 deletions cloudfunctions/getOpenid/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 云函数入口文件
const cloud = require('qq-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
})

// 云函数入口函数
exports.main = async (event, context) => {

const {
OPENID,
APPID,
ENV
} = await cloud.getQQContext()

return {
event,
openid : OPENID,
appid : APPID,
env : cloud.DYNAMIC_CURRENT_ENV
}
}
14 changes: 14 additions & 0 deletions cloudfunctions/getOpenid/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "getOpenid",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"qq-server-sdk": "latest"
}
}
32 changes: 32 additions & 0 deletions custom-tab-bar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Component({
data: {
selected : 0,
color: "#7F8389",
selectedColor: "#0097E6",
backgroundColor: "#FFFFFF",
list : [ {
"pagePath": "/pages/index/index",
"iconPath": "/images/tabbar/icon-home.png",
"selectedIconPath": "/images/tabbar/icon-home-selected.png",
"text": "提交订单"
},
{
"pagePath": "/pages/test/index",
"iconPath": "/images/tabbar/icon-log.png",
"selectedIconPath": "/images/tabbar/icon-log-selected.png",
"text": "相关与反馈"
}]
},
attached() {
},
methods: {
switchTab(e) {
const data = e.currentTarget.dataset
const url = data.path
wx.switchTab({url})
this.setData({
selected: data.index
})
}
},
});
3 changes: 3 additions & 0 deletions custom-tab-bar/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"component": true
}
Empty file added custom-tab-bar/index.qml
Empty file.
38 changes: 38 additions & 0 deletions custom-tab-bar/index.qss
Original file line number Diff line number Diff line change
@@ -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 cover-image {
width: 27px;
height: 27px;
}

.tab-bar-item cover-view {
font-size: 10px;
}
Binary file added images/pages/index/Unselected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pages/index/default-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pages/index/selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tabbar/icon-admin-selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tabbar/icon-admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 582c962

Please sign in to comment.