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

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

@ -1,7 +1,6 @@
<script>
export default {
onLaunch: function() {
console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
console.log('App Launch')
},
onShow: function() {
@ -14,19 +13,158 @@
</script>
<style lang="scss">
/*每个页面公共css */
@import '@/static/styles/theme.scss';
@import '@/uni_modules/uni-scss/index.scss';
/* #ifndef APP-NVUE */
@import '@/static/customicons.css';
//
page {
background-color: #f5f5f5;
background-color: #F5F7FA;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
/* #endif */
.example-info {
font-size: 14px;
color: #333;
padding: 10px;
.page-container {
min-height: 100vh;
background-color: #F5F7FA;
padding-bottom: 40rpx;
}
.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>

@ -1,13 +1,15 @@
import {
useHttp
} from '@/tools/http';
import { getBaseUrl } from '@/config';
const {
isLoading,
sendRequest
} = useHttp();
let Url='http://192.168.80.76'
//let Url='http://yiji-qhdzhongyiyuan'
let BaseUrl=Url+'/api/'
let Url = getBaseUrl();
let BaseUrl = Url + '/api/'
export const BaseFileUrl=()=>{
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": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
"navigationBarTitleText": "秦皇岛中医院",
"navigationStyle": "custom"
}
},
{
"path" : "pages/CheckItemMainList",
"path" : "pages/Login",
"style" :
{
"navigationBarTitleText" : "",
"navigationBarTitleText" : "登录",
"enablePullDownRefresh" : false,
"navigationStyle": "custom"
}
},
{
"path" : "pages/Login",
"path" : "pages/CheckItemMainList",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
"navigationBarTitleText" : "检查项目",
"enablePullDownRefresh" : true,
"navigationStyle": "custom"
}
},
{
"path" : "pages/PlanList",
"style" :
{
"navigationBarTitleText" : "",
"navigationBarTitleText" : "预约时段",
"enablePullDownRefresh" : false,
"navigationStyle": "custom"
}
}],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "秦皇岛中医院",
"navigationBarBackgroundColor": "#2E7D32",
"backgroundColor": "#F5F7FA",
"app-plus": {
"background": "#efeff4"
"background": "#F5F7FA"
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,40 +1,302 @@
<template>
<view class="LoginMain">
<view style="padding-top: 30%;">
<uni-easyinput type="text" v-model="regnum" placeholder="请输入患者id" />
<button style="margin-top: 20rpx;background-color: #33cdc9;color: #fff;" @click="LoginFunc()"> </button>
<view class="login-page">
<view class="login-header">
<view class="header-bg"></view>
<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>
</template>
<script setup>
import{ref,onMounted} from "vue"
import {Login} from "@/api"
import {onLoad} from "@dcloudio/uni-app"
let regnum=ref('');
const LoginFunc=()=> {
if(regnum.value==''){
import { ref, onMounted } from "vue"
import { Login } from "@/api"
import { onLoad } from "@dcloudio/uni-app"
let regnum = ref('');
let loading = ref(false);
const LoginFunc = () => {
if (regnum.value === '') {
uni.showToast({
title: '请输入患者登记号',
icon: 'none'
});
return false;
}
Login({regnum:regnum.value}).then(res => {
console.log(res)
if(res.status){
sessionStorage.setItem("access_token",res.data.token)
sessionStorage.setItem("refresh_token",res.data.refresh_token)
loading.value = true;
Login({ regnum: regnum.value }).then(res => {
loading.value = false;
if (res.status) {
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(() => {
const token = uni.getStorageSync("access_token");
if (token) {
uni.reLaunch({
url: '/pages/CheckItemMainList'
});
}
onMounted(()=>{
//LoginFunc()
})
});
</script>
<style scoped>
.LoginMain{
padding: 20rpx;
<style lang="scss" scoped>
.login-page {
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>

@ -1,210 +1,516 @@
<template>
<view class="PlanListMain">
<view class="head"></view>
<view class="userInfo" v-if="MianInfo">
<view class="title">选择预约日期及时段</view>
<view class="row">
<view class="label">登记号</view>
<view class="value">{{MianInfo.reg_num}}</view>
<view class="page-container">
<view class="page-header">
<view class="header-bg"></view>
<view class="header-content">
<view class="back-btn" @click="goBack">
<uni-icons type="left" size="20" color="#FFFFFF"></uni-icons>
</view>
<view class="row">
<view class="label">医嘱</view>
<view class="value">{{MianInfo.entrust}}</view>
<view class="header-title">选择预约时段</view>
<view class="header-placeholder"></view>
</view>
<view class="date">
<view class="datetime">
<uni-datetime-picker v-model="SearchInfo.date" :clear-icon="false" type="date" @change="dateSelecteFunc" />
</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 class="info-body">
<view class="info-row">
<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 class="list">
<view class="info" v-for="(item,index) in List">
<view>
<view class="row">
<view class="label">执行科室</view>
<view class="value">{{MianInfo.implement_department}}</view>
</view>
<view class="row">
<view class="label">资源</view>
<view class="value">{{item.department_resources_name}}</view>
<view class="date-section">
<view class="date-picker-card">
<view class="date-label">选择日期</view>
<uni-datetime-picker
v-model="SearchInfo.date"
:clear-icon="false"
type="date"
@change="dateSelecteFunc"
/>
</view>
</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="row">
<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-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 class="time-footer">
<view class="resource-name">
<uni-icons type="location" size="12" color="#999"></uni-icons>
<text>{{ item.department_resources_name }}</text>
</view>
<view class="book-btn">预约</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>
<view class="right">
<view class="right_top">
<view class="button" @click="StartYuYue(item)"></view>
<text class="empty-text">该日期暂无可约时段</text>
<text class="empty-desc">请尝试选择其他日期</text>
</view>
<view class="right_bottom">已约/总数<span style="color: darkturquoise;">{{item.used_count}}</span>/{{item.count}}</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>
</template>
<script setup>
import{ref,onMounted} from "vue"
import {GetEnablePlan,H5_YuYue} from "@/api"
import {onLoad,onShow} from "@dcloudio/uni-app"
let SearchInfo=ref({
date:'',
})
let List=ref([]);
let MianInfo=ref(null); //
const GetList=()=> {
GetEnablePlan({...SearchInfo.value}).then(res => {
if(res.status){
List.value=res.data.plan_list
MianInfo.value=res.data.mainInfo
SearchInfo.value.mainlistid=[MianInfo.value.id]
}
})
}
const dateSelecteFunc=(e)=>{
SearchInfo.value.date=e
GetList()
}
const StartYuYue=(item)=>{
import { ref, computed } from "vue"
import { GetEnablePlan, H5_YuYue } from "@/api"
import { onLoad, onShow } from "@dcloudio/uni-app"
let SearchInfo = ref({
date: '',
do_type: 1,
appointment_type: 2,
mainlistid: []
});
let List = ref([]);
let MianInfo = ref(null);
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 GetList = () => {
uni.showLoading({ title: '加载中' });
GetEnablePlan({ ...SearchInfo.value }).then(res => {
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({
cancelText:"取消",
confirmText:"确定",
title: '提示',
content: '确定预约 '+SearchInfo.value.date+' '+item.begin_time.substring(0,5)+'~'+item.end_time.substring(0,5)+' 时段吗?',
success: function (res) {
cancelText: "取消",
confirmText: "确认预约",
title: '预约确认',
content: `确定预约 ${SearchInfo.value.date} ${timeStr} 时段吗?`,
confirmColor: '#2E7D32',
success: function(res) {
if (res.confirm) {
SearchInfo.value.planid=item.id
H5_YuYue({...SearchInfo.value}).then(res => {
if(res.status){
uni.showLoading({ title: '预约中' });
SearchInfo.value.planid = item.id;
H5_YuYue({ ...SearchInfo.value }).then(res => {
uni.hideLoading();
if (res.status) {
uni.showToast({
title: '预约成功',
icon: 'success'
});
setTimeout(function(){
setTimeout(() => {
uni.redirectTo({
url: '/pages/CheckItemMainList'
})
},1000)
});
}, 1000);
}
})
}).catch(() => {
uni.hideLoading();
});
}
}
});
};
}
onLoad((option)=>{
SearchInfo.value = JSON.parse(decodeURIComponent(option.data))
const goBack = () => {
uni.navigateBack();
};
var today = new Date();
// YYYY-MM-DD
function formatDate(date) {
var year = date.getFullYear();
var month = ("0" + (date.getMonth() + 1)).slice(-2); // 0+1
var day = ("0" + date.getDate()).slice(-2);
return year + "-" + month + "-" + day;
const getTodayDate = () => {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
};
onLoad((option) => {
if (option.data) {
const data = JSON.parse(decodeURIComponent(option.data));
SearchInfo.value = { ...SearchInfo.value, ...data };
}
SearchInfo.value.date = formatDate(today);
GetList()
})
SearchInfo.value.date = getTodayDate();
GetList();
});
</script>
<style scoped>
.PlanListMain {
height: calc(100vh - 120rpx);
background: radial-gradient(circle at top center, #dcdcdc 30%, #e3e3e3, transparent 2%);
padding-top: 30rpx;
<style lang="scss" scoped>
.page-container {
min-height: 100vh;
background: #F5F7FA;
padding-bottom: 40rpx;
}
.userInfo {
background-color: #33cdc9;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 30rpx;
padding: 40rpx 40rpx 0rpx 40rpx;
border: 1rpx solid #fff;
.page-header {
position: relative;
.header-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 180rpx;
background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
border-radius: 0 0 48rpx 48rpx;
}
.userInfo .row {
margin-top: 20rpx;
font-size: 32rpx;
.header-content {
position: relative;
z-index: 1;
display: flex;
align-items: center;
justify-content: space-between;
padding: 60rpx 32rpx 40rpx;
.back-btn {
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
}
color: #fff;
.header-title {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
}
.userInfo .value {
margin-left: 20rpx;
.header-placeholder {
width: 64rpx;
}
}
}
.userInfo .label {
text-align: right;
.info-card {
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 {
padding-top: 20rpx;
.info-row {
display: flex;
justify-content: space-between;
padding: 8rpx 0;
.info-label {
font-size: 28rpx;
color: #999999;
}
.date{
text-align: center;
font-size: 30rpx;
background-color: #fff;
padding: 20rpx 60rpx;
border-radius: 30rpx;
box-shadow: 0rpx 10rpx 10rpx #add2d1;
color: #333;
/* transform: translateY(40rpx); */
position: relative;
top: 50rpx;
white-space: nowrap;
.info-value {
font-size: 28rpx;
color: #333333;
font-weight: 500;
}
}
.title{
font-weight: 700;
color:#fff;
font-size: 32rpx;
}
.list{
margin-top: 60rpx;
padding: 20rpx;
}
.info{
background-color: #fff;
padding: 40rpx 40rpx 20rpx 40rpx;
.date-section {
padding: 0 32rpx;
margin-bottom: 24rpx;
.date-picker-card {
display: flex;
align-items: center;
justify-content: space-between;
background: #FFFFFF;
border-radius: 20rpx;
color: #333;
padding: 24rpx 28rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
.date-label {
font-size: 30rpx;
color: #333333;
font-weight: 500;
}
}
}
.info .row{
.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;
}
.info .row .value{
font-weight: 700;
}
.info .right{
.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);
}
.info .right .right_top{
.time-main {
display: flex;
justify-content: center;
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;
}
.info .right .right_bottom{
}
.time-progress {
display: flex;
justify-content: flex-end;
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;
}
.button{
width: 70rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
background-color: #33cdc9;
padding: 20rpx;
}
}
}
}
.empty-state {
display: flex;
flex-direction: column;
align-items: 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;
}
}
.tips-section {
margin: 32rpx 32rpx 0;
background: rgba(255, 152, 0, 0.08);
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>

@ -1,29 +1,40 @@
<template>
<view class="container">
<view class="intro">本项目已包含uni ui组件无需import和注册可直接使用在代码区键入字母u即可通过代码助手列出所有可用组件光标置于组件名称处按F1即可查看组件文档</view>
<text class="intro">详见</text>
<uni-link :href="href" :text="href"></uni-link>
<view class="loading">正在跳转...</view>
</view>
</template>
<script>
export default {
data() {
return {
href: 'https://uniapp.dcloud.io/component/README?id=uniui'
}
return {}
},
methods: {
onLoad() {
const token = uni.getStorageSync("access_token");
if (token) {
uni.reLaunch({
url: '/pages/CheckItemMainList'
});
} else {
uni.reLaunch({
url: '/pages/Login'
});
}
}
}
</script>
<style>
.container {
padding: 20px;
font-size: 14px;
line-height: 24px;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #F5F7FA;
}
.loading {
color: #999999;
font-size: 28rpx;
}
</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,34 +1,45 @@
// http.js
import { ref } from 'vue';
// 封装请求拦截器
function requestInterceptor(options) {
const token = uni.getStorageSync("access_token");
// 在请求发送之前做一些处理
// 比如添加请求头、修改请求参数等
options.header = {
'Authorization': 'Bearer ' + sessionStorage.getItem("access_token"), // 假设需要添加 token
'Content-Type': 'application/json' // 设置请求头
'Authorization': token ? 'Bearer ' + token : '',
'Content-Type': 'application/json'
};
return options;
}
// 封装响应拦截器
function responseInterceptor(response) {
// 对响应数据进行处理
// 比如根据响应状态码进行不同的操作
if (response.statusCode === 200) {
// 请求成功
if(response.data.status==false){
const data = response.data;
if (data.status === 'Toke_Error' || data.code === 10001) {
uni.removeStorageSync("access_token");
uni.removeStorageSync("refresh_token");
uni.showModal({
title: '提示',
content: '登录已过期,请重新登录',
showCancel: false,
success: () => {
uni.reLaunch({
url: '/pages/Login'
});
}
});
return Promise.reject(data);
}
if (data.status === false) {
uni.showToast({
title: response.data.msg ,
title: data.msg || data.meg || '操作失败',
icon: 'none'
});
}
return response.data;
return data;
} else {
// 请求失败
uni.showToast({
title: '请求失败,请稍后重试',
icon: 'none'
@ -37,7 +48,6 @@ function responseInterceptor(response) {
}
}
// 发送请求的方法,内部使用拦截器
export function useHttp() {
const isLoading = ref(false);
@ -46,25 +56,25 @@ export function useHttp() {
uni.showLoading({
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);
}
});

Loading…
Cancel
Save