diff --git a/newPages/appointment/assets/style/index.rpx.scss b/newPages/appointment/assets/style/index.rpx.scss index a4f182d..56402c7 100644 --- a/newPages/appointment/assets/style/index.rpx.scss +++ b/newPages/appointment/assets/style/index.rpx.scss @@ -92,7 +92,6 @@ .box_4 { background-color: rgba(255, 255, 255, 1); border-radius: 8px; - height: 242rpx; width: 686rpx; margin: 16rpx 0 0 32rpx; .group_5 { diff --git a/newPages/appointment/index.vue b/newPages/appointment/index.vue index 5377d3e..26f652a 100644 --- a/newPages/appointment/index.vue +++ b/newPages/appointment/index.vue @@ -1,16 +1,18 @@ @@ -125,10 +235,12 @@ export default { // 新增样式 .content-box { - margin-top: 88rpx; /* 根据头部高度调整 */ + margin-top: 88rpx; + /* 根据头部高度调整 */ padding: 20rpx; overflow-y: auto; - height: calc(100vh - 88rpx); /* 确保内容区域高度正确 */ + height: calc(100vh - 88rpx); + /* 确保内容区域高度正确 */ } .header { @@ -137,8 +249,31 @@ export default { box-sizing: border-box; padding-top: 88px; } -.bottom_{ + +.bottom_ { position: fixed; bottom: 0; } + +.ytg { + background-color: #cfe2ff; + border-radius: 4px; + height: 40rpx; + margin-top: 22rpx; + width: 96rpx; + + .text_5 { + width: 72rpx; + height: 24rpx; + overflow-wrap: break-word; + color: rgba(4, 78, 242, 1); + font-size: 24rpx; + font-family: PingFang SC-Regular; + font-weight: NaN; + text-align: left; + white-space: nowrap; + line-height: 24rpx; + margin: 8rpx 0 0 12rpx; + } +} diff --git a/newPages/appointmentAdd/index.vue b/newPages/appointmentAdd/index.vue index fce9f27..b110f29 100644 --- a/newPages/appointmentAdd/index.vue +++ b/newPages/appointmentAdd/index.vue @@ -1,213 +1,279 @@ diff --git a/newPages/appointmentDetail/assets/style/index.rpx.scss b/newPages/appointmentDetail/assets/style/index.rpx.scss index 9712ca6..acae042 100644 --- a/newPages/appointmentDetail/assets/style/index.rpx.scss +++ b/newPages/appointmentDetail/assets/style/index.rpx.scss @@ -91,7 +91,6 @@ background-color: rgba(255, 255, 255, 1); border-radius: 8px; width: 686rpx; - height: 834rpx; margin: 20rpx 0 0 32rpx; .section_4 { background-image: linear-gradient( @@ -256,8 +255,7 @@ } .text-wrapper_5 { width: 646rpx; - height: 28rpx; - margin: 100rpx 0 0 20rpx; + margin: 20rpx 0 0 20rpx; .text_12 { width: 168rpx; height: 28rpx; @@ -271,7 +269,6 @@ line-height: 28rpx; } .text_13 { - width: 56rpx; height: 28rpx; overflow-wrap: break-word; color: rgba(51, 51, 51, 1); diff --git a/newPages/appointmentDetail/index.vue b/newPages/appointmentDetail/index.vue index fdbe691..fe379a0 100644 --- a/newPages/appointmentDetail/index.vue +++ b/newPages/appointmentDetail/index.vue @@ -1,99 +1,173 @@ diff --git a/newPages/evaluate/index.vue b/newPages/evaluate/index.vue index a8931ba..0d8950d 100644 --- a/newPages/evaluate/index.vue +++ b/newPages/evaluate/index.vue @@ -1,41 +1,11 @@ diff --git a/utils/auth.js b/utils/auth.js index 76bbe18..8b53862 100644 --- a/utils/auth.js +++ b/utils/auth.js @@ -29,3 +29,33 @@ export function setLocalUserInfo(userinfo){ export function getLocalUserInfo() { return uni.getStorageSync(userInfo) } + +// 设置本地存储,并设置一个过期时间(单位为秒) +export function setStorageWithExpiry(key, value, ttl) { + const now = new Date(); + // 计算过期时间 + const item = { + value: value, + expiry: now.getTime() + ttl * 1000, + }; + // 将数据对象转换为字符串存储 + uni.setStorageSync(key, JSON.stringify(item)); +} + +// 获取本地存储的数据,检查是否过期 +export function getStorageWithExpiry(key) { + // 从本地存储获取数据 + const itemStr = uni.getStorageSync(key); + if (!itemStr) { + return null; // 未找到数据 + } + const item = JSON.parse(itemStr); + const now = new Date(); + // 检查项目是否过期 + if (now.getTime() > item.expiry) { + // 如果过期,从存储中移除该项 + uni.removeStorageSync(key); + return null; + } + return item.value; // 数据未过期,返回数据 +} diff --git a/utils/request.js b/utils/request.js index c72076d..50c8ed1 100644 --- a/utils/request.js +++ b/utils/request.js @@ -32,13 +32,13 @@ const request = config => { // 设置租户 const isTanantId = (config.headers || {}).isTanantId === false config.header = config.header || {} - if (!config.hasOwnProperty("tenantIdFlag")) { - //请求设置了不需要租户,不拼接,,走进这里的是没设置不需要租户的 - if (getTenantId() && !isTanantId) { - config.header['tenant-id'] = getTenantId() - } - config.header['tenant-id'] = 180 - } + // if (!config.hasOwnProperty("tenantIdFlag")) { + // //请求设置了不需要租户,不拼接,,走进这里的是没设置不需要租户的 + // if (getTenantId() && !isTanantId) { + // config.header['tenant-id'] = getTenantId() + // } + // config.header['tenant-id'] = 180 + // } console.log(config.header, 424242); return new Promise((resolve, reject) => { uni.request({ diff --git a/utils/utils.js b/utils/utils.js new file mode 100644 index 0000000..53833e5 --- /dev/null +++ b/utils/utils.js @@ -0,0 +1,59 @@ +import request from "./request"; +import { + setStorageWithExpiry, + getStorageWithExpiry +} from './auth' + +export async function getDictDataByType(type) { + let data = getStorageWithExpiry(type); + if (data === null || data === undefined) { + try { + const response = await request({ + url: '/app-api/system/dict-data/type', + method: 'get', + params: {type} + }); + data = response.data; + setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间 + } catch (error) { + console.error("请求字典数据时出现了异常:", error); + throw error; // 确保错误能够被外部捕获 + } + } + return data; +} + +export function formatDate(timestamp) { + // 将时间戳转换为Date对象 + const date = new Date(timestamp); + // 获取年月日时分秒 + const year = date.getFullYear(); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); + const day = date.getDate().toString().padStart(2, '0'); + // 组合成日期时间字符串 + return `${year}-${month}-${day}`; +} +export function formatDateChinese(timestamp) { + // 将时间戳转换为Date对象 + const date = new Date(timestamp); + // 获取年月日时分秒 + const year = date.getFullYear(); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); + const day = date.getDate().toString().padStart(2, '0'); + // 组合成日期时间字符串 + return `${year}年${month}月${day}日`; +} + +export function formatDateTimeToMinute(timestamp) { + // 将时间戳转换为 Date 对象 + const date = new Date(timestamp); + // 获取年月日时分 + const year = date.getFullYear(); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); + const day = date.getDate().toString().padStart(2, '0'); + const hours = date.getHours().toString().padStart(2, '0'); + const minutes = date.getMinutes().toString().padStart(2, '0'); + // 组合成日期时间字符串(格式:yyyy-MM-dd hh:mm) + return `${year}-${month}-${day} ${hours}:${minutes}`; +} +