1.部分接口对接 页面调整

This commit is contained in:
2025-07-25 17:30:20 +08:00
parent 658d21399d
commit b82bf6ef8c
10 changed files with 1227 additions and 1231 deletions

View File

@@ -57,6 +57,9 @@
activeColor: '#007aff',
checked: false
}
},
onLoad() {
this.getUserInfo()
},
methods: {
async submit() {
@@ -82,15 +85,28 @@
this.$store.commit('$uStore', {
name: 'vuex_token',
value: res.data.access_token
});
setTimeout(() => {
uni.reLaunch({
url: '/pages/sys/home/home'
});
}, 500);
});
this.getUserInfo()
// setTimeout(() => {
// uni.reLaunch({
// url: '/pages/sys/home/home'
// });
// }, 500);
}
},
getUserInfo(){
this.$u.api.getUserInfo({loginCheck: true}).then(res => {
if (res.code == '200'){
this.$store.commit('$uStore', {
name: 'vuex_user',
value: res.data.user
});
uni.reLaunch({
url: '/pages/sys/home/home'
});
}
});
},
handleCheckboxChange(e) {
this.checked = e.target.checked;
}

View File

@@ -1,6 +1,6 @@
<template>
<view class="change-info-container">
<image src="/static/ic_back.png" class="back-arrow" @click="goBack"/>
<image src="/static/ic_back.png" class="back-arrow" @click="goBack" />
<view class="title-main">完善你的资料</view>
<view class="title-sub">让大家更好地了解你</view>
<view class="avatar-section">
@@ -12,7 +12,7 @@
<view class="form-section">
<view class="form-label">取个昵称</view>
<view class="input-row">
<input class="form-input" v-model="nickname" placeholder="请输入昵称" />
<input class="form-input" v-model="userInfo.nickName" placeholder="请输入昵称" />
<view class="input-suffix">
<image src="/static/ic_i_c_01.png" class="random-icon" />
<text class="random-text">随机</text>
@@ -20,19 +20,19 @@
</view>
<view class="form-label">你的手机号</view>
<view class="input-row">
<input class="form-input" v-model="phone" placeholder="请输入您的手机号" />
<input class="form-input" v-model="userInfo.phonenumber" placeholder="请输入您的手机号" />
<image src="/static/ic_arrow_right.png" class="arrow-icon" />
</view>
<view class="form-label">你的性别不可修改</view>
<view class="gender-row">
<view class="gender-item selected">
<view v-if="userInfo.sex == 1" class="gender-item selected">
<image src="/static/ic_i_c_02.png" class="gender-icon" />
</view>
<view class="gender-item">
<view v-else class="gender-item">
<image src="/static/ic_i_c_03.png" class="gender-icon" />
</view>
</view>
<view class="info-row"><text class="info-label">部门</text>生活服务部</view>
<view class="info-row"><text class="info-label">部门</text>{{userInfo.deptName}}</view>
<view class="info-row"><text class="info-label">岗位</text>客服</view>
<view class="info-row"><text class="info-label">工号</text>A10235</view>
</view>
@@ -44,10 +44,12 @@
export default {
data() {
return {
nickname: '帅气的小南瓜',
phone: ''
userInfo: {},
}
},
onLoad() {
this.userInfo = this.vuex_user
},
methods: {
goBack() {
uni.navigateBack();
@@ -130,7 +132,7 @@
color: #737373;
font-size: 28rpx;
margin-bottom: 17rpx;
margin-top: 32rpx;
margin-top: 32rpx;
font-weight: bold;
}
@@ -147,7 +149,7 @@
.form-input {
flex: 1;
border: none;
border: none;
font-weight: bold;
font-size: 33rpx;
color: #000000;
@@ -179,14 +181,13 @@
.gender-row {
display: flex;
align-items: center;
margin-bottom: 50rpx;
margin-bottom: 50rpx;
padding-top: 15rpx;
}
.gender-item {
width: 188rpx;
height: 97rpx;
border: 2rpx dashed #bbb;
border-radius: 10rpx;
display: flex;
align-items: center;
@@ -209,14 +210,14 @@
display: flex;
align-items: center;
font-size: 28rpx;
color: #737373;
color: #737373;
margin-bottom: 20rpx;
}
.info-label {
color: #737373;
width: 134rpx;
font-size: 28rpx;
width: 134rpx;
font-size: 28rpx;
font-weight: bold;
display: inline-block;
}

View File

@@ -1,232 +1,293 @@
<template>
<view class="mine-container">
<!-- 顶部蓝色背景和个人信息 -->
<view class="mine-header">
<image class="mine-bg" src="/static/ic_mine_topbg.png" mode="widthFix" />
<view class="mine-info-row">
<image class="mine-avatar" src="/static/ic_mine_head.png" />
<view class="mine-userinfo">
<view class="mine-nick">昵称</view>
<view class="mine-phone">1789548878</view>
</view>
</view>
<view class="mine-header-icons">
<image class="mine-header-icon" src="/static/ic_mine_notice.png" @click="handleItemClick(-1)"/>
<image class="mine-header-icon2" src="/static/ic_mine_setting.png" @click="handleItemClick(-2)"/>
</view>
<view class="mine-header-wave"></view>
</view>
<!-- 白色圆角面板 -->
<view class="mine-panel">
<view class="mine-list">
<view class="mine-list-item" v-for="(item, idx) in list" :key="idx" @click="handleItemClick(idx)">
<image class="mine-list-icon" :src="item.icon" />
<text class="mine-list-text">{{ item.text }}</text>
<text v-if="item.extra" class="mine-list-extra">{{ item.extra }}</text>
<image v-if="!item.extra" class="mine-list-arrow" src="/static/ic_arrow_gray.webp" />
</view>
</view>
<button class="logout-btn">退出登录</button>
</view>
</view>
<view class="mine-container">
<!-- 顶部蓝色背景和个人信息 -->
<view class="mine-header">
<image class="mine-bg" src="/static/ic_mine_topbg.png" mode="widthFix" />
<view class="mine-info-row">
<image class="mine-avatar" src="/static/ic_mine_head.png" />
<view class="mine-userinfo">
<view class="mine-nick">{{userInfo.nickname}}</view>
<view class="mine-phone">{{userInfo.phone}}</view>
</view>
</view>
<view class="mine-header-icons">
<image class="mine-header-icon" src="/static/ic_mine_notice.png" @click="handleItemClick(-1)" />
<image class="mine-header-icon2" src="/static/ic_mine_setting.png" @click="handleItemClick(-2)" />
</view>
<view class="mine-header-wave"></view>
</view>
<!-- 白色圆角面板 -->
<view class="mine-panel">
<view class="mine-list">
<view class="mine-list-item" v-for="(item, idx) in list" :key="idx" @click="handleItemClick(idx)">
<image class="mine-list-icon" :src="item.icon" />
<text class="mine-list-text">{{ item.text }}</text>
<text v-if="item.extra" class="mine-list-extra">{{ item.extra }}</text>
<image v-if="!item.extra" class="mine-list-arrow" src="/static/ic_arrow_gray.webp" />
</view>
</view>
<button class="logout-btn">退出登录</button>
</view>
</view>
</template>
<script>
export default {
name: 'Mine',
data() {
return {
list: [
{ icon: '/static/ic_mine_info.png', text: '我的信息' },
{ icon: '/static/ic_mine_pay.png', text: '我的缴费' },
{ icon: '/static/ic_mine_repair.png', text: '我的报修' },
{ icon: '/static/ic_mine_visitor.png', text: '我的访客' },
{ icon: '/static/ic_mine_check.png', text: '我的考勤' },
{ icon: '/static/ic_mine_pwd.png', text: '修改密码' },
{ icon: '/static/ic_mine_version.png', text: '系统版本', extra: 'v1.00.01' },
{ icon: '/static/ic_mine_setting2.png', text: '设置' }
]
}
},
onLoad() {
this.$u.api.getUserInfo().then(res => {
if (res.code == '200'){
}
});
},
methods: {
handleItemClick(idx) {
if (idx === 0) {
uni.navigateTo({ url: '/pages/sys/user/changeInfo/changeInfo' });
}else if(idx === -1){
uni.navigateTo({ url: '/pages/sys/user/message/message' });
}else if(idx === -2){
uni.navigateTo({ url: '/pages/sys/user/serviceCenter/serviceCenter' });
}else if(idx === 1){
uni.navigateTo({ url: '/pages/sys/user/myPayment/myPayment' });
}else if(idx === 2){
uni.navigateTo({ url: '/pages/sys/user/myRepair/myRepair' });
}else if(idx === 3){
uni.navigateTo({ url: '/pages/sys/user/myVisitor/myVisitor' });
}else if(idx === 4){
uni.navigateTo({ url: '/pages/sys/user/myRecord/myRecord' });
// uni.navigateTo({ url: '/pages/workbench/oa/oa' });
}
}
}
}
export default {
name: 'Mine',
data() {
return {
userInfo:{
nickname: '',
phone:''
},
list: [{
icon: '/static/ic_mine_info.png',
text: '我的信息'
},
{
icon: '/static/ic_mine_pay.png',
text: '我的缴费'
},
{
icon: '/static/ic_mine_repair.png',
text: '我的报修'
},
{
icon: '/static/ic_mine_visitor.png',
text: '我的访客'
},
{
icon: '/static/ic_mine_check.png',
text: '我的考勤'
},
{
icon: '/static/ic_mine_pwd.png',
text: '修改密码'
},
{
icon: '/static/ic_mine_version.png',
text: '系统版本',
extra: 'v1.00.01'
},
{
icon: '/static/ic_mine_setting2.png',
text: '设置'
}
]
}
},
onLoad() {
this.userInfo.nickname =this.vuex_user.nickName
this.userInfo.phone = this.vuex_user.phonenumber
},
methods: {
handleItemClick(idx) {
if (idx === 0) {
uni.navigateTo({
url: '/pages/sys/user/changeInfo/changeInfo'
});
} else if (idx === -1) {
uni.navigateTo({
url: '/pages/sys/user/message/message'
});
} else if (idx === -2) {
uni.navigateTo({
url: '/pages/sys/user/serviceCenter/serviceCenter'
});
} else if (idx === 1) {
uni.navigateTo({
url: '/pages/sys/user/myPayment/myPayment'
});
} else if (idx === 2) {
uni.navigateTo({
url: '/pages/sys/user/myRepair/myRepair'
});
} else if (idx === 3) {
uni.navigateTo({
url: '/pages/sys/user/myVisitor/myVisitor'
});
} else if (idx === 4) {
// uni.navigateTo({
// url: '/pages/sys/user/myRecord/myRecord'
// });
uni.navigateTo({ url: '/pages/sys/workbench/oa/oa' });
}
}
}
}
</script>
<style scoped>
.mine-container {
height: 100vh;
background: #f8f8f8;
display: flex;
flex-direction: column;
}
.mine-header {
width: 100%;
height: 343rpx;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding-bottom: 0;
flex-shrink: 0; /* 防止被压缩 */
}
.mine-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 343rpx;
z-index: 0;
}
.mine-header-wave {
position: absolute;
left: 0;
bottom: -18rpx;
width: 100%;
height: 36rpx;
background: #fff;
border-bottom-left-radius: 36rpx;
border-bottom-right-radius: 36rpx;
z-index: 2;
}
.mine-info-row {
display: flex;
align-items: center;
position: relative;
z-index: 3;
margin-left: 32rpx;
bottom: 127rpx;
}
.mine-header-icons {
position: absolute;
right: 22rpx;
top: 86rpx;
display: flex;
z-index: 4;
}
.mine-avatar {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
background: #fff;
margin-right: 24rpx;
border: 4rpx solid #fff;
}
.mine-userinfo {
display: flex;
flex-direction: column;
}
.mine-nick {
color: #fff;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 6rpx;
}
.mine-phone {
color: #fff;
font-size: 24rpx;
}
.mine-container {
height: 100vh;
background: #f8f8f8;
display: flex;
flex-direction: column;
}
.mine-header-icon {
width: 30rpx;
height: 35rpx;
margin-left: 24rpx;
}
.mine-header-icon2 {
width: 33rpx;
height: 33rpx;
margin-left: 24rpx;
}
.mine-panel {
position: relative;
z-index: 10;
background: #fff;
border-top-left-radius: 30rpx;
border-top-right-radius: 30rpx;
margin-top: -51rpx;
box-shadow: 0 -2rpx 16rpx rgba(0,0,0,0.04);
padding: 0 0 40rpx 0;
display: flex;
flex-direction: column;
align-items: center;
flex: 1; /* 占据剩余空间 */
overflow-y: auto; /* 开启滚动 */
}
.mine-list {
width: 92vw;
background: transparent;
border-radius: 0;
margin: 51rpx auto;
box-shadow: none;
padding: 0;
}
.mine-list-item {
display: flex;
align-items: center;
padding: 0 0 0 0;
height: 96rpx;
position: relative;
background: transparent;
}
.mine-list-item:last-child {
border-bottom: none;
}
.mine-list-icon {
width: 38rpx;
height: 38rpx;
margin: 0 24rpx 0 30rpx;
}
.mine-list-text {
flex: 1;
font-size: 28rpx;
color: #1A1A1A;
}
.mine-list-extra {
color: #999;
font-size: 24rpx;
margin-right: 10rpx;
}
.mine-list-arrow {
width: 18rpx;
height: 28rpx;
margin-right: 24rpx;
}
.logout-btn {
width: 88vw;
height: 80rpx;
background: #0090FF;
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
margin: 100rpx auto 0 auto;
display: block;
box-shadow: 0 18rpx 24rpx rgba(0,0,0,0.18);
font-weight: bold;
}
</style>
.mine-header {
width: 100%;
height: 343rpx;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding-bottom: 0;
flex-shrink: 0;
/* 防止被压缩 */
}
.mine-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 343rpx;
z-index: 0;
}
.mine-header-wave {
position: absolute;
left: 0;
bottom: -18rpx;
width: 100%;
height: 36rpx;
background: #fff;
border-bottom-left-radius: 36rpx;
border-bottom-right-radius: 36rpx;
z-index: 2;
}
.mine-info-row {
display: flex;
align-items: center;
position: relative;
z-index: 3;
margin-left: 32rpx;
bottom: 127rpx;
}
.mine-header-icons {
position: absolute;
right: 22rpx;
top: 86rpx;
display: flex;
z-index: 4;
}
.mine-avatar {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
background: #fff;
margin-right: 24rpx;
border: 4rpx solid #fff;
}
.mine-userinfo {
display: flex;
flex-direction: column;
}
.mine-nick {
color: #fff;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 6rpx;
}
.mine-phone {
color: #fff;
font-size: 24rpx;
}
.mine-header-icon {
width: 30rpx;
height: 35rpx;
margin-left: 24rpx;
}
.mine-header-icon2 {
width: 33rpx;
height: 33rpx;
margin-left: 24rpx;
}
.mine-panel {
position: relative;
z-index: 10;
background: #fff;
border-top-left-radius: 30rpx;
border-top-right-radius: 30rpx;
margin-top: -51rpx;
box-shadow: 0 -2rpx 16rpx rgba(0, 0, 0, 0.04);
padding: 0 0 40rpx 0;
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
/* 占据剩余空间 */
overflow-y: auto;
/* 开启滚动 */
}
.mine-list {
width: 92vw;
background: transparent;
border-radius: 0;
margin: 51rpx auto;
box-shadow: none;
padding: 0;
}
.mine-list-item {
display: flex;
align-items: center;
padding: 0 0 0 0;
height: 96rpx;
position: relative;
background: transparent;
}
.mine-list-item:last-child {
border-bottom: none;
}
.mine-list-icon {
width: 38rpx;
height: 38rpx;
margin: 0 24rpx 0 30rpx;
}
.mine-list-text {
flex: 1;
font-size: 28rpx;
color: #1A1A1A;
}
.mine-list-extra {
color: #999;
font-size: 24rpx;
margin-right: 10rpx;
}
.mine-list-arrow {
width: 18rpx;
height: 28rpx;
margin-right: 24rpx;
}
.logout-btn {
width: 88vw;
height: 80rpx;
background: #0090FF;
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
margin: 100rpx auto 0 auto;
display: block;
box-shadow: 0 18rpx 24rpx rgba(0, 0, 0, 0.18);
font-weight: bold;
}
</style>

View File

@@ -1,460 +1,411 @@
<template>
<view class="visitor-container">
<!-- tab栏 -->
<view class="visitor-tabs">
<view v-for="(tab, idx) in tabs" :key="idx" :class="['visitor-tab', {active: idx === activeTab}]"
@click="changeTab(idx)">
{{ tab }}
<view v-if="idx === activeTab" class="tab-underline"></view>
</view>
</view>
<!-- 列表区 -->
<view class="visitor-list">
<view v-for="(item, idx) in list" :key="idx" class="visitor-card" @click="showVisitorDetail(item)">
<view class="card-row">
<view class="card-type">{{ item.type }}</view>
<view class="card-status" :class="item.statusClass">{{ item.status }}</view>
</view>
<view class="card-info">{{ item.name }}
<text class="card-phone">{{ item.phone }}</text>
<text class="card-divider"></text>
<text class="card-address">{{ item.address }}</text>
</view>
<view class="card-time">{{ item.time }}</view>
</view>
</view>
<!-- 底部按钮 -->
<button class="visitor-btn-fixed" @click="goCreateVisitor">访客邀约</button>
<view v-if="showDetail" class="visitor-detail-mask" @click.self="closeVisitorDetail">
<view class="visitor-detail-dialog">
<view class="visitor-detail-title-row">
<text class="visitor-detail-title">访客详情</text>
<image src="/static/ic_close_01.png" class="visitor-detail-close" @click="closeVisitorDetail" />
</view>
<view class="visitor-detail-info">
<view>{{ detailData.name }} {{ detailData.phone }}</view>
<view>{{ detailData.idCard || '5021119740208****' }}</view>
<view>车牌号{{ detailData.carNumber || '渝A·H1455' }}</view>
<view>来访时间{{ detailData.time }}</view>
<view>访问地址{{ detailData.address || '服务中心1栋8楼6871' }}</view>
<image :src="detailData.statusClass === 'orange' ? '/static/ic_my_visitor_01.png' : '/static/ic_my_visitor_02.png'" class="visitor-detail-status-img" />
</view>
<button class="visitor-detail-btn">修改</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tabs: ['我的预约', '我的邀约', '全部记录'],
activeTab: 1,
tabData: [
[],
[],
[]
], // 每个tab的数据
tabLoaded: [false, false, false], // 每个tab是否已加载
loading: false,
showDetail: false,
detailData: {},
}
},
computed: {
list() {
return this.tabData[this.activeTab];
}
},
created() {
this.loadTabData(this.activeTab); // 初始化加载当前tab数据
},
methods: {
goBack() {
uni.navigateBack();
<template>
<view class="visitor-container">
<!-- tab栏 -->
<view class="visitor-tabs">
<view v-for="(tab, idx) in tabs" :key="idx" :class="['visitor-tab', {active: idx === activeTab}]"
@click="changeTab(idx)">
{{ tab }}
<view v-if="idx === activeTab" class="tab-underline"></view>
</view>
</view>
<!-- 列表区 -->
<view class="visitor-list">
<view v-for="(item, idx) in list" :key="idx" class="visitor-card" @click="showVisitorDetail(item)">
<view class="card-row">
<view class="card-type">{{ item.visitorUnit }}</view>
<view class="card-status" :class="getStatusColor(item.serveStatus)">{{ getStatusLabel(item.serveStatus) }}</view>
</view>
<view class="card-info">{{ item.visitorName }}
<text class="card-phone">{{ item.visitorPhone }}</text>
<text class="card-divider"></text>
<text class="card-address">{{ item.visitorUnit }}</text>
</view>
<view class="card-time">{{ item.createTime }}</view>
</view>
</view>
<!-- 底部按钮 -->
<button class="visitor-btn-fixed" @click="goCreateVisitor">访客邀约</button>
<view v-if="showDetail" class="visitor-detail-mask" @click.self="closeVisitorDetail">
<view class="visitor-detail-dialog">
<view class="visitor-detail-title-row">
<text class="visitor-detail-title">访客详情</text>
<image src="/static/ic_close_01.png" class="visitor-detail-close" @click="closeVisitorDetail" />
</view>
<view class="visitor-detail-info">
<view>{{ detailData.visitorName }} {{ detailData.visitorPhone }}</view>
<view v-if="detailData.idCard">{{ detailData.idCard}}</view>
<view v-if="detailData.carNumber">车牌号{{ detailData.carNumber}}</view>
<view>来访时间{{ detailData.visitingBeginTime }}</view>
<view>访问地址{{ detailData.visitorUnit}}</view>
<image
:src="detailData.statusClass === 'orange' ? '/static/ic_my_visitor_01.png' : '/static/ic_my_visitor_02.png'"
class="visitor-detail-status-img" />
</view>
<button class="visitor-detail-btn">修改</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tabs: ['我的预约', '我的邀约', '全部记录'],
activeTab: 1,
tabData: [
[],
[],
[]
], // 每个tab的数据
tabLoaded: [false, false, false], // 每个tab是否已加载
loading: false,
showDetail: false,
detailData: {},
}
},
computed: {
list() {
return this.tabData[this.activeTab];
}
},
created() {
this.loadTabData(this.activeTab); // 初始化加载当前tab数据
},
methods: {
goBack() {
uni.navigateBack();
},
goCreateVisitor() {
uni.navigateTo({
url: '/pages/sys/user/myVisitor/creatVisitor'
});
},
async changeTab(idx) {
this.activeTab = idx;
if (!this.tabLoaded[idx]) {
await this.loadTabData(idx);
}
},
async loadTabData(idx) {
this.loading = true;
// 模拟接口请求不同tab返回不同mock数据
let params = {}
if (idx === 0) {
params = {
"interviewedPerson": this.vuex_user.userId
}
}
let data = [];
let res = await this.$u.api.getMyVisitor(params);
if (res.code == '200') {
data = res.rows
}
this.$set(this.tabData, idx, data);
this.$set(this.tabLoaded, idx, true);
this.loading = false;
},
showVisitorDetail(item) {
this.detailData = item;
this.showDetail = true;
},
closeVisitorDetail() {
this.showDetail = false;
},
getStatusLabel(status) {
const statusMap = {
0: '待确认',
1: '已确认',
2: '已取消',
3: '已完成'
};
return statusMap[status] || '';
},
goCreateVisitor() {
uni.navigateTo({
url: '/pages/sys/user/myVisitor/creatVisitor'
});
},
async changeTab(idx) {
this.activeTab = idx;
if (!this.tabLoaded[idx]) {
await this.loadTabData(idx);
}
},
async loadTabData(idx) {
this.loading = true;
// 模拟接口请求不同tab返回不同mock数据
let data = [];
if (idx === 0) {
data = [{
type: '商务合作',
status: '待处理',
statusClass: 'orange',
name: '张小晓',
phone: '18725468789',
address: '8栋2楼309',
time: '2025-07-06 15:28:16'
},
{
type: '送货上门',
status: '已到访',
statusClass: 'green',
name: '张小晓',
phone: '18725468789',
address: '8栋2楼309',
time: '2025-07-06 15:28:16'
},
{
type: '送货上门',
status: '未到访',
statusClass: 'green',
name: '张小晓',
phone: '18725468789',
address: '8栋2楼309',
time: '2025-07-06 15:28:16'
},
{ type: '商务合作', status: '待处理', statusClass: 'orange', name: '刘小备', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' },
{ type: '送货上门', status: '已到访', statusClass: 'green', name: '关小羽', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' },
{ type: '送货上门', status: '未到访', statusClass: 'green', name: '张小飞', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' },
{ type: '商务合作', status: '待处理', statusClass: 'orange', name: '曹小操', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' },
{ type: '送货上门', status: '已到访', statusClass: 'green', name: '孙小权', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' },
{ type: '送货上门', status: '未到访', statusClass: 'green', name: '周小瑜', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' }
];
} else if (idx === 1) {
data = [{
type: '商务合作',
status: '待处理',
statusClass: 'orange',
name: '李明',
phone: '13812345678',
address: '5栋1楼101',
time: '2025-07-07 10:00:00'
},
{
type: '送货上门',
status: '已到访',
statusClass: 'green',
name: '王五',
phone: '13987654321',
address: '6栋3楼202',
time: '2025-07-07 11:00:00'
},
{ type: '商务合作', status: '待处理', statusClass: 'orange', name: '赵六', phone: '13812345678', address: '5栋1楼101', time: '2025-07-07 10:00:00' },
{ type: '送货上门', status: '已到访', statusClass: 'green', name: '钱七', phone: '13987654321', address: '6栋3楼202', time: '2025-07-07 11:00:00' },
{ type: '商务合作', status: '待处理', statusClass: 'orange', name: '孙八', phone: '13812345678', address: '5栋1楼101', time: '2025-07-07 10:00:00' },
{ type: '送货上门', status: '已到访', statusClass: 'green', name: '周九', phone: '13987654321', address: '6栋3楼202', time: '2025-07-07 11:00:00' }
];
} else {
data = [{
type: '商务合作',
status: '已结束',
statusClass: 'gray',
name: '张小晓',
phone: '18725468789',
address: '8栋2楼309',
time: '2025-07-06 15:28:16'
},
{
type: '送货上门',
status: '已结束',
statusClass: 'gray',
name: '李明',
phone: '13812345678',
address: '5栋1楼101',
time: '2025-07-07 10:00:00'
},
{
type: '送货上门',
status: '已结束',
statusClass: 'gray',
name: '王五',
phone: '13987654321',
address: '6栋3楼202',
time: '2025-07-07 11:00:00'
},
{ type: '商务合作', status: '已结束', statusClass: 'gray', name: '张小晓', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' },
{ type: '送货上门', status: '已结束', statusClass: 'gray', name: '李明', phone: '13812345678', address: '5栋1楼101', time: '2025-07-07 10:00:00' },
{ type: '送货上门', status: '已结束', statusClass: 'gray', name: '王五', phone: '13987654321', address: '6栋3楼202', time: '2025-07-07 11:00:00' },
{ type: '商务合作', status: '已结束', statusClass: 'gray', name: '张小晓', phone: '18725468789', address: '8栋2楼309', time: '2025-07-06 15:28:16' },
{ type: '送货上门', status: '已结束', statusClass: 'gray', name: '李明', phone: '13812345678', address: '5栋1楼101', time: '2025-07-07 10:00:00' },
{ type: '送货上门', status: '已结束', statusClass: 'gray', name: '王五', phone: '13987654321', address: '6栋3楼202', time: '2025-07-07 11:00:00' }
];
}
// 模拟网络延迟
await new Promise(res => setTimeout(res, 300));
this.$set(this.tabData, idx, data);
this.$set(this.tabLoaded, idx, true);
this.loading = false;
},
showVisitorDetail(item) {
this.detailData = item;
this.showDetail = true;
},
closeVisitorDetail() {
this.showDetail = false;
}
}
}
</script>
<style scoped>
.visitor-container {
height: 100vh;
background: #f7f7f7;
display: flex;
flex-direction: column;
}
.visitor-navbar {
width: 100%;
height: 120rpx;
padding-top: 40rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
background: #fff;
flex-shrink: 0; /* 防止被压缩 */
}
.visitor-back {
position: absolute;
left: 37rpx;
width: 15rpx;
height: 33rpx;
}
.visitor-title {
font-size: 36rpx;
color: #000;
}
.visitor-tabs {
display: flex;
align-items: center;
justify-content: space-around;
background: #fff;
height: 80rpx;
border-bottom: 1px solid #f0f0f0;
flex-shrink: 0; /* 防止被压缩 */
}
.visitor-tab {
flex: 1;
text-align: center;
font-size: 30rpx;
color: #888;
position: relative;
font-weight: 500;
padding: 0 0 10rpx 0;
/* tab点击事件 */
cursor: pointer;
}
.visitor-tab.active {
color: #2186FF;
font-weight: bold;
}
.tab-underline {
width: 60rpx;
height: 6rpx;
background: #2186FF;
border-radius: 3rpx;
margin: 0 auto;
margin-top: 8rpx;
}
.visitor-list {
margin: 25rpx 0 0 0;
padding: 0 35rpx;
flex: 1; /* 占据所有剩余空间 */
overflow-y: auto; /* 内容超出时,开启垂直滚动 */
padding-bottom: 200rpx; /* 为底部按钮留出空间 */
}
.visitor-card {
background: #fff;
border-radius: 16rpx;
margin-bottom: 24rpx;
padding: 20rpx 40rpx 70rpx 12rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
}
.card-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 28rpx;
}
.card-type {
font-weight: 600;
font-size: 26rpx;
padding: 10rpx 45rpx 10rpx 12rpx;
border-radius: 15rpx;
color: #fff;
background: linear-gradient(90deg, #007CFF 0%, #FFFFFF 100%);
display: inline-block;
}
.card-status {
font-size: 28rpx;
}
.card-status.orange {
color: #F3831F;
}
.card-status.green {
color: #07C78E;
}
.card-status.gray {
color: #8F8F8F;
}
.card-info {
font-size: 26rpx;
color: #333;
margin-bottom: 8rpx;
display: flex;
align-items: center;
}
.card-phone {
margin: 0 8rpx 0 8rpx;
}
.card-divider {
width: 1rpx;
height: 40rpx;
background: #DCDCDC;
display: inline-block;
margin: 0 12rpx;
vertical-align: middle;
content: '';
}
.card-address {
margin-left: 0;
}
.card-time {
font-size: 28rpx;
color: #626262;
}
.visitor-btn {
width: 90vw;
height: 80rpx;
background: #0090FF;
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
margin: 60rpx auto 0 auto;
display: block;
font-weight: bold;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.18);
}
.visitor-btn-fixed {
position: fixed;
left: 0;
right: 0;
bottom: 100rpx;
margin: 0 auto;
width: 90vw;
height: 80rpx;
background: #0090FF;
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
display: block;
font-weight: bold;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.18);
z-index: 99;
}
.visitor-detail-mask {
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background: rgba(0,0,0,0.5);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
}
.visitor-detail-dialog {
width: 66vw;
background: #fff;
border-radius: 36rpx;
box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
padding: 48rpx 36rpx 36rpx 36rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}
.visitor-detail-title-row {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-bottom: 52rpx;
}
.visitor-detail-title {
font-size: 36rpx;
color: #000;
}
.visitor-detail-close {
position: absolute;
right: 0;
top: 0;
width: 22rpx;
height: 22rpx;
}
.visitor-detail-info {
width: 100%;
font-size: 28rpx;
color: #222;
margin-bottom: 80rpx;
display: flex;
flex-direction: column;
gap: 28rpx;
position: relative;
}
.visitor-detail-status-img {
position: absolute;
right: 0;
bottom: -40rpx;
width: 160rpx;
height: 160rpx;
z-index: 1;
pointer-events: none;
}
.visitor-detail-btn {
width: 320rpx;
height: 80rpx;
background: linear-gradient(90deg, #0090FF 0%, #2E9FFF 100%);
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
margin-bottom: 30rpx;
display: block;
font-weight: bold;
box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.18);
}
getStatusColor(status){
const statusMap = {
0: '待确认',
1: 'orange',
2: '已取消',
3: '已完成'
};
return statusMap[status] || '';
}
}
}
</script>
<style scoped>
.visitor-container {
height: 100vh;
background: #f7f7f7;
display: flex;
flex-direction: column;
}
.visitor-navbar {
width: 100%;
height: 120rpx;
padding-top: 40rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
background: #fff;
flex-shrink: 0;
/* 防止被压缩 */
}
.visitor-back {
position: absolute;
left: 37rpx;
width: 15rpx;
height: 33rpx;
}
.visitor-title {
font-size: 36rpx;
color: #000;
}
.visitor-tabs {
display: flex;
align-items: center;
justify-content: space-around;
background: #fff;
height: 80rpx;
border-bottom: 1px solid #f0f0f0;
flex-shrink: 0;
/* 防止被压缩 */
}
.visitor-tab {
flex: 1;
text-align: center;
font-size: 30rpx;
color: #888;
position: relative;
font-weight: 500;
padding: 0 0 10rpx 0;
/* tab点击事件 */
cursor: pointer;
}
.visitor-tab.active {
color: #2186FF;
font-weight: bold;
}
.tab-underline {
width: 60rpx;
height: 6rpx;
background: #2186FF;
border-radius: 3rpx;
margin: 0 auto;
margin-top: 8rpx;
}
.visitor-list {
margin: 25rpx 0 0 0;
padding: 0 35rpx;
flex: 1;
/* 占据所有剩余空间 */
overflow-y: auto;
/* 内容超出时,开启垂直滚动 */
padding-bottom: 200rpx;
/* 为底部按钮留出空间 */
}
.visitor-card {
background: #fff;
border-radius: 16rpx;
margin-bottom: 24rpx;
padding: 20rpx 40rpx 70rpx 12rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
}
.card-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 28rpx;
}
.card-type {
font-weight: 600;
font-size: 26rpx;
padding: 10rpx 45rpx 10rpx 12rpx;
border-radius: 15rpx;
color: #fff;
background: linear-gradient(90deg, #007CFF 0%, #FFFFFF 100%);
display: inline-block;
}
.card-status {
font-size: 28rpx;
}
.card-status.orange {
color: #F3831F;
}
.card-status.green {
color: #07C78E;
}
.card-status.gray {
color: #8F8F8F;
}
.card-info {
font-size: 26rpx;
color: #333;
margin-bottom: 8rpx;
margin-left: 8rpx;
display: flex;
align-items: center;
}
.card-phone {
margin: 0 8rpx 0 8rpx;
}
.card-divider {
width: 1rpx;
height: 40rpx;
background: #DCDCDC;
display: inline-block;
margin: 0 12rpx;
vertical-align: middle;
content: '';
}
.card-address {
margin-left: 0;
}
.card-time {
font-size: 28rpx;
color: #626262;
margin-left: 8rpx;
}
.visitor-btn {
width: 90vw;
height: 80rpx;
background: #0090FF;
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
margin: 60rpx auto 0 auto;
display: block;
font-weight: bold;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.18);
}
.visitor-btn-fixed {
position: fixed;
left: 0;
right: 0;
bottom: 100rpx;
margin: 0 auto;
width: 90vw;
height: 80rpx;
background: #0090FF;
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
display: block;
font-weight: bold;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.18);
z-index: 99;
}
.visitor-detail-mask {
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
}
.visitor-detail-dialog {
width: 80vw;
background: #fff;
border-radius: 36rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.12);
padding: 48rpx 36rpx 36rpx 36rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}
.visitor-detail-title-row {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-bottom: 52rpx;
}
.visitor-detail-title {
font-size: 36rpx;
color: #000;
}
.visitor-detail-close {
position: absolute;
right: 0;
top: 0;
width: 22rpx;
height: 22rpx;
}
.visitor-detail-info {
width: 100%;
font-size: 28rpx;
color: #222;
margin-bottom: 80rpx;
display: flex;
flex-direction: column;
gap: 28rpx;
position: relative;
}
.visitor-detail-status-img {
position: absolute;
right: 0;
bottom: -40rpx;
width: 160rpx;
height: 160rpx;
z-index: 1;
pointer-events: none;
}
.visitor-detail-btn {
width: 320rpx;
height: 80rpx;
background: linear-gradient(90deg, #0090FF 0%, #2E9FFF 100%);
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
margin-bottom: 30rpx;
display: block;
font-weight: bold;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.18);
}
</style>

