taskDetail.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <view class="container">
  3. <scroll-view class="content" scroll-y>
  4. <!-- 任务卡片 -->
  5. <view class="task-card">
  6. <view class="card-header">
  7. <view class="card-title">{{ taskData.title }}</view>
  8. <view class="status-tag" :class="taskData.status">
  9. {{ taskData.statusText }}
  10. </view>
  11. </view>
  12. <view class="card-tags">
  13. <view class="tag-item video-tag">
  14. <text class="tag-icon">▶</text>
  15. <text>{{ taskData.videoType }}</text>
  16. </view>
  17. <view class="tag-item">{{ taskData.category }}</view>
  18. <view class="tag-item points-tag">{{ taskData.points }}积分</view>
  19. <view class="tag-item">{{ taskData.count }}个</view>
  20. </view>
  21. <view class="card-dates">
  22. <view class="date-item">开始时间: {{ taskData.startTime }}</view>
  23. <view class="date-item">结束时间: {{ taskData.endTime }}</view>
  24. </view>
  25. </view>
  26. <!-- 项目信息 -->
  27. <view class="info-section">
  28. <view class="section-header">
  29. <view class="section-indicator"></view>
  30. <text class="section-title">项目信息</text>
  31. </view>
  32. <view class="info-list">
  33. <view class="info-item">
  34. <text class="info-label">项目名称:</text>
  35. <text class="info-value">{{ projectData.projectName }}</text>
  36. </view>
  37. <view class="info-item">
  38. <text class="info-label">任务ID:</text>
  39. <text class="info-value">{{ projectData.taskId }}</text>
  40. </view>
  41. <view class="info-item">
  42. <text class="info-label">交付物ID:</text>
  43. <text class="info-value">{{ projectData.deliverableId }}</text>
  44. </view>
  45. <view class="info-item">
  46. <text class="info-label">观看人数:</text>
  47. <text class="info-value">{{ projectData.viewers }}</text>
  48. </view>
  49. <view class="info-item">
  50. <text class="info-label">有效观看:</text>
  51. <text class="info-value">{{ projectData.validViews }}</text>
  52. </view>
  53. <view class="info-item">
  54. <text class="info-label">标题:</text>
  55. <text class="info-value">{{ projectData.title }}</text>
  56. </view>
  57. <view class="info-item">
  58. <text class="info-label">项目信息:</text>
  59. <text class="info-value">{{ projectData.projectInfo || '-' }}</text>
  60. </view>
  61. <view class="info-item">
  62. <text class="info-label">封面图:</text>
  63. <view class="cover-image">
  64. <image v-if="projectData.coverImage" :src="projectData.coverImage" mode="aspectFill"></image>
  65. <text v-else>-</text>
  66. </view>
  67. </view>
  68. <view class="info-item">
  69. <text class="info-label">情况说明:</text>
  70. <text class="info-value">{{ projectData.description || '-' }}</text>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 申请人员信息 -->
  75. <view class="info-section">
  76. <view class="section-header">
  77. <view class="section-indicator"></view>
  78. <text class="section-title">申请人员信息</text>
  79. </view>
  80. <view class="info-list">
  81. <view class="info-item">
  82. <text class="info-label">申请人姓名:</text>
  83. <text class="info-value">{{ applicantData.name }}</text>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- 客户信息 -->
  88. <view class="info-section">
  89. <view class="section-header">
  90. <view class="section-indicator"></view>
  91. <text class="section-title">客户信息</text>
  92. </view>
  93. <view class="info-list">
  94. <view class="info-item">
  95. <text class="info-label">客户名称:</text>
  96. <text class="info-value">{{ clientData.name }}</text>
  97. </view>
  98. <view class="info-item">
  99. <text class="info-label">客户ID:</text>
  100. <text class="info-value">{{ clientData.clientId }}</text>
  101. </view>
  102. <view class="info-item">
  103. <text class="info-label">归属医院:</text>
  104. <text class="info-value">{{ clientData.hospital }}</text>
  105. </view>
  106. <view class="info-item">
  107. <text class="info-label">归属科室:</text>
  108. <text class="info-value">{{ clientData.department }}</text>
  109. </view>
  110. </view>
  111. </view>
  112. </scroll-view>
  113. <!-- 底部按钮 -->
  114. <view class="bottom-btn" v-if="taskData.status === 'pending'" @click="goComplete">
  115. 去完成
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. import { getTaskDetail } from '@/api-js/airClassroom'
  121. export default {
  122. data() {
  123. return {
  124. statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
  125. taskId: '',
  126. taskData: {
  127. title: '王小明医生学术视频任务',
  128. videoType: '长视频',
  129. category: '学术',
  130. points: '10',
  131. count: '1',
  132. startTime: '2025-9-20 13:55',
  133. endTime: '2025-9-20 13:55',
  134. status: 'pending',
  135. statusText: '待完成'
  136. },
  137. projectData: {
  138. projectName: '王小明医学术视频任务',
  139. taskId: 'CRW234443000221',
  140. deliverableId: 'JF123456',
  141. viewers: '688',
  142. validViews: '680',
  143. title: '康复医学概论',
  144. projectInfo: '-',
  145. coverImage: '',
  146. description: '-'
  147. },
  148. applicantData: {
  149. name: '张菲菲'
  150. },
  151. clientData: {
  152. name: '王小明',
  153. clientId: 'C00000001231445',
  154. hospital: '江南大学附属医院',
  155. department: '消化内科'
  156. }
  157. }
  158. },
  159. onLoad(options) {
  160. if (options.id) {
  161. this.taskId = options.id
  162. this.loadData()
  163. }
  164. },
  165. methods: {
  166. goBack() {
  167. uni.navigateBack()
  168. },
  169. goComplete() {
  170. uni.navigateTo({
  171. url: `/pages_task/completeTask?id=${this.taskId}`
  172. })
  173. },
  174. async loadData() {
  175. try {
  176. uni.showLoading({ title: '加载中...' })
  177. const res = await getTaskDetail({ id: this.taskId })
  178. uni.hideLoading()
  179. if (res.code === 200 && res.data) {
  180. this.taskData = { ...this.taskData, ...res.data.task }
  181. this.projectData = { ...this.projectData, ...res.data.project }
  182. this.applicantData = { ...this.applicantData, ...res.data.applicant }
  183. this.clientData = { ...this.clientData, ...res.data.client }
  184. }
  185. } catch (e) {
  186. uni.hideLoading()
  187. console.error('加载数据失败', e)
  188. }
  189. }
  190. }
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. .container {
  195. min-height: 100vh;
  196. background: #f5f5f5;
  197. display: flex;
  198. flex-direction: column;
  199. }
  200. .status-bar {
  201. width: 100%;
  202. background: #fff;
  203. }
  204. .header {
  205. position: relative;
  206. height: 88rpx;
  207. display: flex;
  208. align-items: center;
  209. justify-content: center;
  210. background: #fff;
  211. border-bottom: 1rpx solid #f0f0f0;
  212. .back-btn {
  213. position: absolute;
  214. left: 24rpx;
  215. width: 40rpx;
  216. height: 40rpx;
  217. image {
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. .title {
  223. font-size: 36rpx;
  224. font-weight: bold;
  225. color: #333;
  226. }
  227. .header-right {
  228. position: absolute;
  229. right: 24rpx;
  230. display: flex;
  231. align-items: center;
  232. gap: 16rpx;
  233. .more-icon {
  234. font-size: 32rpx;
  235. color: #333;
  236. }
  237. }
  238. }
  239. .content {
  240. flex: 1;
  241. padding: 24rpx;
  242. }
  243. .task-card {
  244. background: #fff;
  245. border-radius: 16rpx;
  246. padding: 24rpx;
  247. margin-bottom: 24rpx;
  248. .card-header {
  249. display: flex;
  250. align-items: flex-start;
  251. justify-content: space-between;
  252. margin-bottom: 16rpx;
  253. .card-title {
  254. flex: 1;
  255. font-size: 32rpx;
  256. font-weight: bold;
  257. color: #333;
  258. }
  259. .status-tag {
  260. padding: 8rpx 16rpx;
  261. border-radius: 20rpx;
  262. font-size: 24rpx;
  263. &.pending {
  264. background: #E3F2FD;
  265. color: #2196F3;
  266. }
  267. }
  268. }
  269. .card-tags {
  270. display: flex;
  271. align-items: center;
  272. flex-wrap: wrap;
  273. gap: 12rpx;
  274. margin-bottom: 16rpx;
  275. .tag-item {
  276. padding: 8rpx 16rpx;
  277. background: #f5f5f5;
  278. border-radius: 8rpx;
  279. font-size: 24rpx;
  280. color: #666;
  281. &.video-tag {
  282. background: #FFF3E0;
  283. color: #FF9800;
  284. .tag-icon {
  285. margin-right: 4rpx;
  286. }
  287. }
  288. &.points-tag {
  289. border: 1rpx solid #388BFF;
  290. color: #388BFF;
  291. background: transparent;
  292. }
  293. }
  294. }
  295. .card-dates {
  296. .date-item {
  297. font-size: 26rpx;
  298. color: #999;
  299. margin-bottom: 8rpx;
  300. }
  301. }
  302. }
  303. .info-section {
  304. background: #fff;
  305. border-radius: 16rpx;
  306. padding: 24rpx;
  307. margin-bottom: 24rpx;
  308. .section-header {
  309. display: flex;
  310. align-items: center;
  311. margin-bottom: 24rpx;
  312. .section-indicator {
  313. width: 6rpx;
  314. height: 32rpx;
  315. background: #388BFF;
  316. border-radius: 3rpx;
  317. margin-right: 16rpx;
  318. }
  319. .section-title {
  320. font-size: 32rpx;
  321. font-weight: bold;
  322. color: #333;
  323. }
  324. }
  325. .info-list {
  326. .info-item {
  327. display: flex;
  328. align-items: flex-start;
  329. margin-bottom: 24rpx;
  330. &:last-child {
  331. margin-bottom: 0;
  332. }
  333. .info-label {
  334. width: 160rpx;
  335. font-size: 28rpx;
  336. color: #666;
  337. flex-shrink: 0;
  338. }
  339. .info-value {
  340. flex: 1;
  341. font-size: 28rpx;
  342. color: #333;
  343. }
  344. .cover-image {
  345. width: 200rpx;
  346. height: 200rpx;
  347. border-radius: 8rpx;
  348. overflow: hidden;
  349. image {
  350. width: 100%;
  351. height: 100%;
  352. }
  353. }
  354. }
  355. }
  356. }
  357. .bottom-btn {
  358. position: fixed;
  359. bottom: 0;
  360. left: 0;
  361. right: 0;
  362. height: 88rpx;
  363. background: #388BFF;
  364. display: flex;
  365. align-items: center;
  366. justify-content: center;
  367. font-size: 32rpx;
  368. color: #fff;
  369. font-weight: 500;
  370. z-index: 100;
  371. }
  372. </style>