flat: 新页面
This commit is contained in:
75
components/CustomNavbar/navbar.vue
Normal file
75
components/CustomNavbar/navbar.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<view class="navbar" :style="{height: _data.navHeight+'px'}">
|
||||
<view class="back" @tap="back">
|
||||
<uni-icons type="back" size="26" color="#FFFFFF"></uni-icons>
|
||||
</view>
|
||||
<view class="title">
|
||||
{{titke}}
|
||||
</view>
|
||||
<view class="ri">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"navbar",
|
||||
data() {
|
||||
return {
|
||||
_data: {},
|
||||
};
|
||||
},
|
||||
props: {
|
||||
titke: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
||||
const { top, width, height, right } = menuButtonInfo
|
||||
const that = this
|
||||
uni.getSystemInfo({
|
||||
success: function (res) {
|
||||
const { statusBarHeight } = res
|
||||
const margin = top - statusBarHeight
|
||||
that._data.navHeight = (height + statusBarHeight + (margin * 2))
|
||||
that._data.statusBarHeight = statusBarHeight
|
||||
that._data.searchMarginTop = statusBarHeight + margin
|
||||
that._data.searchHeight = height
|
||||
that._data.searchWidth= right - width - 30
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$emit('back')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar{
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
padding-bottom: 8rpx;
|
||||
width: 100%;
|
||||
background-color: #4071f8;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
.back,.ri{
|
||||
padding: 10rpx;
|
||||
width: 50rpx;
|
||||
}
|
||||
.title{
|
||||
line-height: 78rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
121
components/CustomTabbar/custom_tabbar.vue
Normal file
121
components/CustomTabbar/custom_tabbar.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<view class="tabbar_container">
|
||||
<view class="tabbar_item" v-for="(item, index) in tabbarList" :key="index" @click="changeItem(item)">
|
||||
<view class="item-top" >
|
||||
<image :src="currentItem == item.id ? item.selectedIconPath : item.iconPath"
|
||||
:class="[item.centerItem ? 'center-item-img' : '']"></image>
|
||||
</view>
|
||||
<view class="item-bottom" :class="[currentItem == item.id ? 'item-active' : '']">
|
||||
<text>{{ item.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let listSrc = require('../../static/img/tabbar/list.png');
|
||||
let listSrc2 = require('../../static/img/tabbar/avtiveList.png');
|
||||
let newsSrc = require('../../static/img/tabbar/news.png');
|
||||
let newsSrc2 = require('../../static/img/tabbar/activeNews.png');
|
||||
let recruitSrc = require('../../static/img/tabbar/recruit.png');
|
||||
let recruitSrc2 = require('../../static/img/tabbar/activeRecruit.png');
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentItem: 0,
|
||||
tabbarList: [{
|
||||
id: 0,
|
||||
text: "招工列表",
|
||||
path: '/pages/recruit/subPage/index',
|
||||
iconPath: listSrc2,
|
||||
selectedIconPath: listSrc,
|
||||
centerItem: false,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
text: "发布招工",
|
||||
path: '/pages/recruit/subPage/recruit',
|
||||
iconPath: recruitSrc2,
|
||||
selectedIconPath:recruitSrc,
|
||||
centerItem: true,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
text: "消息",
|
||||
path: '/pages/recruit/subPage/MessageList',
|
||||
iconPath: newsSrc2,
|
||||
selectedIconPath: newsSrc,
|
||||
centerItem: false,
|
||||
}],
|
||||
}
|
||||
},
|
||||
props: {
|
||||
currentpage: {
|
||||
type: Number,
|
||||
required: true,
|
||||
default: 0,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.currentItem = this.currentpage
|
||||
uni.hideTabBar()
|
||||
},
|
||||
methods: {
|
||||
changeItem(item) {
|
||||
// uni.switchTab({
|
||||
// url: item.path
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: item.path
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tabbar_container{
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
left: 0rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
box-shadow: 0 0 5px #999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5rpx 0;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
.tabbar_item{
|
||||
width: 33.33%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
.item-top{
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.item-bottom{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.center-item-img{
|
||||
position: absolute;
|
||||
top: -58rpx;
|
||||
left: calc(50% - 53rpx);
|
||||
width: 106rpx !important;
|
||||
height: 106rpx !important;
|
||||
}
|
||||
.item-active{
|
||||
color: #4071f8;
|
||||
}
|
||||
</style>
|
||||
123
components/empty/empty.vue
Normal file
123
components/empty/empty.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view class="empty" :style="{ background: bgcolor, marginTop: mrTop + 'rpx' }">
|
||||
<view class="ty_content" :style="{ paddingTop: pdTop + 'rpx' }">
|
||||
<view class="content_top" :style="{ width: width + 'rpx', height: height + 'rpx' }">
|
||||
<image :src="pictrue || Empty" style="width: 100%;" mode=""></image>
|
||||
</view>
|
||||
<view class="content_c color_666666">{{ content }}</view>
|
||||
<button class="content_btn" v-if="showButton" hover-class="active">重新加载</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let Empty = require('../../static/img/Empty.png');
|
||||
export default {
|
||||
name: 'empty',
|
||||
data() {
|
||||
return {
|
||||
Empty
|
||||
}
|
||||
},
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '网络加载失败'
|
||||
},
|
||||
bgcolor: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'transparent'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '504'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '504'
|
||||
},
|
||||
pdTop: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '20'
|
||||
},
|
||||
mrTop: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '0'
|
||||
},
|
||||
pictrue: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
showButton: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
.ty_content {
|
||||
// position: absolute;
|
||||
// left: 50%;
|
||||
// top: 0;
|
||||
// transform: translate(-50%, 0);
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: max-content;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.content_top {
|
||||
// width: 504rpx;
|
||||
// height: 504rpx;
|
||||
}
|
||||
|
||||
.content_c {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
color: #6A707C;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content_btn {
|
||||
margin-top: 37rpx;
|
||||
width: fit-content;
|
||||
height: 45rpx;
|
||||
border-radius: 5rpx;
|
||||
border: 1rpx solid #643CB6;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Normal, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #643CB6;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.active {
|
||||
border: 1rpx solid #666666;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user