main
岩仔88 4 weeks ago
parent 7d8fd2bbfe
commit 81cfd72096

@ -11,7 +11,7 @@ class EntrustController extends Controller
public function GetList(Request $request) public function GetList(Request $request)
{ {
$searchInfo = request('searchInfo'); $searchInfo = request('searchInfo');
$userid = $request->get('(userid)'); // 中间件产生的参数 $userid = $request->get('userid');//中间件产生的参数
$list = DB::table('s_list') $list = DB::table('s_list')
->leftJoin('s_period', 's_list.reservation_time', '=', 's_period.id') ->leftJoin('s_period', 's_list.reservation_time', '=', 's_period.id')

@ -1,7 +1,6 @@
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
console.log('App Launch') console.log('App Launch')
}, },
onShow: function() { onShow: function() {
@ -14,19 +13,158 @@
</script> </script>
<style lang="scss"> <style lang="scss">
/*每个页面公共css */ @import '@/static/styles/theme.scss';
@import '@/uni_modules/uni-scss/index.scss'; @import '@/uni_modules/uni-scss/index.scss';
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
@import '@/static/customicons.css'; @import '@/static/customicons.css';
//
page { page {
background-color: #f5f5f5; background-color: #F5F7FA;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
} }
/* #endif */ .page-container {
.example-info { min-height: 100vh;
font-size: 14px; background-color: #F5F7FA;
color: #333; padding-bottom: 40rpx;
padding: 10px; }
.primary-btn {
background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
color: #FFFFFF;
border-radius: 24rpx;
font-weight: 500;
border: none;
&:active {
opacity: 0.9;
}
}
.secondary-btn {
background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
color: #FFFFFF;
border-radius: 24rpx;
font-weight: 500;
}
.danger-btn {
background: linear-gradient(135deg, #F44336 0%, #EF5350 100%);
color: #FFFFFF;
border-radius: 24rpx;
font-weight: 500;
}
.card {
background-color: #FFFFFF;
border-radius: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
overflow: hidden;
}
.card-header {
padding: 24rpx 32rpx;
background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
color: #FFFFFF;
}
.card-body {
padding: 32rpx;
}
.info-row {
display: flex;
align-items: center;
padding: 16rpx 0;
border-bottom: 1rpx solid #F0F0F0;
&:last-child {
border-bottom: none;
}
.label {
color: #999999;
font-size: 28rpx;
width: 160rpx;
flex-shrink: 0;
}
.value {
color: #333333;
font-size: 28rpx;
font-weight: 500;
flex: 1;
}
} }
.status-badge {
display: inline-flex;
align-items: center;
padding: 6rpx 20rpx;
border-radius: 20rpx;
font-size: 24rpx;
font-weight: 500;
&.status-pending {
background-color: rgba(255, 152, 0, 0.1);
color: #FF9800;
}
&.status-success {
background-color: rgba(76, 175, 80, 0.1);
color: #4CAF50;
}
&.status-info {
background-color: rgba(33, 150, 243, 0.1);
color: #2196F3;
}
&.status-done {
background-color: rgba(158, 158, 158, 0.1);
color: #9E9E9E;
}
}
.action-bar {
display: flex;
justify-content: flex-end;
gap: 20rpx;
padding-top: 24rpx;
margin-top: 24rpx;
border-top: 1rpx solid #F0F0F0;
}
.action-btn {
padding: 16rpx 40rpx;
border-radius: 40rpx;
font-size: 28rpx;
font-weight: 500;
transition: all 0.2s ease;
&:active {
transform: scale(0.96);
}
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 40rpx;
color: #CCCCCC;
.empty-icon {
font-size: 120rpx;
margin-bottom: 24rpx;
}
.empty-text {
font-size: 28rpx;
}
}
/* #endif */
</style> </style>

@ -1,13 +1,15 @@
import { import {
useHttp useHttp
} from '@/tools/http'; } from '@/tools/http';
import { getBaseUrl } from '@/config';
const { const {
isLoading, isLoading,
sendRequest sendRequest
} = useHttp(); } = useHttp();
let Url='http://192.168.80.76'
//let Url='http://yiji-qhdzhongyiyuan' let Url = getBaseUrl();
let BaseUrl=Url+'/api/' let BaseUrl = Url + '/api/'
export const BaseFileUrl=()=>{ export const BaseFileUrl=()=>{
return Url; return Url;

@ -0,0 +1,18 @@
const env = process.env.NODE_ENV || 'development'
const config = {
development: {
baseUrl: 'http://yiji-qhdzhongyiyuan'
},
production: {
baseUrl: 'http://192.168.80.76'
}
}
export const getBaseUrl = () => {
return config[env]?.baseUrl || config.development.baseUrl
}
export default {
getBaseUrl
}

@ -2,42 +2,44 @@
"pages": [{ "pages": [{
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "秦皇岛中医院",
"navigationStyle": "custom"
} }
}, },
{ {
"path" : "pages/CheckItemMainList", "path" : "pages/Login",
"style" : "style" :
{ {
"navigationBarTitleText" : "", "navigationBarTitleText" : "登录",
"enablePullDownRefresh" : false, "enablePullDownRefresh" : false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path" : "pages/Login", "path" : "pages/CheckItemMainList",
"style" : "style" :
{ {
"navigationBarTitleText" : "", "navigationBarTitleText" : "检查项目",
"enablePullDownRefresh" : false "enablePullDownRefresh" : true,
"navigationStyle": "custom"
} }
}, },
{ {
"path" : "pages/PlanList", "path" : "pages/PlanList",
"style" : "style" :
{ {
"navigationBarTitleText" : "", "navigationBarTitleText" : "预约时段",
"enablePullDownRefresh" : false, "enablePullDownRefresh" : false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "秦皇岛中医院",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#2E7D32",
"backgroundColor": "#F8F8F8", "backgroundColor": "#F5F7FA",
"app-plus": { "app-plus": {
"background": "#efeff4" "background": "#F5F7FA"
} }
} }
} }

File diff suppressed because it is too large Load Diff

@ -1,40 +1,302 @@
<template> <template>
<view class="LoginMain"> <view class="login-page">
<view style="padding-top: 30%;"> <view class="login-header">
<uni-easyinput type="text" v-model="regnum" placeholder="请输入患者id" /> <view class="header-bg"></view>
<button style="margin-top: 20rpx;background-color: #33cdc9;color: #fff;" @click="LoginFunc()"> </button> <view class="hospital-logo">
<view class="logo-icon">
<text class="icon-hospital">+</text>
</view>
</view>
<view class="hospital-info">
<text class="hospital-name">秦皇岛中医院</text>
<text class="hospital-subtitle">医技预约系统</text>
</view>
</view>
<view class="login-content">
<view class="welcome-section">
<text class="welcome-title">欢迎使用</text>
<text class="welcome-desc">请输入患者登记号进行登录</text>
</view>
<view class="login-form">
<view class="form-item">
<view class="input-wrapper">
<uni-icons type="person" size="20" color="#2E7D32"></uni-icons>
<input
class="input-field"
type="text"
v-model="regnum"
placeholder="请输入患者登记号"
placeholder-class="placeholder-text"
@confirm="LoginFunc"
/>
</view>
</view>
<view class="login-tips">
<uni-icons type="info" size="14" color="#999"></uni-icons>
<text class="tips-text">登记号可在就诊卡或挂号单上找到</text>
</view>
<button class="login-btn" :disabled="regnum === ''" @click="LoginFunc()">
<text v-if="!loading"> </text>
<text v-else>...</text>
</button>
</view>
<view class="login-footer">
<view class="footer-item">
<uni-icons type="medal" size="16" color="#2E7D32"></uni-icons>
<text>三甲医院</text>
</view>
<view class="footer-divider"></view>
<view class="footer-item">
<uni-icons type="heart" size="16" color="#2E7D32"></uni-icons>
<text>用心服务</text>
</view>
<view class="footer-divider"></view>
<view class="footer-item">
<uni-icons type="staff" size="16" color="#2E7D32"></uni-icons>
<text>专业医疗</text>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import{ref,onMounted} from "vue" import { ref, onMounted } from "vue"
import {Login} from "@/api" import { Login } from "@/api"
import {onLoad} from "@dcloudio/uni-app" import { onLoad } from "@dcloudio/uni-app"
let regnum=ref('');
const LoginFunc=()=> { let regnum = ref('');
if(regnum.value==''){ let loading = ref(false);
const LoginFunc = () => {
if (regnum.value === '') {
uni.showToast({
title: '请输入患者登记号',
icon: 'none'
});
return false; return false;
} }
Login({regnum:regnum.value}).then(res => {
console.log(res) loading.value = true;
if(res.status){
sessionStorage.setItem("access_token",res.data.token) Login({ regnum: regnum.value }).then(res => {
sessionStorage.setItem("refresh_token",res.data.refresh_token) loading.value = false;
uni.reLaunch({ if (res.status) {
url: '/pages/CheckItemMainList' uni.setStorageSync("access_token", res.data.token);
}) uni.setStorageSync("refresh_token", res.data.refresh_token);
} uni.showToast({
}) title: '登录成功',
icon: 'success'
});
setTimeout(() => {
uni.reLaunch({
url: '/pages/CheckItemMainList'
});
}, 500);
}
}).catch(() => {
loading.value = false;
});
} }
onMounted(()=>{
//LoginFunc() onMounted(() => {
}) const token = uni.getStorageSync("access_token");
if (token) {
uni.reLaunch({
url: '/pages/CheckItemMainList'
});
}
});
</script> </script>
<style scoped> <style lang="scss" scoped>
.LoginMain{ .login-page {
padding: 20rpx; min-height: 100vh;
background: linear-gradient(180deg, #F5F7FA 0%, #FFFFFF 100%);
}
.login-header {
position: relative;
padding: 80rpx 40rpx 60rpx;
text-align: center;
.header-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 280rpx;
background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 50%, #81C784 100%);
border-radius: 0 0 60rpx 60rpx;
}
.hospital-logo {
position: relative;
z-index: 1;
margin-bottom: 24rpx;
.logo-icon {
width: 120rpx;
height: 120rpx;
background: #FFFFFF;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
box-shadow: 0 8rpx 32rpx rgba(46, 125, 50, 0.3);
.icon-hospital {
font-size: 60rpx;
font-weight: bold;
color: #2E7D32;
}
}
}
.hospital-info {
position: relative;
z-index: 1;
.hospital-name {
display: block;
font-size: 40rpx;
font-weight: 600;
color: #FFFFFF;
letter-spacing: 4rpx;
text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}
.hospital-subtitle {
display: block;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.9);
margin-top: 12rpx;
}
}
} }
.login-content {
padding: 40rpx 48rpx;
.welcome-section {
text-align: center;
margin-bottom: 60rpx;
.welcome-title {
display: block;
font-size: 44rpx;
font-weight: 600;
color: #333333;
margin-bottom: 16rpx;
}
.welcome-desc {
display: block;
font-size: 28rpx;
color: #999999;
}
}
.login-form {
.form-item {
margin-bottom: 24rpx;
.input-wrapper {
display: flex;
align-items: center;
background: #FFFFFF;
border: 2rpx solid #E8E8E8;
border-radius: 24rpx;
padding: 0 32rpx;
height: 100rpx;
transition: all 0.3s ease;
&:focus-within {
border-color: #2E7D32;
box-shadow: 0 0 0 4rpx rgba(46, 125, 50, 0.1);
}
.input-field {
flex: 1;
font-size: 32rpx;
color: #333333;
margin-left: 16rpx;
}
}
}
.login-tips {
display: flex;
align-items: center;
justify-content: center;
margin: 32rpx 0;
.tips-text {
font-size: 24rpx;
color: #999999;
margin-left: 8rpx;
}
}
.login-btn {
width: 100%;
height: 100rpx;
background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
border-radius: 24rpx;
font-size: 34rpx;
font-weight: 500;
color: #FFFFFF;
border: none;
letter-spacing: 8rpx;
box-shadow: 0 8rpx 24rpx rgba(46, 125, 50, 0.3);
transition: all 0.3s ease;
&:active {
transform: scale(0.98);
opacity: 0.9;
}
&[disabled] {
background: #CCCCCC;
box-shadow: none;
}
}
}
.login-footer {
display: flex;
align-items: center;
justify-content: center;
margin-top: 80rpx;
padding: 40rpx 0;
.footer-item {
display: flex;
align-items: center;
font-size: 24rpx;
color: #666666;
text {
margin-left: 8rpx;
}
}
.footer-divider {
width: 2rpx;
height: 24rpx;
background: #E0E0E0;
margin: 0 24rpx;
}
}
}
.placeholder-text {
color: #CCCCCC;
font-size: 32rpx;
}
</style> </style>

@ -1,210 +1,516 @@
<template> <template>
<view class="PlanListMain"> <view class="page-container">
<view class="head"></view> <view class="page-header">
<view class="userInfo" v-if="MianInfo"> <view class="header-bg"></view>
<view class="title">选择预约日期及时段</view> <view class="header-content">
<view class="row"> <view class="back-btn" @click="goBack">
<view class="label">登记号</view> <uni-icons type="left" size="20" color="#FFFFFF"></uni-icons>
<view class="value">{{MianInfo.reg_num}}</view> </view>
<view class="header-title">选择预约时段</view>
<view class="header-placeholder"></view>
</view> </view>
<view class="row"> </view>
<view class="label">医嘱</view>
<view class="value">{{MianInfo.entrust}}</view> <view class="info-card" v-if="MianInfo">
<view class="info-header">
<uni-icons type="medal" size="20" color="#2E7D32"></uni-icons>
<text class="info-title">{{ MianInfo.entrust }}</text>
</view> </view>
<view class="date"> <view class="info-body">
<view class="datetime"> <view class="info-row">
<uni-datetime-picker v-model="SearchInfo.date" :clear-icon="false" type="date" @change="dateSelecteFunc" /> <text class="info-label">登记号</text>
<text class="info-value">{{ MianInfo.reg_num }}</text>
</view>
<view class="info-row">
<text class="info-label">执行科室</text>
<text class="info-value">{{ MianInfo.implement_department || '-' }}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="list">
<view class="info" v-for="(item,index) in List"> <view class="date-section">
<view> <view class="date-picker-card">
<view class="row"> <view class="date-label">选择日期</view>
<view class="label">执行科室</view> <uni-datetime-picker
<view class="value">{{MianInfo.implement_department}}</view> v-model="SearchInfo.date"
</view> :clear-icon="false"
<view class="row"> type="date"
<view class="label">资源</view> @change="dateSelecteFunc"
<view class="value">{{item.department_resources_name}}</view> />
</view> </view>
<view class="row"> </view>
<view class="label">时间段</view>
<view class="value" v-if="item.begin_time">{{item.begin_time.substring(0,5)}}~{{item.end_time.substring(0,5)}}</view> <view class="time-section" v-if="List.length > 0">
<view class="section-header">
<text class="section-title">可预约时段</text>
<text class="section-tip">点击时段进行预约</text>
</view>
<view class="time-grid">
<view
class="time-card"
v-for="(item, index) in List"
:key="item.id"
@click="StartYuYue(item)"
>
<view class="time-main">
<view class="time-range">
<text class="time-start">{{ item.begin_time ? item.begin_time.substring(0, 5) : '' }}</text>
<text class="time-separator">-</text>
<text class="time-end">{{ item.end_time ? item.end_time.substring(0, 5) : '' }}</text>
</view>
<view class="time-progress">
<view class="progress-bar">
<view
class="progress-fill"
:style="{ width: getProgressWidth(item) + '%' }"
:class="{ 'progress-warning': getProgressWidth(item) >= 80 }"
></view>
</view>
<text class="progress-text" :class="{ 'text-warning': getProgressWidth(item) >= 80 }">
{{ item.used_count || 0 }}/{{ item.count || 0 }}
</text>
</view>
</view> </view>
</view> <view class="time-footer">
<view class="right"> <view class="resource-name">
<view class="right_top"> <uni-icons type="location" size="12" color="#999"></uni-icons>
<view class="button" @click="StartYuYue(item)"></view> <text>{{ item.department_resources_name }}</text>
</view>
<view class="book-btn">预约</view>
</view> </view>
<view class="right_bottom">已约/总数<span style="color: darkturquoise;">{{item.used_count}}</span>/{{item.count}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="empty-state" v-else-if="SearchInfo.date">
<view class="empty-icon">
<uni-icons type="calendar" size="80" color="#CCCCCC"></uni-icons>
</view>
<text class="empty-text">该日期暂无可约时段</text>
<text class="empty-desc">请尝试选择其他日期</text>
</view>
<view class="tips-section">
<view class="tips-title">
<uni-icons type="info" size="16" color="#FF9800"></uni-icons>
<text>温馨提示</text>
</view>
<view class="tips-list">
<text class="tips-item">1. 请按时到达逾期可能需要重新预约</text>
<text class="tips-item">2. 如需取消或改约请提前操作</text>
<text class="tips-item">3. 如有疑问请咨询导诊台</text>
</view>
</view>
</view> </view>
</template> </template>
<script setup> <script setup>
import{ref,onMounted} from "vue" import { ref, computed } from "vue"
import {GetEnablePlan,H5_YuYue} from "@/api" import { GetEnablePlan, H5_YuYue } from "@/api"
import {onLoad,onShow} from "@dcloudio/uni-app" import { onLoad, onShow } from "@dcloudio/uni-app"
let SearchInfo=ref({ let SearchInfo = ref({
date:'', date: '',
}) do_type: 1,
let List=ref([]); appointment_type: 2,
let MianInfo=ref(null); // mainlistid: []
const GetList=()=> { });
GetEnablePlan({...SearchInfo.value}).then(res => {
if(res.status){ let List = ref([]);
List.value=res.data.plan_list let MianInfo = ref(null);
MianInfo.value=res.data.mainInfo
SearchInfo.value.mainlistid=[MianInfo.value.id] const getProgressWidth = (item) => {
} if (!item.count || item.count == 0) return 0;
}) return Math.min(100, Math.round((item.used_count || 0) / item.count * 100));
} };
const dateSelecteFunc=(e)=>{
SearchInfo.value.date=e const GetList = () => {
GetList() uni.showLoading({ title: '加载中' });
} GetEnablePlan({ ...SearchInfo.value }).then(res => {
const StartYuYue=(item)=>{ uni.hideLoading();
if (res.status) {
List.value = res.data.plan_list || [];
MianInfo.value = res.data.mainInfo;
if (MianInfo.value) {
SearchInfo.value.mainlistid = [MianInfo.value.id];
}
}
}).catch(() => {
uni.hideLoading();
});
};
const dateSelecteFunc = (e) => {
SearchInfo.value.date = e;
GetList();
};
const StartYuYue = (item) => {
if ((item.used_count || 0) >= (item.count || 0)) {
uni.showToast({
title: '该时段已约满',
icon: 'none'
});
return;
}
const timeStr = `${item.begin_time ? item.begin_time.substring(0, 5) : ''}-${item.end_time ? item.end_time.substring(0, 5) : ''}`;
uni.showModal({ uni.showModal({
cancelText:"取消", cancelText: "取消",
confirmText:"确定", confirmText: "确认预约",
title: '提示', title: '预约确认',
content: '确定预约 '+SearchInfo.value.date+' '+item.begin_time.substring(0,5)+'~'+item.end_time.substring(0,5)+' 时段吗?', content: `确定预约 ${SearchInfo.value.date} ${timeStr} 时段吗?`,
success: function (res) { confirmColor: '#2E7D32',
success: function(res) {
if (res.confirm) { if (res.confirm) {
SearchInfo.value.planid=item.id uni.showLoading({ title: '预约中' });
H5_YuYue({...SearchInfo.value}).then(res => { SearchInfo.value.planid = item.id;
if(res.status){ H5_YuYue({ ...SearchInfo.value }).then(res => {
uni.showToast({ uni.hideLoading();
title: '预约成功', if (res.status) {
}); uni.showToast({
setTimeout(function(){ title: '预约成功',
uni.redirectTo({ icon: 'success'
url: '/pages/CheckItemMainList' });
}) setTimeout(() => {
},1000) uni.redirectTo({
url: '/pages/CheckItemMainList'
} });
}) }, 1000);
}
}).catch(() => {
uni.hideLoading();
});
} }
} }
}); });
};
} const goBack = () => {
onLoad((option)=>{ uni.navigateBack();
SearchInfo.value = JSON.parse(decodeURIComponent(option.data)) };
var today = new Date(); const getTodayDate = () => {
// YYYY-MM-DD const today = new Date();
function formatDate(date) { const year = today.getFullYear();
var year = date.getFullYear(); const month = String(today.getMonth() + 1).padStart(2, '0');
var month = ("0" + (date.getMonth() + 1)).slice(-2); // 0+1 const day = String(today.getDate()).padStart(2, '0');
var day = ("0" + date.getDate()).slice(-2); return `${year}-${month}-${day}`;
return year + "-" + month + "-" + day; };
}
SearchInfo.value.date = formatDate(today); onLoad((option) => {
GetList() if (option.data) {
}) const data = JSON.parse(decodeURIComponent(option.data));
SearchInfo.value = { ...SearchInfo.value, ...data };
}
SearchInfo.value.date = getTodayDate();
GetList();
});
</script> </script>
<style scoped> <style lang="scss" scoped>
.PlanListMain { .page-container {
height: calc(100vh - 120rpx); min-height: 100vh;
background: radial-gradient(circle at top center, #dcdcdc 30%, #e3e3e3, transparent 2%); background: #F5F7FA;
padding-top: 30rpx; padding-bottom: 40rpx;
} }
.userInfo { .page-header {
background-color: #33cdc9; position: relative;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 30rpx;
padding: 40rpx 40rpx 0rpx 40rpx;
border: 1rpx solid #fff;
}
.userInfo .row { .header-bg {
margin-top: 20rpx; position: absolute;
font-size: 32rpx; top: 0;
left: 0;
right: 0;
height: 180rpx;
background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
border-radius: 0 0 48rpx 48rpx;
}
color: #fff; .header-content {
} position: relative;
z-index: 1;
display: flex;
align-items: center;
justify-content: space-between;
padding: 60rpx 32rpx 40rpx;
.userInfo .value { .back-btn {
margin-left: 20rpx; width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
}
.header-title {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
}
.header-placeholder {
width: 64rpx;
}
}
} }
.userInfo .label { .info-card {
text-align: right; margin: -40rpx 32rpx 24rpx;
background: #FFFFFF;
border-radius: 24rpx;
padding: 28rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
position: relative;
z-index: 2;
width: 30%; .info-header {
display: flex;
align-items: center;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #F0F0F0;
} .info-title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
margin-left: 12rpx;
}
}
.row { .info-body {
display: flex; padding-top: 20rpx;
.info-row {
display: flex;
justify-content: space-between;
padding: 8rpx 0;
.info-label {
font-size: 28rpx;
color: #999999;
}
.info-value {
font-size: 28rpx;
color: #333333;
font-weight: 500;
}
}
}
} }
.date{
text-align: center; .date-section {
font-size: 30rpx; padding: 0 32rpx;
background-color: #fff; margin-bottom: 24rpx;
padding: 20rpx 60rpx;
border-radius: 30rpx; .date-picker-card {
box-shadow: 0rpx 10rpx 10rpx #add2d1; display: flex;
color: #333; align-items: center;
justify-content: space-between;
/* transform: translateY(40rpx); */ background: #FFFFFF;
position: relative; border-radius: 20rpx;
top: 50rpx; padding: 24rpx 28rpx;
white-space: nowrap; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.title{ .date-label {
font-weight: 700; font-size: 30rpx;
color:#fff; color: #333333;
font-size: 32rpx; font-weight: 500;
} }
.list{ }
margin-top: 60rpx;
padding: 20rpx;
}
.info{
background-color: #fff;
padding: 40rpx 40rpx 20rpx 40rpx;
display: flex;
justify-content: space-between;
border-radius: 20rpx;
color: #333;
}
.info .row{
margin-bottom: 20rpx;
}
.info .row .value{
font-weight: 700;
} }
.info .right{
.time-section {
padding: 0 32rpx;
box-sizing: border-box;
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.section-title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
}
.section-tip {
font-size: 24rpx;
color: #999999;
}
}
.time-grid {
display: flex;
flex-direction: column;
gap: 20rpx;
.time-card {
width: 100%;
background: #FFFFFF;
border-radius: 20rpx;
padding: 28rpx 32rpx;
box-sizing: border-box;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
&:active {
transform: scale(0.99);
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}
.time-main {
display: flex;
justify-content: space-between;
align-items: center;
.time-range {
display: flex;
align-items: center;
.time-start, .time-end {
font-size: 44rpx;
font-weight: 600;
color: #2E7D32;
}
.time-separator {
margin: 0 12rpx;
color: #CCCCCC;
font-size: 36rpx;
}
}
.time-progress {
display: flex;
flex-direction: column;
align-items: flex-end;
.progress-bar {
width: 160rpx;
height: 12rpx;
background: #F0F0F0;
border-radius: 6rpx;
overflow: hidden;
margin-bottom: 8rpx;
.progress-fill {
height: 100%;
background: linear-gradient(90deg, #4CAF50 0%, #81C784 100%);
border-radius: 6rpx;
transition: width 0.3s ease;
&.progress-warning {
background: linear-gradient(90deg, #FF9800 0%, #FFB74D 100%);
}
}
}
.progress-text {
font-size: 26rpx;
color: #4CAF50;
font-weight: 500;
&.text-warning {
color: #FF9800;
}
}
}
}
.time-footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
padding-top: 20rpx;
border-top: 1rpx solid #F5F5F5;
.resource-name {
display: flex;
align-items: center;
font-size: 26rpx;
color: #666666;
text {
margin-left: 8rpx;
}
}
.book-btn {
padding: 14rpx 48rpx;
background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
border-radius: 32rpx;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
}
}
}
}
} }
.info .right .right_top{
.empty-state {
display: flex; display: flex;
flex-direction: column;
align-items: center;
justify-content: center; justify-content: center;
padding: 100rpx 40rpx;
background: #FFFFFF;
margin: 0 32rpx;
border-radius: 24rpx;
.empty-icon {
margin-bottom: 24rpx;
}
.empty-text {
font-size: 32rpx;
color: #CCCCCC;
margin-bottom: 12rpx;
}
.empty-desc {
font-size: 26rpx;
color: #DDDDDD;
}
} }
.info .right .right_bottom{
display: flex; .tips-section {
justify-content: flex-end; margin: 32rpx 32rpx 0;
margin-top: 20rpx; background: rgba(255, 152, 0, 0.08);
}
.button{
width: 70rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
background-color: #33cdc9;
padding: 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
color: #fff; padding: 24rpx 28rpx;
border-left: 6rpx solid #FF9800;
.tips-title {
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: 600;
color: #FF9800;
margin-bottom: 16rpx;
text {
margin-left: 8rpx;
}
}
.tips-list {
.tips-item {
display: block;
font-size: 24rpx;
color: #666666;
line-height: 2;
}
}
} }
</style> </style>

@ -1,29 +1,40 @@
<template> <template>
<view class="container"> <view class="container">
<view class="loading">正在跳转...</view>
<view class="intro">本项目已包含uni ui组件无需import和注册可直接使用在代码区键入字母u即可通过代码助手列出所有可用组件光标置于组件名称处按F1即可查看组件文档</view>
<text class="intro">详见</text>
<uni-link :href="href" :text="href"></uni-link>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {}
href: 'https://uniapp.dcloud.io/component/README?id=uniui'
}
}, },
methods: { onLoad() {
const token = uni.getStorageSync("access_token");
if (token) {
uni.reLaunch({
url: '/pages/CheckItemMainList'
});
} else {
uni.reLaunch({
url: '/pages/Login'
});
}
} }
} }
</script> </script>
<style> <style>
.container { .container {
padding: 20px; display: flex;
font-size: 14px; justify-content: center;
line-height: 24px; align-items: center;
height: 100vh;
background: #F5F7FA;
}
.loading {
color: #999999;
font-size: 28rpx;
} }
</style> </style>

