Compare commits

...

1 Commits
master ... newo

Author SHA1 Message Date
scout
0056d1e4a4 commit 2024-10-25 09:21:28 +08:00
19 changed files with 215 additions and 47 deletions

View File

@ -0,0 +1,19 @@
<script setup>
</script>
<template>
<div class="tab">
<slot></slot>
</div>
</template>
<style scoped lang="scss">
.tab {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
</style>

View File

@ -0,0 +1,79 @@
<script setup>
import { theme } from '@/config/theme'
import tabbarItem from './components/tabbar-item/index.vue'
const emit = defineEmits(['update:active'])
const props=defineProps({
active:{
type:Number,
default:0
},
list:{
type:Array,
default:()=>[]
}
})
const clickItem = (item) => {
emit('update:active',item.value)
}
</script>
<template>
<div class="tabbar-container">
<div class="tabbar">
<tabbar-item v-for="item in list" :key="item.url" @click="clickItem(item)">
<div class="tab-content">
<img :src="item.value === active ? item.selectedIconPath : item.iconPath" :style="{width:item.iconWidth?item.iconWidth:'34rpx',height:item.iconHeight?item.iconHeight:'40rpx'}" class="tab-icon">
<div class="tab-text" :style="{ color: active === item.value ? theme.colors.primary : '#666666' }">
{{ item.text }}
</div>
</div>
</tabbar-item>
</div>
<!--底部安全区-->
<div class="content-placeholder"></div>
</div>
</template>
<style scoped lang="scss">
.tabbar-container {
flex-shrink: 0;
width: 100%;
background-color: #ffffff;
overflow: hidden;
.tabbar {
display: flex;
padding-top: 20rpx;
height: 104rpx;
.tab {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
.tab-content {
display: flex;
flex-direction: column;
align-items: center;
.tab-icon {
width: 40rpx;
height: 40rpx;
}
.tab-text {
margin-top: 10rpx;
font-size: 20rpx;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
.content-placeholder {
height: 58rpx;
}
}
</style>

View File

@ -1,8 +1,8 @@
const env = 'prod';
const env = 'LocalTest';
const configs = {
LocalTest: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
h5Url:'http://192.168.88.29:8080/#/'
h5Url:'http://192.168.88.30:2367/#/'
},
dev: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',

58
config/tabbar/index.js Normal file
View File

@ -0,0 +1,58 @@
// 图片资源导入
import clockInIcon from '@/static/image/tabbar/wz@3x1.png' // 打卡图标
import clockInSelectedIcon from '@/static/image/tabbar/zu3499@3x.png' // 打卡选中图标
import attendanceIcon from '@/static/image/tabbar/attendance2.png' // 考勤图标
import attendanceSelectedIcon from '@/static/image/tabbar/kaoqin.png' // 考勤选中图标
import myIcon from '@/static/image/tabbar/my1.png' // 我的图标
import mySelectedIcon from '@/static/image/tabbar/my2.png' // 我的选中图标
import applyIcon from '@/static/image/apply/zu3809@3x.png' // 申请图标
import applySelectedIcon from '@/static/image/apply/zu3808@3x.png' // 申请选中图标
import spIcon from '@/static/image/apply/sp.png' // 审批图标
import spSelectedIcon from '@/static/image/apply/zu3812@3x.png' // 审批选中图标
// Tabbar 配置
export const tabbar = [
{
text: "打卡",
iconPath: clockInIcon,
selectedIconPath: clockInSelectedIcon,
value: 0,
iconWidth: '33.32rpx',
iconHeight: '40rpx',
url: '/pages/clockIn/index'
},
{
text: "考勤",
iconPath: attendanceIcon,
selectedIconPath: attendanceSelectedIcon,
value: 1,
url: '/pages/attendance/index'
},
{
text: "我的",
iconPath: myIcon,
selectedIconPath: mySelectedIcon,
value: 3,
url: '/pages/mine/index'
}
]
// 审批页面 Tabbar 配置
export const approveTabbar = [
{
text: "申请",
iconPath: applyIcon,
selectedIconPath: applySelectedIcon,
value: 0,
iconWidth: '33.32rpx',
iconHeight: '40rpx'
},
{
text: "审批中心",
iconPath: spIcon,
selectedIconPath: spSelectedIcon,
value: 1,
iconWidth: '37rpx',
iconHeight: '40rpx'
}
]

12
config/theme/index.js Normal file
View File

@ -0,0 +1,12 @@
export const theme = {
colors: {
primary: '#46299D',
secondary: '#35495e',
accent: '#ff4081',
error: '#f44336',
warning: '#ff9800',
info: '#2196f3',
success: '#4caf50'
}
};

View File

@ -1,6 +1,6 @@
<template>
<!-- <web-view class="webview" @message="webLoad" style="flex: 1;" :src="config.h5Url"></web-view> -->
<view style="position: absolute;bottom: 0;">124124</view>
</template>
<script setup>
import { ref } from 'vue'
@ -13,57 +13,57 @@ currentWebview.append(wv)
const {statusBarHeight} = uni.getSystemInfoSync()
wv.setStyle({
top: statusBarHeight,
bottom: 0,
bottom: 20,
})
import { Communication } from '../../utils/communication.js';
const commun=new Communication()
import {
registerRequestPermissionTipsListener,
unregisterRequestPermissionTipsListener,
setRequestPermissionTips
} from "@/uni_modules/uni-registerRequestPermissionTips"
// import {
// registerRequestPermissionTipsListener,
// unregisterRequestPermissionTipsListener,
// setRequestPermissionTips
// } from "@/uni_modules/uni-registerRequestPermissionTips"
const PermissionTips = {
"android.permission.READ_PHONE_STATE": "<h4 style=\"font-size:40px;\">正在读取网络状态权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意</font>",
"android.permission.CAMERA": "<h4 style=\"font-size:40px;\">正在访问相机权限</h4><font color=#cccccc>需要扫描二维码或拍照,是否允许打开相机?</font>",
"android.permission.WRITE_EXTERNAL_STORAGE": "<h4 style=\"font-size:40px;\">正在读取相册权限</h4><font color=#cccccc>我们需要获取访问您设备相册的权限,以便您能够选择并上传图片或视频到我们的应用中。</font>"
}
onExit(()=>{
unregisterRequestPermissionTipsListener()
})
// const PermissionTips = {
// "android.permission.READ_PHONE_STATE": "<h4 style=\"font-size:40px;\"></h4><font color=#cccccc></font>",
// "android.permission.CAMERA": "<h4 style=\"font-size:40px;\">访</h4><font color=#cccccc></font>",
// "android.permission.WRITE_EXTERNAL_STORAGE": "<h4 style=\"font-size:40px;\"></h4><font color=#cccccc>访便</font>"
// }
// onExit(()=>{
// unregisterRequestPermissionTipsListener()
// })
const brand = uni.getSystemInfoSync().deviceBrand
setRequestPermissionTips(PermissionTips)
registerRequestPermissionTipsListener({
onRequest: (e) => {
console.log('onRequest',e)
},
onConfirm: (e) => {
commun.sendToH5('permission-application',{action:'open-permission',data:e});
},
onComplete: (e) => {
commun.sendToH5('permission-application',{action:'close-permission',data:e});
// const brand = uni.getSystemInfoSync().deviceBrand
// setRequestPermissionTips(PermissionTips)
// registerRequestPermissionTipsListener({
// onRequest: (e) => {
// console.log('onRequest',e)
// },
// onConfirm: (e) => {
// commun.sendToH5('permission-application',{action:'open-permission',data:e});
// },
// onComplete: (e) => {
// commun.sendToH5('permission-application',{action:'close-permission',data:e});
//
if (brand.toLowerCase() === "huawei") {
const tips = {}
let hasDeniedPermission = false
for (let k in PermissionTips) {
if (e[k] !== "denied") {
tips[k] = PermissionTips[k]
} else {
hasDeniedPermission = true
}
}
setRequestPermissionTips(tips) //
if (hasDeniedPermission)
uni.showModal({
content: "权限已经被拒绝,请前往设置中开启"
})
}
}
})
// //
// if (brand.toLowerCase() === "huawei") {
// const tips = {}
// let hasDeniedPermission = false
// for (let k in PermissionTips) {
// if (e[k] !== "denied") {
// tips[k] = PermissionTips[k]
// } else {
// hasDeniedPermission = true
// }
// }
// setRequestPermissionTips(tips) //
// if (hasDeniedPermission)
// uni.showModal({
// content: ""
// })
// }
// }
// })
function initializeWebView() {
const currentWebview = getCurrentPages().pop().$getAppWebview()
commun.setWebView(currentWebview.children()[0])

BIN
static/image/apply/sp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/image/tabbar/my1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/image/tabbar/my2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB