taskDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <template>
  2. <view class="container">
  3. <!-- <image class="bg" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/images/bg_qestion.png" mode="widthFix"></image> -->
  4. <view class="bg"></view>
  5. <view class="fixed-top-box" :style="{background: bgColor }">
  6. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  7. <view class="back-box" @click="goBack">
  8. <image src="@/static/image/icon_back_w.png" mode=""></image>
  9. <text class="title">任务详情</text>
  10. <text></text>
  11. </view>
  12. </view>
  13. <scroll-view class="content" scroll-y>
  14. <!-- 任务卡片 -->
  15. <view class="task-card">
  16. <view class="card-header">
  17. <view class="card-title">{{ taskData.taskName || '-'}}</view>
  18. <view class="status-tag" :class="'tag'+taskData.finishAuditStatus">
  19. {{ taskData.finishAuditStatus==0?'待审核':taskData.finishAuditStatus==1?'已通过':taskData.finishAuditStatus==2?'已驳回':'未完成'}}
  20. </view>
  21. </view>
  22. <view class="card-tags">
  23. <view class="x-f">
  24. <view class="tag-item video-tag">
  25. <image v-if="taskData.taskType==4" class="w28 h28 mr10" src="@/static/image/icon_article.png" mode=""></image>
  26. <image v-else class="w28 h28 mr10" src="@/static/image/icon_longvideo.png" mode=""></image>
  27. <text>{{ taskData.taskType==4?'文章':taskData.taskType==5?'短视频':'长视频'}}</text>
  28. </view>
  29. <view class="tag-item category">学术</view>
  30. </view>
  31. <view class="tag-item points-tag">{{ taskData.taskIntegral || 0}}积分</view>
  32. <view class="tag-item">{{ taskData.taskUnit || 0 }}个</view>
  33. </view>
  34. <view class="card-dates">
  35. <view class="date-item">开始时间:{{ taskData.planStartTime || '-' }}</view>
  36. <view class="date-item">结束时间:{{ taskData.planEndTime || '-'}}</view>
  37. </view>
  38. <view class="card-rejection" v-if="taskData.finishAuditStatus == 2">
  39. <image class="w28 h28 mr8" src="@/static/image/icon_reject.png" mode=""></image>
  40. <text>驳回原因: {{ taskData.finishAuditRemark }}</text>
  41. </view>
  42. </view>
  43. <!-- 项目信息 -->
  44. <view class="info-section">
  45. <view class="section-header">
  46. <view class="section-indicator"></view>
  47. <text class="section-title">项目信息</text>
  48. </view>
  49. <view class="info-list">
  50. <view class="info-item">
  51. <text class="info-label">项目名称:</text>
  52. <text class="info-value">{{ taskData.projectName||'-' }}</text>
  53. </view>
  54. <view class="info-item">
  55. <text class="info-label">任务ID:</text>
  56. <text class="info-value">{{ projectData.taskId ||'-'}}</text>
  57. </view>
  58. <view class="info-item">
  59. <text class="info-label">交付物ID:</text>
  60. <text class="info-value">{{ projectData.deliveryNo||'-' }}</text>
  61. </view>
  62. <view class="info-item">
  63. <text class="info-label">观看人数:</text>
  64. <text class="info-value">{{ projectData.viewCount||0 }}</text>
  65. </view>
  66. <view class="info-item">
  67. <text class="info-label">有效观看:</text>
  68. <text class="info-value">{{ projectData.validViews||0 }}</text>
  69. </view>
  70. <view class="info-item">
  71. <text class="info-label">标题:</text>
  72. <text class="info-value">{{ projectData.title || '-'}}</text>
  73. </view>
  74. <view class="info-item">
  75. <text class="info-label">项目信息:</text>
  76. <text class="info-value">{{ projectData.content || '-' }}</text>
  77. </view>
  78. <view class="info-item">
  79. <text class="info-label">封面图:</text>
  80. <view class="cover-image">
  81. <image v-if="projectData.coverImage" :src="projectData.coverImage" mode="aspectFill"></image>
  82. <text v-else>-</text>
  83. </view>
  84. </view>
  85. <view class="info-item">
  86. <text class="info-label">情况说明:</text>
  87. <text class="info-value">{{ projectData.remark || '-' }}</text>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 申请人员信息 -->
  92. <view class="info-section">
  93. <view class="section-header">
  94. <view class="section-indicator"></view>
  95. <text class="section-title">申请人员信息</text>
  96. </view>
  97. <view class="info-list">
  98. <view class="info-item">
  99. <text class="info-label">申请人姓名:</text>
  100. <text class="info-value">{{ taskData.doctorName || '-' }}</text>
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 客户信息 -->
  105. <view class="info-section">
  106. <view class="section-header">
  107. <view class="section-indicator"></view>
  108. <text class="section-title">客户信息</text>
  109. </view>
  110. <view class="info-list">
  111. <view class="info-item">
  112. <text class="info-label">客户名称:</text>
  113. <text class="info-value">{{ clientData.doctorName || '-'}}</text>
  114. </view>
  115. <view class="info-item">
  116. <text class="info-label">客户ID:</text>
  117. <text class="info-value">{{ clientData.doctorId || '-'}}</text>
  118. </view>
  119. <view class="info-item">
  120. <text class="info-label">归属医院:</text>
  121. <text class="info-value">{{ clientData.institution || '-'}}</text>
  122. </view>
  123. <view class="info-item">
  124. <text class="info-label">归属科室:</text>
  125. <text class="info-value">{{ clientData.department || '-' }}</text>
  126. </view>
  127. </view>
  128. </view>
  129. </scroll-view>
  130. <!-- 底部按钮 -->
  131. <view class="submit-box" v-if="taskData.finishAuditStatus == 3||taskData.finishAuditStatus == 2">
  132. <view class="submit-btn" @click="goComplete">去完成</view>
  133. </view>
  134. </view>
  135. </template>
  136. <script>
  137. import { getTaskDetail } from '@/api/airClassroom'
  138. export default {
  139. data() {
  140. return {
  141. top:0,
  142. statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
  143. taskId: '',
  144. taskData: {
  145. },
  146. projectData: {
  147. // projectName: '王小明医学术视频任务',
  148. // taskId: 'CRW234443000221',
  149. // deliverableId: 'JF123456',
  150. // viewers: '688',
  151. // validViews: '680',
  152. // title: '康复医学概论',
  153. // projectInfo: '-',
  154. // coverImage: '',
  155. // description: '-'
  156. },
  157. applicantData: {
  158. // name: '张菲菲'
  159. },
  160. clientData: {
  161. // name: '王小明',
  162. // clientId: 'C00000001231445',
  163. // hospital: '江南大学附属医院',
  164. // department: '消化内科'
  165. }
  166. }
  167. },
  168. onLoad(options) {
  169. if (options.id) {
  170. this.taskId = options.id
  171. this.loadData()
  172. }
  173. },
  174. onPageScroll(e) {
  175. //console.log(e)
  176. this.top = e.scrollTop;
  177. },
  178. computed: {
  179. // 计算属性的 getter
  180. bgColor: function() {
  181. var top = this.top / 30;
  182. return 'rgba(56, 139, 255,' + top + ')';
  183. },
  184. },
  185. methods: {
  186. goBack() {
  187. uni.navigateBack()
  188. },
  189. goComplete() {
  190. uni.navigateTo({
  191. url: `/pages_task/completeTask?id=${this.taskId}&taskType=${this.taskData.taskType}`
  192. })
  193. },
  194. async loadData() {
  195. try {
  196. uni.showLoading({ title: '加载中...' })
  197. const res = await getTaskDetail(this.taskId)
  198. uni.hideLoading()
  199. if (res.code === 200 && res.data) {
  200. this.taskData = { ...this.taskData, ...res.data }
  201. this.projectData = { ...this.projectData, ...res.data.taskDelivery }
  202. this.applicantData = { ...this.applicantData, ...res.data.applicant }
  203. this.clientData = { ...this.clientData, ...res.data.doctorVO }
  204. }
  205. } catch (e) {
  206. uni.hideLoading()
  207. console.error('加载数据失败', e)
  208. }
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="scss" scoped>
  214. .container {
  215. min-height: 100vh;
  216. background: #f5f5f5;
  217. display: flex;
  218. flex-direction: column;
  219. }
  220. .status-bar {
  221. width: 100%;
  222. background: #fff;
  223. }
  224. .bg{
  225. position: absolute;
  226. top: 0;
  227. left: 0;
  228. width: 100%;
  229. height: 532rpx;
  230. background: linear-gradient( 180deg, rgba(56,139,255,0.79) 0%, rgba(56,139,255,0) 100%);
  231. }
  232. .fixed-top-box{
  233. width: 100%;
  234. // background: linear-gradient(135deg, #66b2ef 0%, #0bb3f2 100%);
  235. position: fixed;
  236. top: 0;
  237. left: 0;
  238. z-index: 1000;
  239. .back-box{
  240. height: 88upx;
  241. padding-left: 22upx;
  242. display: flex;
  243. align-items: center;
  244. justify-content: space-between;
  245. padding: 0 24upx;
  246. image{
  247. width: 48rpx;
  248. height: 48rpx;
  249. }
  250. .title{
  251. font-family: PingFang SC, PingFang SC;
  252. font-weight: 600;
  253. font-size: 36rpx;
  254. color: #fff;
  255. }
  256. }
  257. }
  258. .header {
  259. position: relative;
  260. height: 88rpx;
  261. display: flex;
  262. align-items: center;
  263. justify-content: center;
  264. background: #fff;
  265. border-bottom: 1rpx solid #f0f0f0;
  266. .back-btn {
  267. position: absolute;
  268. left: 24rpx;
  269. width: 40rpx;
  270. height: 40rpx;
  271. image {
  272. width: 100%;
  273. height: 100%;
  274. }
  275. }
  276. .title {
  277. font-size: 36rpx;
  278. font-weight: bold;
  279. color: #333;
  280. }
  281. .header-right {
  282. position: absolute;
  283. right: 24rpx;
  284. display: flex;
  285. align-items: center;
  286. gap: 16rpx;
  287. .more-icon {
  288. font-size: 32rpx;
  289. color: #333;
  290. }
  291. }
  292. }
  293. .content {
  294. margin-top:168rpx;
  295. flex: 1;
  296. padding: 24rpx;
  297. box-sizing: border-box;
  298. padding-bottom: 120rpx;
  299. }
  300. .task-card {
  301. background: #fff;
  302. border-radius: 16rpx;
  303. padding: 24rpx;
  304. margin-bottom: 24rpx;
  305. .card-header {
  306. display: flex;
  307. align-items: flex-start;
  308. justify-content: space-between;
  309. margin-bottom: 16rpx;
  310. .card-title {
  311. flex: 1;
  312. font-size: 32rpx;
  313. font-weight: bold;
  314. color: #333;
  315. }
  316. .status-tag {
  317. padding: 8rpx 16rpx;
  318. border-radius: 20rpx;
  319. font-size: 24rpx;
  320. &.tag0 {
  321. // 待审核
  322. background: #FFF3E0;
  323. color: #FF9800;
  324. }
  325. &.tag1 {
  326. // 已通过
  327. background: #E8F5E9;
  328. color: #4CAF50;
  329. }
  330. &.tag2 {
  331. // 已驳回
  332. background: #FFF4F5;
  333. color: #CF3546;
  334. }
  335. &.tag3 {
  336. // 未完成
  337. background: #EBF5FF;
  338. color: #388BFF;
  339. }
  340. }
  341. }
  342. .card-tags {
  343. display: flex;
  344. align-items: center;
  345. flex-wrap: wrap;
  346. gap: 12rpx;
  347. margin-bottom: 16rpx;
  348. .tag-item {
  349. padding: 8rpx 16rpx;
  350. // background: #f5f5f5;
  351. border-radius: 8rpx;
  352. font-size: 24rpx;
  353. color: #999999;
  354. border-radius: 8rpx 8rpx 8rpx 8rpx;
  355. border: 2rpx solid #F5F5F5;
  356. &.category{
  357. border-radius: 0rpx 8rpx 8rpx 0rpx;
  358. border: 2rpx solid #F3D191;
  359. background: #FFFAF4;
  360. color:#5D410F
  361. }
  362. &.video-tag {
  363. background: linear-gradient( 90deg, #FFE9C7 0%, #F3D091 100%);
  364. border-radius:8rpx 0rpx 0rpx 8rpx;
  365. border: 2rpx solid #F3D191;
  366. font-family: PingFang SC, PingFang SC;
  367. font-weight: 400;
  368. font-size: 24rpx;
  369. color: #5D410F;
  370. display: flex;
  371. align-items: center;
  372. .tag-icon {
  373. margin-right: 4rpx;
  374. }
  375. }
  376. &.points-tag {
  377. border: 1rpx solid #388BFF;
  378. color: #388BFF;
  379. background: transparent;
  380. }
  381. }
  382. }
  383. .card-dates {
  384. .date-item {
  385. font-size: 26rpx;
  386. color: #999;
  387. margin-bottom: 8rpx;
  388. }
  389. }
  390. .card-rejection {
  391. display: flex;
  392. align-items: center;
  393. gap: 8rpx;
  394. padding: 12rpx;
  395. background: #FFEBEE;
  396. border-radius: 8rpx;
  397. margin-bottom: 16rpx;
  398. font-size: 26rpx;
  399. color: #F44336;
  400. .rejection-icon {
  401. font-size: 28rpx;
  402. }
  403. }
  404. }
  405. .info-section {
  406. background: #fff;
  407. border-radius: 16rpx;
  408. padding: 24rpx;
  409. margin-bottom: 24rpx;
  410. .section-header {
  411. display: flex;
  412. align-items: center;
  413. margin-bottom: 24rpx;
  414. .section-indicator {
  415. width: 6rpx;
  416. height: 32rpx;
  417. background: #388BFF;
  418. border-radius: 3rpx;
  419. margin-right: 16rpx;
  420. }
  421. .section-title {
  422. font-size: 32rpx;
  423. font-weight: bold;
  424. color: #333;
  425. }
  426. }
  427. .info-list {
  428. .info-item {
  429. display: flex;
  430. align-items: flex-start;
  431. margin-bottom: 24rpx;
  432. &:last-child {
  433. margin-bottom: 0;
  434. }
  435. .info-label {
  436. width: 160rpx;
  437. font-size: 28rpx;
  438. color: #666;
  439. flex-shrink: 0;
  440. }
  441. .info-value {
  442. flex: 1;
  443. font-size: 28rpx;
  444. color: #333;
  445. }
  446. .cover-image {
  447. width: 200rpx;
  448. height: 200rpx;
  449. border-radius: 8rpx;
  450. overflow: hidden;
  451. image {
  452. width: 100%;
  453. height: 100%;
  454. }
  455. }
  456. }
  457. }
  458. }
  459. .submit-box{
  460. position: fixed;
  461. bottom: 0;
  462. left: 0;
  463. right: 0;
  464. background: #fff;
  465. z-index: 100;
  466. padding: 24rpx 32rpx;
  467. .submit-btn {
  468. height: 88rpx;
  469. background: #388BFF;
  470. border-radius: 200rpx 200rpx 200rpx 200rpx;
  471. display: flex;
  472. align-items: center;
  473. justify-content: center;
  474. font-size: 32rpx;
  475. color: #fff;
  476. font-weight: 500;
  477. }
  478. }
  479. </style>