Browse Source

增加通知公告列表页-接口联调,修改AI问诊输入框自动增高,键盘弹起优化,滚动优化

master
ZhaoYang 1 week ago
parent
commit
495e3c9c73
  1. 3
      app.json
  2. 2
      pages/home/home.js
  3. 4
      pages/home/home.wxml
  4. 26
      pages/personal/personal.wxml
  5. 16
      pages/personal/personal.wxss
  6. 2
      pagesA/pages/askingSyAdd/askingSyAdd.wxml
  7. 6
      pagesA/pages/expert/expert.wxss
  8. 1150
      pagesA/pages/expertChat/expertChat.js
  9. 135
      pagesA/pages/expertChat/expertChat.wxml
  10. 492
      pagesA/pages/expertChat/expertChat.wxss
  11. 97
      pagesA/pages/noticeList/noticeList.js
  12. 4
      pagesA/pages/noticeList/noticeList.json
  13. 108
      pagesA/pages/noticeList/noticeList.wxml
  14. 289
      pagesA/pages/noticeList/noticeList.wxss
  15. 291
      pagesA/pages/wzai/wzai.js
  16. 68
      pagesA/pages/wzai/wzai.wxml
  17. 939
      pagesA/pages/wzai/wzai.wxss
  18. 2
      utils/api.js
  19. 4
      utils/baseUrl.js

3
app.json