View File

@@ -1,10 +1,5 @@
<template>
<view class="oa-container">
<!-- 顶部导航栏 -->
<view class="oa-navbar">
<image src="/static/ic_back.png" class="oa-back" @click="goBack" />
<text class="oa-title">申批中心</text>
</view>
<!-- 搜索框 -->
<view class="oa-search">
<view class="search-box">
@@ -22,7 +17,7 @@
</view>
<!-- 列表区 -->
<view class="oa-list">
<view v-for="(item, idx) in list" :key="idx" class="oa-card" :class="{'special-leave': item.status === '已通过'}" @click="goToDetail(item)">
<view v-for="(item, idx) in list" :key="idx" class="oa-card" @click="goToDetail(item)">
<view class="card-row">
<view class="card-type">{{ item.type }}</view>
<view class="card-status-tag" :class="item.statusClass">{{ item.status }}</view>
@@ -238,19 +233,6 @@
display: flex;
flex-direction: column;
}
.oa-navbar {
width: 100%;
height: 120rpx;
padding-top: 40rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
background: #fff;
flex-shrink: 0;
}
.oa-back {
position: absolute;
left: 37rpx;
@@ -423,21 +405,5 @@
color: #626262;
}
.special-leave {
position: relative;
overflow: hidden;
}
.special-leave::after {
content: '特批假';
position: absolute;
top: 10rpx;
right: -50rpx;
background-color: #F3831F;
color: #fff;
padding: 5rpx 60rpx;
transform: rotate(45deg);
font-size: 22rpx;
font-weight: bold;
}
</style>

