report-upload.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. <template>
  2. <view class="upload-container">
  3. <!-- 说明提示 -->
  4. <view class="tip-banner">
  5. <text class="tip-icon">📋</text>
  6. <text class="tip-text">{{ tipText }}</text>
  7. </view>
  8. <!-- 成员归属(统一上传:后台按指纹自动识别报告类型,需指定成员以正确归属) -->
  9. <view class="form-section">
  10. <view class="member-box">
  11. <text class="form-label">报告属于哪位成员</text>
  12. <view class="member-list" v-if="familyMembers.length > 0">
  13. <view
  14. class="member-item"
  15. v-for="(member, mIdx) in familyMembers"
  16. :key="getMemberKey(member)"
  17. :class="member._selected ? 'member-selected' : ''"
  18. hover-class="member-hover"
  19. @click="selectMemberByIndex(mIdx)">
  20. <text class="member-avatar">{{ memberInitial(member) }}</text>
  21. <text class="member-name">{{ member.nickname || '未命名' }}</text>
  22. </view>
  23. </view>
  24. <text class="member-empty" v-else>暂无家庭成员,请先在家庭中添加</text>
  25. </view>
  26. </view>
  27. <!-- 上传方式 -->
  28. <view class="form-section">
  29. <view class="upload-methods">
  30. <view class="upload-card card-chat" @click="pickFromChat">
  31. <view class="upload-card-icon">💬</view>
  32. <text class="upload-card-title">从聊天选取</text>
  33. <text class="upload-card-desc">微信聊天中的 PDF / 图片报告</text>
  34. </view>
  35. <view class="upload-card card-photo" @click="takePhoto">
  36. <view class="upload-card-icon">📷</view>
  37. <text class="upload-card-title">拍照上传</text>
  38. <text class="upload-card-desc">拍摄纸质报告(PDF 报告更佳)</text>
  39. </view>
  40. </view>
  41. <!-- 采集中面板 -->
  42. <view class="collecting-panel" v-if="collecting">
  43. <view class="collecting-card">
  44. <view class="collecting-icon">
  45. <view class="spinner" v-if="!collectError"></view>
  46. <text class="collecting-fail-mark" v-else>!</text>
  47. </view>
  48. <view class="collecting-info">
  49. <text class="collecting-title">{{ collectError ? '采集失败' : '数据采集中' }}</text>
  50. <text class="collecting-file">{{ collectFileName || '报告文件' }}</text>
  51. <text class="collecting-hint">{{ collectError || '后台正在识别报告类型并解析,完成后自动入库' }}</text>
  52. </view>
  53. </view>
  54. <view class="collecting-actions">
  55. <view class="collecting-btn" @click="goReportList">去报告列表查看</view>
  56. <view class="collecting-cancel" @click="cancelCollect">取消</view>
  57. </view>
  58. </view>
  59. <!-- 上传中 -->
  60. <view class="form-item" v-if="uploading">
  61. <text class="form-label">上传中...</text>
  62. <view class="analyzing-status">
  63. <text class="analyzing-text">{{ uploadingText }}</text>
  64. </view>
  65. </view>
  66. <!-- 责任声明 -->
  67. <view class="form-item disclaimer-box">
  68. <view class="disclaimer-check" @click="toggleAgree">
  69. <view class="disclaimer-checkbox" :class="{ 'disclaimer-checked': agreedToTerms }">
  70. <text class="disclaimer-checkmark" v-if="agreedToTerms">✓</text>
  71. </view>
  72. <text class="disclaimer-label">我已阅读并同意以下声明</text>
  73. </view>
  74. <view class="disclaimer-content">
  75. <text class="disclaimer-text">我同意平台使用本报告数据进行分析,为我提供个性化健康解决方案;未经我授权,平台不会以任何形式将我的报告内容提供给其他任何个人或机构。</text>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- 上传说明 -->
  80. <view class="guide-section">
  81. <view class="guide-header">
  82. <text class="guide-header-icon">📖</text>
  83. <text class="guide-header-title">支持的报告类型</text>
  84. </view>
  85. <view class="guide-list">
  86. <view class="guide-item">
  87. <view class="guide-icon-box guide-icon-blue"><text class="guide-icon">📄</text></view>
  88. <view class="guide-info">
  89. <text class="guide-name">菌群检测报告</text>
  90. <text class="guide-desc">肠道菌群 PDF,后台采集解析菌群指标</text>
  91. </view>
  92. </view>
  93. <view class="guide-item">
  94. <view class="guide-icon-box guide-icon-purple"><text class="guide-icon">🧠</text></view>
  95. <view class="guide-info">
  96. <text class="guide-name">素质测评 A2</text>
  97. <text class="guide-desc">核心素养 PDF,解析认知、情绪、大五人格等</text>
  98. </view>
  99. </view>
  100. <view class="guide-item">
  101. <view class="guide-icon-box guide-icon-blue"><text class="guide-icon">📄</text></view>
  102. <view class="guide-info">
  103. <text class="guide-name">体检报告</text>
  104. <text class="guide-desc">血常规、尿常规、生化检验等,支持 PDF 或清晰照片</text>
  105. </view>
  106. </view>
  107. <view class="guide-item">
  108. <view class="guide-icon-box guide-icon-orange"><text class="guide-icon">👅</text></view>
  109. <view class="guide-info">
  110. <text class="guide-name">舌象照片</text>
  111. <text class="guide-desc">拍摄舌象照片,AI 辅助舌诊分析</text>
  112. </view>
  113. </view>
  114. <view class="guide-item">
  115. <view class="guide-icon-box guide-icon-teal"><text class="guide-icon">⚖️</text></view>
  116. <view class="guide-info">
  117. <text class="guide-name">体脂秤报告</text>
  118. <text class="guide-desc">拍摄体脂秤显示屏,自动提取体重、BMI、体脂率等</text>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="guide-tips">
  123. <text class="guide-tips-title">温馨提示</text>
  124. <text class="guide-tips-item">· 上传后无需选择类型,后台自动识别报告种类并解析</text>
  125. <text class="guide-tips-item">· 请先选择报告归属成员,再上传文件</text>
  126. <text class="guide-tips-item">· 请确认报告清晰完整,以便准确解析</text>
  127. <text class="guide-tips-item">· 确认入库后将自动生成成长方案,可再分解为每日任务</text>
  128. </view>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import { uploadReportOnly, getReportCollectStatus, getFamilyMemberList, requestReportTransfer } from '../../utils/api.js'
  134. export default {
  135. data() {
  136. return {
  137. memberId: null,
  138. reportKind: '',
  139. uploadType: null, // 'tongue' | null;从 URL query reportType 读取
  140. familyMembers: [],
  141. uploading: false,
  142. agreedToTerms: false,
  143. uploadingText: '正在上传文件...',
  144. collectDraftId: null,
  145. collectTimer: null,
  146. collecting: false,
  147. collectFileName: '',
  148. collectError: '',
  149. collectPollCount: 0
  150. }
  151. },
  152. computed: {
  153. tipText: function() {
  154. return '上传报告后由系统自动识别类型并解析:菌群检测、素质测评 A2、体检报告等'
  155. }
  156. },
  157. onLoad: function(options) {
  158. this.memberId = options.memberId ? parseInt(options.memberId) : null
  159. if (options.type === 'a2' || options.reportKind === 'a2') {
  160. this.reportKind = 'a2'
  161. } else if (options.type === 'gut' || options.reportKind === 'gut') {
  162. this.reportKind = 'gut'
  163. }
  164. if (options.reportType === 'tongue' || options.type === 'tongue') {
  165. this.uploadType = 'tongue'
  166. }
  167. this.loadFamilyMembers()
  168. },
  169. onUnload: function() {
  170. this.stopCollectPolling()
  171. },
  172. methods: {
  173. resolveMemberId: function(member) {
  174. if (!member) return null
  175. var raw = member.id || member.userId
  176. if (raw === 0 || raw === '0') return 0
  177. if (!raw) return null
  178. var id = parseInt(raw)
  179. return isNaN(id) ? null : id
  180. },
  181. selectMemberByIndex: function(idx) {
  182. var list = this.familyMembers
  183. if (!list || idx < 0 || idx >= list.length) return
  184. var id = this.resolveMemberId(list[idx])
  185. if (id === null) {
  186. uni.showToast({ title: '该成员缺少编号,无法选择', icon: 'none' })
  187. return
  188. }
  189. this.memberId = id
  190. this.markSelectedMember(id)
  191. },
  192. markSelectedMember: function(memberId) {
  193. var list = this.familyMembers || []
  194. var target = memberId === null || memberId === undefined ? null : parseInt(memberId)
  195. for (var i = 0; i < list.length; i++) {
  196. var cur = this.resolveMemberId(list[i])
  197. this.$set(list[i], '_selected', target !== null && !isNaN(target) && cur === target)
  198. }
  199. },
  200. getMemberKey: function(member) {
  201. var id = this.resolveMemberId(member)
  202. return id === null ? 'm0' : ('m' + id)
  203. },
  204. memberInitial: function(member) {
  205. var name = (member && member.nickname) || '?'
  206. return name.substring(0, 1)
  207. },
  208. loadFamilyMembers: function() {
  209. var self = this
  210. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  211. var list = (res && res.data) || []
  212. self.familyMembers = list instanceof Array ? list : []
  213. if (!self.memberId && self.familyMembers.length === 1) {
  214. self.memberId = self.resolveMemberId(self.familyMembers[0])
  215. }
  216. self.markSelectedMember(self.memberId)
  217. }).catch(function() {
  218. self.familyMembers = []
  219. })
  220. },
  221. ensureMember: function() {
  222. if (this.memberId) return true
  223. uni.showToast({ title: '请先选择报告所属成员', icon: 'none' })
  224. return false
  225. },
  226. toggleAgree: function() {
  227. this.agreedToTerms = !this.agreedToTerms
  228. },
  229. ensureAgreed: function(callback) {
  230. if (this.agreedToTerms) {
  231. callback()
  232. return
  233. }
  234. var self = this
  235. uni.showModal({
  236. title: '数据使用声明',
  237. content: '上传报告即代表您同意平台使用本报告数据进行分析,为您提供个性化健康解决方案;未经您授权,平台不会以任何形式将您的报告内容提供给其他任何个人或机构。点击「同意继续」即表示您已阅读并同意。',
  238. confirmText: '同意继续',
  239. cancelText: '暂不',
  240. success: function(res) {
  241. if (res.confirm) {
  242. self.agreedToTerms = true
  243. callback()
  244. }
  245. }
  246. })
  247. },
  248. pickFromChat: function() {
  249. var self = this
  250. if (!this.ensureMember()) return
  251. this.ensureAgreed(function() {
  252. // type='all' 的选择器默认停留在图片 tab,用户难以发现可切换选文件。
  253. // 改为先弹 actionSheet 让用户明确选择图片或文件,分别走对应 type。
  254. uni.showActionSheet({
  255. itemList: ['聊天中的文件(PDF等)', '聊天中的图片'],
  256. success: function(res) {
  257. if (res.tapIndex === 0) {
  258. self.chooseChatFile('file', '聊天文件')
  259. } else if (res.tapIndex === 1) {
  260. self.chooseChatFile('image', '聊天图片')
  261. }
  262. },
  263. fail: function() {
  264. // 用户取消,静默处理
  265. }
  266. })
  267. })
  268. },
  269. chooseChatFile: function(type, fallbackName) {
  270. var self = this
  271. uni.chooseMessageFile({
  272. count: 1,
  273. type: type,
  274. success: function(res) {
  275. var files = res.tempFiles
  276. if (files && files.length > 0) {
  277. self.uploadReport(files[0].path, files[0].name || fallbackName)
  278. }
  279. },
  280. fail: function() {
  281. // 用户取消或失败,静默处理
  282. }
  283. })
  284. },
  285. takePhoto: function() {
  286. var self = this
  287. if (!this.ensureMember()) return
  288. this.ensureAgreed(function() {
  289. uni.chooseImage({
  290. count: 1,
  291. sourceType: ['camera', 'album'],
  292. success: function(res) {
  293. if (res.tempFilePaths && res.tempFilePaths.length > 0) {
  294. self.uploadReport(res.tempFilePaths[0], '照片')
  295. }
  296. }
  297. })
  298. })
  299. },
  300. uploadReport: function(filePath, fileName) {
  301. if (!filePath) return
  302. var self = this
  303. self.uploading = true
  304. self.uploadingText = '正在上传文件...'
  305. uni.showLoading({ title: '上传中...' })
  306. // 统一上传:舌诊照片(uploadType=tongue)走舌诊专用流程;其余 type=auto,后台指纹判定后走对应采集管道(dan_a2 → DAN入库 / 其余 → 健康报告)
  307. uploadReportOnly(filePath, self.uploadType || 'auto', self.memberId).then(function(res) {
  308. uni.hideLoading()
  309. self.uploading = false
  310. var data = res.data || {}
  311. // 舌诊照片:后端直接返回 recordId + 舌诊指标,不走 draft/collect 流程
  312. if (data.type === 'tongue' || data.recordId) {
  313. var tonguePayload = {
  314. type: 'tongue',
  315. recordId: data.recordId,
  316. indicators: data.indicators || [],
  317. summary: { overallAssessment: data.overallAssessment || '' }
  318. }
  319. var url = '/pages/health/report-confirm?payload=' + encodeURIComponent(JSON.stringify(tonguePayload))
  320. if (self.memberId) url += '&memberId=' + self.memberId
  321. uni.redirectTo({ url: url })
  322. return
  323. }
  324. // 处理重复上传:duplicate=true
  325. if (data.duplicate) {
  326. if (data.collecting) {
  327. self.collectDraftId = data.draftId
  328. self.collecting = true
  329. self.collectError = data.message || '该报告正在解析中,请稍候'
  330. self.collectFileName = fileName || '报告文件'
  331. self.startCollectPolling(data.draftId)
  332. } else if (data.crossFamily) {
  333. // 同一份报告已被其他家庭上传:弹窗确认后向原家庭发起转移申请,不跳详情
  334. self.confirmCrossFamilyTransfer(data)
  335. return
  336. } else {
  337. // 本家庭已完成,跳转详情
  338. var reportId = data.reportId
  339. if (reportId) {
  340. self.goToDetail(reportId, 'gut_flora')
  341. }
  342. }
  343. uni.showToast({ title: data.message || '该报告已上传过', icon: 'none', duration: 3000 })
  344. return
  345. }
  346. var draftId = data.draftId
  347. if (!draftId) {
  348. uni.showToast({ title: (res && res.message) || '上传失败', icon: 'none' })
  349. return
  350. }
  351. self.collectDraftId = draftId
  352. self.collecting = true
  353. self.collectError = ''
  354. self.collectFileName = fileName || '报告文件'
  355. self.startCollectPolling(draftId)
  356. }).catch(function(err) {
  357. uni.hideLoading()
  358. self.uploading = false
  359. var msg = (err && err.message) || '上传失败,请重试'
  360. uni.showToast({ title: msg, icon: 'none' })
  361. })
  362. },
  363. // 跨家庭重复上传:弹窗确认后向原家庭发起转移申请(原家庭同意后报告才转入本家庭)
  364. confirmCrossFamilyTransfer: function(data) {
  365. uni.showModal({
  366. title: '申请转移报告',
  367. content: '该报告已由其他家庭上传。发起申请后需对方家庭同意,报告才会转入您的家庭;同意前您无法查看该报告。是否发起申请?',
  368. confirmText: '发起申请',
  369. cancelText: '取消',
  370. success: function(res) {
  371. if (!res.confirm) return
  372. requestReportTransfer(data.reportId).then(function(r) {
  373. if (r && r.code === 200) {
  374. uni.showToast({ title: '申请已提交,等待对方家庭同意', icon: 'none', duration: 3000 })
  375. } else {
  376. uni.showToast({ title: (r && r.message) || '申请失败', icon: 'none' })
  377. }
  378. }).catch(function() {
  379. uni.showToast({ title: '申请失败,请重试', icon: 'none' })
  380. })
  381. }
  382. })
  383. },
  384. stopCollectPolling: function() {
  385. if (this.collectTimer) {
  386. clearInterval(this.collectTimer)
  387. this.collectTimer = null
  388. }
  389. },
  390. startCollectPolling: function(draftId) {
  391. var self = this
  392. self.stopCollectPolling()
  393. self.collectPollCount = 0
  394. self.pollCollectStatus(draftId)
  395. self.collectTimer = setInterval(function() {
  396. self.pollCollectStatus(draftId)
  397. }, 4000)
  398. },
  399. pollCollectStatus: function(draftId) {
  400. var self = this
  401. self.collectPollCount = (self.collectPollCount || 0) + 1
  402. // 约 6 分钟仍未完成:停轮询,提示去列表看进度
  403. if (self.collectPollCount > 90) {
  404. self.stopCollectPolling()
  405. self.collectError = '解析耗时较长,可去报告列表查看进度,无需重复上传'
  406. return
  407. }
  408. getReportCollectStatus(draftId).then(function(res) {
  409. var data = res.data || {}
  410. var status = data.parseStatus
  411. if (status === 'completed') {
  412. self.stopCollectPolling()
  413. self.collecting = false
  414. uni.showToast({ title: '报告已采集完成', icon: 'success', duration: 2000 })
  415. var reportId = data.reportId
  416. var reportType = data.reportType || 'gut_flora'
  417. setTimeout(function() {
  418. if (reportId) {
  419. // 后端指纹识别后统一入库:dan_* → DAN 报告页,其余 → 健康报告详情页
  420. if (reportType && reportType.indexOf('dan_') === 0) {
  421. uni.redirectTo({ url: '/pages/dan-assessment/report-result?reportId=' + reportId })
  422. } else if (reportType === 'gut_flora') {
  423. uni.redirectTo({ url: '/pages/health/gut-flora-detail?reportId=' + reportId })
  424. } else {
  425. uni.redirectTo({ url: '/pages/health/report-detail?reportType=' + reportType + '&reportId=' + reportId })
  426. }
  427. } else {
  428. uni.redirectTo({ url: '/pages/health/report-list' })
  429. }
  430. }, 600)
  431. } else if (status === 'failed') {
  432. self.stopCollectPolling()
  433. self.collectError = data.parseError || '报告采集失败,请重试'
  434. uni.showToast({ title: self.collectError, icon: 'none', duration: 3000 })
  435. }
  436. }).catch(function() {
  437. // 轮询失败静默,下次继续
  438. })
  439. },
  440. goReportList: function() {
  441. this.stopCollectPolling()
  442. uni.redirectTo({ url: '/pages/health/report-list' })
  443. },
  444. goToDetail: function(reportId, reportType) {
  445. var url
  446. if (reportType === 'gut_flora') {
  447. url = '/pages/health/gut-flora-detail?reportId=' + reportId
  448. } else {
  449. url = '/pages/health/report-detail?reportType=' + (reportType || 'gut_flora') + '&reportId=' + reportId
  450. }
  451. uni.redirectTo({ url: url })
  452. },
  453. cancelCollect: function() {
  454. this.stopCollectPolling()
  455. this.collecting = false
  456. this.collectDraftId = null
  457. this.collectFileName = ''
  458. this.collectError = ''
  459. }
  460. }
  461. }
  462. </script>
  463. <style scoped>
  464. .upload-container {
  465. min-height: 100vh;
  466. background: #F5F7FA;
  467. padding-bottom: env(safe-area-inset-bottom);
  468. }
  469. .tip-banner {
  470. display: flex;
  471. flex-direction: row;
  472. align-items: center;
  473. background: #E3F2FD;
  474. margin: 20rpx 30rpx;
  475. padding: 20rpx 24rpx;
  476. border-radius: 16rpx;
  477. }
  478. .tip-icon {
  479. font-size: 32rpx;
  480. margin-right: 16rpx;
  481. flex-shrink: 0;
  482. }
  483. .tip-text {
  484. font-size: 24rpx;
  485. color: #1565C0;
  486. line-height: 1.5;
  487. }
  488. .form-section {
  489. margin: 0 30rpx;
  490. }
  491. .member-box {
  492. background: #fff;
  493. border-radius: 16rpx;
  494. padding: 24rpx;
  495. margin-bottom: 20rpx;
  496. }
  497. .member-list {
  498. display: flex;
  499. flex-direction: row;
  500. flex-wrap: wrap;
  501. gap: 16rpx;
  502. }
  503. .member-item {
  504. display: flex;
  505. flex-direction: column;
  506. align-items: center;
  507. padding: 16rpx 20rpx;
  508. background: #F5F7FA;
  509. border-radius: 16rpx;
  510. border: 2rpx solid transparent;
  511. min-width: 120rpx;
  512. }
  513. .member-selected {
  514. background: #EDE9FE;
  515. border-color: #8B5CF6;
  516. }
  517. .member-hover {
  518. opacity: 0.85;
  519. }
  520. .member-avatar {
  521. width: 64rpx;
  522. height: 64rpx;
  523. border-radius: 50%;
  524. background: #8B5CF6;
  525. color: #fff;
  526. font-size: 28rpx;
  527. font-weight: bold;
  528. text-align: center;
  529. line-height: 64rpx;
  530. margin-bottom: 8rpx;
  531. }
  532. .member-name {
  533. font-size: 24rpx;
  534. color: #333;
  535. }
  536. .member-empty {
  537. font-size: 24rpx;
  538. color: #94A3B8;
  539. }
  540. .form-item {
  541. background: #fff;
  542. border-radius: 16rpx;
  543. padding: 24rpx;
  544. margin-bottom: 20rpx;
  545. }
  546. .form-label {
  547. font-size: 26rpx;
  548. font-weight: bold;
  549. color: #333;
  550. display: block;
  551. margin-bottom: 16rpx;
  552. }
  553. /* 上传方式卡片 */
  554. .upload-methods {
  555. display: flex;
  556. flex-direction: row;
  557. gap: 16rpx;
  558. margin-bottom: 20rpx;
  559. }
  560. .upload-card {
  561. flex: 1;
  562. display: flex;
  563. flex-direction: column;
  564. align-items: center;
  565. justify-content: center;
  566. padding: 32rpx 12rpx;
  567. border-radius: 20rpx;
  568. text-align: center;
  569. min-height: 200rpx;
  570. }
  571. .upload-card:active {
  572. opacity: 0.85;
  573. }
  574. .upload-card-icon {
  575. width: 80rpx;
  576. height: 80rpx;
  577. border-radius: 20rpx;
  578. font-size: 40rpx;
  579. display: flex;
  580. align-items: center;
  581. justify-content: center;
  582. margin-bottom: 16rpx;
  583. }
  584. .upload-card-title {
  585. font-size: 26rpx;
  586. font-weight: 600;
  587. color: #333;
  588. margin-bottom: 8rpx;
  589. }
  590. .upload-card-desc {
  591. font-size: 20rpx;
  592. color: #94A3B8;
  593. line-height: 1.5;
  594. }
  595. .card-chat {
  596. background: #F0F7FF;
  597. border: 2rpx dashed #93C5FD;
  598. }
  599. .card-chat .upload-card-icon {
  600. background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  601. color: #fff;
  602. }
  603. .card-photo {
  604. background: #FFF7ED;
  605. border: 2rpx solid #FED7AA;
  606. }
  607. .card-photo .upload-card-icon {
  608. background: linear-gradient(135deg, #FB923C, #EA580C);
  609. color: #fff;
  610. }
  611. /* 采集中面板 */
  612. .collecting-panel {
  613. margin-bottom: 20rpx;
  614. }
  615. .collecting-card {
  616. display: flex;
  617. flex-direction: row;
  618. align-items: flex-start;
  619. background: #FFF8E6;
  620. border: 1rpx solid #F5D78E;
  621. border-radius: 16rpx;
  622. padding: 28rpx 24rpx;
  623. }
  624. .collecting-icon {
  625. width: 56rpx;
  626. height: 56rpx;
  627. border-radius: 50%;
  628. background: #F0B429;
  629. display: flex;
  630. align-items: center;
  631. justify-content: center;
  632. margin-right: 20rpx;
  633. flex-shrink: 0;
  634. }
  635. .spinner {
  636. width: 28rpx;
  637. height: 28rpx;
  638. border: 4rpx solid rgba(255,255,255,0.4);
  639. border-top-color: #fff;
  640. border-radius: 50%;
  641. animation: collecting-spin 1s linear infinite;
  642. }
  643. @keyframes collecting-spin {
  644. 0% { transform: rotate(0deg); }
  645. 100% { transform: rotate(360deg); }
  646. }
  647. .collecting-fail-mark {
  648. font-size: 32rpx;
  649. color: #fff;
  650. font-weight: bold;
  651. }
  652. .collecting-info {
  653. flex: 1;
  654. display: flex;
  655. flex-direction: column;
  656. min-width: 0;
  657. }
  658. .collecting-title {
  659. font-size: 30rpx;
  660. font-weight: 600;
  661. color: #7A5C00;
  662. }
  663. .collecting-file {
  664. font-size: 24rpx;
  665. color: #A08A45;
  666. margin-top: 6rpx;
  667. overflow: hidden;
  668. text-overflow: ellipsis;
  669. white-space: nowrap;
  670. }
  671. .collecting-hint {
  672. font-size: 22rpx;
  673. color: #C0A75A;
  674. margin-top: 8rpx;
  675. line-height: 1.5;
  676. }
  677. .collecting-actions {
  678. display: flex;
  679. flex-direction: row;
  680. gap: 16rpx;
  681. margin-top: 16rpx;
  682. }
  683. .collecting-btn {
  684. flex: 1;
  685. height: 72rpx;
  686. line-height: 72rpx;
  687. text-align: center;
  688. background: #5B9BD5;
  689. color: #fff;
  690. font-size: 28rpx;
  691. border-radius: 12rpx;
  692. }
  693. .collecting-cancel {
  694. padding: 0 24rpx;
  695. height: 72rpx;
  696. line-height: 72rpx;
  697. text-align: center;
  698. background: #fff;
  699. border: 1rpx solid #D1D5DB;
  700. color: #666;
  701. font-size: 28rpx;
  702. border-radius: 12rpx;
  703. }
  704. /* 上传中状态 */
  705. .analyzing-status {
  706. display: flex;
  707. flex-direction: row;
  708. align-items: center;
  709. }
  710. .analyzing-text {
  711. font-size: 26rpx;
  712. color: #5B9BD5;
  713. }
  714. /* 责任声明 */
  715. .disclaimer-box {
  716. background: #FFF8F0;
  717. border: 2rpx solid #FDE68A;
  718. }
  719. .disclaimer-check {
  720. display: flex;
  721. flex-direction: row;
  722. align-items: center;
  723. margin-bottom: 12rpx;
  724. }
  725. .disclaimer-checkbox {
  726. width: 36rpx;
  727. height: 36rpx;
  728. border-radius: 6rpx;
  729. border: 2rpx solid #CBD5E1;
  730. background: #fff;
  731. display: flex;
  732. align-items: center;
  733. justify-content: center;
  734. flex-shrink: 0;
  735. margin-right: 12rpx;
  736. }
  737. .disclaimer-checked {
  738. background: #5B9BD5;
  739. border-color: #5B9BD5;
  740. }
  741. .disclaimer-checkmark {
  742. font-size: 24rpx;
  743. color: #fff;
  744. font-weight: bold;
  745. }
  746. .disclaimer-label {
  747. font-size: 24rpx;
  748. color: #333;
  749. font-weight: 500;
  750. }
  751. .disclaimer-content {
  752. background: #FFFDF5;
  753. border-radius: 10rpx;
  754. padding: 16rpx;
  755. margin-left: 48rpx;
  756. }
  757. .disclaimer-text {
  758. font-size: 22rpx;
  759. color: #92400E;
  760. line-height: 1.6;
  761. }
  762. /* 上传说明 */
  763. .guide-section {
  764. margin: 0 30rpx 30rpx;
  765. background: #fff;
  766. border-radius: 20rpx;
  767. padding: 28rpx 24rpx;
  768. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
  769. }
  770. .guide-header {
  771. display: flex;
  772. flex-direction: row;
  773. align-items: center;
  774. margin-bottom: 20rpx;
  775. }
  776. .guide-header-icon {
  777. font-size: 32rpx;
  778. margin-right: 12rpx;
  779. }
  780. .guide-header-title {
  781. font-size: 28rpx;
  782. font-weight: 600;
  783. color: #1E293B;
  784. }
  785. .guide-item {
  786. display: flex;
  787. flex-direction: row;
  788. align-items: flex-start;
  789. margin-bottom: 20rpx;
  790. }
  791. .guide-icon-box {
  792. width: 64rpx;
  793. height: 64rpx;
  794. border-radius: 16rpx;
  795. display: flex;
  796. align-items: center;
  797. justify-content: center;
  798. margin-right: 16rpx;
  799. flex-shrink: 0;
  800. }
  801. .guide-icon {
  802. font-size: 32rpx;
  803. }
  804. .guide-icon-blue { background: #DBEAFE; }
  805. .guide-icon-green { background: #DCFCE7; }
  806. .guide-icon-orange { background: #FFEDD5; }
  807. .guide-icon-purple { background: #EDE9FE; }
  808. .guide-icon-teal { background: #CCFBF1; }
  809. .guide-info {
  810. flex: 1;
  811. }
  812. .guide-name {
  813. font-size: 26rpx;
  814. font-weight: 600;
  815. color: #334155;
  816. display: block;
  817. margin-bottom: 4rpx;
  818. }
  819. .guide-desc {
  820. font-size: 22rpx;
  821. color: #94A3B8;
  822. line-height: 1.5;
  823. }
  824. .guide-tips {
  825. margin-top: 8rpx;
  826. padding-top: 16rpx;
  827. border-top: 1rpx solid #F1F5F9;
  828. }
  829. .guide-tips-title {
  830. font-size: 24rpx;
  831. font-weight: 600;
  832. color: #64748B;
  833. display: block;
  834. margin-bottom: 8rpx;
  835. }
  836. .guide-tips-item {
  837. font-size: 22rpx;
  838. color: #94A3B8;
  839. display: block;
  840. line-height: 1.7;
  841. }
  842. </style>