@ -18,7 +18,8 @@
"pages/expertChat/expertChat",
"pages/medicine/medicine",
"pages/medicineDetails/medicineDetails",
"pages/attestation/attestation"
"pages/attestation/attestation",
"pages/noticeList/noticeList"
]
},
{

2
pages/home/home.js

@ -188,7 +188,7 @@ Page({
// 查看所有通知
viewAllNotices() {
wx.navigateTo({
url: '/pagesB/pages/noticeList/noticeList',
url: '/pagesA/pages/noticeList/noticeList',
})
},

4
pages/home/home.wxml

@ -54,7 +54,7 @@
<view class="card2" bind:tap="bindWsy">
<view>问兽医</view>
<view class="card2_1">智能匹配医生</view>
<view class="card2_1">平均5分钟复</view>
<view class="card2_1">平均5分钟复</view>
</view>
<view class="card3">
<view class="card3_1 card3_kp" bind:tap="bindZj">
@ -174,7 +174,7 @@
<!-- 经验分享板块 -->
<view class="user-question-section">
<!-- 标题区域 -->
<view class="question-header" bind:tap="bindwdlist">
<view class="question-header" >
<view class="question-title">
<view class="title-text1_1">经验分享</view>
<view class="title-sub">分享自己养殖经验</view>

26
pages/personal/personal.wxml

@ -94,7 +94,20 @@
</view>
<view class="modal-body">
<textarea class="feedback-input" placeholder="请输入您的反馈或建议..." placeholder-class="placeholder" value="{{feedbackContent}}" bindinput="onFeedbackInput" maxlength="200" auto-height></textarea>
<!-- 修复iOS输入框问题:添加focus控制并增加条件渲染 -->
<textarea
class="feedback-input"
placeholder="请输入您的反馈或建议..."
placeholder-class="placeholder"
value="{{feedbackContent}}"
bindinput="onFeedbackInput"
maxlength="200"
auto-height
focus="{{showFeedbackModal && textareaFocus}}"
disabled="{{!showFeedbackModal}}"
confirm-type="done"
show-confirm-bar="{{false}}"
></textarea>
<view class="char-count">
<text class="current">{{feedbackContent.length}}</text>
<text class="total">/200</text>
@ -117,7 +130,16 @@
<text class="modal-title">修改昵称</text>
</view>
<view class="modal-body">
<input class="nickname-input" type="text" placeholder="请输入昵称" value="{{newNickname}}" bindinput="onNicknameInput" maxlength="10" />
<input
class="nickname-input"
type="text"
placeholder="请输入昵称"
value="{{newNickname}}"
bindinput="onNicknameInput"
maxlength="10"
focus="{{showNicknameModal}}"
confirm-type="done"
/>
<text class="input-tip">最多10个字符</text>
</view>
<view class="modal-footer">

16
pages/personal/personal.wxss

@ -175,8 +175,6 @@
color: #065f46;
}
/* 卡片样式 */
.section-card {
background: white;
@ -338,11 +336,13 @@
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
pointer-events: none; /* 防止未显示时误触 */
}
.feedback-modal.show {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.modal-mask {
@ -406,7 +406,7 @@
filter: brightness(0%);
}
/* 反馈输入框 */
/* 反馈输入框 - iOS修复 */
.modal-body {
padding: 40rpx;
}
@ -423,6 +423,7 @@
line-height: 1.5;
color: #1e293b;
transition: all 0.3s ease;
-webkit-user-select: auto; /* iOS修复 */
}
.feedback-input:focus {
@ -431,6 +432,10 @@
box-shadow: 0 0 0 4rpx rgba(102, 126, 234, 0.1);
}
.feedback-input[disabled] {
opacity: 0.8; /* 禁用状态样式 */
}
.placeholder {
color: #94a3b8;
}
@ -499,11 +504,13 @@
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
pointer-events: none;
}
.nickname-modal.show {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.nickname-modal .modal-content {
@ -610,11 +617,13 @@
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
pointer-events: none;
}
.logout-modal.show {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.logout-modal .modal-content {
@ -636,7 +645,6 @@
text-align: center;
}
.logout-title {
font-weight: 700;
color: #1e293b;

2
pagesA/pages/askingSyAdd/askingSyAdd.wxml

@ -31,7 +31,7 @@
<text>年龄</text>
</view>
<view class="item-input-wrapper">
<input class="item-input" name="petAge" type="digit" placeholder="例如:3岁或者3个月" value="{{formData.animalAge}}" bindinput="onPetAgeInput" />
<input class="item-input" name="petAge" placeholder="例如:3岁或者3个月" value="{{formData.animalAge}}" bindinput="onPetAgeInput" />
</view>
</view>

6
pagesA/pages/expert/expert.wxss

@ -606,15 +606,15 @@
}
.phone-item .contact-icon-container {
background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
background: linear-gradient(135deg, #b8d8ba 0%, #c8e6c9 100%);
}
.email-item .contact-icon-container {
background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
background: linear-gradient(135deg, #a2baca 0%, #bbdefb 100%);
}
.institution-item .contact-icon-container {
background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
background: linear-gradient(135deg, #c9abce 0%, #e1bee7 100%);
}
.contact-item-icon {

1150
pagesA/pages/expertChat/expertChat.js
File diff suppressed because it is too large
View File

135
pagesA/pages/expertChat/expertChat.wxml

@ -32,7 +32,6 @@
<!-- 消息列表 -->
<block wx:for="{{messageList}}" wx:key="id">
<!-- 对方消息 -->
<view class="message-item message-left" wx:if="{{item.sender === 'expert'}}">
<view class="message-avatar">
@ -40,15 +39,12 @@
</view>
<view class="message-content-wrapper">
<!-- 气泡箭头 -->
<view class="message-arrow arrow-left"></view>
<!-- 文本消息 -->
<view class="message-bubble bubble-left" wx:if="{{item.type === 'text'}}">
<text class="message-text">{{item.content}}</text>
</view>
<!-- 图片消息 -->
<view class="media-bubble" wx:elif="{{item.type === 'image'}}">
<image
src="{{item.content}}"
@ -59,7 +55,6 @@
></image>
</view>
<!-- 视频消息 -->
<view class="media-bubble" wx:elif="{{item.type === 'video'}}">
<video
src="{{item.content}}"
@ -73,20 +68,6 @@
</view>
</view>
<!-- 语音消息 -->
<view class="message-bubble bubble-left message-audio" wx:elif="{{item.type === 'audio'}}">
<image src="/images/icons/voice_left.png" class="audio-icon-left"></image>
<view class="audio-content">
<view class="audio-wave">
<view class="wave-bar" style="animation-delay: 0s;"></view>
<view class="wave-bar" style="animation-delay: 0.2s;"></view>
<view class="wave-bar" style="animation-delay: 0.4s;"></view>
</view>
<text class="audio-duration">{{item.duration || 0}}''</text>
</view>
</view>
<!-- 文件消息 -->
<view class="message-bubble bubble-left message-file" wx:elif="{{item.type === 'file'}}">
<view class="file-icon-box">
<image src="/images/icons/file_icon.png" class="file-icon"></image>
@ -102,15 +83,12 @@
<!-- 我的消息 -->
<view class="message-item message-right" wx:else>
<view class="message-content-wrapper">
<!-- 气泡箭头 -->
<view class="message-arrow arrow-right"></view>
<!-- 文本消息 -->
<view class="message-bubble bubble-right" wx:if="{{item.type === 'text'}}">
<text class="message-text">{{item.content}}</text>
</view>
<!-- 图片消息 -->
<view class="media-bubble" wx:elif="{{item.type === 'image'}}">
<image
src="{{item.content}}"
@ -126,7 +104,6 @@
</view>
</view>
<!-- 视频消息 -->
<view class="media-bubble" wx:elif="{{item.type === 'video'}}">
<video
src="{{item.content}}"
@ -145,20 +122,6 @@
</view>
</view>
<!-- 语音消息 -->
<view class="message-bubble bubble-right message-audio" wx:elif="{{item.type === 'audio'}}">
<view class="audio-content">
<view class="audio-wave">
<view class="wave-bar" style="animation-delay: 0s;"></view>
<view class="wave-bar" style="animation-delay: 0.2s;"></view>
<view class="wave-bar" style="animation-delay: 0.4s;"></view>
</view>
<text class="audio-duration">{{item.duration || 0}}''</text>
</view>
<image src="/images/icons/voice_right.png" class="audio-icon-right"></image>
</view>
<!-- 文件消息 -->
<view class="message-bubble bubble-right message-file" wx:elif="{{item.type === 'file'}}">
<view class="file-icon-box">
<image src="/images/icons/file_icon.png" class="file-icon"></image>
@ -181,94 +144,64 @@
</view>
</block>
<!-- 底部留白区域 -->
<view class="chat-bottom-space"></view>
<!-- 加载更多提示 -->
<view class="load-more-tip" wx:if="{{loadingMore}}">
<text>加载中...</text>
</view>
<!-- 没有消息提示 -->
<view class="empty-tip" wx:if="{{messageList.length === 0 && !loading}}">
<image src="/images/icons/empty_chat.png" class="empty-icon"></image>
<text class="empty-text">暂无聊天记录,开始咨询吧</text>
</view>
</scroll-view>
<!-- 输入区域 -->
<view class="input-section">
<!-- 语音输入模式 -->
<view class="voice-input-panel" wx:if="{{inputMode === 'voice'}}">
<!-- 切换到文字输入按钮 -->
<view class="voice-input-btn" bindtap="switchInputMode">
<image src="/pagesA/images/xjp.png" class="voice-btn-icon"></image>
</view>
<!-- 语音输入按钮 -->
<view class="input-wrapper">
<view
class="voice-record-btn"
bindtouchstart="startVoiceRecord"
bindtouchmove="onVoiceTouchMove"
bindtouchend="endVoiceRecord"
bindtouchcancel="cancelVoiceRecord"
>
<text class="voice-tip">{{voiceTip}}</text>
</view>
</view>
<view class="more-btn" bindtap="showMediaActionSheet" >
<image src="/pagesA/images/add.png" class="more-icon"></image>
<view class="input-section" id="inputSection">
<view class="text-input-panel">
<!-- 添加按钮 - 完美垂直居中 -->
<view class="add-btn" bindtap="showMediaActionSheet">
<image src="/pagesA/images/add.png" class="add-icon"></image>
</view>
</view>
<!-- 文字输入模式 -->
<view class="text-input-panel" wx:else>
<!-- 切换到语音输入按钮 -->
<view class="voice-input-btn" bindtap="switchInputMode">
<image src="/pagesA/images/yy.png" class="voice-btn-icon"></image>
</view>
<!-- 文字输入框 -->
<!-- 输入框包装器 -->
<view class="input-wrapper">
<input
type="text"
class="chat-input"
placeholder="{{inputPlaceholder}}"
<textarea
auto-height
maxlength="500"
class="chat-textarea"
placeholder="请输入消息..."
placeholder-class="input-placeholder"
value="{{inputValue}}"
bindinput="onInput"
bindconfirm="sendTextMessage"
confirm-type="send"
focus="{{inputFocus}}"
adjust-position="{{false}}"
cursor-spacing="20"
bindfocus="onInputFocus"
bindblur="onInputBlur"
/>
show-confirm-bar="{{false}}"
disable-default-padding="{{true}}"
></textarea>
<!-- 输入框操作按钮 -->
<view class="input-actions" wx:if="{{inputValue.trim()}}">
<!-- 清空按钮 - 垂直居中 -->
<view class="input-actions" wx:if="{{inputValue}}">
<button class="clear-btn" bindtap="clearInput">
<image src="/images/icons/clear.png" class="clear-icon"></image>
</button>
</view>
</view>
<!-- 发送/更多按钮 -->
<!-- <button
<!-- 发送按钮 - 美观渐变绿色,完美垂直居中 -->
<button
class="send-btn"
bindtap="sendTextMessage"
wx:if="{{inputValue.trim()}}"
wx:if="{{inputValue}}"
>
<text class="send-text">发送</text>
</button> -->
</button>
<view class="more-btn" bindtap="showMediaActionSheet" >
<image src="/pagesA/images/add.png" class="more-icon"></image>
</view>
<!-- 无内容时显示占位,保持布局稳定 -->
<view class="send-placeholder" wx:else></view>
</view>
</view>
@ -310,28 +243,4 @@
</view>
</view>
</view>
<!-- 录音提示 -->
<view class="recording-modal" wx:if="{{isRecording}}">
<view class="recording-box {{isCanceling ? 'is-canceling' : ''}}">
<view class="recording-icon">
<image
src="{{isCanceling ? '/images/icons/cancel_recording.png' : '/images/icons/recording.png'}}"
class="recording-mic-icon"
></image>
</view>
<text class="recording-tip">{{recordingTip}}</text>
<view class="recording-meter">
<view class="recording-waves">
<view
class="recording-wave"
wx:for="{{[1,2,3,4,5]}}"
wx:key="index"
style="animation-delay: {{index * 0.1}}s;"
></view>
</view>
<text class="recording-time">{{recordingTime}}s</text>
</view>
</view>
</view>
</view>

492
pagesA/pages/expertChat/expertChat.wxss

@ -1,20 +1,21 @@
/* 页面整体样式 */
/* ========== 页面整体样式 ========== */
.consult-page {
width: 100vw;
height: 100vh;
background: #f5f5f5;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* 头部样式 */
/* ========== 头部样式 ========== */
.consult-header {
background: #ffffff;
border-bottom: 1rpx solid #e5e5e5;
position: relative;
z-index: 1000;
box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.05);
flex-shrink: 0;
}
.header-content {
@ -24,16 +25,12 @@
height: 96rpx;
}
.header-center {
flex: 1;
display: flex;
justify-content: center;
}
.expert-info {
display: flex;
flex-direction: column;
@ -72,15 +69,9 @@
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(7, 193, 96, 0.4);
}
70% {
box-shadow: 0 0 0 8rpx rgba(7, 193, 96, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(7, 193, 96, 0);
}
0% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0.4); }
70% { box-shadow: 0 0 0 8rpx rgba(7, 193, 96, 0); }
100% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0); }
}
.status-text {
@ -88,15 +79,14 @@
color: #666666;
}
/* 聊天容器 */
/* ========== 聊天容器 ========== */
.chat-container {
flex: 1;
padding: 20rpx 0;
background: #f5f5f5;
overflow-y: auto;
position: relative;
height: 0;
}
/* 日期分隔线 */
@ -112,13 +102,10 @@
border-radius: 100rpx;
font-size: 24rpx;
color: #ffffff;
font-weight: 400;
background-color: #d8d8d8;
}
/* 消息项 */
/* ========== 消息项 ========== */
.message-item {
display: flex;
margin-bottom: 24rpx;
@ -130,23 +117,12 @@
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
from { opacity: 0; transform: translateY(10rpx); }
to { opacity: 1; transform: translateY(0); }
}
.message-left {
justify-content: flex-start;
}
.message-right {
justify-content: flex-end;
}
.message-left { justify-content: flex-start; }
.message-right { justify-content: flex-end; }
/* 头像 */
.message-avatar {
@ -161,13 +137,8 @@
z-index: 1;
}
.message-left .message-avatar {
margin-right: 16rpx;
}
.message-right .message-avatar {
margin-left: 16rpx;
}
.message-left .message-avatar { margin-right: 16rpx; }
.message-right .message-avatar { margin-left: 16rpx; }
.avatar-img {
width: 100%;
@ -175,7 +146,7 @@
object-fit: cover;
}
/* 消息内容包装器 */
/* 消息内容包装器 */
.message-content-wrapper {
max-width: 480rpx;
position: relative;
@ -184,38 +155,31 @@
z-index: 2;
}
.message-left .message-content-wrapper {
align-items: flex-start;
}
.message-left .message-content-wrapper { align-items: flex-start; }
.message-right .message-content-wrapper { align-items: flex-end; }
.message-right .message-content-wrapper {
align-items: flex-end;
}
/* 气泡箭头*/
/* 气泡箭头 */
.message-arrow {
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-width: 12rpx;
top: 30rpx; /* 固定在头像中间位置 (80rpx/2 = 40rpx) */
top: 30rpx;
z-index: 1;
}
/* 左侧箭头(专家) */
.arrow-left {
left: -24rpx;
border-color: transparent #ffffff transparent transparent;
}
/* 右侧箭头(用户) */
.arrow-right {
right: -24rpx;
border-color: transparent transparent transparent #95ec69;
}
/* 消息气泡通用样式 */
/* 消息气泡 */
.message-bubble {
position: relative;
padding: 16rpx 20rpx;
@ -226,7 +190,6 @@
align-items: center;
}
/* 左侧气泡(专家) */
.bubble-left {
background: #ffffff;
border-radius: 10rpx;
@ -234,7 +197,6 @@
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}
/* 右侧气泡(用户) */
.bubble-right {
background: #95ec69;
border-radius: 10rpx;
@ -249,11 +211,9 @@
line-height: 1.4;
}
.bubble-right .message-text {
color: #000000;
}
.bubble-right .message-text { color: #000000; }
/* 媒体消息通用样式 */
/* 媒体消息 */
.media-bubble {
position: relative;
border-radius: 10rpx;
@ -266,22 +226,15 @@
justify-content: center;
}
.message-left .media-bubble {
border-top-left-radius: 4rpx;
}
.message-left .media-bubble { border-top-left-radius: 4rpx; }
.message-right .media-bubble { border-top-right-radius: 4rpx; }
.message-right .media-bubble {
border-top-right-radius: 4rpx;
}
/* 图片消息 */
.message-image {
width: 280rpx;
height: 280rpx;
display: block;
}
/* 视频消息 */
.message-video {
width: 280rpx;
height: 280rpx;
@ -308,67 +261,6 @@
margin-left: 4rpx;
}
/* 语音消息 */
.message-audio {
min-width: 240rpx;
padding: 20rpx;
display: flex;
align-items: center;
min-height: 60rpx;
}
.audio-icon-left,
.audio-icon-right {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
.audio-icon-left {
margin-right: 16rpx;
}
.audio-icon-right {
margin-left: 16rpx;
}
.audio-content {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
}
.audio-wave {
display: flex;
align-items: flex-end;
height: 28rpx;
margin-right: 16rpx;
}
.wave-bar {
width: 4rpx;
margin: 0 2rpx;
background: currentColor;
border-radius: 2rpx;
animation: wave 1s ease-in-out infinite;
}
@keyframes wave {
0%, 100% {
height: 12rpx;
}
50% {
height: 28rpx;
}
}
.audio-duration {
font-size: 26rpx;
font-weight: 500;
color: #000000;
}
/* 文件消息 */
.message-file {
min-width: 280rpx;
@ -441,12 +333,8 @@
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.progress-text {
@ -455,12 +343,10 @@
font-weight: 600;
}
/* 底部留白区域 */
.chat-bottom-space {
height: 40rpx;
}
/* 底部留白 */
.chat-bottom-space { height: 40rpx; }
/* 加载更多提示 */
/* 加载更多 */
.load-more-tip {
display: flex;
justify-content: center;
@ -470,7 +356,7 @@
font-size: 24rpx;
}
/* 空状态提示 */
/* 空状态 */
.empty-tip {
display: flex;
flex-direction: column;
@ -492,123 +378,100 @@
color: #999999;
}
/* 输入区域 */
/* ========== 输入区域 - 优化垂直对齐和按钮美化 ========== */
.input-section {
background: #ffffff;
border-top: 1rpx solid #e5e5e5;
padding: 20rpx 30rpx;
padding: 16rpx 30rpx;
position: relative;
z-index: 100;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
flex-shrink: 0;
width: 100%;
box-sizing: border-box;
}
/* 语音输入面板 */
.voice-input-panel {
display: flex;
align-items: center;
gap: 20rpx;
height: 80rpx;
}
/* 文字输入面板 */
/* 文字输入面板 - 垂直居中优化 */
.text-input-panel {
display: flex;
align-items: center;
gap: 20rpx;
height: 80rpx;
gap: 16rpx;
min-height: 72rpx;
}
/* 语音输入按钮(切换按钮) */
.voice-input-btn {
width: 80rpx;
height: 80rpx;
/* 添加按钮 - 完美垂直居中 */
.add-btn {
width: 72rpx;
height: 72rpx;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
flex-shrink: 0;
}
.voice-btn-icon {
width: 70rpx;
height: 70rpx;
.add-icon {
width: 60rpx;
height: 60rpx;
}
/* 输入框包装器 */
/* 输入框包装器 - 优化高度和内边距 */
.input-wrapper {
flex: 1;
position: relative;
background: #f5f5f5;
border-radius: 40rpx;
height: 80rpx;
border-radius: 36rpx;
min-height: 72rpx;
display: flex;
align-items: center;
padding: 0 24rpx;
transition: all 0.2s;
overflow: hidden;
min-width: 0;
}
/* 语音输入模式下的输入框 */
.voice-input-panel .input-wrapper {
padding: 0;
background: #f5f5f5;
}
/* 文字输入模式下的输入框 */
.text-input-panel .input-wrapper {
padding: 0 30rpx;
box-sizing: border-box;
}
.input-wrapper:active {
background: #e8e8e8;
}
/* 语音输入按钮 */
.voice-record-btn {
width: 100%;
height: 100%;
border-radius: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.voice-record-btn:active {
background: #e0e0e0;
}
.voice-tip {
font-size: 24rpx;
color: #666666;
}
/* 文字输入框 */
.chat-input {
/* 多行文本输入框 - 优化垂直居中 */
.chat-textarea {
flex: 1;
height: 100%;
font-size: 32rpx;
color: #000000;
line-height: 80rpx;
min-width: 0;
width: 100%;
font-size: 30rpx;
color: #333333;
line-height: 1.4;
min-height: 48rpx;
max-height: 160rpx;
padding: 12rpx 0;
margin: 0;
background: transparent;
border: none;
box-sizing: border-box;
overflow-y: auto;
}
/* 占位符样式 */
.input-placeholder {
color: #999999;
font-size: 24rpx;
font-size: 28rpx;
line-height: 1.4;
}
/* 清空按钮 - 完美垂直居中 */
.input-actions {
position: absolute;
right: 20rpx;
right: 16rpx;
top: 50%;
transform: translateY(-50%);
z-index: 2;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}
.clear-btn {
width: 40rpx;
height: 40rpx;
width: 36rpx;
height: 36rpx;
border: none;
background: transparent;
padding: 0;
@ -620,70 +483,87 @@
justify-content: center;
}
.clear-btn::after {
border: none;
}
.clear-btn:active {
background: rgba(0, 0, 0, 0.05);
background: rgba(0, 0, 0, 0.1);
}
.clear-icon {
width: 32rpx;
height: 32rpx;
width: 28rpx;
height: 28rpx;
}
/* 更多按钮 */
.more-btn {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
/* 发送按钮 - 美观渐变绿色,完美垂直居中 */
.send-btn {
background: linear-gradient(135deg, #07c160 0%, #06ae56 100%);
width: 112rpx;
height: 72rpx;
border-radius: 36rpx;
border: none;
background: transparent;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
transition: all 0.3s ease;
padding: 0;
margin: 0;
line-height: 1;
flex-shrink: 0;
box-shadow: 0 4rpx 8rpx rgba(7, 193, 96, 0.2);
position: relative;
overflow: hidden;
}
.more-btn:active {
background: rgba(0, 0, 0, 0.05);
}
.more-icon {
width: 70rpx;
height: 70rpx;
/* 发送按钮点击效果 */
.send-btn:active {
background: linear-gradient(135deg, #06ae56 0%, #059c4c 100%);
transform: scale(0.96);
box-shadow: 0 2rpx 4rpx rgba(7, 193, 96, 0.3);
}
/* 发送按钮 */
.send-btn {
background: #07c160;
width: 120rpx;
border-radius: 40rpx;
height: 80rpx;
border: none;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
padding: 0;
margin: 0;
line-height: 1;
flex-shrink: 0;
/* 发送按钮水波纹效果 */
.send-btn::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-radius: 50%;
background: rgba(255, 255, 255, 0.3);
transform: translate(-50%, -50%);
transition: width 0.3s, height 0.3s;
}
.send-btn:active {
background: #06ad56;
transform: scale(0.98);
.send-btn:active::after {
width: 200rpx;
height: 200rpx;
opacity: 0;
}
.send-text {
font-size: 28rpx;
color: #ffffff;
font-weight: 500;
font-weight: 600;
letter-spacing: 2rpx;
}
/* 发送按钮占位 - 保持布局稳定 */
.send-placeholder {
width: 112rpx;
height: 72rpx;
flex-shrink: 0;
}
/* 多媒体选择面板 */
/* 适配小屏幕 */
@media screen and (max-width: 320px) {
.send-btn { width: 100rpx; }
.send-placeholder { width: 100rpx; }
}
/* ========== 多媒体选择面板 ========== */
.media-action-sheet {
position: fixed;
top: 0;
@ -708,12 +588,8 @@
}
@keyframes slideUp {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.media-sheet-header {
@ -721,7 +597,7 @@
align-items: center;
justify-content: space-between;
margin-bottom: 40rpx;
padding: 0 10rpx 20rpx;
padding: 0 10rpx 20rpx;
border-bottom: 1px solid #E4E4E4;
}
@ -776,7 +652,6 @@
transform: scale(0.95);
}
.option-icon-box image {
width: 60rpx;
height: 60rpx;
@ -796,101 +671,6 @@
color: #999999;
}
/* 录音模态框 */
.recording-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 3000;
animation: fadeIn 0.2s ease;
}
.recording-box {
background: rgba(0, 0, 0, 0.8);
border-radius: 40rpx;
padding: 60rpx 80rpx;
display: flex;
flex-direction: column;
align-items: center;
min-width: 400rpx;
}
.recording-box.is-canceling {
background: rgba(0, 0, 0, 0.9);
}
.recording-icon {
width: 160rpx;
height: 160rpx;
margin-bottom: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.recording-mic-icon {
width: 120rpx;
height: 120rpx;
}
.recording-tip {
font-size: 32rpx;
color: #ffffff;
font-weight: 500;
margin-bottom: 30rpx;
text-align: center;
}
.recording-box.is-canceling .recording-tip {
color: #ff4444;
}
.recording-meter {
display: flex;
flex-direction: column;
align-items: center;
}
.recording-waves {
display: flex;
align-items: flex-end;
height: 60rpx;
margin-bottom: 20rpx;
}
.recording-wave {
width: 8rpx;
margin: 0 4rpx;
background: #07c160;
border-radius: 4rpx;
animation: recordingWave 1.2s ease-in-out infinite;
}
.recording-box.is-canceling .recording-wave {
background: #ff4444;
}
@keyframes recordingWave {
0%, 100% {
height: 20rpx;
}
50% {
height: 60rpx;
}
}
.recording-time {
font-size: 36rpx;
color: #ffffff;
font-weight: bold;
}
/* 适配全面屏 */
.safe-area-bottom {
padding-bottom: env(safe-area-inset-bottom);

97
pagesA/pages/noticeList/noticeList.js

@ -0,0 +1,97 @@
import http from '../../../utils/api'
Page({
data: {
// 分类数据
categories: [
{ name: '全部', value: 'all' },
{ name: '系统公告', value: 'system', tagBg: '#e9efff', importanceColor: '#3b82f6' },
{ name: '活动通知', value: 'activity', tagBg: '#f3e8ff', importanceColor: '#8b5cf6' },
{ name: '紧急提醒', value: 'urgent', tagBg: '#ffe4e2', importanceColor: '#ef4444' },
{ name: '学术讲座', value: 'academic', tagBg: '#dcfce7', importanceColor: '#10b981' },
{ name: '校园生活', value: 'campus', tagBg: '#fff3cd', importanceColor: '#f59e0b' },
],
currentCategory: 'all', // 当前选中分类
searchKeyword: '', // 搜索关键字
noticeList: [], // 渲染列表数据
pageIndex: 1, // 页码
pageSize: 8, // 每页条数
hasMore: true, // 是否有更多
loading: false, // 首次加载/加载中
refreshing: false, // 下拉刷新状态
mockTotal: 28, // 模拟总条数
},
onLoad() {
// this.loadFirstPage();
this.getdisaster()
},
// 通知公告
getdisaster(){
http.disaster({
data:{},
success: res => {
console.log(111,res);
this.setData({
noticeList:res.rows
})
}
})
},
// 切换分类
switchCategory(e) {
const category = e.currentTarget.dataset.category;
if (category === this.data.currentCategory) return;
this.setData({ currentCategory: category });
this.loadFirstPage();
},
// 搜索输入
onSearchInput(e) {
this.setData({ searchKeyword: e.detail.value });
},
// 执行搜索(确认或点击清空后也会触发重置)
handleSearch() {
this.loadFirstPage();
},
// 清空搜索框
clearSearch() {
this.setData({ searchKeyword: '' }, () => {
this.loadFirstPage();
});
},
// 上拉加载更多
loadMore() {
const { hasMore, loading, refreshing } = this.data;
if (!hasMore || loading || refreshing) return;
this.setData({ loading: true });
this.fetchNotices(false);
},
// 下拉刷新
onRefresh() {
this.setData({ refreshing: true });
// 重置到第一页
this.setData({ pageIndex: 1, hasMore: true }, () => {
this.fetchNotices(true);
});
},
// 查看详情 (仅跳转示意)
viewDetail(e) {
const id = e.currentTarget.dataset.id;
wx.showToast({
title: `查看公告 ${id}`,
icon: 'none'
});
// 实际开发: wx.navigateTo...
}
})

4
pagesA/pages/noticeList/noticeList.json

@ -0,0 +1,4 @@
{
"navigationBarTitleText":"通知公告列表",
"usingComponents": {}
}

108
pagesA/pages/noticeList/noticeList.wxml

@ -0,0 +1,108 @@
<view class="notice-page">
<!-- 毛玻璃背景装饰 -->
<view class="bg-blur"></view>
<!-- 主内容区 -->
<view class="content">
<!-- 头部标题 & 搜索栏一体化 -->
<view class="header">
<text class="title">📋 公告·通知</text>
<view class="search-box">
<text class="icon">🔍</text>
<input
type="text"
placeholder="搜索标题或摘要..."
placeholder-class="placeholder"
bindinput="onSearchInput"
value="{{searchKeyword}}"
confirm-type="search"
bindconfirm="handleSearch"
/>
<text class="clear-icon" wx:if="{{searchKeyword}}" bindtap="clearSearch">✕</text>
</view>
</view>
<!-- 分类导航 - 滑动流畅 -->
<scroll-view class="category-scroll" scroll-x show-scrollbar="{{false}}" enhanced>
<view class="category-list">
<view
wx:for="{{categories}}"
wx:key="index"
class="category-item {{currentCategory === item.value ? 'active' : ''}}"
bindtap="switchCategory"
data-category="{{item.value}}"
>
<text>{{item.name}}</text>
<text class="dot" wx:if="{{currentCategory === item.value}}"></text>
</view>
</view>
</scroll-view>
<!-- 列表内容区域 -->
<view class="list-container">
<!-- 骨架屏 / 加载提示 -->
<block wx:if="{{loading && noticeList.length === 0}}">
<view class="skeleton-list">
<view wx:for="{{4}}" wx:key="*this" class="skeleton-item"></view>
</view>
</block>
<!-- 列表渲染 -->
<scroll-view
class="notice-scroll"
scroll-y
enhanced
show-scrollbar="{{false}}"
bindscrolltolower="loadMore"
lower-threshold="50"
refresher-enabled
refresher-triggered="{{refreshing}}"
bindrefresherrefresh="onRefresh"
>
<view class="notice-list">
<view
wx:for="{{noticeList}}"
wx:key="id"
class="notice-card"
bindtap="viewDetail"
data-id="{{item.id}}"
>
<!-- 重要性标记装饰 -->
<view class="card-left-bar" style="background: {{item.importanceColor}};"></view>
<view class="card-content">
<view class="card-header">
<text class="notice-title">{{item.title}}</text>
<text class="notice-tag" style="background: {{item.tagBg}};">{{item.warningType}}</text>
</view>
<view class="notice-abstract">{{item.responseMeasures}}</view>
<view class="card-footer">
<view class="date-time">
<text class="date-icon">📅</text>
<text>{{item.createdTime}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 上拉加载更多状态 -->
<view class="load-more" wx:if="{{noticeList.length > 0}}">
<block wx:if="{{hasMore}}">
<text class="loading-icon">⋯</text>
<text>加载更多</text>
</block>
<block wx:else>
<text>—— 已经到底了 ——</text>
</block>
</view>
<!-- 空状态展示 -->
<view class="empty-state" wx:if="{{!loading && noticeList.length === 0}}">
<image src="/images/empty-notice.png" mode="aspectFit" style="width: 160rpx; height: 160rpx;" wx:if="{{false}}"></image>
<text>📭 暂无相关公告</text>
<text style="font-size: 28rpx; color: #999; margin-top: 16rpx;">试试其他关键词或分类</text>
</view>
</scroll-view>
</view>
</view>
</view>

289
pagesA/pages/noticeList/noticeList.wxss

@ -0,0 +1,289 @@
.page {
background: linear-gradient(145deg, #f5f7fa 0%, #f0f2f5 100%);
}
.notice-page {
min-height: 100vh;
background: transparent;
position: relative;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;
}
.bg-blur {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle at 20% 30%, rgba(235, 245, 255, 0.7) 0%, rgba(255, 255, 255, 0.9) 70%);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
z-index: 0;
pointer-events: none;
}
.content {
position: relative;
z-index: 2;
display: flex;
flex-direction: column;
padding: 30rpx 32rpx 0;
box-sizing: border-box;
}
/* 头部与搜索 */
.header {
margin-bottom: 36rpx;
}
.title {
font-size: 48rpx;
font-weight: 700;
color: #1e293b;
letter-spacing: 2rpx;
display: block;
margin-bottom: 24rpx;
text-shadow: 0 4rpx 12rpx rgba(0,0,0,0.02);
}
.search-box {
background: rgba(255,255,255,0.7);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border-radius: 48rpx;
padding: 16rpx 32rpx;
display: flex;
align-items: center;
border: 1rpx solid rgba(255,255,255,0.9);
box-shadow: 0 8rpx 20rpx rgba(0,0,0,0.02), 0 2rpx 4rpx rgba(0,0,0,0.02);
transition: all 0.2s;
}
.search-box:focus-within {
border-color: #b2d9ff;
background: rgba(255,255,255,0.9);
box-shadow: 0 12rpx 28rpx rgba(0,120,255,0.08);
}
.search-box .icon {
font-size: 32rpx;
color: #7c8ea0;
margin-right: 16rpx;
}
.search-box input {
flex: 1;
font-size: 30rpx;
padding: 8rpx 0;
color: #1e293b;
}
.placeholder {
color: #9aa6b2;
font-weight: 400;
}
.clear-icon {
font-size: 36rpx;
color: #8e9dac;
padding: 8rpx;
border-radius: 50%;
background: rgba(0,0,0,0.02);
width: 40rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
/* 分类导航 — 磨砂质感 */
.category-scroll {
white-space: nowrap;
margin-bottom: 32rpx;
background: rgba(255,255,255,0.5);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-radius: 60rpx;
padding: 8rpx 0;
border: 1rpx solid rgba(255,255,255,0.8);
}
.category-list {
display: inline-flex;
padding: 0 24rpx;
}
.category-item {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 16rpx 36rpx;
margin-right: 12rpx;
border-radius: 60rpx;
font-size: 30rpx;
color: #475569;
background: transparent;
transition: all 0.18s;
position: relative;
font-weight: 500;
}
.category-item.active {
background: #ffffff;
color: #1e4bd2;
font-weight: 600;
box-shadow: 0 6rpx 14rpx rgba(0,80,255,0.1);
}
.dot {
width: 8rpx;
height: 8rpx;
background: #1e4bd2;
border-radius: 50%;
margin-top: 6rpx;
}
/* 列表容器 */
.list-container {
flex: 1;
height: calc(100vh - 280rpx);
background: transparent;
border-radius: 40rpx 40rpx 0 0;
margin-top: 8rpx;
}
.notice-scroll {
height: 100%;
padding-bottom: 20rpx;
}
.notice-list {
display: flex;
flex-direction: column;
gap: 28rpx;
}
/* 卡片设计 — 轻盈毛玻璃 */
.notice-card {
background: rgba(255,255,255,0.7);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border-radius: 36rpx;
border: 1rpx solid rgba(255,255,255,0.9);
box-shadow: 0 8rpx 18rpx rgba(0,0,0,0.02);
display: flex;
overflow: hidden;
transition: transform 0.2s, box-shadow 0.3s;
}
.notice-card:active {
transform: scale(0.99);
box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.04);
}
.card-left-bar {
width: 12rpx;
flex-shrink: 0;
background: #3b82f6;
}
.card-content {
flex: 1;
padding: 32rpx 28rpx;
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.notice-title {
font-size: 34rpx;
font-weight: 600;
color: #0a1e3c;
max-width: 460rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.notice-tag {
font-size: 24rpx;
padding: 8rpx 24rpx;
border-radius: 48rpx;
background: #eef2ff;
color: #1e4bd2;
font-weight: 500;
letter-spacing: 1rpx;
}
.notice-abstract {
font-size: 28rpx;
color: #55657a;
line-height: 1.5;
margin-bottom: 28rpx;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.card-footer {
display: flex;
justify-content: space-between;
align-items: center;
color: #778a9b;
font-size: 26rpx;
}
.date-time, .view-count {
display: flex;
align-items: center;
gap: 8rpx;
}
/* 加载更多 / 状态 */
.load-more {
text-align: center;
padding: 48rpx 0 36rpx;
color: #8f9eb0;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 12rpx;
}
.loading-icon {
font-size: 48rpx;
line-height: 1;
animation: pulse 1.2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 0.6; }
50% { opacity: 1; }
}
/* 骨架屏 */
.skeleton-list {
padding: 0 8rpx;
}
.skeleton-item {
background: rgba(255,255,255,0.6);
border-radius: 32rpx;
height: 220rpx;
margin-bottom: 28rpx;
position: relative;
overflow: hidden;
}
.skeleton-item::after {
content: "";
position: absolute;
top: 0;
left: -150%;
width: 200%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
100% { left: 100%; }
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 120rpx 0;
color: #6f7d8c;
font-size: 32rpx;
background: rgba(255,255,255,0.4);
backdrop-filter: blur(8px);
border-radius: 48rpx;
margin-top: 60rpx;
}
/* 模拟图片(无实际图片用文字代替) */
.empty-state text:first-of-type {
font-size: 64rpx;
margin-bottom: 24rpx;
}

291
pagesA/pages/wzai/wzai.js

@ -1,4 +1,5 @@
import http from '../../../utils/api'
Page({
data: {
// 当前时间
@ -8,6 +9,14 @@ Page({
// 输入框相关
inputValue: '',
autoFocus: false,
inputHeight: 60,
isKeyboardShow: false,
// 滚动控制
scrollIntoView: 'welcome-message',
scrollAnimation: true,
isUserScrolling: false, // 用户是否正在手动滚动
scrollTimer: null, // 滚动定时器
lastMessageCount: 0, // 上次消息数量
// 症状选择
quickSymptoms: [],
wzsearch: {},
@ -22,7 +31,90 @@ Page({
onLoad() {
this.initData();
this.getInquiry()
this.getInquiry();
// 监听键盘高度变化
wx.onKeyboardHeightChange(this.onKeyboardHeightChange.bind(this));
},
onUnload() {
// 页面卸载时移除监听
wx.offKeyboardHeightChange(this.onKeyboardHeightChange);
// 清除定时器
if (this.data.scrollTimer) {
clearTimeout(this.data.scrollTimer);
}
},
// 监听滚动事件
onScroll(e) {
// 检测用户是否在手动滚动
const scrollTop = e.detail.scrollTop;
// 获取滚动容器和底部元素的位置
const query = wx.createSelectorQuery();
query.select('#scrollBottom').boundingClientRect();
query.select('#chatScroll').boundingClientRect();
query.exec((res) => {
if (res[0] && res[1]) {
const bottomPosition = res[0].top - res[1].top + res[1].height;
// 如果滚动位置不在底部(偏差超过50px),认为是用户手动滚动
if (Math.abs(scrollTop - bottomPosition) > 100) {
if (!this.data.isUserScrolling) {
this.setData({
isUserScrolling: true
});
}
// 清除之前的定时器
if (this.data.scrollTimer) {
clearTimeout(this.data.scrollTimer);
}
// 5秒后重置用户滚动状态
const timer = setTimeout(() => {
this.setData({
isUserScrolling: false
});
// 重置后检查是否需要滚动到底部
this.checkAndScrollToBottom();
}, 5000);
this.setData({ scrollTimer: timer });
}
}
});
},
// 滚动到底部事件
onScrollToLower() {
// 用户滚动到底部时,重置滚动状态
this.setData({
isUserScrolling: false
});
},
// 键盘高度变化监听
onKeyboardHeightChange(res) {
if (res.height > 0) {
// 键盘弹起
this.setData({
isKeyboardShow: true
});
// 强制滚动到底部
this.scrollToBottom(true);
} else {
// 键盘收起
this.setData({
isKeyboardShow: false
});
}
},
// 检查并滚动到底部
checkAndScrollToBottom() {
// 如果用户没有手动滚动,则滚动到底部
if (!this.data.isUserScrolling) {
this.scrollToBottom(true);
}
},
// AI问诊快捷字列表
@ -30,19 +122,22 @@ Page({
http.inquiry({
data: {},
success: res => {
console.log(1111, res);
console.log('快捷症状列表', res);
this.setData({
quickSymptoms: res.rows
})
});
}
})
});
},
onShow() {
this.updateCurrentTime();
this.setData({
autoFocus: true
});
// 延迟设置焦点,避免影响滚动
setTimeout(() => {
this.setData({
autoFocus: true
});
}, 300);
},
// 初始化数据
@ -54,6 +149,11 @@ Page({
setInterval(() => {
this.updateCurrentTime();
}, 60000);
// 初始化消息数量
this.setData({
lastMessageCount: this.data.messages.length
});
},
// 更新当前时间
@ -65,6 +165,86 @@ Page({
});
},
// 滚动到底部
scrollToBottom(force = false) {
// 如果用户正在手动滚动且不是强制滚动,则不滚动
if (this.data.isUserScrolling && !force) {
console.log('用户正在手动滚动,跳过自动滚动');
return;
}
// 获取最新消息的ID
let targetId = 'scrollBottom';
// 优先滚动到最新的消息
if (this.data.messages.length > 0) {
targetId = `msg-${this.data.messages.length - 1}`;
} else {
targetId = 'welcome-message';
}
console.log('滚动到:', targetId);
// 先重置scrollIntoView,确保能触发滚动
this.setData({
scrollIntoView: '',
scrollAnimation: true
}, () => {
// 延迟一下再设置滚动目标,确保视图更新
setTimeout(() => {
this.setData({
scrollIntoView: targetId,
scrollAnimation: true
});
}, 50);
});
// 多重保障滚动
setTimeout(() => {
if (!this.data.isUserScrolling || force) {
this.setData({
scrollIntoView: targetId
});
}
}, 150);
setTimeout(() => {
if (!this.data.isUserScrolling || force) {
this.setData({
scrollIntoView: targetId
});
}
}, 300);
},
// 输入框行数变化
onInputLineChange(e) {
// 输入框高度变化时,确保滚动到底部
if (this.data.isKeyboardShow) {
this.scrollToBottom();
}
},
// 输入框聚焦
onInputFocus(e) {
this.setData({
autoFocus: true,
isKeyboardShow: true
});
// 延迟滚动到底部,等待键盘完全弹起
setTimeout(() => {
this.scrollToBottom(true);
}, 300);
},
// 输入框失焦
onInputBlur(e) {
this.setData({
autoFocus: false,
isKeyboardShow: false
});
},
// 输入框变化
onInput(e) {
this.setData({
@ -85,20 +265,32 @@ Page({
time: this.getCurrentTime()
};
// 更新消息列表
const newMessages = [...this.data.messages, userMessage];
this.setData({
messages: [...this.data.messages, userMessage],
inputValue: '',
autoFocus: true
autoFocus: true,
inputHeight: 60,
messages: newMessages,
isUserScrolling: false, // 发送消息时重置用户滚动状态
lastMessageCount: newMessages.length
});
console.log(666, this.data.messages)
// 立即滚动到底部
this.scrollToBottom(true);
// 显示AI思考状态
// 显示AI思考状态
this.setData({
isAIThinking: true
});
// 模拟AI思考时间(1.5-2.5秒)
// 滚动到底部(显示思考状态后)
setTimeout(() => {
this.scrollToBottom(true);
}, 100);
// 模拟AI思考时间
setTimeout(() => {
this.generateAIResponse(message);
}, 1500 + Math.random() * 1000);
@ -112,14 +304,14 @@ Page({
// 生成AI响应
generateAIResponse(userMessage) {
console.log(888, userMessage);
console.log('发送消息:', userMessage);
http.search({
data: {
keyword: userMessage
},
success: res => {
console.log('查询结果', res);
console.log('AI响应:', res);
let aiMessage;
if (res.rows && res.rows.length > 0) {
@ -128,12 +320,11 @@ Page({
aiMessage = {
id: Date.now() + 1,
type: 'assistant',
content:'根据您的描述,' + wzsearch.title || '已收到您的症状描述',
content: '根据您的描述,' + (wzsearch.title || '已收到您的症状描述'),
diagnosis: wzsearch,
time: this.getCurrentTime()
};
} else {
// 如果没有查询到结果
aiMessage = {
id: Date.now() + 1,
type: 'assistant',
@ -147,38 +338,60 @@ Page({
};
}
// 添加AI消息到聊天记录并隐藏思考状态
// 添加AI消息
const newMessages = [...this.data.messages, aiMessage];
this.setData({
messages: [...this.data.messages, aiMessage],
isAIThinking: false
messages: newMessages,
isAIThinking: false,
isUserScrolling: false, // 收到新消息时强制重置用户滚动状态
lastMessageCount: newMessages.length
}, () => {
// 消息添加后立即滚动到底部
console.log('AI消息已添加,滚动到底部');
this.scrollToBottom(true);
// 多重保险滚动
setTimeout(() => {
this.scrollToBottom(true);
}, 100);
setTimeout(() => {
this.scrollToBottom(true);
}, 300);
setTimeout(() => {
this.scrollToBottom(true);
}, 500);
});
console.log(789, this.data.messages);
},
fail: err => {
console.error('API请求失败:', err);
// API失败时的默认响应
const aiMessage = {
id: Date.now() + 1,
type: 'assistant',
content: '已收到您的症状描述',
diagnosis: {
disease: '网络请求失败',
severity: 'unknown',
severityText: '未知',
suggestion: '请检查网络连接后重试,或直接联系兽医'
possibleDiseases: '网络请求失败',
severityLevel: '未知',
suggestions: '请检查网络连接后重试,或直接联系兽医'
},
time: this.getCurrentTime()
};
const newMessages = [...this.data.messages, aiMessage];
this.setData({
messages: [...this.data.messages, aiMessage],
isAIThinking: false
messages: newMessages,
isAIThinking: false,
isUserScrolling: false,
lastMessageCount: newMessages.length
}, () => {
this.scrollToBottom(true);
});
},
complete: () => {
// 确保无论如何都会隐藏思考状态
if (this.data.isAIThinking) {
this.setData({
isAIThinking: false
@ -188,8 +401,6 @@ Page({
});
},
// 选择快捷症状
selectQuickSymptom(e) {
const symptom = e.currentTarget.dataset.symptom.keywords;
@ -229,13 +440,15 @@ Page({
success: (res) => {
if (res.confirm) {
this.setData({
messages: [{
id: 1,
type: 'assistant',
content: '您好!我是AI健康助手,有什么可以帮您?\n\n请描述您或牲畜的健康状况,我会为您提供专业的分析和建议。',
time: this.getCurrentTime()
}],
selectedSymptoms: []
messages: [],
selectedSymptoms: [],
isUserScrolling: false,
lastMessageCount: 0
}, () => {
// 清空后滚动到欢迎消息
this.setData({
scrollIntoView: 'welcome-message'
});
});
this.closeMoreMenu();
}
@ -272,7 +485,7 @@ Page({
showInstructions() {
wx.showModal({
title: '使用说明',
content: '1. 描述您或牲畜的症状2. AI助手会分析并提供建议3. 可使用快捷症状选择4. 诊断结果仅供参考,请及时咨询专业兽医',
content: '1. 描述您或牲畜的症状\n2. AI助手会分析并提供建议\n3. 可使用快捷症状选择\n4. 诊断结果仅供参考,请及时咨询专业兽医',
showCancel: false
});
this.closeMoreMenu();

68
pagesA/pages/wzai/wzai.wxml

@ -2,9 +2,6 @@
<view class="diagnosis-container">
<!-- 医生信息卡片 -->
<view class="doctor-card">
<view class="nav-right">
<view class="more-btn" bindtap="showMoreMenu">···</view>
</view>
<view class="doctor-avatar">
<image class="avatar-img" src="/pages/images/aiwz.png" mode="aspectFit"></image>
</view>
@ -12,7 +9,7 @@
<text class="doctor-name">AI健康助手</text>
<text class="doctor-title">智能诊断专家</text>
<view class="doctor-tags">
<view class="tag">24小时在线</view>
<view class="tag">24小时在线</view>
<view class="tag">专业诊断</view>
<view class="tag">快速响应</view>
</view>
@ -22,13 +19,19 @@
<!-- 聊天区域 -->
<scroll-view
id="chatScroll"
class="chat-container"
scroll-y
scroll-into-view="{{'msg-' + (messages.length - 1)}}"
scroll-with-animation="true"
scroll-into-view="{{scrollIntoView}}"
scroll-with-animation="{{scrollAnimation}}"
bindscroll="onScroll"
enhanced
show-scrollbar="{{false}}"
lower-threshold="100"
bindscrolltolower="onScrollToLower"
>
<!-- 欢迎消息 -->
<view class="message-wrapper assistant">
<view class="message-wrapper assistant" id="welcome-message">
<view class="message-avatar">
<image class="avatar" src="/pages/images/aiwz.png" mode="aspectFit"></image>
</view>
@ -41,7 +44,7 @@
</view>
<!-- 消息列表 -->
<view wx:for="{{messages}}" wx:key="id" id="msg-{{index}}">
<view wx:for="{{messages}}" wx:key="id" id="msg-{{index}}" class="message-item">
<!-- 用户消息 -->
<view wx:if="{{item.type === 'user'}}" class="message-wrapper user">
<view class="message-content">
@ -70,17 +73,17 @@
</view>
<view class="diagnosis-item">
<text class="diagnosis-label">可能病症:</text>
<text class="diagnosis-value">{{item.diagnosis.possibleDiseases}}</text>
<text class="diagnosis-value">{{item.diagnosis.possibleDiseases || item.diagnosis.title}}</text>
</view>
<view class="diagnosis-item">
<text class="diagnosis-label">严重程度:</text>
<view class="severity-level {{tool.ztLevel(item.diagnosis.severityLevel)}}">
{{item.diagnosis.severityLevel}}
{{item.diagnosis.severityLevel || '中等'}}
</view>
</view>
<view class="diagnosis-item">
<text class="diagnosis-label">建议措施:</text>
<text class="diagnosis-value">{{item.diagnosis.suggestions}}</text>
<text class="diagnosis-value">{{item.diagnosis.suggestions || '请咨询专业兽医'}}</text>
</view>
<view class="diagnosis-footer">
<text class="disclaimer">* 本结果仅供参考,请及时咨询专业兽医</text>
@ -93,7 +96,10 @@
</view>
<!-- AI正在输入 -->
<view wx:if="{{isAIThinking}}" class="message-wrapper assistant" style="justify-content: center;">
<view wx:if="{{isAIThinking}}" class="message-wrapper assistant" id="ai-thinking">
<view class="message-avatar">
<image class="avatar" src="/pages/images/aiwz.png" mode="aspectFit"></image>
</view>
<view class="message-content">
<view class="message-bubble assistant-bubble typing">
<view class="typing-indicator">
@ -105,6 +111,9 @@
</view>
</view>
</view>
<!-- 底部占位,确保滚动到底部 -->
<view class="scroll-bottom-placeholder" id="scrollBottom"></view>
</scroll-view>
<!-- 快捷症状选择 -->
@ -118,17 +127,25 @@
</view>
<!-- 输入区域 -->
<view class="input-area">
<view class="input-wrapper">
<input
<view class="input-area" id="inputArea">
<view class="input-wrapper" style="min-height: {{inputHeight}}rpx; height: auto;">
<textarea
class="message-input"
value="{{inputValue}}"
placeholder="描述您或牲畜的症状..."
placeholder-class="placeholder"
bindinput="onInput"
bindlinechange="onInputLineChange"
bindconfirm="sendMessage"
confirm-type="send"
focus="{{autoFocus}}"
auto-height
maxlength="-1"
show-confirm-bar="{{false}}"
cursor-spacing="30"
adjust-position="false"
bindfocus="onInputFocus"
bindblur="onInputBlur"
/>
</view>
<button class="send-btn" bindtap="sendMessage" hover-class="send-btn-hover">
@ -146,27 +163,6 @@
bind:close="closeSymptomSelector"
/>
<!-- 更多菜单弹窗 -->
<view class="modal-overlay" wx:if="{{showMoreMenu}}" bindtap="closeMoreMenu">
<view class="more-menu" catchtap="stopPropagation">
<view class="menu-item" bindtap="clearHistory">
<text class="menu-icon">🗑️</text>
<text class="menu-text">清空记录</text>
</view>
<view class="menu-item" bindtap="exportChat">
<text class="menu-icon">📤</text>
<text class="menu-text">导出记录</text>
</view>
<view class="menu-item" bindtap="contactDoctor">
<text class="menu-icon">👨‍⚕️</text>
<text class="menu-text">联系兽医</text>
</view>
<view class="menu-item" bindtap="showInstructions">
<text class="menu-icon">❓</text>
<text class="menu-text">使用说明</text>
</view>
</view>
</view>
<!-- 加载动画 -->
<view class="loading-overlay" wx:if="{{isLoading}}">

939
pagesA/pages/wzai/wzai.wxss

@ -1,486 +1,455 @@
.diagnosis-container {
min-height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 100%);
}
/* 顶部功能选择 */
.nav-right {
position: absolute;
right: 30rpx;
top: 30rpx;
}
.more-btn {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background:#86D8D0;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 36rpx;
font-weight: bold;
}
/* 医生信息卡片 */
.doctor-card {
background: white;
margin: 24rpx 32rpx;
padding: 32rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
position: relative;
}
.doctor-avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: linear-gradient(135deg, #86D8D0 0%, #A8E6CF 100%);
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx;
overflow: hidden;
}
.avatar-img {
width: 100rpx;
height: 100rpx;
}
.doctor-info {
flex: 1;
}
.doctor-name {
display: block;
font-size: 32rpx;
font-weight: 600;
color: #333;
margin-bottom: 8rpx;
}
.doctor-title {
display: block;
font-size: 24rpx;
color: #86D8D0;
margin-bottom: 16rpx;
}
.doctor-tags {
display: flex;
gap: 12rpx;
}
.tag {
font-size: 20rpx;
padding: 6rpx 12rpx;
background: #E8F4F3;
color: #6BC4BC;
border-radius: 20rpx;
}
.online-status {
position: absolute;
right: 32rpx;
bottom: 32rpx;
font-size: 22rpx;
padding: 4rpx 12rpx;
border-radius: 12rpx;
}
.online-status.online {
background: #e8f1f4;
color: #6b8fc4;
}
/* 聊天容器 */
.chat-container {
flex: 1;
/* padding: 0 32rpx; */
display: flex;
flex-direction: column;
}
/* 消息样式 */
.message-wrapper {
display: flex;
margin: 40rpx 0;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20rpx); }
to { opacity: 1; transform: translateY(0); }
}
.message-wrapper.user {
justify-content: flex-end;
}
.message-content {
max-width: 70%;
display: flex;
flex-direction: column;
}
.message-wrapper.user .message-content {
align-items: flex-end;
}
.message-wrapper.assistant .message-content {
align-items: flex-start;
}
.message-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
margin: 0 20rpx;
align-self: flex-end;
}
.avatar {
width: 100%;
height: 100%;
}
/* 消息气泡 */
.message-bubble {
padding: 24rpx;
border-radius: 24rpx;
position: relative;
line-height: 1.5;
}
.assistant-bubble {
background: #E8F4F3;
border-radius: 0 24rpx 24rpx 24rpx;
}
.user-bubble {
background: #86D8D0;
border-radius: 24rpx 0 24rpx 24rpx;
}
.message-text {
font-size: 28rpx;
color: #333;
}
.user-bubble .message-text {
color: white;
}
/* 消息时间 */
.message-time {
font-size: 22rpx;
color: #999;
margin-top: 8rpx;
}
/* 诊断结果卡片 */
.diagnosis-card {
background: white;
border-radius: 16rpx;
padding: 24rpx;
margin-top: 20rpx;
border-left: 6rpx solid #86D8D0;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
}
.diagnosis-header {
margin-bottom: 20rpx;
}
.diagnosis-title {
font-size: 28rpx;
font-weight: 600;
color: #333;
}
.diagnosis-item {
display: flex;
margin-bottom: 16rpx;
align-items: flex-start;
}
.diagnosis-label {
font-size: 26rpx;
color: #666;
width: 140rpx;
flex-shrink: 0;
}
.diagnosis-value {
font-size: 26rpx;
color: #333;
flex: 1;
line-height: 1.4;
}
.severity-level {
padding: 4rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
font-weight: 500;
}
.severity-level.low {
background: #E8F4F3;
color: #6BC4BC;
}
.severity-level.moderate {
background: #FFF3E0;
color: #FF9800;
}
.severity-level.high {
background: #FFEBEE;
color: #F44336;
}
.diagnosis-footer {
margin-top: 20rpx;
padding-top: 16rpx;
border-top: 1rpx solid #eee;
}
.disclaimer {
font-size: 22rpx;
color: #999;
font-style: italic;
}
/* AI正在输入 */
.typing {
min-width: 200rpx;
}
.typing-indicator {
display: flex;
align-items: center;
gap: 8rpx;
}
.typing-dot {
width: 12rpx;
height: 12rpx;
background: #86D8D0;
border-radius: 50%;
animation: typingAnimation 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingAnimation {
0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
40% { transform: scale(1); opacity: 1; }
}
.typing-text {
font-size: 26rpx;
color: #666;
margin-left: 12rpx;
}
/* 快捷症状选择 */
.symptom-quick-select {
padding: 0 32rpx 20rpx;
}
.section-title {
display: block;
font-size: 26rpx;
color: #666;
margin-bottom: 20rpx;
}
.symptom-tags {
white-space: nowrap;
display: flex;
gap: 20rpx;
}
.symptom-tag {
display: inline-block;
padding: 16rpx 24rpx;
background: white;
border-radius: 24rpx;
border: 1rpx solid #E8F4F3;
box-shadow: 0 2rpx 8rpx rgba(134, 216, 208, 0.1);
transition: all 0.2s ease;
}
.symptom-tag:active {
transform: scale(0.95);
background: #E8F4F3;
}
.tag-text {
font-size: 26rpx;
color: #666;
}
/* 输入区域 */
.input-area {
background: white;
padding: 20rpx 32rpx 40rpx;
border-top: 1rpx solid #f0f0f0;
display: flex;
align-items: flex-end;
gap: 20rpx;
}
.input-wrapper {
flex: 1;
background: #f8fafc;
border-radius: 24rpx;
padding: 16rpx 24rpx;
border: 1rpx solid #E8F4F3;
}
.message-input {
font-size: 28rpx;
min-height: 60rpx;
line-height: 1.5;
}
.placeholder {
color: #aaa;
}
.send-btn {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #86D8D0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(134, 216, 208, 0.3);
transition: all 0.2s ease;
}
.send-btn-hover {
background: #6BC4BC;
transform: translateY(-2rpx);
box-shadow: 0 6rpx 16rpx rgba(134, 216, 208, 0.4);
}
.send-icon {
color: white;
font-size: 36rpx;
font-weight: 300;
}
/* 更多菜单 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
display: flex;
justify-content: flex-end;
align-items: flex-start;
padding-top: 120rpx;
padding-right: 32rpx;
}
.more-menu {
background: white;
border-radius: 16rpx;
padding: 16rpx 0;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.15);
min-width: 240rpx;
animation: slideIn 0.3s ease;
}
@keyframes slideIn {
from { opacity: 0; transform: translateY(-20rpx); }
to { opacity: 1; transform: translateY(0); }
}
.menu-item {
display: flex;
align-items: center;
padding: 24rpx 32rpx;
gap: 16rpx;
}
.menu-item:active {
background: #f8fafc;
}
.menu-icon {
font-size: 28rpx;
}
.menu-text {
font-size: 28rpx;
color: #333;
}
/* 加载动画 */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.9);
z-index: 1001;
display: flex;
align-items: center;
justify-content: center;
}
.loading-content {
display: flex;
flex-direction: column;
align-items: center;
}
.pulse-animation {
position: relative;
width: 120rpx;
height: 120rpx;
}
.pulse-circle {
position: absolute;
width: 100%;
height: 100%;
border: 4rpx solid #86D8D0;
border-radius: 50%;
animation: pulse 2s infinite ease-in-out;
}
.pulse-circle:nth-child(2) { animation-delay: 0.5s; }
.pulse-circle:nth-child(3) { animation-delay: 1s; }
@keyframes pulse {
0% { transform: scale(0.8); opacity: 1; }
100% { transform: scale(1.5); opacity: 0; }
}
.loading-text {
margin-top: 40rpx;
font-size: 28rpx;
color: #666;
}
min-height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 100%);
}
/* 医生信息卡片 */
.doctor-card {
background: white;
margin: 24rpx 32rpx;
padding: 32rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
position: relative;
}
.doctor-avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: linear-gradient(135deg, #86D8D0 0%, #A8E6CF 100%);
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx;
overflow: hidden;
}
.avatar-img {
width: 100rpx;
height: 100rpx;
}
.doctor-info {
flex: 1;
}
.doctor-name {
display: block;
font-size: 32rpx;
font-weight: 600;
color: #333;
margin-bottom: 8rpx;
}
.doctor-title {
display: block;
font-size: 24rpx;
color: #86D8D0;
margin-bottom: 16rpx;
}
.doctor-tags {
display: flex;
gap: 12rpx;
}
.tag {
font-size: 20rpx;
padding: 6rpx 12rpx;
background: #E8F4F3;
color: #6BC4BC;
border-radius: 20rpx;
}
.online-status {
position: absolute;
right: 32rpx;
bottom: 32rpx;
font-size: 22rpx;
padding: 4rpx 12rpx;
border-radius: 12rpx;
}
.online-status.online {
background: #e8f1f4;
color: #6b8fc4;
}
/* 聊天容器 */
.chat-container {
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
overflow-y: auto;
}
/* 消息样式 */
.message-wrapper {
display: flex;
margin: 40rpx 0;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20rpx); }
to { opacity: 1; transform: translateY(0); }
}
.message-wrapper.user {
justify-content: flex-end;
}
.message-content {
max-width: 70%;
display: flex;
flex-direction: column;
}
.message-wrapper.user .message-content {
align-items: flex-end;
}
.message-wrapper.assistant .message-content {
align-items: flex-start;
}
.message-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
margin: 0 20rpx;
align-self: flex-end;
flex-shrink: 0;
}
.avatar {
width: 100%;
height: 100%;
}
/* 消息气泡 */
.message-bubble {
padding: 24rpx;
border-radius: 24rpx;
position: relative;
line-height: 1.5;
word-break: break-word;
}
.assistant-bubble {
background: #E8F4F3;
border-radius: 0 24rpx 24rpx 24rpx;
}
.user-bubble {
background: #86D8D0;
border-radius: 24rpx 0 24rpx 24rpx;
}
.message-text {
font-size: 28rpx;
color: #333;
white-space: pre-wrap;
word-break: break-word;
}
.user-bubble .message-text {
color: white;
}
/* 消息时间 */
.message-time {
font-size: 22rpx;
color: #999;
margin-top: 8rpx;
}
/* 诊断结果卡片 */
.diagnosis-card {
background: white;
border-radius: 16rpx;
padding: 24rpx;
margin-top: 20rpx;
border-left: 6rpx solid #86D8D0;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
}
.diagnosis-header {
margin-bottom: 20rpx;
}
.diagnosis-title {
font-size: 28rpx;
font-weight: 600;
color: #333;
}
.diagnosis-item {
display: flex;
margin-bottom: 16rpx;
align-items: flex-start;
}
.diagnosis-label {
font-size: 26rpx;
color: #666;
width: 140rpx;
flex-shrink: 0;
}
.diagnosis-value {
font-size: 26rpx;
color: #333;
flex: 1;
line-height: 1.4;
word-break: break-word;
}
.severity-level {
padding: 4rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
font-weight: 500;
}
.severity-level.low {
background: #E8F4F3;
color: #6BC4BC;
}
.severity-level.moderate {
background: #FFF3E0;
color: #FF9800;
}
.severity-level.high {
background: #FFEBEE;
color: #F44336;
}
.diagnosis-footer {
margin-top: 20rpx;
padding-top: 16rpx;
border-top: 1rpx solid #eee;
}
.disclaimer {
font-size: 22rpx;
color: #999;
font-style: italic;
}
/* AI正在输入 */
.typing {
min-width: 200rpx;
}
.typing-indicator {
display: flex;
align-items: center;
gap: 8rpx;
}
.typing-dot {
width: 12rpx;
height: 12rpx;
background: #86D8D0;
border-radius: 50%;
animation: typingAnimation 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingAnimation {
0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
40% { transform: scale(1); opacity: 1; }
}
.typing-text {
font-size: 26rpx;
color: #666;
margin-left: 12rpx;
}
/* 快捷症状选择 */
.symptom-quick-select {
padding: 0 32rpx 20rpx;
}
.section-title {
display: block;
font-size: 26rpx;
color: #666;
margin-bottom: 20rpx;
}
.symptom-tags {
white-space: nowrap;
display: flex;
gap: 20rpx;
}
.symptom-tag {
display: inline-block;
padding: 16rpx 24rpx;
background: white;
border-radius: 24rpx;
border: 1rpx solid #E8F4F3;
box-shadow: 0 2rpx 8rpx rgba(134, 216, 208, 0.1);
transition: all 0.2s ease;
}
.symptom-tag:active {
transform: scale(0.95);
background: #E8F4F3;
}
.tag-text {
font-size: 26rpx;
color: #666;
}
/* 输入区域 */
.input-area {
background: white;
padding: 20rpx 32rpx 40rpx;
border-top: 1rpx solid #f0f0f0;
display: flex;
align-items: flex-end;
gap: 20rpx;
width: 100%;
box-sizing: border-box;
}
.input-wrapper {
flex: 1;
background: #f8fafc;
border-radius: 24rpx;
padding: 16rpx 24rpx;
border: 1rpx solid #E8F4F3;
display: flex;
align-items: center;
transition: all 0.1s ease;
min-height: 60rpx;
}
.message-input {
width: 100%;
font-size: 28rpx;
line-height: 1.5;
padding: 0;
margin: 0;
border: none;
background: transparent;
max-height: 200rpx;
overflow-y: auto;
}
.placeholder {
color: #aaa;
font-size: 28rpx;
}
.send-btn {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #86D8D0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(134, 216, 208, 0.3);
transition: all 0.2s ease;
flex-shrink: 0;
border: none;
outline: none;
}
.send-btn-hover {
background: #6BC4BC;
transform: translateY(-2rpx);
box-shadow: 0 6rpx 16rpx rgba(134, 216, 208, 0.4);
}
.send-icon {
color: white;
font-size: 36rpx;
font-weight: 300;
}
/* 底部占位元素 - 用于滚动定位 */
.scroll-bottom-placeholder {
height: 20rpx;
width: 100%;
}
/* 消息列表项 */
.message-item {
width: 100%;
}
/* 加载动画 */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.9);
z-index: 1001;
display: flex;
align-items: center;
justify-content: center;
}
.loading-content {
display: flex;
flex-direction: column;
align-items: center;
}
.pulse-animation {
position: relative;
width: 120rpx;
height: 120rpx;
}
.pulse-circle {
position: absolute;
width: 100%;
height: 100%;
border: 4rpx solid #86D8D0;
border-radius: 50%;
animation: pulse 2s infinite ease-in-out;
}
.pulse-circle:nth-child(2) { animation-delay: 0.5s; }
.pulse-circle:nth-child(3) { animation-delay: 1s; }
@keyframes pulse {
0% { transform: scale(0.8); opacity: 1; }
100% { transform: scale(1.5); opacity: 0; }
}
.loading-text {
margin-top: 40rpx;
font-size: 28rpx;
color: #666;
}
/* 隐藏textarea默认滚动条 */
.message-input::-webkit-scrollbar {
width: 0;
background: transparent;
}

2
utils/api.js

@ -214,8 +214,6 @@ function feedback(params) {
export default { // 暴露接口
login,carousel,disaster,pharmacy,guidance,getPhoneNumber,inquiry,policyeDetails,
search,trend,feed,sales,wzd,wzdxq,wzdAdd,expertsList,recommendationList,policyeZd,

4
utils/baseUrl.js

@ -1,5 +1,5 @@
// var baseUrl = 'https://wx.chenhaitech.com/ymtx-prod-api'
var baseUrl = 'https://wx.chenhaitech.com/ymtx-prod-api'
// var baseUrl = 'http://192.168.101.109:8080'
var baseUrl = 'http://192.168.101.105:8082'
// var baseUrl = 'http://192.168.101.105:8082'
// var baseUrl = 'http://192.168.101.111:8081'
module.exports = baseUrl
Loading…
Cancel
Save