View File

@@ -5,7 +5,7 @@
<!-- 顶部蓝色背景和搜索栏 -->
<view class="workbench-search-row">
<view class="search-bar">
<image class="search-icon" src="/static/ic_search_gray.png"/>
<image class="search-icon" src="/static/ic_search_gray.png" />
<input class="search-input" placeholder="搜索" />
</view>
<text class="search-btn">搜索</text>
@@ -13,7 +13,7 @@
<!-- banner 区域 -->
<view class="workbench-banner">
<image class="banner-img" src="/static/workbench_banner.png" mode="aspectFill" />
<image class="banner-img" src="/static/ic_work_01.png" />
</view>
</view>
<!-- 常用应用九宫格 -->
@@ -24,17 +24,17 @@
</view>
</view>
<!-- 全部应用 -->
<view >
<view>
<view class="all-apps-title">全部应用</view>
<view class="all-apps-tabs">
<view class="all-apps-tabs" v-if="false">
<text v-for="(tab, idx) in tabs" :key="idx" :class="['tab', {active: idx === activeTab}]"
@click="activeTab = idx">{{ tab }}</text>
</view>
<view class="line"></view>
<view class="workbench-grid">
<view class="grid-item" v-for="(item, idx) in allApps[activeTab]" :key="idx">
<view class="grid-item" v-for="(item, idx) in allApps" :key="idx" @click="handleItemClick(item.url)">
<image :src="item.icon" class="grid-icon" />
<text class="grid-text">{{ item.text }}</text>
<text class="grid-text">{{ item.name }}</text>
</view>
</view>
</view>
@@ -47,55 +47,60 @@
name: 'Workbench',
data() {
return {
commonApps: [
{ icon: 'https://picsum.photos/80/80?random=3', text: '审批' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '假勤' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '工单' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '停车' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '保洁' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '邀约' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '会议' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '添加常用' }
commonApps: [{
icon: 'https://picsum.photos/80/80?random=3',
text: '审批'
},
{
icon: 'https://picsum.photos/80/80?random=3',
text: '假勤'
},
{
icon: 'https://picsum.photos/80/80?random=3',
text: '工单'
},
{
icon: 'https://picsum.photos/80/80?random=3',
text: '停车'
},
{
icon: 'https://picsum.photos/80/80?random=3',
text: '保洁'
},
{
icon: 'https://picsum.photos/80/80?random=3',
text: '邀约'
},
{
icon: 'https://picsum.photos/80/80?random=3',
text: '会议'
},
{
icon: 'https://picsum.photos/80/80?random=3',
text: '添加常用'
}
],
tabs: ['最近使用', 'OA 管理', '敏捷开发', '协同办公'],
activeTab: 0,
allApps: [
// 最近使用
[
{ icon: 'https://picsum.photos/80/80?random=3', text: '文档' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '表格' },
{ icon: 'https://picsum.photos/80/80?random=3', text: 'PPT' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '笔记' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '录音' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '云打印' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '智能门禁' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '易企秀H5' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '多维表格' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '问卷网' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '集客云' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '收票宝' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '图表' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '消息' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '沟通' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '' }
],
// OA 管理
[
{ icon: 'https://picsum.photos/80/80?random=3', text: '文档' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '表格' },
{ icon: 'https://picsum.photos/80/80?random=3', text: 'PPT' }
],
// 敏捷开发
[
{ icon: 'https://picsum.photos/80/80?random=3', text: '集客云' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '问卷网' }
],
// 协同办公
[
{ icon: 'https://picsum.photos/80/80?random=3', text: '笔记' },
{ icon: 'https://picsum.photos/80/80?random=3', text: '沟通' }
]
]
allApps: []
}
},
onLoad() {
this.getWorkList()
},
methods: {
async getWorkList() {
let res = await this.$u.api.getFunList({
"roleid": this.vuex_user.roles[0].roleId
});
if (res.code == '200') {
this.allApps = res.rows
}
},
handleItemClick(url) {
uni.navigateTo({
url: url
});
}
}
}
@@ -114,7 +119,6 @@
position: relative;
height: 463rpx;
width: 100vw;
margin-bottom: -40rpx;
flex-shrink: 0;
}
@@ -167,9 +171,8 @@
}
.workbench-banner {
width: 92vw;
height: 140rpx;
margin: 0 auto 20rpx auto;
width: 90vw;
margin: 20rpx auto 20rpx auto;
border-radius: 20rpx;
overflow: hidden;
background: #fff;
@@ -179,9 +182,7 @@
}
.banner-img {
width: 100%;
height: 140rpx;
border-radius: 20rpx;
height: 293rpx;
}
.workbench-grid {
@@ -224,22 +225,29 @@
.all-apps-tabs {
display: flex;
align-items: center;
padding-left: 54rpx;
padding-right: 54rpx;
flex-wrap: wrap;
padding-left: 32rpx;
padding-right: 32rpx;
}
.tab {
font-size: 24rpx;
color: #999;
margin-right: 32rpx;
padding-bottom: 6rpx;
flex: 1 0 0;
font-size: 28rpx;
color: #333333;
margin-right: 0;
padding-bottom: 15rpx;
border-bottom: 4rpx solid transparent;
text-align: center;
font-weight: 500;
}
.tab.active {
color: #2e6cf6;
border-bottom: 4rpx solid #2e6cf6;
color: #0090FF;
border-bottom: 6rpx solid #007CFF;
font-weight: bold;
position: relative;
border-left: 20rpx;
border-right: 20rpx;
}
.all-apps-grid {
@@ -249,7 +257,8 @@
border-radius: 20rpx;
padding: 0 54rpx 0 54rpx;
}
.line{
.line {
background: #DCDCDC;
height: 2rpx;
margin-bottom: 40rpx;