taskDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. <template>
  2. <view class="container">
  3. <view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
  4. <view class="top">
  5. <image class="return" @click="goBack" src="/static/image/back_white.png"></image>
  6. <text>任务详情</text>
  7. </view>
  8. <scroll-view class="content" scroll-y>
  9. <!-- 任务卡片 -->
  10. <view class="task-card">
  11. <view class="card-header">
  12. <view class="card-title">{{ taskData.title }}</view>
  13. </view>
  14. <view class="card-meta">
  15. <view class="meta-tag">{{ taskData.tag }}</view>
  16. <view class="meta-id">ID:{{ taskData.id }}</view>
  17. </view>
  18. </view>
  19. <!-- 任务信息 -->
  20. <view class="info-section">
  21. <view class="section-header">
  22. <view class="section-indicator"></view>
  23. <text class="section-title">任务信息</text>
  24. </view>
  25. <view class="info-list">
  26. <view class="info-item">
  27. <text class="info-label">费用分摊:</text>
  28. <text class="info-value">{{ taskInfo.costSharing }}</text>
  29. </view>
  30. <view class="info-item">
  31. <text class="info-label">归属项目:</text>
  32. <text class="info-value">{{ taskInfo.belongProject }}</text>
  33. </view>
  34. <view class="info-item">
  35. <text class="info-label">归属部门:</text>
  36. <text class="info-value">{{ taskInfo.belongDept }}</text>
  37. </view>
  38. <view class="info-item">
  39. <text class="info-label">归属产品:</text>
  40. <text class="info-value">{{ taskInfo.belongProduct }}</text>
  41. </view>
  42. <view class="info-item">
  43. <text class="info-label">申请补充直播任务:</text>
  44. <text class="info-value">{{ taskInfo.applySupplementLive }}</text>
  45. </view>
  46. <view class="info-item">
  47. <text class="info-label">补充任务直播间ID:</text>
  48. <text class="info-value">{{ taskInfo.supplementRoomId }}</text>
  49. </view>
  50. <view class="info-item">
  51. <text class="info-label">申请补充任务原因:</text>
  52. <text class="info-value">{{ taskInfo.supplementReason }}</text>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 内容信息 -->
  57. <view class="info-section">
  58. <view class="section-header">
  59. <view class="section-indicator"></view>
  60. <text class="section-title">内容信息</text>
  61. </view>
  62. <view class="info-list">
  63. <view class="info-item">
  64. <text class="info-label">交付物名称:</text>
  65. <text class="info-value">{{ contentInfo.deliverableName }}</text>
  66. </view>
  67. <view class="info-item">
  68. <text class="info-label">交付物ID:</text>
  69. <text class="info-value">{{ contentInfo.deliverableId }}</text>
  70. </view>
  71. <view class="info-item">
  72. <text class="info-label">直播间地址:</text>
  73. <text class="info-value">{{ contentInfo.liveRoomUrl }}</text>
  74. <text class="copy-btn" @click="copyToClipboard(contentInfo.liveRoomUrl)">复制</text>
  75. </view>
  76. <view class="info-item">
  77. <text class="info-label">推流地址:</text>
  78. <text class="info-value">{{ contentInfo.pushUrl }}</text>
  79. <text class="copy-btn" @click="copyToClipboard(contentInfo.pushUrl)">复制</text>
  80. </view>
  81. <view class="info-item">
  82. <text class="info-label">开播地址:</text>
  83. <text class="info-value">{{ contentInfo.startUrl }}</text>
  84. <text class="copy-btn" @click="copyToClipboard(contentInfo.startUrl)">复制</text>
  85. </view>
  86. <view class="info-item">
  87. <text class="info-label">直播回放:</text>
  88. <text class="info-value">{{ contentInfo.liveReplay }}</text>
  89. </view>
  90. <view class="info-item">
  91. <text class="info-label">播放视频:</text>
  92. <text class="info-value">{{ contentInfo.playVideo }}</text>
  93. </view>
  94. <view class="info-item">
  95. <text class="info-label">下载视频:</text>
  96. <text class="info-value">{{ contentInfo.downloadVideo }}</text>
  97. </view>
  98. <view class="info-item">
  99. <text class="info-label">观众人数:</text>
  100. <text class="info-value">{{ contentInfo.viewerCount }}</text>
  101. </view>
  102. <view class="info-item">
  103. <text class="info-label">有效观看:</text>
  104. <text class="info-value">{{ contentInfo.validView }}</text>
  105. </view>
  106. <view class="info-item">
  107. <text class="info-label">情况说明:</text>
  108. <text class="info-value">{{ contentInfo.description }}</text>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 客户信息 -->
  113. <view class="info-section">
  114. <view class="section-header">
  115. <view class="section-indicator"></view>
  116. <text class="section-title">客户信息</text>
  117. </view>
  118. <view class="client-list">
  119. <view class="client-item" v-for="(item, index) in clientList" :key="index">
  120. <view class="client-info">
  121. <image class="avatar" src="/static/image/my_heads_icon.png"></image>
  122. <view class="client-txt">
  123. <view class="client-name">
  124. {{ item.name }}
  125. <text class="client-level">{{ item.level }}</text>
  126. </view>
  127. <view class="client-hospital">
  128. <text>{{ item.hospital }} </text>
  129. <view class="line"></view>
  130. <text>{{ item.department }}</text>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="client-stats">
  135. <view class="stat-item"><text class="num">{{ item.taskCount }} </text>任务</view>
  136. <view class="stat-item"><text class="num">{{ item.points }} </text>积分</view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 补充材料 -->
  142. <view class="info-section">
  143. <view class="section-header">
  144. <view class="section-indicator"></view>
  145. <text class="section-title">补充材料</text>
  146. </view>
  147. <view class="info-list">
  148. <view class="info-item">
  149. <text class="info-label">交付物名称:</text>
  150. <text class="info-value">{{ supplementMaterial.deliverableName }}</text>
  151. </view>
  152. <view class="info-item">
  153. <text class="info-label">情况说明:</text>
  154. <text class="info-value">{{ supplementMaterial.description }}</text>
  155. </view>
  156. <view class="info-item column">
  157. <text class="info-label">附件:</text>
  158. <view class="attachment-item">
  159. <view class="left">
  160. <image class="img" src="/static/image/icon_attachment.png"></image>
  161. <view class="txt-item">
  162. <view class="attachment-name">{{ supplementMaterial.attachment.name }}</view>
  163. <view class="attachment-size">{{ supplementMaterial.attachment.size }}</view>
  164. </view>
  165. </view>
  166. <image class="download-btn" @click="downloadAttachment"
  167. src="/static/image/icon_downlad.png"></image>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 审批信息 -->
  173. <view class="info-section">
  174. <view class="section-header">
  175. <view class="section-indicator"></view>
  176. <text class="section-title">审批信息</text>
  177. </view>
  178. <view class="approval-list">
  179. <view class="approval-item" v-for="(item, index) in approvalInfo" :key="index">
  180. <view class="left">
  181. <view class="avatar-box">
  182. <image class="avatar" src="/static/image/my_heads_icon.png"></image>
  183. <image class="icon" src="/static/image/icon_wait.png"></image>
  184. <!-- <image class="icon" src="/static/image/icon_pass.png"></image>
  185. <image class="icon" src="/static/image/icon_refuse.png"></image> -->
  186. </view>
  187. <view class="approval-user">
  188. <view class="user-name">{{ item.name }}</view>
  189. <view class="user-status" :style="{ color: item.statusColor }">{{ item.status }}</view>
  190. </view>
  191. </view>
  192. <text class="approval-time">{{ item.time }}</text>
  193. <view class="approval-line" v-if="index < approvalInfo.length - 1"></view>
  194. </view>
  195. </view>
  196. <view class="reason">
  197. 费用分摊部门填写错误,应该是学术研究事业部,请修改后重新提交。
  198. </view>
  199. </view>
  200. </scroll-view>
  201. </view>
  202. </template>
  203. <script>
  204. export default {
  205. data() {
  206. return {
  207. // 仅获取微信小程序状态栏高度,无多余逻辑
  208. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  209. taskId: '',
  210. // 任务基础信息
  211. taskData: {
  212. title: '王小明医师学术讲座',
  213. tag: '学术讲座',
  214. id: 'CRW0000001022345'
  215. },
  216. // 任务信息
  217. taskInfo: {
  218. costSharing: '湖北省药学服务公司',
  219. belongProject: '项目名称',
  220. belongDept: '中药事业部',
  221. belongProduct: '201',
  222. applySupplementLive: '否',
  223. supplementRoomId: '-',
  224. supplementReason: '-'
  225. },
  226. // 内容信息
  227. contentInfo: {
  228. deliverableName: '直播',
  229. deliverableId: '-',
  230. liveRoomUrl: 'http://www.zhibotest123333...',
  231. pushUrl: 'http://www.zhibotest123123...',
  232. startUrl: 'http://www.zhibotest123123...',
  233. liveReplay: '-',
  234. playVideo: '-',
  235. downloadVideo: '-',
  236. viewerCount: '203',
  237. validView: '198',
  238. description: '这是一段说明,这是一段说明,一行展示不完就换行展示。'
  239. },
  240. // 客户信息列表
  241. clientList: [{
  242. name: '王小明',
  243. level: '一级',
  244. hospital: '湖南省人民医院',
  245. department: '口腔科',
  246. taskCount: '1',
  247. points: '30'
  248. },
  249. {
  250. name: '王小明',
  251. level: '一级',
  252. hospital: '湖南省人民医院',
  253. department: '口腔科',
  254. taskCount: '1',
  255. points: '30'
  256. }
  257. ],
  258. // 补充材料
  259. supplementMaterial: {
  260. deliverableName: '-',
  261. description: '-',
  262. attachment: {
  263. name: '文件名称文件名称.pdf',
  264. size: '128kb'
  265. }
  266. },
  267. // 审批信息
  268. approvalInfo: [{
  269. name: '王彬彬',
  270. status: '发起申请',
  271. statusColor: '#4CAF50',
  272. time: '2025-03-04 18:00'
  273. },
  274. {
  275. name: '王小明',
  276. status: '待审核',
  277. statusColor: '#FF9800',
  278. time: ''
  279. }
  280. ]
  281. }
  282. },
  283. onLoad(options) {
  284. if (options.id) {
  285. this.taskId = options.id
  286. this.loadData()
  287. }
  288. },
  289. methods: {
  290. goBack() {
  291. uni.navigateBack()
  292. },
  293. async loadData() {
  294. try {
  295. uni.showLoading({
  296. title: '加载中...'
  297. })
  298. // 实际项目中替换为接口请求:const res = await getTaskDetail({ id: this.taskId })
  299. // 这里模拟接口赋值
  300. uni.hideLoading()
  301. } catch (e) {
  302. uni.hideLoading()
  303. console.error('加载数据失败', e)
  304. }
  305. },
  306. // 复制到剪贴板
  307. copyToClipboard(text) {
  308. uni.setClipboardData({
  309. data: text,
  310. success() {
  311. uni.showToast({
  312. title: '复制成功',
  313. icon: 'success'
  314. })
  315. }
  316. })
  317. },
  318. // 下载附件
  319. downloadAttachment() {
  320. uni.showToast({
  321. title: '开始下载附件',
  322. icon: 'none'
  323. })
  324. // 实际项目中添加下载逻辑:uni.downloadFile + uni.saveFile
  325. }
  326. }
  327. }
  328. </script>
  329. <style lang="scss" scoped>
  330. .container {
  331. min-height: 100vh;
  332. background: #f5f5f5;
  333. display: flex;
  334. flex-direction: column;
  335. height: auto;
  336. &::before {
  337. content: '';
  338. position: absolute;
  339. top: 0;
  340. left: 0;
  341. right: 0;
  342. width: 100%;
  343. height: 532rpx;
  344. background: linear-gradient(180deg, rgba(56, 139, 255, 0.79) 0%, rgba(56, 139, 255, 0) 100%);
  345. }
  346. }
  347. .top {
  348. display: flex;
  349. justify-content: center;
  350. align-items: center;
  351. height: 88rpx;
  352. position: relative;
  353. font-weight: 600;
  354. font-size: 36rpx;
  355. color: #FFFFFF;
  356. .return {
  357. position: absolute;
  358. left: 32rpx;
  359. width: 40rpx;
  360. height: 40rpx;
  361. }
  362. }
  363. .content {
  364. flex: 1;
  365. padding: 24rpx;
  366. box-sizing: border-box;
  367. }
  368. /* 任务卡片样式 */
  369. .task-card {
  370. background: #fff;
  371. border-radius: 16rpx;
  372. padding: 24rpx;
  373. margin-bottom: 24rpx;
  374. .card-header {
  375. .card-title {
  376. font-weight: 500;
  377. font-size: 36rpx;
  378. color: #333333;
  379. margin-bottom: 24rpx;
  380. }
  381. }
  382. .card-meta {
  383. display: flex;
  384. align-items: center;
  385. gap: 16rpx;
  386. font-size: 24rpx;
  387. color: #666;
  388. .meta-tag {
  389. border-radius: 8rpx 8rpx 8rpx 8rpx;
  390. border: 2rpx solid rgba(56, 139, 255, 0.4);
  391. padding: 4rpx 8rpx;
  392. color: #388BFF;
  393. }
  394. }
  395. }
  396. /* 通用信息区块样式 */
  397. .info-section {
  398. background: #fff;
  399. border-radius: 16rpx;
  400. padding: 24rpx;
  401. margin-bottom: 24rpx;
  402. .section-header {
  403. display: flex;
  404. align-items: center;
  405. margin-bottom: 24rpx;
  406. .section-indicator {
  407. width: 6rpx;
  408. height: 32rpx;
  409. background: #388BFF;
  410. border-radius: 3rpx;
  411. margin-right: 16rpx;
  412. }
  413. .section-title {
  414. font-weight: 600;
  415. font-size: 32rpx;
  416. color: #333333;
  417. }
  418. }
  419. .info-list {
  420. .info-item {
  421. display: flex;
  422. margin-bottom: 24rpx;
  423. &:last-child {
  424. margin-bottom: 0;
  425. }
  426. .info-label {
  427. width: 50%;
  428. font-size: 28rpx;
  429. color: #666;
  430. flex-shrink: 0;
  431. }
  432. .info-value {
  433. flex: 1;
  434. text-align: end;
  435. font-size: 28rpx;
  436. color: #333;
  437. }
  438. .copy-btn {
  439. margin-left: 16rpx;
  440. color: #2196F3;
  441. font-size: 24rpx;
  442. cursor: pointer;
  443. }
  444. .column {
  445. flex-direction: column;
  446. }
  447. .attachment-item {
  448. margin-top: 24rpx;
  449. display: flex;
  450. justify-content: space-between;
  451. align-items: center;
  452. gap: 16rpx;
  453. background: #F7F8FA;
  454. border-radius: 16rpx 16rpx 16rpx 16rpx;
  455. .left {
  456. display: flex;
  457. align-items: center;
  458. .img {
  459. width: 72rpx;
  460. height: 72rpx;
  461. margin-right: 24rpx;
  462. }
  463. .txt-item {
  464. .attachment-name {
  465. font-size: 28rpx;
  466. color: #333;
  467. }
  468. .attachment-size {
  469. font-size: 24rpx;
  470. color: #999;
  471. }
  472. }
  473. }
  474. .download-btn {
  475. width: 32rpx;
  476. height: 32rpx;
  477. }
  478. }
  479. }
  480. }
  481. }
  482. /* 客户信息样式 */
  483. .client-list {
  484. .client-item {
  485. display: flex;
  486. justify-content: space-between;
  487. align-items: center;
  488. padding: 16rpx 0;
  489. &:last-child {
  490. border-bottom: none;
  491. }
  492. .client-info {
  493. display: flex;
  494. align-items: center;
  495. .avatar {
  496. width: 88rpx;
  497. height: 88rpx;
  498. margin-right: 24rpx;
  499. }
  500. .client-txt {
  501. .client-name {
  502. font-size: 28rpx;
  503. font-weight: 500;
  504. color: #333;
  505. .client-level {
  506. margin-left: 8rpx;
  507. padding: 2rpx 8rpx;
  508. background: #FFF6E5;
  509. color: #C89743;
  510. font-size: 22rpx;
  511. border-radius: 8rpx;
  512. }
  513. }
  514. }
  515. .client-hospital {
  516. font-size: 24rpx;
  517. color: #666;
  518. margin-top: 4rpx;
  519. display: flex;
  520. align-items: center;
  521. .line {
  522. width: 2rpx;
  523. height: 28rpx;
  524. background: #EAEBEE;
  525. margin: 0 24rpx;
  526. }
  527. }
  528. }
  529. .client-stats {
  530. display: flex;
  531. gap: 24rpx;
  532. font-size: 24rpx;
  533. color: #999999;
  534. .stat-item {
  535. display: flex;
  536. flex-direction: column;
  537. align-items: center;
  538. .num {
  539. font-weight: 500;
  540. font-size: 28rpx;
  541. color: #333333;
  542. }
  543. }
  544. }
  545. }
  546. }
  547. /* 审批信息样式 */
  548. .approval-list {
  549. .approval-item {
  550. position: relative;
  551. padding-left: 24rpx;
  552. margin-bottom: 68rpx;
  553. display: flex;
  554. align-items: center;
  555. justify-content: space-between;
  556. &:last-child {
  557. margin-bottom: 0;
  558. }
  559. .left {
  560. display: flex;
  561. align-items: center;
  562. .avatar-box {
  563. width: 80rpx;
  564. height: 80rpx;
  565. margin-right: 32rpx;
  566. position: relative;
  567. .avatar {
  568. width: 100%;
  569. height: 100%;
  570. }
  571. .icon {
  572. position: absolute;
  573. bottom: 0;
  574. right: 0;
  575. width: 32rpx;
  576. height: 32rpx;
  577. }
  578. }
  579. .approval-user {
  580. gap: 12rpx;
  581. .user-name {
  582. font-weight: 500;
  583. font-size: 28rpx;
  584. color: #333;
  585. }
  586. .user-status {
  587. font-size: 24rpx;
  588. }
  589. }
  590. }
  591. .approval-time {
  592. font-size: 24rpx;
  593. color: #999;
  594. margin-top: 4rpx;
  595. }
  596. }
  597. .approval-line {
  598. position: absolute;
  599. left: 64rpx;
  600. bottom: -64rpx;
  601. width: 1rpx;
  602. height: 56rpx;
  603. background: #BFD8FF;
  604. }
  605. }
  606. .reason {
  607. font-size: 28rpx;
  608. color: #666666;
  609. line-height: 40rpx;
  610. margin-left: 136rpx;
  611. }
  612. </style>