1.订单部分页面 2.会议部分页面
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<view class="info">
|
||||
<view class="cv-section-title">访客信息</view>
|
||||
<view class="cv-avatar-upload" @click="chooseAvatar">
|
||||
<view v-if="!form.facePictures" class="cv-avatar-placeholder">上传正脸照</view>
|
||||
<image v-else :src="form.facePictures" class="cv-avatar-img" />
|
||||
<view v-if="!header" class="cv-avatar-placeholder">上传正脸照</view>
|
||||
<image v-else :src="header" class="cv-avatar-img" />
|
||||
</view>
|
||||
<input class="cv-input-name" placeholder="请输入姓名" v-model="form.visitorName" />
|
||||
<input class="cv-input-phone" placeholder="请输入来访人电话" v-model="form.visitorPhone" />
|
||||
@@ -73,7 +73,8 @@
|
||||
} from '@/common/upload.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
return {
|
||||
header:'',
|
||||
form: {
|
||||
visitorName: '',
|
||||
visitorPhone: '',
|
||||
@@ -104,7 +105,7 @@
|
||||
count: 1 // 根据剩余数量选择
|
||||
});
|
||||
// 将选择的图片添加到selectedImages数组
|
||||
this.form.facePictures = images[0].path
|
||||
this.header = images[0].path
|
||||
|
||||
} catch (error) {
|
||||
|
||||
@@ -112,7 +113,7 @@
|
||||
},
|
||||
async submit(){
|
||||
let images = [''];
|
||||
let filePath = this.form.facePictures.replace('file://', '');
|
||||
let filePath = this.header.replace('file://', '');
|
||||
images[0] = filePath;
|
||||
console.log("t1",images)
|
||||
const result = await uploadFiles({
|
||||
@@ -121,10 +122,19 @@
|
||||
name: 'file',
|
||||
vm: this // 关键:用于注入 token 等
|
||||
});
|
||||
console.log("t1",result)
|
||||
|
||||
if (result.code == '200') {
|
||||
data = result.data.url
|
||||
console.log("t1",result.data.url)
|
||||
}
|
||||
|
||||
this.form.facePictures = result.url
|
||||
},
|
||||
chooseRoom() {
|
||||
// 这里可弹出选择房间号
|
||||
// 这里可弹出选择房间号
|
||||
uni.navigateTo({
|
||||
url: '/pages/sys/user/myVisitor/selectRoom'
|
||||
});
|
||||
},
|
||||
chooseCarNumber() {
|
||||
// 这里可弹出选择车牌号
|
||||
|
@@ -146,32 +146,7 @@
|
||||
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;
|
||||
|
155
pages/sys/user/myVisitor/selectRoom.vue
Normal file
155
pages/sys/user/myVisitor/selectRoom.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-bar">
|
||||
<picker mode="region" @change="onRegionChange">
|
||||
<view class="region">{{ region }}</view>
|
||||
</picker>
|
||||
<input class="search-input" placeholder="请输入您的地址" />
|
||||
</view>
|
||||
|
||||
<!-- 地图展示 -->
|
||||
<map
|
||||
class="map-view"
|
||||
:longitude="longitude"
|
||||
:latitude="latitude"
|
||||
scale="16"
|
||||
show-location
|
||||
:markers="markers"
|
||||
></map>
|
||||
|
||||
<!-- 地址列表 -->
|
||||
<view class="address-list">
|
||||
<block v-for="(item, index) in addressList" :key="index">
|
||||
<view
|
||||
class="address-item"
|
||||
@tap="onSelect(item)"
|
||||
>
|
||||
<view class="addr-info">
|
||||
<view class="addr-title">{{ item.name }}</view>
|
||||
<view class="addr-desc">{{ item.detail }}</view>
|
||||
</view>
|
||||
<radio :checked="selectedId === item.id" />
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
region: '重庆',
|
||||
latitude: 29.534,
|
||||
longitude: 106.565,
|
||||
selectedId: null,
|
||||
markers: [
|
||||
{
|
||||
id: 1,
|
||||
latitude: 29.534,
|
||||
longitude: 106.565,
|
||||
iconPath: '/static/ic_map.png', // 设置背景图
|
||||
width: 20,
|
||||
height: 20
|
||||
}
|
||||
],
|
||||
addressList: [
|
||||
{
|
||||
id: 1,
|
||||
name: '综合服务中心-1栋',
|
||||
detail: '重庆市南川区隆化大道9号'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '综合服务中心-2栋',
|
||||
detail: '重庆市南川区隆化大道12号'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '综合服务中心-3栋',
|
||||
detail: '重庆市南川区隆化大道4号'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '综合服务中心-4栋',
|
||||
detail: '重庆市南川区隆化大道5号'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '综合服务中心-5栋',
|
||||
detail: '重庆市南川区隆化大道145号'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onRegionChange(e) {
|
||||
this.region = e.detail.value;
|
||||
},
|
||||
onSelect(item) {
|
||||
this.selectedId = item.id;
|
||||
console.log('Selected:', item);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.region {
|
||||
margin-right: 20rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.map-view {
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
}
|
||||
|
||||
.address-list {
|
||||
padding: 20rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.address-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.addr-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.addr-title {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.addr-desc {
|
||||
font-size: 26rpx;
|
||||
color: #888;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
</style>
|
815
pages/sys/workbench/camera.vue
Normal file
815
pages/sys/workbench/camera.vue
Normal file
@@ -0,0 +1,815 @@
|
||||
<template>
|
||||
<view class="camera-container">
|
||||
<!-- 相机预览区域 -->
|
||||
<view class="camera-preview">
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="camera-placeholder">
|
||||
<text class="placeholder-text">H5端需要特殊配置才能使用相机</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP-PLUS || MP -->
|
||||
<camera
|
||||
:device-position="devicePosition"
|
||||
:flash="flashMode"
|
||||
@error="cameraError"
|
||||
class="camera"
|
||||
ref="camera"
|
||||
></camera>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 相机控制区域 -->
|
||||
<view class="camera-controls">
|
||||
<!-- 顶部控制栏 -->
|
||||
<view class="top-controls">
|
||||
<view class="control-btn" @click="toggleFlash">
|
||||
<image
|
||||
:src="flashMode === 'off' ? '/static/ic_flash_off.png' : '/static/ic_flash_on.png'"
|
||||
class="control-icon"
|
||||
></image>
|
||||
</view>
|
||||
<view class="control-btn" @click="switchCamera">
|
||||
<image src="/static/ic_camera_switch.png" class="control-icon"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom-controls">
|
||||
<!-- 相册入口 -->
|
||||
<view class="album-entry" @click="openAlbum">
|
||||
<image v-if="latestMedia" :src="latestMedia" class="album-thumb"></image>
|
||||
<view v-else class="album-placeholder"></view>
|
||||
</view>
|
||||
|
||||
<!-- 拍摄按钮 -->
|
||||
<view class="capture-area">
|
||||
<view
|
||||
class="capture-btn"
|
||||
:class="{ recording: isRecording }"
|
||||
@touchstart="startCapture"
|
||||
@touchend="stopCapture"
|
||||
>
|
||||
<view class="capture-inner"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 模式切换 -->
|
||||
<view class="mode-toggle">
|
||||
<view
|
||||
class="mode-btn"
|
||||
:class="{ active: captureMode === 'photo' }"
|
||||
@click="switchMode('photo')"
|
||||
>
|
||||
拍照
|
||||
</view>
|
||||
<view
|
||||
class="mode-btn"
|
||||
:class="{ active: captureMode === 'video' }"
|
||||
@click="switchMode('video')"
|
||||
>
|
||||
录像
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 录制时间显示 -->
|
||||
<view v-if="isRecording" class="recording-timer">
|
||||
{{ formatTime(recordTime) }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结果预览区域 -->
|
||||
<view v-if="capturedMedia" class="preview-container">
|
||||
<image v-if="captureMode === 'photo'" :src="capturedMedia" class="preview-image"></image>
|
||||
<video v-else :src="capturedMedia" class="preview-video" autoplay controls></video>
|
||||
|
||||
<view class="preview-actions">
|
||||
<view class="action-btn cancel-btn" @click="cancelPreview">取消</view>
|
||||
<view class="action-btn confirm-btn" @click="confirmMedia">使用</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 权限提示 -->
|
||||
<view v-if="showPermissionTip" class="permission-tip">
|
||||
<view class="tip-content">
|
||||
<text class="tip-text">需要相机权限才能使用拍照功能</text>
|
||||
<view class="tip-buttons">
|
||||
<button class="tip-btn" @click="cancelPermission">取消</button>
|
||||
<button class="tip-btn confirm" @click="requestPermission">去设置</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
devicePosition: 'back', // 'front' or 'back'
|
||||
flashMode: 'off', // 'off', 'on', 'auto'
|
||||
captureMode: 'photo', // 'photo' or 'video'
|
||||
isRecording: false,
|
||||
recordTime: 0,
|
||||
recordTimer: null,
|
||||
capturedMedia: '',
|
||||
latestMedia: '',
|
||||
hasCameraPermission: false,
|
||||
showPermissionTip: false,
|
||||
cameraContext: null
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
// 页面加载时检查权限
|
||||
this.checkPermission()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 页面显示时重置状态
|
||||
this.resetState()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 检查权限
|
||||
checkPermission() {
|
||||
// #ifdef APP-PLUS
|
||||
this.checkAppPermission()
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.checkMPPermission()
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
// H5默认可以使用
|
||||
this.hasCameraPermission = true
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 检查App权限
|
||||
checkAppPermission() {
|
||||
// #ifdef APP-PLUS
|
||||
// 先检查是否已有权限
|
||||
// #ifdef APP-PLUS && ANDROID
|
||||
// Android平台检查权限
|
||||
var Context = plus.android.importClass("android.content.Context");
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var PackageManager = plus.android.importClass("android.content.pm.PackageManager");
|
||||
var permission = "android.permission.CAMERA";
|
||||
var result = main.checkSelfPermission(permission);
|
||||
|
||||
if (result === PackageManager.PERMISSION_GRANTED) {
|
||||
this.hasCameraPermission = true;
|
||||
} else {
|
||||
// 请求权限
|
||||
plus.android.requestPermissions(
|
||||
[permission],
|
||||
(resultObj) => {
|
||||
let denied = false;
|
||||
for (let i = 0; i < resultObj.denied.length; i++) {
|
||||
denied = true;
|
||||
break;
|
||||
}
|
||||
this.hasCameraPermission = !denied;
|
||||
if (denied) {
|
||||
this.showPermissionTip = true;
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.error('权限请求失败:', error);
|
||||
this.hasCameraPermission = false;
|
||||
this.showPermissionTip = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS && IOS
|
||||
// iOS平台默认认为有权限,实际使用时会弹出授权框
|
||||
this.hasCameraPermission = true;
|
||||
// #endif
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 检查小程序权限
|
||||
checkMPPermission() {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.getSetting({
|
||||
success: (res) => {
|
||||
if (res.authSetting['scope.camera']) {
|
||||
this.hasCameraPermission = true;
|
||||
} else {
|
||||
this.requestMPPermission();
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.requestMPPermission();
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 请求小程序权限
|
||||
requestMPPermission() {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.authorize({
|
||||
scope: 'scope.camera',
|
||||
success: () => {
|
||||
this.hasCameraPermission = true;
|
||||
},
|
||||
fail: () => {
|
||||
this.showPermissionTip = true;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 请求权限
|
||||
requestPermission() {
|
||||
this.showPermissionTip = false;
|
||||
// #ifdef APP-PLUS
|
||||
if (plus.os.name == 'Android') {
|
||||
var Intent = plus.android.importClass('android.content.Intent');
|
||||
var Settings = plus.android.importClass('android.provider.Settings');
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
var uri = plus.android.invoke('android.net.Uri', 'fromParts', 'package', main.getPackageName(), null);
|
||||
plus.android.invoke(intent, 'setData', uri);
|
||||
main.startActivity(intent);
|
||||
} else if (plus.os.name == 'iOS') {
|
||||
plus.runtime.openURL('app-settings:');
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.openSetting({
|
||||
success: (setting) => {
|
||||
if (setting.authSetting['scope.camera']) {
|
||||
this.hasCameraPermission = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 取消权限请求
|
||||
cancelPermission() {
|
||||
this.showPermissionTip = false;
|
||||
},
|
||||
|
||||
// 重置状态
|
||||
resetState() {
|
||||
this.capturedMedia = '';
|
||||
this.isRecording = false;
|
||||
if (this.recordTimer) {
|
||||
clearInterval(this.recordTimer);
|
||||
this.recordTimer = null;
|
||||
}
|
||||
this.recordTime = 0;
|
||||
},
|
||||
|
||||
// 切换闪光灯
|
||||
toggleFlash() {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
this.flashMode = this.flashMode === 'off' ? 'on' : 'off';
|
||||
},
|
||||
|
||||
// 切换前后摄像头
|
||||
switchCamera() {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
this.devicePosition = this.devicePosition === 'back' ? 'front' : 'back';
|
||||
},
|
||||
|
||||
// 切换拍摄模式
|
||||
switchMode(mode) {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
this.captureMode = mode;
|
||||
},
|
||||
|
||||
// 开始拍摄
|
||||
startCapture() {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.captureMode === 'photo') {
|
||||
this.takePhoto();
|
||||
} else {
|
||||
this.startRecord();
|
||||
}
|
||||
},
|
||||
|
||||
// 停止拍摄
|
||||
stopCapture() {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.captureMode === 'video' && this.isRecording) {
|
||||
this.stopRecord();
|
||||
}
|
||||
},
|
||||
|
||||
// 拍照
|
||||
takePhoto() {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
const ctx = uni.createCameraContext();
|
||||
ctx.takePhoto({
|
||||
quality: 'high',
|
||||
success: (res) => {
|
||||
this.capturedMedia = res.tempImagePath;
|
||||
this.latestMedia = res.tempImagePath;
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('拍照失败:', err);
|
||||
// 检查是否是权限问题
|
||||
if (err.errMsg && (err.errMsg.includes('permission') || err.errMsg.includes('权限'))) {
|
||||
this.hasCameraPermission = false;
|
||||
this.showPermissionTip = true;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '拍照失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
const ctx = uni.createCameraContext();
|
||||
ctx.takePhoto({
|
||||
quality: 'high',
|
||||
success: (res) => {
|
||||
this.capturedMedia = res.tempImagePath;
|
||||
this.latestMedia = res.tempImagePath;
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('拍照失败:', err);
|
||||
// 检查是否是权限问题
|
||||
if (err.errMsg && (err.errMsg.includes('permission') || err.errMsg.includes('权限'))) {
|
||||
this.hasCameraPermission = false;
|
||||
this.showPermissionTip = true;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '拍照失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 开始录像
|
||||
startRecord() {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
const ctx = uni.createCameraContext();
|
||||
ctx.startRecord({
|
||||
success: () => {
|
||||
this.isRecording = true;
|
||||
this.recordTime = 0;
|
||||
this.recordTimer = setInterval(() => {
|
||||
this.recordTime++;
|
||||
}, 1000);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('开始录像失败:', err);
|
||||
// 检查是否是权限问题
|
||||
if (err.errMsg && (err.errMsg.includes('permission') || err.errMsg.includes('权限'))) {
|
||||
this.hasCameraPermission = false;
|
||||
this.showPermissionTip = true;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '开始录像失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
const ctx = uni.createCameraContext();
|
||||
ctx.startRecord({
|
||||
success: () => {
|
||||
this.isRecording = true;
|
||||
this.recordTime = 0;
|
||||
this.recordTimer = setInterval(() => {
|
||||
this.recordTime++;
|
||||
}, 1000);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('开始录像失败:', err);
|
||||
// 检查是否是权限问题
|
||||
if (err.errMsg && (err.errMsg.includes('permission') || err.errMsg.includes('权限'))) {
|
||||
this.hasCameraPermission = false;
|
||||
this.showPermissionTip = true;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '开始录像失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 停止录像
|
||||
stopRecord() {
|
||||
if (!this.hasCameraPermission) {
|
||||
this.showNoPermissionTip();
|
||||
return;
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
const ctx = uni.createCameraContext();
|
||||
ctx.stopRecord({
|
||||
success: (res) => {
|
||||
clearInterval(this.recordTimer);
|
||||
this.recordTimer = null;
|
||||
this.isRecording = false;
|
||||
this.capturedMedia = res.tempVideoPath;
|
||||
this.latestMedia = res.tempVideoPath;
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('停止录像失败:', err);
|
||||
uni.showToast({
|
||||
title: '停止录像失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
const ctx = uni.createCameraContext();
|
||||
ctx.stopRecord({
|
||||
success: (res) => {
|
||||
clearInterval(this.recordTimer);
|
||||
this.recordTimer = null;
|
||||
this.isRecording = false;
|
||||
this.capturedMedia = res.tempVideoPath;
|
||||
this.latestMedia = res.tempVideoPath;
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('停止录像失败:', err);
|
||||
uni.showToast({
|
||||
title: '停止录像失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 显示无权限提示
|
||||
showNoPermissionTip() {
|
||||
uni.showToast({
|
||||
title: '无相机权限,请先授权',
|
||||
icon: 'none'
|
||||
});
|
||||
this.showPermissionTip = true;
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
formatTime(seconds) {
|
||||
const mins = Math.floor(seconds / 60);
|
||||
const secs = seconds % 60;
|
||||
return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
|
||||
},
|
||||
|
||||
// 打开相册
|
||||
openAlbum() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
this.capturedMedia = res.tempFilePaths[0];
|
||||
this.captureMode = 'photo';
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('选择图片失败:', err);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 取消预览
|
||||
cancelPreview() {
|
||||
this.capturedMedia = '';
|
||||
},
|
||||
|
||||
// 确认使用媒体
|
||||
confirmMedia() {
|
||||
// 将媒体文件传递回上一个页面
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length > 1) {
|
||||
const prevPage = pages[pages.length - 2];
|
||||
if (prevPage && prevPage.$vm) {
|
||||
if (this.captureMode === 'photo') {
|
||||
if (prevPage.$vm.onPhotoTaken) {
|
||||
prevPage.$vm.onPhotoTaken(this.capturedMedia);
|
||||
}
|
||||
} else {
|
||||
if (prevPage.$vm.onVideoTaken) {
|
||||
prevPage.$vm.onVideoTaken(this.capturedMedia);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
// 相机错误处理
|
||||
cameraError(e) {
|
||||
console.error('相机错误:', e);
|
||||
uni.showToast({
|
||||
title: '相机初始化失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
// 清理定时器
|
||||
if (this.recordTimer) {
|
||||
clearInterval(this.recordTimer);
|
||||
this.recordTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.camera-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.camera-preview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.camera {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.camera-placeholder {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.placeholder-text {
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.camera-controls {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.camera-controls > view {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.top-controls {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.control-btn {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.control-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.bottom-controls {
|
||||
position: absolute;
|
||||
bottom: 40rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.album-entry {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.album-thumb {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.album-placeholder {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.capture-area {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
border: 8rpx solid rgba(255, 255, 255, 0.3);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.capture-btn {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.capture-btn.recording {
|
||||
background: #ff4d4f;
|
||||
border-color: #ff4d4f;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.capture-inner {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.mode-toggle {
|
||||
display: flex;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 50rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mode-btn {
|
||||
padding: 16rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mode-btn.active {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.recording-timer {
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 30rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.preview-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #000;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.preview-image,
|
||||
.preview-video {
|
||||
width: 100%;
|
||||
height: 80%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.preview-actions {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
padding: 20rpx 60rpx;
|
||||
border-radius: 50rpx;
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
background: #999;
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
background: #007aff;
|
||||
}
|
||||
|
||||
.permission-tip {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
.tip-content {
|
||||
width: 80%;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tip-text {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
margin-bottom: 40rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tip-buttons {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.tip-btn {
|
||||
flex: 1;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
.tip-btn.confirm {
|
||||
background: #007aff;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
471
pages/sys/workbench/meet/createMeet.vue
Normal file
471
pages/sys/workbench/meet/createMeet.vue
Normal file
@@ -0,0 +1,471 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 日期导航 -->
|
||||
<view class="date-nav">
|
||||
<scroll-view scroll-x class="date-scroll">
|
||||
<view class="date-item" :class="currentDate === '07-07' ? 'active' : ''" data-date="07-07">今天 07-07 周六
|
||||
</view>
|
||||
<view class="date-item" :class="currentDate === '07-07' ? 'active' : ''" data-date="07-07">
|
||||
<text class="highlight">07-07</text> 周一
|
||||
</view>
|
||||
<view class="date-item" data-date="07-08">07-08 周二</view>
|
||||
<view class="date-item" data-date="07-09">07-09 周三</view>
|
||||
<view class="date-item" data-date="07-10">07-10 周四</view>
|
||||
<view class="date-item" data-date="07-11">07-11 周五</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 选择时段 -->
|
||||
<text class="label">选择时段</text>
|
||||
<view class="time-tabs">
|
||||
<view class="time-tab" :class="timeTab === 'morning' ? '' : 'inactive'">
|
||||
<image src="/static/ic_meet_02.png" class="time-img1" />上午
|
||||
</view>
|
||||
<view class="time-tab" :class="timeTab === 'afternoon' ? 'active' : ''">
|
||||
<image src="/static/ic_meet_03.png" class="time-img2" />下午
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 会议人数 -->
|
||||
<text class="label">会议人数</text>
|
||||
<input type="number" v-model="formData.peopleNum" placeholder="请输入会议人数" class="meet-num" />
|
||||
|
||||
|
||||
<!-- 选择会议室 -->
|
||||
<text class="label">选择会议室</text>
|
||||
<picker :value="meetingRoomIndex" :range="meetingRooms">
|
||||
<view class="picker-content">
|
||||
<text>{{formData.meetingRoom || '请选择会议室'}}</text>
|
||||
<text v-if="formData.meetingRoom" class="room-info">{{meetingRooms[meetingRoomIndex]}}</text>
|
||||
</view>
|
||||
</picker>
|
||||
|
||||
|
||||
<!-- 会议主题 -->
|
||||
<text class="label">会议主题</text>
|
||||
<input type="text" v-model="formData.theme" placeholder="请输入会议名称" class="meet-input" />
|
||||
|
||||
|
||||
<!-- 会议时间 -->
|
||||
|
||||
<text class="label">会议时间</text>
|
||||
<input type="text" v-model="meetingTime" placeholder="请选择会议时间" class="meet-input" />
|
||||
|
||||
|
||||
<!-- 是否需要签到 -->
|
||||
<view class="sgin-in-row">
|
||||
<view class="label">是否需要签到</view>
|
||||
<view class="radio-label" @click="formData.checkIn = true">
|
||||
<view :class="['radio-custom', {checked: formData.checkIn === true}]" />
|
||||
<text>是</text>
|
||||
</view>
|
||||
<view class="radio-label" @click="formData.checkIn = false">
|
||||
<view :class="['radio-custom', {checked: formData.checkIn === false}]" />
|
||||
<text>否</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text class="label">增值服务</text>
|
||||
<view class="meet-text">会议物品</view>
|
||||
|
||||
<view class="service-list">
|
||||
<view v-for="(data,index) in itemList">
|
||||
<view class="label">{{data.type}}</view>
|
||||
<view class="service-item" v-for="(item, index) in data.data" :key="index">
|
||||
<view class="service-info">
|
||||
<text>{{item.name}}</text>
|
||||
<text class="price">¥{{item.price}}/{{item.unit}}</text>
|
||||
</view>
|
||||
<view class="quantity-selector">
|
||||
<view class="minus" @tap="decreaseQuantity(index, 'tea')">-</view>
|
||||
<input type="number" v-model="item.quantity" disabled class="quantity-input" />
|
||||
<view class="plus" @tap="increaseQuantity(index, 'tea')">+</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-line" v-if="index<itemList.length-1"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 备注 -->
|
||||
<view class="remark-section">
|
||||
<textarea v-model="formData.remark" placeholder="若您还有其他需求,请在这里进行备注~"></textarea>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="footer">
|
||||
<view class="total-price">
|
||||
<text>¥</text>
|
||||
<text>{{totalPrice}}</text>
|
||||
</view>
|
||||
<button class="submit-btn" @tap="submitForm">发起会议并支付</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentDate: '07-07',
|
||||
timeTab: 'afternoon',
|
||||
formData: {
|
||||
peopleNum: '',
|
||||
meetingRoom: '',
|
||||
theme: '',
|
||||
checkIn: false,
|
||||
remark: ''
|
||||
},
|
||||
meetingRoomIndex: 1, // 默认选中第二个会议室(3栋2号)
|
||||
meetingRooms: [
|
||||
'3栋1号会议室 (3078) 可容纳20人 带电视',
|
||||
'3栋2号会议室 (5124) 可容纳50人 带投影仪',
|
||||
'1栋3号会议室 (1247) 可容纳100人'
|
||||
],
|
||||
meetingTime: '2025-07-07 14:00-18:00',
|
||||
itemList: [{
|
||||
type: '茶水',
|
||||
data: [{
|
||||
id: 1,
|
||||
name: '清茶',
|
||||
price: 5,
|
||||
unit: '杯',
|
||||
quantity: 5
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '碧螺春',
|
||||
price: 8,
|
||||
unit: '杯',
|
||||
quantity: 5
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '红茶',
|
||||
price: 10,
|
||||
unit: '杯',
|
||||
quantity: 5
|
||||
}
|
||||
]
|
||||
}, {
|
||||
type: '会议物品',
|
||||
data: [{
|
||||
id: 4,
|
||||
name: '清茶',
|
||||
price: 5,
|
||||
unit: '杯',
|
||||
quantity: 5
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '碧螺春',
|
||||
price: 8,
|
||||
unit: '杯',
|
||||
quantity: 5
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: '红茶',
|
||||
price: 10,
|
||||
unit: '杯',
|
||||
quantity: 5
|
||||
}
|
||||
]
|
||||
}],
|
||||
|
||||
// 其他物品列表...
|
||||
totalPrice: 256
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
increaseQuantity(index, category) {
|
||||
if (category === 'tea') {
|
||||
this.teaList[index].quantity++;
|
||||
this.calculateTotalPrice();
|
||||
}
|
||||
// 其他类别数量增加逻辑...
|
||||
},
|
||||
decreaseQuantity(index, category) {
|
||||
if (this.teaList[index].quantity > 1) {
|
||||
this.teaList[index].quantity--;
|
||||
this.calculateTotalPrice();
|
||||
}
|
||||
// 其他类别数量减少逻辑...
|
||||
},
|
||||
calculateTotalPrice() {
|
||||
let total = 0;
|
||||
// 计算茶水总价
|
||||
this.teaList.forEach(item => {
|
||||
total += item.price * item.quantity;
|
||||
});
|
||||
// 计算其他类别总价...
|
||||
this.totalPrice = total;
|
||||
},
|
||||
submitForm() {
|
||||
// 表单验证
|
||||
if (!this.formData.peopleNum || !this.formData.meetingRoom) {
|
||||
uni.showToast({
|
||||
title: '请完善必填信息',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 提交表单逻辑(实际开发需对接API)
|
||||
uni.showLoading({
|
||||
title: '提交中...'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '预约成功',
|
||||
success: () => {
|
||||
// 跳转支付页面或完成预约
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
padding-bottom: 120rpx;
|
||||
padding-left: 35rpx;
|
||||
padding-right: 35rpx;
|
||||
}
|
||||
|
||||
/* 日期导航 */
|
||||
.date-nav {
|
||||
padding: 20rpx 30rpx;
|
||||
background: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.date-scroll {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.date-item {
|
||||
display: inline-block;
|
||||
padding: 10rpx 20rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
&.active {
|
||||
color: #4a90e2;
|
||||
background: #e8f4ff;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
color: #4a90e2;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.time-tabs {
|
||||
flex: 1;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
margin-top: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.time-img1 {
|
||||
width: 41rpx;
|
||||
height: 29rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.time-img2 {
|
||||
width: 33rpx;
|
||||
height: 34rpx;
|
||||
margin-right: 17rpx;
|
||||
}
|
||||
|
||||
.time-tab {
|
||||
width: 152rpx;
|
||||
height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 40rpx;
|
||||
|
||||
&.active {
|
||||
background: #2E93FF;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.inactive {
|
||||
background: #EBF5FF;
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.meet-num {
|
||||
background: #F7F7F7;
|
||||
width: 297rpx;
|
||||
height: 73rpx;
|
||||
font-size: 24rpx;
|
||||
align-items: center;
|
||||
padding-left: 18rpx;
|
||||
margin-top: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.meet-input {
|
||||
background: #F7F7F7;
|
||||
width: 86vw;
|
||||
height: 73rpx;
|
||||
font-size: 24rpx;
|
||||
align-items: center;
|
||||
padding-left: 18rpx;
|
||||
margin-top: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.meet-text {
|
||||
background: #F7F7F7;
|
||||
width: 86vw;
|
||||
height: 73rpx;
|
||||
font-size: 24rpx;
|
||||
align-items: center;
|
||||
padding-left: 18rpx;
|
||||
margin-top: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.sgin-in-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.radio-label {
|
||||
font-size: 24rpx;
|
||||
color: #0B0B0B;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 30rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.radio-custom {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
border-radius: 50%;
|
||||
border: 1rpx solid #007CFF;
|
||||
background: #fff;
|
||||
margin-right: 12rpx;
|
||||
box-sizing: border-box;
|
||||
transition: background 0.2s, border 0.2s;
|
||||
}
|
||||
|
||||
.radio-custom.checked {
|
||||
background: #007CFF;
|
||||
border: 1rpx solid #007CFF;
|
||||
}
|
||||
|
||||
.service-list {
|
||||
background: #F7F7F7;
|
||||
padding: 34rpx 20rpx 20rpx 34rpx;
|
||||
|
||||
.service-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.service-info {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
.price {
|
||||
color: #4a90e2;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.quantity-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.minus,
|
||||
.plus {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
border: 1rpx solid #eee;
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.quantity-input {
|
||||
width: 80rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
margin: 0 10rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-line{
|
||||
width: 80vw;
|
||||
margin: 26rpx auto 20rpx auto;
|
||||
background: #fff;
|
||||
height: 1rpx;
|
||||
}
|
||||
/* 底部按钮 */
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 100rpx;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.total-price {
|
||||
font-size: 32rpx;
|
||||
color: #ff6b00;
|
||||
font-weight: bold;
|
||||
|
||||
text:first-child {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
margin-left: 30rpx;
|
||||
background: #4a90e2;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
390
pages/sys/workbench/meet/meet.vue
Normal file
390
pages/sys/workbench/meet/meet.vue
Normal file
@@ -0,0 +1,390 @@
|
||||
<template>
|
||||
<view class="meet-container">
|
||||
<!-- tab栏 -->
|
||||
<view class="meet-tabs">
|
||||
<view v-for="(tab, idx) in tabs" :key="idx" :class="['meet-tab', {active: idx === activeTab}]"
|
||||
@click="changeTab(idx)">
|
||||
{{ tab }}
|
||||
<view v-if="idx === activeTab" class="tab-underline"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="empty-content" v-if="list.length ===0">
|
||||
<image src="/static/ic_meet_01.png" class="empty-img"></image>
|
||||
<view class="empty-txt">暂无预约</view>
|
||||
<button class="empty-btn" @click="createMeet">发起预约</button>
|
||||
</view>
|
||||
<!-- 列表区 -->
|
||||
<view v-else class="meet-list">
|
||||
<view v-for="(item, idx) in list" :key="idx" class="meet-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>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabs: ['我发起的', '邀请我的'],
|
||||
activeTab: 0,
|
||||
tabData: [
|
||||
[],
|
||||
[]
|
||||
], // 每个tab的数据
|
||||
tabLoaded: [false, false], // 每个tab是否已加载
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list() {
|
||||
return this.tabData[this.activeTab];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadTabData(this.activeTab); // 初始化加载当前tab数据
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
createMeet(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/sys/workbench/meet/createMeet'
|
||||
});
|
||||
},
|
||||
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 = {
|
||||
}
|
||||
}
|
||||
|
||||
let data = [];
|
||||
|
||||
let res = await this.$u.api.getMeetings(params);
|
||||
if (res.code == '200') {
|
||||
data = res.rows
|
||||
}
|
||||
|
||||
this.$set(this.tabData, idx, data);
|
||||
this.$set(this.tabLoaded, idx, true);
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
getStatusLabel(status) {
|
||||
const statusMap = {
|
||||
0: '待确认',
|
||||
1: '已确认',
|
||||
2: '已取消',
|
||||
3: '已完成'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
},
|
||||
getStatusColor(status) {
|
||||
const statusMap = {
|
||||
0: '待确认',
|
||||
1: 'orange',
|
||||
2: '已取消',
|
||||
3: '已完成'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.meet-container {
|
||||
height: 100vh;
|
||||
background: #f7f7f7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.empty-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 168rpx;
|
||||
}
|
||||
.empty-img{
|
||||
width: 440rpx;
|
||||
height: 398rpx;
|
||||
}
|
||||
.empty-txt{
|
||||
color: #737373;
|
||||
font-size: 28rpx;
|
||||
margin-top: 64rpx;
|
||||
}
|
||||
|
||||
.empty-btn {
|
||||
width: 70vw;
|
||||
height: 80rpx;
|
||||
background: #0090FF;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
border-radius: 40rpx;
|
||||
margin: 140rpx auto 0 auto;
|
||||
display: block;
|
||||
box-shadow: 0 18rpx 24rpx rgba(0, 0, 0, 0.18);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.meet-tabs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background: #fff;
|
||||
height: 80rpx;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
flex-shrink: 0;
|
||||
/* 防止被压缩 */
|
||||
}
|
||||
|
||||
.meet-tab {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #888;
|
||||
position: relative;
|
||||
font-weight: 500;
|
||||
padding: 0 0 10rpx 0;
|
||||
/* tab点击事件 */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.meet-tab.active {
|
||||
color: #2186FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tab-underline {
|
||||
width: 60rpx;
|
||||
height: 6rpx;
|
||||
background: #2186FF;
|
||||
border-radius: 3rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.meet-list {
|
||||
margin: 25rpx 0 0 0;
|
||||
padding: 0 35rpx;
|
||||
flex: 1;
|
||||
/* 占据所有剩余空间 */
|
||||
overflow-y: auto;
|
||||
/* 内容超出时,开启垂直滚动 */
|
||||
padding-bottom: 200rpx;
|
||||
/* 为底部按钮留出空间 */
|
||||
}
|
||||
|
||||
.meet-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;
|
||||
}
|
||||
|
||||
.meet-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);
|
||||
}
|
||||
|
||||
.meet-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;
|
||||
}
|
||||
|
||||
.meet-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;
|
||||
}
|
||||
|
||||
.meet-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;
|
||||
}
|
||||
|
||||
.meet-detail-title-row {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
margin-bottom: 52rpx;
|
||||
}
|
||||
|
||||
.meet-detail-title {
|
||||
font-size: 36rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.meet-detail-close {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
|
||||
.meet-detail-info {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
color: #222;
|
||||
margin-bottom: 80rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 28rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.meet-detail-status-img {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: -40rpx;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
z-index: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.meet-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>
|
@@ -1,498 +1,407 @@
|
||||
<template>
|
||||
<view class="detail-container">
|
||||
<!-- 顶部导航栏 -->
|
||||
<view class="detail-navbar">
|
||||
<image src="/static/ic_back_white.webp" class="detail-back" @click="goBack" />
|
||||
<view class="detail-right">
|
||||
<image src="/static/ic_share_w.png" class="detail-scan" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 卡片容器 -->
|
||||
<view class="card-wrapper">
|
||||
<!-- 请假信息卡片 -->
|
||||
<view class="detail-card">
|
||||
<!-- 请假状态 -->
|
||||
<view class="leave-header">
|
||||
<view class="leave-type">请假</view>
|
||||
<view class="leave-status">已通过</view>
|
||||
</view>
|
||||
|
||||
<!-- 申请人信息 -->
|
||||
<view class="applicant-info">
|
||||
<view class="applicant-avatar" style="background-color: #4B7BF5;">余</view>
|
||||
<view class="applicant-detail">
|
||||
<text class="applicant-name">余永乐</text>
|
||||
<text class="applicant-dept">数据开发及研发部</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 提交时间 -->
|
||||
<view class="submit-time">提交时间:7月16日 18:36:44</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 其他卡片保持原结构 -->
|
||||
<view class="detail-card">
|
||||
<view class="detail-title">申批详情</view>
|
||||
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">假期类型</text>
|
||||
<text class="detail-value-vertical">病假</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">开始时间</text>
|
||||
<text class="detail-value-vertical">2025-07-15</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">结束时间</text>
|
||||
<text class="detail-value-vertical">2025-07-17</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">时长</text>
|
||||
<text class="detail-value-vertical">2天</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">请假事由</text>
|
||||
<text class="detail-value-vertical">由于腿儿过大,需要到医院进行检查</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">附件</text>
|
||||
<view class="attachment">
|
||||
<view class="attachment-preview">
|
||||
<image src="/static/ic_attachment_preview.png" class="attachment-img" />
|
||||
</view>
|
||||
<view class="attachment-info">
|
||||
<text class="attachment-name">174568963.jpg</text>
|
||||
<text class="attachment-size">289.14 KB</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 审批记录卡片保持原结构 -->
|
||||
<view class="detail-card">
|
||||
<view class="detail-title">申批记录</view>
|
||||
|
||||
<view class="approval-item">
|
||||
<view class="approval-status">
|
||||
<view class="status-dot selected"></view>
|
||||
<view class="status-line" v-if="true"></view>
|
||||
</view>
|
||||
<view class="approval-content">
|
||||
<view class="approval-type">提交</view>
|
||||
<view class="approver-info">
|
||||
<view class="approver-avatar" style="background-color: #4B7BF5;">余</view>
|
||||
<text class="approver-name">余永乐</text>
|
||||
<text class="approval-result">已提交</text>
|
||||
</view>
|
||||
<text class="approval-time">07-12 18:28:22</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="approval-item">
|
||||
<view class="approval-status">
|
||||
<view class="status-dot selected"></view>
|
||||
<view class="status-line" v-if="true"></view>
|
||||
</view>
|
||||
<view class="approval-content">
|
||||
<view class="approval-type">审批</view>
|
||||
<view class="approver-info">
|
||||
<view class="approver-avatar" style="background-color: #F3831F;">张</view>
|
||||
<text class="approver-name">张桂花</text>
|
||||
<text class="approval-result">已同意</text>
|
||||
</view>
|
||||
<text class="approval-time">07-12 18:28:22</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="approval-item">
|
||||
<view class="approval-status">
|
||||
<view class="status-dot selected"></view>
|
||||
<view class="status-line" v-if="false"></view>
|
||||
</view>
|
||||
<view class="approval-content">
|
||||
<view class="approval-type">审批</view>
|
||||
<view class="approver-info">
|
||||
<view class="approver-avatar" style="background-color: #F3831F;">张</view>
|
||||
<text class="approver-name">张桂花</text>
|
||||
<text class="approval-result">已批准</text>
|
||||
</view>
|
||||
<text class="approval-time">07-12 18:28:22</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="approval-item">
|
||||
<view class="approval-status">
|
||||
<view class="status-dot"></view>
|
||||
</view>
|
||||
<view class="approval-content">
|
||||
<view class="approval-type">结束</view>
|
||||
<text class="approval-time">07-12 18:28:22</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class=" ">
|
||||
<!-- 顶部导航背景 -->
|
||||
<view class="detail-navbar">
|
||||
<image src="/static/ic_back_white.webp" class="detail-back" @click="goBack" />
|
||||
<view class="detail-right">
|
||||
<image src="/static/ic_share_w.png" class="detail-scan" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 卡片内容,盖住导航背景 -->
|
||||
<view class="card-wrapper">
|
||||
<!-- 请假信息卡片 -->
|
||||
<view class="detail-card">
|
||||
<view class="leave-header">
|
||||
<view class="leave-type">请假</view>
|
||||
<view class="leave-status">已通过</view>
|
||||
</view>
|
||||
<view class="applicant-info">
|
||||
<view class="applicant-avatar" style="background-color: #4B7BF5;">余</view>
|
||||
<view class="applicant-detail">
|
||||
<text class="applicant-name">余永乐</text>
|
||||
<text class="applicant-dept">数据开发及研发部</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-time">提交时间:7月16日 18:36:44</view>
|
||||
</view>
|
||||
|
||||
<!-- 申批详情卡片 -->
|
||||
<view class="detail-card">
|
||||
<view class="detail-title">申批详情</view>
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">假期类型</text>
|
||||
<text class="detail-value-vertical">病假</text>
|
||||
</view>
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">开始时间</text>
|
||||
<text class="detail-value-vertical">2025-07-15</text>
|
||||
</view>
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">结束时间</text>
|
||||
<text class="detail-value-vertical">2025-07-17</text>
|
||||
</view>
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">时长</text>
|
||||
<text class="detail-value-vertical">2天</text>
|
||||
</view>
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">请假事由</text>
|
||||
<text class="detail-value-vertical">由于腿儿过大,需要到医院进行检查</text>
|
||||
</view>
|
||||
<view class="detail-item-vertical">
|
||||
<text class="detail-label-vertical">附件</text>
|
||||
<view class="attachment">
|
||||
<view class="attachment-preview">
|
||||
<image src="/static/ic_attachment_preview.png" class="attachment-img" />
|
||||
</view>
|
||||
<view class="attachment-info">
|
||||
<text class="attachment-name">174568963.jpg</text>
|
||||
<text class="attachment-size">289.14 KB</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 审批记录卡片 -->
|
||||
<view class="detail-card">
|
||||
<view class="detail-title">申批记录</view>
|
||||
<view
|
||||
class="approval-item"
|
||||
v-for="(item, index) in detailData.approvalRecords"
|
||||
:key="index"
|
||||
>
|
||||
<view class="approval-status">
|
||||
<view :class="['status-dot', index < 3 ? 'selected' : '']"></view>
|
||||
<view
|
||||
v-if="index < detailData.approvalRecords.length - 1"
|
||||
class="status-line"
|
||||
></view>
|
||||
</view>
|
||||
<view class="approval-content">
|
||||
<view class="approval-type">{{ item.type }}</view>
|
||||
<view class="approver-info" v-if="item.approver">
|
||||
<view
|
||||
class="approver-avatar"
|
||||
:style="{ backgroundColor: item.approver.avatarColor }"
|
||||
>
|
||||
{{ item.approver.avatarText }}
|
||||
</view>
|
||||
<text class="approver-name">{{ item.approver.name }}</text>
|
||||
<text class="approval-result">{{ item.result }}</text>
|
||||
</view>
|
||||
<text class="approval-time">{{ item.time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* OA申批详情页面
|
||||
* @author lyc
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 详情数据
|
||||
detailData: {
|
||||
type: '请假',
|
||||
status: '已通过',
|
||||
leaveType: '病假',
|
||||
applicant: {
|
||||
name: '余永乐',
|
||||
dept: '数据开发及研发部',
|
||||
avatarText: '余',
|
||||
avatarColor: '#4B7BF5'
|
||||
},
|
||||
submitTime: '7月16日 18:36:44',
|
||||
startTime: '2025-07-15',
|
||||
endTime: '2025-07-17',
|
||||
duration: '2天',
|
||||
reason: '由于腿儿过大,需要到医院进行检查',
|
||||
attachment: {
|
||||
name: '174568963.jpg',
|
||||
size: '289.14 KB'
|
||||
},
|
||||
approvalRecords: [
|
||||
{
|
||||
type: '提交',
|
||||
approver: {
|
||||
name: '余永乐',
|
||||
avatarText: '余',
|
||||
avatarColor: '#4B7BF5'
|
||||
},
|
||||
result: '已提交',
|
||||
time: '07-12 18:28:22'
|
||||
},
|
||||
{
|
||||
type: '审批',
|
||||
approver: {
|
||||
name: '张桂花',
|
||||
avatarText: '张',
|
||||
avatarColor: '#F3831F'
|
||||
},
|
||||
result: '已同意',
|
||||
time: '07-12 18:28:22'
|
||||
},
|
||||
{
|
||||
type: '审批',
|
||||
approver: {
|
||||
name: '张桂花',
|
||||
avatarText: '张',
|
||||
avatarColor: '#F3831F'
|
||||
},
|
||||
result: '已批准',
|
||||
time: '07-12 18:28:22'
|
||||
},
|
||||
{
|
||||
type: '结束',
|
||||
time: '07-12 18:28:22'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
detailData: {
|
||||
approvalRecords: [
|
||||
{
|
||||
type: "提交",
|
||||
approver: {
|
||||
name: "余永乐",
|
||||
avatarText: "余",
|
||||
avatarColor: "#4B7BF5",
|
||||
},
|
||||
result: "已提交",
|
||||
time: "07-12 18:28:22",
|
||||
},
|
||||
{
|
||||
type: "审批",
|
||||
approver: {
|
||||
name: "张桂花",
|
||||
avatarText: "张",
|
||||
avatarColor: "#F3831F",
|
||||
},
|
||||
result: "已同意",
|
||||
time: "07-12 18:28:22",
|
||||
},
|
||||
{
|
||||
type: "审批",
|
||||
approver: {
|
||||
name: "张桂花",
|
||||
avatarText: "张",
|
||||
avatarColor: "#F3831F",
|
||||
},
|
||||
result: "已批准",
|
||||
time: "07-12 18:28:22",
|
||||
},
|
||||
{
|
||||
type: "结束",
|
||||
time: "07-12 18:28:22",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-container {
|
||||
background-color: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
/* 导航栏样式 */
|
||||
.detail-navbar {
|
||||
width: 100%;
|
||||
height: 372rpx;
|
||||
margin-bottom: -180rpx; /* 减少负边距避免过度覆盖 */
|
||||
padding-top: 115rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: linear-gradient(180deg, #0A60ED 0%, #FFFFFF 100%);
|
||||
}
|
||||
|
||||
.card-wrapper{
|
||||
z-index: 100;
|
||||
}
|
||||
.detail-back {
|
||||
margin-left: 37rpx;
|
||||
width: 15rpx;
|
||||
height: 33rpx;
|
||||
}
|
||||
|
||||
.detail-right {
|
||||
margin-right: 37rpx;
|
||||
}
|
||||
|
||||
.detail-scan {
|
||||
width: 36rpx;
|
||||
height: 35rpx;
|
||||
}
|
||||
|
||||
/* 卡片通用样式 */
|
||||
.detail-card {
|
||||
z-index: 20; /* 提高层级确保显示在导航栏之上 */
|
||||
background-color: #fff;
|
||||
margin: 20rpx 30rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
border: 1px dashed #ddd;
|
||||
}
|
||||
|
||||
/* 请假信息卡片 */
|
||||
.leave-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.leave-type {
|
||||
font-weight: 600;
|
||||
font-size: 26rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #2186FF;
|
||||
background: rgba(33, 134, 255, 0.1);
|
||||
border: 1px solid #2186FF;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.leave-status {
|
||||
font-size: 26rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #07C78E;
|
||||
background-color: rgba(7, 199, 142, 0.1);
|
||||
border: 1px solid #07C78E;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.applicant-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.applicant-avatar {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
background-color: #4B7BF5;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.applicant-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.applicant-name {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.applicant-dept {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.submit-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 申批详情 */
|
||||
.detail-title {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
width: 150rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 垂直布局的申批详情 */
|
||||
.detail-item-vertical {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.detail-label-vertical {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.detail-value-vertical {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
/* 附件样式 */
|
||||
.attachment {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.attachment-preview {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.attachment-img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.attachment-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.attachment-name {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.attachment-size {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 审批记录 */
|
||||
.approval-item {
|
||||
display: flex;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.approval-status {
|
||||
width: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #fff;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.status-dot.selected {
|
||||
background-color: #2186FF;
|
||||
border-color: #2186FF;
|
||||
}
|
||||
|
||||
.status-line {
|
||||
width: 2rpx;
|
||||
flex: 1;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.approval-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.approval-type {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.approver-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.approver-avatar {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #4B7BF5;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.approver-name {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.approval-result {
|
||||
font-size: 24rpx;
|
||||
color: #07C78E;
|
||||
}
|
||||
|
||||
.approval-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
.detail-container {
|
||||
background-color: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 渐变背景导航栏 */
|
||||
.detail-navbar {
|
||||
width: 100%;
|
||||
height: 372rpx;
|
||||
padding-top: 115rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: linear-gradient(180deg, #0a60ed 0%, #ffffff 100%);
|
||||
}
|
||||
|
||||
/* 卡片区域盖住导航背景 */
|
||||
.card-wrapper {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
margin-top: -200rpx; /* 向上覆盖导航背景 */
|
||||
}
|
||||
|
||||
/* 通用卡片 */
|
||||
.detail-card {
|
||||
background-color: #fff;
|
||||
margin: 20rpx 30rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.detail-back {
|
||||
margin-left: 37rpx;
|
||||
width: 15rpx;
|
||||
height: 33rpx;
|
||||
}
|
||||
|
||||
.detail-right {
|
||||
margin-right: 37rpx;
|
||||
}
|
||||
|
||||
.detail-scan {
|
||||
width: 36rpx;
|
||||
height: 35rpx;
|
||||
}
|
||||
|
||||
.leave-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.leave-type {
|
||||
font-weight: 600;
|
||||
font-size: 26rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #2186ff;
|
||||
background: rgba(33, 134, 255, 0.1);
|
||||
border: 1px solid #2186ff;
|
||||
}
|
||||
|
||||
.leave-status {
|
||||
font-size: 26rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #07c78e;
|
||||
background-color: rgba(7, 199, 142, 0.1);
|
||||
border: 1px solid #07c78e;
|
||||
}
|
||||
|
||||
.applicant-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.applicant-avatar {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.applicant-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.applicant-name {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.applicant-dept {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.submit-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.detail-item-vertical {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.detail-label-vertical {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.detail-value-vertical {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.attachment {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.attachment-preview {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.attachment-img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.attachment-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.attachment-name {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.attachment-size {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 审批记录 */
|
||||
.approval-item {
|
||||
display: flex;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.approval-status {
|
||||
width: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #fff;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.status-dot.selected {
|
||||
background-color: #2186ff;
|
||||
border-color: #2186ff;
|
||||
}
|
||||
|
||||
.status-line {
|
||||
width: 2rpx;
|
||||
flex: 1;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.approval-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.approval-type {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.approver-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.approver-avatar {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.approver-name {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.approval-result {
|
||||
font-size: 24rpx;
|
||||
color: #07c78e;
|
||||
}
|
||||
|
||||
.approval-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
|
162
pages/sys/workbench/order/createOrder.vue
Normal file
162
pages/sys/workbench/order/createOrder.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view class="form-container">
|
||||
<!-- 工单名称 -->
|
||||
<view class="form-item">
|
||||
<text class="label">工单名称</text>
|
||||
<input class="input" placeholder="请输入工单名称" v-model="form.name" />
|
||||
</view>
|
||||
|
||||
<!-- 工单类型 -->
|
||||
<view class="form-item">
|
||||
<text class="label">工单类型</text>
|
||||
<picker :range="orderTypes" @change="onTypeChange">
|
||||
<view class="picker">
|
||||
{{ form.type || '请选择' }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 处理人 -->
|
||||
<view class="form-item">
|
||||
<text class="label">处理人</text>
|
||||
<view class="handler-selector">
|
||||
<picker :range="handlers" @change="onHandlerChange">
|
||||
<view class="picker">
|
||||
{{ form.handler || '请选择' }}
|
||||
</view>
|
||||
</picker>
|
||||
<button class="icon-btn" @click="addHandler">+</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 计划完成时间 -->
|
||||
<view class="form-item">
|
||||
<text class="label">计划完成时间</text>
|
||||
<picker mode="date" @change="onDateChange">
|
||||
<view class="picker">
|
||||
{{ form.date || '请选择' }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 备注 -->
|
||||
<view class="form-item">
|
||||
<text class="label">备注</text>
|
||||
<textarea class="textarea" placeholder="请输入内容(非必填)" v-model="form.remark" />
|
||||
</view>
|
||||
|
||||
<!-- 上传图片 -->
|
||||
<view class="form-item">
|
||||
<button class="upload-btn" @click="uploadImage">+ 上传图片</button>
|
||||
</view>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submit-wrapper">
|
||||
<button class="submit-btn" @click="submit">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
name: '',
|
||||
type: '',
|
||||
handler: '',
|
||||
date: '',
|
||||
remark: '',
|
||||
image: ''
|
||||
},
|
||||
orderTypes: ['类型1', '类型2', '类型3'],
|
||||
handlers: ['张三', '李四', '王五']
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onTypeChange(e) {
|
||||
this.form.type = this.orderTypes[e.detail.value];
|
||||
},
|
||||
onHandlerChange(e) {
|
||||
this.form.handler = this.handlers[e.detail.value];
|
||||
},
|
||||
onDateChange(e) {
|
||||
this.form.date = e.detail.value;
|
||||
},
|
||||
addHandler() {
|
||||
uni.showToast({ title: '添加处理人', icon: 'none' });
|
||||
},
|
||||
uploadImage() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
this.form.image = res.tempFilePaths[0];
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
});
|
||||
console.log(this.form);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.form-item {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.label {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10rpx;
|
||||
display: block;
|
||||
}
|
||||
.input,
|
||||
.picker,
|
||||
.textarea {
|
||||
background-color: #f5f5f5;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.textarea {
|
||||
height: 200rpx;
|
||||
}
|
||||
.handler-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.icon-btn {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #eee;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.upload-btn {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border: 2rpx dashed #ccc;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
.submit-wrapper {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
padding: 20rpx;
|
||||
border-radius: 50rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
230
pages/sys/workbench/order/order.vue
Normal file
230
pages/sys/workbench/order/order.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<view class="order-container">
|
||||
<!-- tab栏 -->
|
||||
<view class="order-tabs">
|
||||
<view v-for="(tab, idx) in tabs" :key="idx" :class="['order-tab', {active: idx === activeTab}]"
|
||||
@click="changeTab(idx)">
|
||||
{{ tab }}
|
||||
<view v-if="idx === activeTab" class="tab-underline"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表区 -->
|
||||
<view class="order-list">
|
||||
<view v-for="(item, idx) in list" :key="idx" class="order-card" @click="goDetail(item)">
|
||||
<view class="order-row">
|
||||
<view class="order-no">工单号:{{ item.orderNo }}</view>
|
||||
<view class="order-status" :class="getStatusColor(item.status)">
|
||||
{{ getStatusLabel(item.status) }}</view>
|
||||
</view>
|
||||
<image class="order-line-image" src="/static/ic_my_repair_03.png" />
|
||||
<view class="order-info">工单名称:{{ item.orderName }}</view>
|
||||
<view class="order-info">工单类型:{{ item.typeName }}</view>
|
||||
<view class="order-info">创建时间:{{ item.createTime }}</view>
|
||||
<view class="order-info">有 效 期:{{ item.createTime }}-{{item.planCompleTime}}</view>
|
||||
<view v-if="item.statusText === '已结束'" class="order-eval-btn eval-btn-right">服务评价</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabs: ['待办', '全部', '发起 '],
|
||||
activeTab: 1,
|
||||
tabData: [
|
||||
[],
|
||||
[],
|
||||
[]
|
||||
], // 每个tab的数据
|
||||
tabLoaded: [false, false, false], // 每个tab是否已加载
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list() {
|
||||
return this.tabData[this.activeTab];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadTabData(this.activeTab); // 初始化加载当前tab数据
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
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 = {
|
||||
}
|
||||
}
|
||||
|
||||
let data = [];
|
||||
let res = await this.$u.api.getOrderList(params);
|
||||
|
||||
if (res.code == '200') {
|
||||
data = res.rows
|
||||
}
|
||||
|
||||
this.$set(this.tabData, idx, data);
|
||||
this.$set(this.tabLoaded, idx, true);
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
getStatusLabel(status) {
|
||||
const statusMap = {
|
||||
0: '创建工单',
|
||||
1: '处理中',
|
||||
2: '处理中',
|
||||
3: '处理中',
|
||||
4: '已完成'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
},
|
||||
getStatusColor(status) {
|
||||
const statusMap = {
|
||||
0: 'orange',
|
||||
1: 'doing',
|
||||
2: 'doing',
|
||||
3: 'doing',
|
||||
4: 'done'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
},
|
||||
goDetail(item) {
|
||||
// 将item对象转换为JSON字符串并进行编码,然后通过URL参数传递
|
||||
const itemStr = encodeURIComponent(JSON.stringify(item));
|
||||
uni.navigateTo({
|
||||
url: '/pages/sys/workbench/order/orderDetail?item=' + itemStr
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.order-container {
|
||||
height: 100vh;
|
||||
background: #f7f7f7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
.order-tabs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background: #fff;
|
||||
height: 80rpx;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
flex-shrink: 0;
|
||||
/* 防止被压缩 */
|
||||
}
|
||||
|
||||
.order-tab {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #888;
|
||||
position: relative;
|
||||
font-weight: 500;
|
||||
padding: 0 0 10rpx 0;
|
||||
/* tab点击事件 */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.order-tab.active {
|
||||
color: #2186FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tab-underline {
|
||||
width: 60rpx;
|
||||
height: 6rpx;
|
||||
background: #2186FF;
|
||||
border-radius: 3rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.order-list {
|
||||
margin: 32rpx 0 0 0;
|
||||
padding: 0 24rpx;
|
||||
flex: 1;
|
||||
/* 占据所有剩余空间 */
|
||||
overflow-y: auto;
|
||||
/* 内容超出时,开启垂直滚动 */
|
||||
padding-bottom: 200rpx;
|
||||
/* 为底部按钮留出空间 */
|
||||
}
|
||||
|
||||
.order-card {
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 24rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
|
||||
padding-top: 25rpx;
|
||||
padding-bottom: 32rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.order-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12rpx;
|
||||
margin-top: 25rpx;
|
||||
margin-left: 19rpx;
|
||||
margin-right: 50rpx;
|
||||
}
|
||||
|
||||
.order-no {
|
||||
font-size: 24rpx;
|
||||
color: #0B0B0B;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.order-status {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.order-line-image {
|
||||
margin: left 29rpx;
|
||||
margin-right: 39rpx;
|
||||
height: 2rpx;
|
||||
margin-bottom: 29rpx;
|
||||
}
|
||||
|
||||
.order-status.orange {
|
||||
color: #F3AB44;
|
||||
}
|
||||
|
||||
.order-status.doing {
|
||||
color: #00C9AA;
|
||||
}
|
||||
|
||||
.order-status.done {
|
||||
color: #8A8A8A;
|
||||
}
|
||||
|
||||
.order-info {
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
margin-bottom: 30rpx;
|
||||
margin-left: 47rpx;
|
||||
}
|
||||
</style>
|
242
pages/sys/workbench/order/orderDetail.vue
Normal file
242
pages/sys/workbench/order/orderDetail.vue
Normal file
@@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<view class="page-container">
|
||||
<view class="top-line"/>
|
||||
<!-- 工单状态进度 -->
|
||||
<view class="repair-detail-progress-box">
|
||||
<view class="repair-detail-progress">
|
||||
<view v-for="(step, idx) in progressSteps" :key="idx" class="repair-detail-step">
|
||||
<view
|
||||
:class="['repair-detail-dot', detailStep >= idx ? 'active' : '', (detailStep === idx && detailStatus !== '已结束') ? 'current' : '']">
|
||||
</view>
|
||||
<view v-if="idx < progressSteps.length - 1"
|
||||
:class="['repair-detail-line', detailStep > idx ? 'active' : '']"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="repair-detail-progress-labels">
|
||||
<view v-for="(step, idx) in progressSteps" :key="idx" class="repair-detail-label">{{ step }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 工单详情 -->
|
||||
<view class="detail-list">
|
||||
<view class="detail-value"><text class="detail-key">工单编号:</text>{{ detail.orderNo }}</view>
|
||||
<view class="detail-value"><text class="detail-key">工单名称:</text>{{ detail.orderName }}</view>
|
||||
<view class="detail-value"><text class="detail-key">工单类型:</text>{{ detail.typeName }}</view>
|
||||
<view class="detail-value"><text class="detail-key">处理地点:</text>{{ detail.location }}</view>
|
||||
<view class="detail-value"><text class="detail-key">创建时间:</text>{{ detail.createTime }}</view>
|
||||
<view class="detail-value"><text class="detail-key">发起单位/人:</text>{{ detail.initiatorPeople }}</view>
|
||||
<view class="detail-value"><text class="detail-key">计划完成时间:</text>{{ detail.planCompleTime }}</view>
|
||||
<view class="detail-value">
|
||||
<text>附件:</text>
|
||||
<text class="link" @click="downloadFile">下载</text>
|
||||
</view>
|
||||
<view class="detail-value remark"><text>备注:</text>{{ detail.remark }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<view class="btn-group">
|
||||
<button class="btn ghost" @click="transfer">转派</button>
|
||||
<button class="btn primary" @click="complete">完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
detailStep: 0,
|
||||
detailStatus: '',
|
||||
progressSteps: ['创建工单', '处理中', '已结束'],
|
||||
currentStatus: 2, // 0: 待分配,1: 已接单,2: 处理中,3: 已完成
|
||||
detail: {
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.item) {
|
||||
const item = JSON.parse(decodeURIComponent(options.item));
|
||||
this.detail = item;
|
||||
console.log("t1",this.detail)
|
||||
// 现在可以使用item对象了
|
||||
// 进度映射
|
||||
if (item.status === 0) {
|
||||
this.detailStep = 0;
|
||||
this.detailStatus = '创建报';
|
||||
} else if (item.status === 4) {
|
||||
this.detailStep = 3;
|
||||
this.detailStatus = '已结束';
|
||||
} else {
|
||||
this.detailStep = 2;
|
||||
this.detailStatus = '处理中';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
transfer() {
|
||||
uni.showToast({
|
||||
title: '转派功能开发中',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
complete() {
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
|
||||
downloadFile() {
|
||||
uni.downloadFile({
|
||||
url: this.detail.attachment,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
background: #fff;
|
||||
}
|
||||
.top-line{
|
||||
width: 100vw;
|
||||
height: 3rpx;
|
||||
background: #ECECEC;
|
||||
}
|
||||
.repair-detail-progress-box {
|
||||
height: 107rpx;
|
||||
margin-bottom: 41rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.repair-detail-progress {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 5rpx;
|
||||
margin-left: 100rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.repair-detail-step {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.repair-detail-dot {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
border-radius: 50%;
|
||||
background: #BDBDBD;
|
||||
border: 2rpx solid #BDBDBD;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.repair-detail-dot.active {
|
||||
background: #2186FF;
|
||||
border-color: #2186FF;
|
||||
}
|
||||
|
||||
.repair-detail-dot.current {
|
||||
background: #EF8D00;
|
||||
border-color: #EF8D00;
|
||||
}
|
||||
|
||||
.repair-detail-line {
|
||||
flex: 1;
|
||||
height: 4rpx;
|
||||
background: #BDBDBD;
|
||||
margin: 0 2rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.repair-detail-line.active {
|
||||
background: #2186FF;
|
||||
}
|
||||
|
||||
.repair-detail-progress-labels {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.repair-detail-label {
|
||||
font-size: 22rpx;
|
||||
color: #888;
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
top: 8rpx;
|
||||
}
|
||||
|
||||
.detail-list {
|
||||
font-size: 28rpx;
|
||||
line-height: 2em;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.detail-key{
|
||||
color: #595858;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
margin-bottom: 30rpx;
|
||||
color: ##2F2F2F;
|
||||
}
|
||||
|
||||
.remark {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: #007CFF;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 276rpx;
|
||||
height: 88rpx;
|
||||
padding: 20rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.primary {
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
background-color: #fff;
|
||||
color: #1890ff;
|
||||
border: 2rpx solid #1890ff;
|
||||
}
|
||||
</style>
|
@@ -18,7 +18,7 @@
|
||||
</view>
|
||||
<!-- 常用应用九宫格 -->
|
||||
<view class="workbench-grid">
|
||||
<view class="grid-item" v-for="(item, idx) in commonApps" :key="idx">
|
||||
<view class="grid-item" v-for="(item, idx) in commonApps" :key="idx" @click="handleItemClick(item.url)">
|
||||
<image :src="item.icon" class="grid-icon" />
|
||||
<text class="grid-text">{{ item.text }}</text>
|
||||
</view>
|
||||
@@ -53,11 +53,14 @@
|
||||
},
|
||||
{
|
||||
icon: 'https://picsum.photos/80/80?random=3',
|
||||
text: '假勤'
|
||||
text: '假勤',
|
||||
url:'/pages/sys/workbench/camera'
|
||||
|
||||
},
|
||||
{
|
||||
icon: 'https://picsum.photos/80/80?random=3',
|
||||
text: '工单'
|
||||
text: '工单',
|
||||
url:'/pages/sys/workbench/order/order'
|
||||
},
|
||||
{
|
||||
icon: 'https://picsum.photos/80/80?random=3',
|
||||
@@ -73,7 +76,8 @@
|
||||
},
|
||||
{
|
||||
icon: 'https://picsum.photos/80/80?random=3',
|
||||
text: '会议'
|
||||
text: '会议',
|
||||
url:'/pages/sys/workbench/meet/meet'
|
||||
},
|
||||
{
|
||||
icon: 'https://picsum.photos/80/80?random=3',
|
||||
|
Reference in New Issue
Block a user