@ -0,0 +1,86 @@
$primary-color: #2E7D32;
$primary-light: #4CAF50;
$primary-dark: #1B5E20;
$secondary-color: #1976D2;
$warning-color: #FF9800;
$danger-color: #F44336;
$success-color: #4CAF50;
$info-color: #2196F3;
$text-primary: #333333;
$text-secondary: #666666;
$text-hint: #999999;
$text-white: #FFFFFF;
$bg-primary: #F5F7FA;
$bg-card: #FFFFFF;
$bg-header: linear-gradient(135deg, $primary-color 0%, $primary-light 100%);
$border-radius: 16rpx;
$border-radius-lg: 24rpx;
$border-radius-xl: 32rpx;
$shadow-sm: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
$shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.12);
$shadow-lg: 0 8rpx 24rpx rgba(0, 0, 0, 0.16);
$spacing-xs: 8rpx;
$spacing-sm: 16rpx;
$spacing-md: 24rpx;
$spacing-lg: 32rpx;
$spacing-xl: 48rpx;
@mixin card-style {
background-color: $bg-card;
border-radius: $border-radius-lg;
box-shadow: $shadow-sm;
}
@mixin button-primary {
background: linear-gradient(135deg, $primary-color 0%, $primary-light 100%);
color: $text-white;
border-radius: $border-radius-lg;
font-weight: 500;
transition: all 0.3s ease;
&:active {
opacity: 0.9;
transform: scale(0.98);
}
}
@mixin button-secondary {
background: linear-gradient(135deg, $secondary-color 0%, #42A5F5 100%);
color: $text-white;
border-radius: $border-radius-lg;
font-weight: 500;
transition: all 0.3s ease;
}
@mixin button-danger {
background: linear-gradient(135deg, $danger-color 0%, #EF5350 100%);
color: $text-white;
border-radius: $border-radius-lg;
font-weight: 500;
}
@mixin status-badge($color) {
display: inline-flex;
align-items: center;
padding: 6rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
font-weight: 500;
background-color: rgba($color, 0.1);
color: $color;
}
@mixin page-container {
min-height: 100vh;
background-color: $bg-primary;
}
@mixin header-gradient {
background: $bg-header;
border-radius: 0 0 48rpx 48rpx;
}

@ -1,78 +1,88 @@
// http.js
import { ref } from 'vue'; import { ref } from 'vue';
// 封装请求拦截器
function requestInterceptor(options) { function requestInterceptor(options) {
const token = uni.getStorageSync("access_token");
// 在请求发送之前做一些处理 options.header = {
// 比如添加请求头、修改请求参数等 'Authorization': token ? 'Bearer ' + token : '',
options.header = { 'Content-Type': 'application/json'
'Authorization': 'Bearer ' + sessionStorage.getItem("access_token"), // 假设需要添加 token };
'Content-Type': 'application/json' // 设置请求头 return options;
};
return options;
} }
// 封装响应拦截器
function responseInterceptor(response) { function responseInterceptor(response) {
// 对响应数据进行处理 if (response.statusCode === 200) {
// 比如根据响应状态码进行不同的操作 const data = response.data;
if (response.statusCode === 200) {
// 请求成功 if (data.status === 'Toke_Error' || data.code === 10001) {
if(response.data.status==false){ uni.removeStorageSync("access_token");
uni.showToast({ uni.removeStorageSync("refresh_token");
title: response.data.msg ,
icon: 'none' uni.showModal({
}); title: '提示',
} content: '登录已过期,请重新登录',
return response.data; showCancel: false,
} else { success: () => {
// 请求失败 uni.reLaunch({
uni.showToast({ url: '/pages/Login'
title: '请求失败,请稍后重试', });
icon: 'none' }
}); });
return Promise.reject(response.data); return Promise.reject(data);
} }
if (data.status === false) {
uni.showToast({
title: data.msg || data.meg || '操作失败',
icon: 'none'
});
}
return data;
} else {
uni.showToast({
title: '请求失败,请稍后重试',
icon: 'none'
});
return Promise.reject(response.data);
}
} }
// 发送请求的方法,内部使用拦截器
export function useHttp() { export function useHttp() {
const isLoading = ref(false); const isLoading = ref(false);
function sendRequest(options) { function sendRequest(options) {
isLoading.value = true; isLoading.value = true;
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
// 请求发送之前,先经过请求拦截器处理
let processedOptions = requestInterceptor(options);
let processedOptions = requestInterceptor(options);
return new Promise((resolve, reject) => {
uni.request({
...processedOptions,
success: (res) => {
let processedResponse = responseInterceptor(res);
isLoading.value = false;
uni.hideLoading();
resolve(processedResponse);
},
fail: (err) => {
isLoading.value = false;
uni.hideLoading();
uni.showToast({
title: '网络异常,请检查网络',
icon: 'none'
});
reject(err);
}
});
});
}
return new Promise((resolve, reject) => { return {
uni.request({ isLoading,
...processedOptions, sendRequest
success: (res) => { };
// 请求成功后,经过响应拦截器处理
let processedResponse = responseInterceptor(res);
isLoading.value = false;
uni.hideLoading();
resolve(processedResponse);
},
fail: (err) => {
// 请求失败
isLoading.value = false;
uni.hideLoading();
reject(err);
}
});
});
}
return {
isLoading,
sendRequest
};
} }
Loading…
Cancel
Save