index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  1. <template>
  2. <view class="folder-select-page">
  3. <!-- 顶部导航栏 -->
  4. <view class="header-bg" :style="{ paddingTop: statusBarHeight + 'px' }">
  5. <view class="header-content">
  6. <view class="back-btn" @click="handleBack">
  7. <text class="back-icon">‹</text>
  8. </view>
  9. <text class="header-title">选择文件夹</text>
  10. <view class="placeholder"></view>
  11. </view>
  12. </view>
  13. <!-- 项目信息 -->
  14. <view class="project-info-bar">
  15. <text class="project-label">当前项目:</text>
  16. <text class="project-name">{{ projectName }}</text>
  17. </view>
  18. <!-- 选择表单 -->
  19. <view class="form-container">
  20. <view v-if="loading" class="loading-tip">
  21. <text class="loading-text">加载中...</text>
  22. </view>
  23. <view v-else class="form-content">
  24. <!-- 国家-中心联动选择 -->
  25. <view class="form-item">
  26. <view class="form-label">国家 - 中心:</view>
  27. <picker
  28. mode="multiSelector"
  29. :range="pickerRange"
  30. :value="[selectedCountryIndex, selectedCenterIndex]"
  31. @change="handleMultiPickerChange"
  32. @columnchange="handleColumnChange"
  33. >
  34. <view class="picker-display">
  35. <text class="picker-text" :class="{ placeholder: selectedCountryIndex === -1 || selectedCenterIndex === -1 }">
  36. {{ getDisplayText() }}
  37. </text>
  38. <text class="picker-arrow">›</text>
  39. </view>
  40. </picker>
  41. </view>
  42. <!-- 名称和生效日期合并 -->
  43. <view class="form-item highlight-item">
  44. <view class="form-label required">名称:</view>
  45. <view class="input-wrapper highlight">
  46. <input
  47. v-model="documentName"
  48. type="text"
  49. placeholder="请输入具体文档名"
  50. class="input-field"
  51. />
  52. </view>
  53. <view class="date-picker-wrapper">
  54. <picker
  55. mode="date"
  56. :value="effectiveDate"
  57. @change="handleDateChange"
  58. >
  59. <view class="picker-display">
  60. <text class="picker-text" :class="{ placeholder: !effectiveDate }">
  61. {{ effectiveDate || '请输入生效日期' }}
  62. </text>
  63. <text class="picker-arrow">›</text>
  64. </view>
  65. </picker>
  66. </view>
  67. <view class="final-name-preview">
  68. <text class="preview-label">完整名称预览:</text>
  69. <text class="preview-text">{{ getFinalName() }}</text>
  70. </view>
  71. </view>
  72. <!-- 提交按钮 -->
  73. <button
  74. class="confirm-btn"
  75. :disabled="selectedCountryIndex < 0 || selectedCenterIndex < 0 || !documentName.trim()"
  76. @click="handleSubmit"
  77. >
  78. 提交
  79. </button>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import { getFolderList, uploadScanFile } from '@/apis/scan'
  86. export default {
  87. data() {
  88. return {
  89. statusBarHeight: 0,
  90. projectId: 0,
  91. projectName: '',
  92. projectCode: '',
  93. rawData: null,
  94. loading: false,
  95. showRawData: false,
  96. // 原始数据列表(用于查找独立的中心)
  97. allFolders: [],
  98. // 国家列表
  99. countryList: [],
  100. selectedCountryIndex: 0, // 默认选中第一个(NA)
  101. // 中心列表
  102. centerList: [],
  103. selectedCenterIndex: 0, // 默认选中第一个(NA)
  104. // 文档名称输入
  105. documentName: '',
  106. // 生效日期
  107. effectiveDate: ''
  108. }
  109. },
  110. computed: {
  111. // 构建选择器的 range 数据
  112. pickerRange() {
  113. // 第一列:国家名称数组
  114. const countryNames = this.countryList.map(item => item.name)
  115. // 第二列:中心显示名称数组
  116. const centerNames = this.centerList.map(item => item.displayName || item.name)
  117. return [countryNames, centerNames]
  118. }
  119. },
  120. onLoad(options) {
  121. console.log('页面参数:', options)
  122. this.projectId = parseInt(options.projectId) || 0
  123. this.projectName = decodeURIComponent(options.projectName || '')
  124. this.projectCode = decodeURIComponent(options.projectCode || '')
  125. console.log('解析后的projectId:', this.projectId)
  126. console.log('解析后的projectName:', this.projectName)
  127. console.log('解析后的projectCode:', this.projectCode)
  128. },
  129. onReady() {
  130. // 获取系统信息
  131. const windowInfo = uni.getWindowInfo()
  132. this.statusBarHeight = windowInfo.statusBarHeight || 0
  133. // 加载数据
  134. if (this.projectId) {
  135. this.loadFolderList()
  136. } else {
  137. console.error('projectId 为空,无法加载文件夹列表')
  138. }
  139. },
  140. methods: {
  141. // 返回上一页
  142. handleBack() {
  143. uni.navigateBack()
  144. },
  145. // 加载文件夹列表
  146. async loadFolderList() {
  147. if (this.loading) return
  148. try {
  149. this.loading = true
  150. console.log('========== 开始加载文件夹列表 ==========')
  151. console.log('projectId:', this.projectId)
  152. const response = await getFolderList({
  153. projectId: this.projectId
  154. })
  155. console.log('========== 后端返回的原始数据 ==========')
  156. console.log('完整响应:', response)
  157. // 保存原始数据
  158. this.rawData = response
  159. // 解析数据
  160. if (response.code === 200 && response.data && Array.isArray(response.data)) {
  161. this.allFolders = response.data
  162. this.parseCountryList(response.data)
  163. }
  164. } catch (error) {
  165. console.error('========== 加载失败 ==========')
  166. console.error('错误信息:', error)
  167. uni.showToast({
  168. title: '加载失败',
  169. icon: 'none'
  170. })
  171. } finally {
  172. this.loading = false
  173. console.log('========== 加载完成 ==========')
  174. }
  175. },
  176. // 解析国家列表(type === 1 为国家)
  177. parseCountryList(data) {
  178. const countries = data.filter(item => {
  179. return item.type === 1 // 国家类型
  180. })
  181. // 在列表开头添加 NA 选项
  182. this.countryList = [
  183. { id: 'NA', name: 'NA', type: 1, children: [], displayName: 'NA' },
  184. ...countries
  185. ]
  186. console.log('解析后的国家列表:', this.countryList)
  187. // 初始化时加载第一个国家(NA)的中心列表
  188. if (this.countryList.length > 0) {
  189. this.loadCenterList(0)
  190. }
  191. },
  192. // 加载中心列表
  193. loadCenterList(countryIndex) {
  194. if (countryIndex >= 0 && this.countryList[countryIndex]) {
  195. const country = this.countryList[countryIndex]
  196. // 如果选择的是 NA(第一个选项)
  197. if (country.id === 'NA') {
  198. // 获取所有不属于任何国家的中心
  199. this.centerList = this.getIndependentCenters()
  200. } else {
  201. // 选择了具体国家,显示该国家下的所有中心(包括子中心)
  202. const allCenters = this.getAllCentersRecursive(country.children || [])
  203. // 在列表开头添加 NA 选项
  204. this.centerList = [
  205. { id: 'NA', name: 'NA', type: 2, displayName: 'NA' },
  206. ...allCenters
  207. ]
  208. }
  209. console.log('国家:', country.name, '中心列表:', this.centerList)
  210. } else {
  211. this.centerList = [{ id: 'NA', name: 'NA', type: 2, displayName: 'NA' }]
  212. }
  213. },
  214. // 递归获取所有中心(包括子中心)
  215. getAllCentersRecursive(nodes, prefix = '') {
  216. let centers = []
  217. nodes.forEach(node => {
  218. // 如果是中心类型(type === 2)
  219. if (node.type === 2) {
  220. // 添加当前中心,名称带层级前缀
  221. const displayName = prefix ? `${prefix} > ${node.name}` : node.name
  222. centers.push({
  223. ...node,
  224. displayName: displayName, // 用于显示的名称
  225. originalName: node.name // 保留原始名称
  226. })
  227. // 如果有子节点,递归获取
  228. if (node.children && node.children.length > 0) {
  229. const subCenters = this.getAllCentersRecursive(node.children, displayName)
  230. centers = centers.concat(subCenters)
  231. }
  232. } else if (node.children && node.children.length > 0) {
  233. // 如果不是中心但有子节点,继续递归
  234. const subCenters = this.getAllCentersRecursive(node.children, prefix)
  235. centers = centers.concat(subCenters)
  236. }
  237. })
  238. return centers
  239. },
  240. // 多列选择器列变化
  241. handleColumnChange(e) {
  242. const column = e.detail.column // 哪一列变化了
  243. const value = e.detail.value // 变化后的值
  244. console.log('列变化:', column, '值:', value)
  245. // 如果是第一列(国家)变化
  246. if (column === 0) {
  247. this.selectedCountryIndex = value
  248. // 重新加载中心列表
  249. this.loadCenterList(value)
  250. // 重置中心选择为第一个
  251. this.selectedCenterIndex = 0
  252. }
  253. },
  254. // 多列选择器确认
  255. handleMultiPickerChange(e) {
  256. const values = e.detail.value
  257. this.selectedCountryIndex = values[0]
  258. this.selectedCenterIndex = values[1]
  259. console.log('选择完成 - 国家索引:', this.selectedCountryIndex, '中心索引:', this.selectedCenterIndex)
  260. if (this.countryList[this.selectedCountryIndex]) {
  261. console.log('选中国家:', this.countryList[this.selectedCountryIndex].name)
  262. }
  263. if (this.centerList[this.selectedCenterIndex]) {
  264. console.log('选中中心:', this.centerList[this.selectedCenterIndex].name)
  265. }
  266. },
  267. // 获取显示文本
  268. getDisplayText() {
  269. if (this.selectedCountryIndex >= 0 && this.selectedCenterIndex >= 0) {
  270. const country = this.countryList[this.selectedCountryIndex]
  271. const center = this.centerList[this.selectedCenterIndex]
  272. if (country && center) {
  273. const centerName = center.displayName || center.name
  274. return `${country.name} - ${centerName}`
  275. }
  276. }
  277. return '请选择国家和中心'
  278. },
  279. // 日期选择变化
  280. handleDateChange(e) {
  281. this.effectiveDate = e.detail.value
  282. console.log('选择的生效日期:', this.effectiveDate)
  283. },
  284. // 格式化日期为 YYYYMMDD 格式(用于显示)
  285. formatDate(dateStr) {
  286. if (!dateStr) return ''
  287. // 将 2026-01-21 转换为 20260121
  288. return dateStr.replace(/-/g, '')
  289. },
  290. // 格式化日期为 YYYY-MM-DD HH:mm:ss 格式(用于提交)
  291. formatDateTimeForSubmit(dateStr) {
  292. if (!dateStr) return ''
  293. // 将 2026-01-21 转换为 2026-01-21 00:00:00
  294. return `${dateStr} 00:00:00`
  295. },
  296. // 获取文件夹ID(folder参数的逻辑)
  297. getFolderId() {
  298. const selectedCountry = this.countryList[this.selectedCountryIndex]
  299. const selectedCenter = this.centerList[this.selectedCenterIndex]
  300. // 如果选择了中心(且不是NA),使用中心ID
  301. if (selectedCenter && selectedCenter.id !== 'NA') {
  302. return selectedCenter.id
  303. }
  304. // 如果选择了国家(且不是NA),使用国家ID
  305. if (selectedCountry && selectedCountry.id !== 'NA') {
  306. return selectedCountry.id
  307. }
  308. // 否则使用0
  309. return 0
  310. },
  311. // 获取完整名称(用于提交)
  312. // 格式:{项目编号}-{国家名/NA}-{中心号/NA}-[具体文档名]-[生效日期]
  313. getFullNameForSubmit() {
  314. const projectCode = this.projectCode || 'NA'
  315. const country = this.countryList[this.selectedCountryIndex]
  316. const countryName = country && country.id !== 'NA' ? country.name : 'NA'
  317. const center = this.centerList[this.selectedCenterIndex]
  318. const centerId = center && center.id !== 'NA' ? center.id : 'NA'
  319. const docName = this.documentName.trim() || '[请输入具体文档名]'
  320. const date = this.formatDate(this.effectiveDate) || '[请输入生效日期]'
  321. return `${projectCode}-${countryName}-${centerId}-${docName}-${date}`
  322. },
  323. // 获取显示名称(用于前端显示,NA时隐藏)
  324. // 格式:{项目编号}-[国家名(如果不是NA)]-[中心号(如果不是NA)]-[具体文档名]-[生效日期]
  325. getFinalName() {
  326. const projectCode = this.projectCode || 'NA'
  327. const country = this.countryList[this.selectedCountryIndex]
  328. const countryName = country && country.id !== 'NA' ? country.name : ''
  329. const center = this.centerList[this.selectedCenterIndex]
  330. const centerId = center && center.id !== 'NA' ? center.id : ''
  331. const docName = this.documentName.trim() || '[请输入具体文档名]'
  332. const date = this.formatDate(this.effectiveDate) || '[请输入生效日期]'
  333. // 构建名称数组,过滤掉空值
  334. const nameParts = [projectCode, countryName, centerId, docName, date].filter(part => part !== '')
  335. return nameParts.join('-')
  336. },
  337. // 获取所有不属于任何国家的中心
  338. getIndependentCenters() {
  339. // 收集所有国家下的中心ID
  340. const centerIdsInCountries = new Set()
  341. this.allFolders.forEach(folder => {
  342. if (folder.type === 1 && folder.children) { // 国家类型
  343. this.collectAllCenterIds(folder.children, centerIdsInCountries)
  344. }
  345. })
  346. // 找出所有不在国家下的中心(直接在根目录下的中心)
  347. const independentCenters = this.allFolders.filter(folder => {
  348. return folder.type === 2 && !centerIdsInCountries.has(folder.id)
  349. })
  350. // 递归获取这些独立中心及其子中心
  351. const allIndependentCenters = this.getAllCentersRecursive(independentCenters)
  352. // 在列表开头添加 NA 选项
  353. return [
  354. { id: 'NA', name: 'NA', type: 2, displayName: 'NA' },
  355. ...allIndependentCenters
  356. ]
  357. },
  358. // 收集所有中心ID(递归)
  359. collectAllCenterIds(nodes, centerIds) {
  360. nodes.forEach(node => {
  361. if (node.type === 2) {
  362. centerIds.add(node.id)
  363. }
  364. if (node.children && node.children.length > 0) {
  365. this.collectAllCenterIds(node.children, centerIds)
  366. }
  367. })
  368. },
  369. // 中心选择变化(保留以防需要)
  370. handleCenterChange(e) {
  371. const index = parseInt(e.detail.value)
  372. this.selectedCenterIndex = index
  373. if (index >= 0 && this.centerList[index]) {
  374. console.log('选中中心:', this.centerList[index].name)
  375. }
  376. },
  377. // 提交
  378. async handleSubmit() {
  379. if (this.selectedCountryIndex < 0) {
  380. uni.showToast({
  381. title: '请选择国家',
  382. icon: 'none'
  383. })
  384. return
  385. }
  386. if (this.selectedCenterIndex < 0) {
  387. uni.showToast({
  388. title: '请选择中心',
  389. icon: 'none'
  390. })
  391. return
  392. }
  393. if (!this.documentName.trim()) {
  394. uni.showToast({
  395. title: '请输入具体文档名',
  396. icon: 'none'
  397. })
  398. return
  399. }
  400. if (!this.effectiveDate) {
  401. uni.showToast({
  402. title: '请输入生效日期',
  403. icon: 'none'
  404. })
  405. return
  406. }
  407. const selectedCountry = this.countryList[this.selectedCountryIndex]
  408. const selectedCenter = this.centerList[this.selectedCenterIndex]
  409. // 从全局数据中获取扫描的fileBase64List
  410. const fileBase64List = getApp().globalData.scannedFileBase64List
  411. if (!fileBase64List || fileBase64List.length === 0) {
  412. uni.showToast({
  413. title: '未找到扫描文件',
  414. icon: 'none'
  415. })
  416. return
  417. }
  418. try {
  419. uni.showLoading({
  420. title: '提交中...',
  421. mask: true
  422. })
  423. // 构建请求参数
  424. const fullName = this.getFullNameForSubmit() // 完整名称用于提交
  425. const folderId = this.getFolderId()
  426. const params = {
  427. projectId: this.projectId,
  428. folder: folderId,
  429. specificName: this.documentName.trim(),
  430. name: fullName,
  431. effectiveDate: this.formatDateTimeForSubmit(this.effectiveDate),
  432. files: fileBase64List
  433. }
  434. console.log('========== 提交参数 ==========')
  435. console.log('params:', params)
  436. // 调用上传接口
  437. const response = await uploadScanFile(params)
  438. console.log('========== 上传响应 ==========')
  439. console.log('response:', response)
  440. uni.hideLoading()
  441. if (response.code === 200) {
  442. uni.showToast({
  443. title: '提交成功',
  444. icon: 'success',
  445. duration: 2000
  446. })
  447. // 清空全局数据
  448. getApp().globalData.scannedFileBase64List = []
  449. // 延迟返回首页
  450. setTimeout(() => {
  451. uni.reLaunch({
  452. url: '/pages/home/index'
  453. })
  454. }, 2000)
  455. } else {
  456. throw new Error(response.msg || '提交失败')
  457. }
  458. } catch (error) {
  459. uni.hideLoading()
  460. console.error('========== 提交失败 ==========')
  461. console.error('错误信息:', error)
  462. uni.showToast({
  463. title: error.message || '提交失败',
  464. icon: 'none'
  465. })
  466. }
  467. },
  468. // 确认选择(保留旧方法以防其他地方调用)
  469. handleConfirm() {
  470. this.handleSubmit()
  471. }
  472. }
  473. }
  474. </script>
  475. <style lang="scss" scoped>
  476. .folder-select-page {
  477. width: 100%;
  478. height: 100vh;
  479. display: flex;
  480. flex-direction: column;
  481. background-color: #f5f5f5;
  482. // 顶部导航栏
  483. .header-bg {
  484. background: linear-gradient(180deg, #1ec9c9 0%, #1eb8b8 100%);
  485. position: relative;
  486. z-index: 100;
  487. .header-content {
  488. height: 88rpx;
  489. display: flex;
  490. align-items: center;
  491. justify-content: space-between;
  492. padding: 0 24rpx;
  493. .back-btn {
  494. width: 60rpx;
  495. height: 60rpx;
  496. display: flex;
  497. align-items: center;
  498. justify-content: flex-start;
  499. .back-icon {
  500. font-size: 56rpx;
  501. color: #ffffff;
  502. font-weight: 300;
  503. }
  504. }
  505. .header-title {
  506. flex: 1;
  507. text-align: center;
  508. font-size: 32rpx;
  509. font-weight: 600;
  510. color: #ffffff;
  511. }
  512. .placeholder {
  513. width: 60rpx;
  514. }
  515. }
  516. }
  517. // 项目信息栏
  518. .project-info-bar {
  519. padding: 24rpx;
  520. background: #ffffff;
  521. display: flex;
  522. align-items: center;
  523. border-bottom: 1rpx solid #f5f5f5;
  524. .project-label {
  525. font-size: 28rpx;
  526. color: #666666;
  527. margin-right: 8rpx;
  528. }
  529. .project-name {
  530. font-size: 28rpx;
  531. font-weight: 600;
  532. color: #1ec9c9;
  533. }
  534. }
  535. // 表单容器
  536. .form-container {
  537. flex: 1;
  538. overflow-y: auto;
  539. }
  540. .form-content {
  541. padding: 32rpx;
  542. }
  543. .form-item {
  544. margin-bottom: 32rpx;
  545. &.highlight-item {
  546. .form-label {
  547. font-size: 32rpx;
  548. color: #1ec9c9;
  549. &.required::after {
  550. content: ' *';
  551. color: #ff4444;
  552. }
  553. }
  554. }
  555. .form-label {
  556. font-size: 28rpx;
  557. color: #333333;
  558. font-weight: 600;
  559. margin-bottom: 16rpx;
  560. }
  561. .date-picker-wrapper {
  562. margin-top: 16rpx;
  563. }
  564. .final-name-preview {
  565. margin-top: 16rpx;
  566. padding: 20rpx 24rpx;
  567. background: #f5f5f5;
  568. border-radius: 12rpx;
  569. border: 2rpx dashed #cccccc;
  570. .preview-label {
  571. font-size: 24rpx;
  572. color: #666666;
  573. display: block;
  574. margin-bottom: 8rpx;
  575. }
  576. .preview-text {
  577. font-size: 26rpx;
  578. color: #333333;
  579. font-weight: 500;
  580. word-break: break-all;
  581. }
  582. }
  583. .input-wrapper {
  584. background: #ffffff;
  585. border: 2rpx solid #e0e0e0;
  586. border-radius: 12rpx;
  587. padding: 24rpx;
  588. transition: all 0.3s;
  589. &.highlight {
  590. border: 3rpx solid #1ec9c9;
  591. background: linear-gradient(135deg, #f0fffe 0%, #ffffff 100%);
  592. box-shadow: 0 4rpx 12rpx rgba(30, 201, 201, 0.15);
  593. padding: 28rpx;
  594. }
  595. &:focus-within {
  596. border-color: #1ec9c9;
  597. box-shadow: 0 0 0 4rpx rgba(30, 201, 201, 0.1);
  598. }
  599. .input-field {
  600. width: 100%;
  601. font-size: 28rpx;
  602. color: #333333;
  603. &::placeholder {
  604. color: #999999;
  605. }
  606. }
  607. }
  608. .picker-display {
  609. background: #ffffff;
  610. border: 2rpx solid #e0e0e0;
  611. border-radius: 12rpx;
  612. padding: 24rpx;
  613. display: flex;
  614. align-items: center;
  615. justify-content: space-between;
  616. transition: all 0.3s;
  617. &.disabled {
  618. background: #f5f5f5;
  619. opacity: 0.6;
  620. }
  621. .picker-text {
  622. flex: 1;
  623. font-size: 28rpx;
  624. color: #333333;
  625. &.placeholder {
  626. color: #999999;
  627. }
  628. }
  629. .picker-arrow {
  630. font-size: 40rpx;
  631. color: #999999;
  632. font-weight: 300;
  633. margin-left: 16rpx;
  634. }
  635. }
  636. }
  637. .confirm-btn {
  638. width: 100%;
  639. height: 88rpx;
  640. background: linear-gradient(135deg, #1ec9c9 0%, #1eb8b8 100%);
  641. color: #ffffff;
  642. font-size: 32rpx;
  643. font-weight: 600;
  644. border-radius: 16rpx;
  645. border: none;
  646. margin-top: 32rpx;
  647. transition: all 0.3s;
  648. box-shadow: 0 6rpx 20rpx rgba(30, 201, 201, 0.3);
  649. &:disabled {
  650. background: #cccccc;
  651. box-shadow: none;
  652. opacity: 0.6;
  653. }
  654. &:active:not(:disabled) {
  655. opacity: 0.9;
  656. transform: scale(0.98);
  657. }
  658. &::after {
  659. border: none;
  660. }
  661. }
  662. // 调试信息
  663. .debug-section {
  664. margin-top: 48rpx;
  665. padding: 24rpx;
  666. background: #fff3cd;
  667. border-radius: 12rpx;
  668. border: 1rpx solid #ffc107;
  669. .debug-title {
  670. font-size: 28rpx;
  671. font-weight: 600;
  672. color: #856404;
  673. margin-bottom: 12rpx;
  674. }
  675. .debug-item {
  676. font-size: 24rpx;
  677. color: #856404;
  678. line-height: 1.8;
  679. }
  680. }
  681. // 原始数据
  682. .raw-data-section {
  683. margin-top: 32rpx;
  684. .raw-data-title {
  685. font-size: 28rpx;
  686. font-weight: 600;
  687. color: #666666;
  688. padding: 16rpx;
  689. background: #f5f5f5;
  690. border-radius: 8rpx;
  691. cursor: pointer;
  692. &:active {
  693. background: #e0e0e0;
  694. }
  695. }
  696. .json-display {
  697. margin-top: 16rpx;
  698. background: #f5f5f5;
  699. padding: 24rpx;
  700. border-radius: 8rpx;
  701. font-size: 22rpx;
  702. color: #333333;
  703. font-family: 'Courier New', monospace;
  704. line-height: 1.6;
  705. word-break: break-all;
  706. white-space: pre-wrap;
  707. }
  708. }
  709. .loading-tip {
  710. padding: 200rpx 0;
  711. text-align: center;
  712. .loading-text {
  713. font-size: 28rpx;
  714. color: #999999;
  715. }
  716. }
  717. }
  718. </style>