taskDetails.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. <template>
  2. <view class="task-detail-container">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-header">
  5. <view class="nav-left" @click="goBack">
  6. <u-icon name="arrow-left" size="20" color="#333"></u-icon>
  7. </view>
  8. <text class="nav-title">任务详情</text>
  9. <view class="nav-right"></view>
  10. </view>
  11. <!-- 滚动内容区域 -->
  12. <scroll-view scroll-y class="content-scroll">
  13. <!-- 拒绝原因提示栏 (根据状态显示) -->
  14. <view class="reject-reason" v-if="taskStatus === 'rejected'">
  15. <u-icon name="close-circle-fill" color="#E63F3F" size="16"></u-icon>
  16. <text class="reason-text">不通过原因:上传的照片有误,请重新上传。画面不清晰,字迹模糊。请重新上传后提交。</text>
  17. </view>
  18. <!-- 任务基本信息卡片 -->
  19. <view class="task-info-card">
  20. <view class="card-top">
  21. <image class="task-icon" src="@/static/image/points/icon_cash_task.png" mode="aspectFill"></image>
  22. <view class="task-main-info">
  23. <view class="task-title">新人必做任务易上手</view>
  24. <view class="task-tags">
  25. <text class="tag">无需经验</text>
  26. <text class="tag">时间自由</text>
  27. </view>
  28. <view class="task-stats-row">
  29. <text class="stat-text">128人已赚</text>
  30. <text class="stat-text">剩余10单</text>
  31. </view>
  32. </view>
  33. <view class="task-reward-wrap">
  34. <text class="reward-sign">+</text>
  35. <text class="reward-num">2.32</text>
  36. <text class="reward-unit">元</text>
  37. </view>
  38. </view>
  39. <view class="card-bottom">
  40. <view class="data-item">
  41. <view class="data-val"><text class="num">992</text>元</view>
  42. <view class="data-label">托管赏金</view>
  43. </view>
  44. <view class="data-item">
  45. <view class="data-val"><text class="num">30</text>人</view>
  46. <view class="data-label">已完成人数</view>
  47. </view>
  48. <view class="data-item">
  49. <view class="data-val highlight"><text class="num">1</text>小时</view>
  50. <view class="data-label">时间限制</view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 任务详情描述区 -->
  55. <view class="section-block">
  56. <view class="section-title">
  57. <view class="title-line"></view>
  58. <text>任务详情</text>
  59. </view>
  60. <view class="section-content">
  61. <text class="desc-text">根据要求从官方渠道下载对应软件安装包,确保文件来源安全、无篡改安装完成后启动软件,验证是否能正常打开、无报错,确认任务完成。交付要求:反馈软件安装成功的截图或启动界面截图。</text>
  62. <!-- 任务详情图,这里用一个带颜色的view模拟占位 -->
  63. <view class="detail-img-placeholder">
  64. <!-- <image src="实际详情长图地址" mode="widthFix" style="width: 100%;"></image> -->
  65. <view class="placeholder-content">
  66. <text style="color:#fff; font-size:36rpx; font-weight:bold;">新人投保指南 (图片占位)</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 任务步骤区 -->
  72. <view class="section-block steps-block">
  73. <view class="section-title">
  74. <view class="title-line"></view>
  75. <text>任务步骤</text>
  76. </view>
  77. <view class="steps-list">
  78. <!-- 步骤一 -->
  79. <view class="step-item">
  80. <view class="step-header">
  81. <view class="step-dot"></view>
  82. <view class="step-badge">第一步</view>
  83. </view>
  84. <view class="step-content">
  85. <text class="step-desc">首先打开应用商店下载软件</text>
  86. <view class="step-imgs">
  87. <view class="img-box">
  88. <text class="img-label">示例</text>
  89. <!-- 占位图 -->
  90. <view class="mock-img"></view>
  91. </view>
  92. <!-- 右侧上传/重新上传区域 -->
  93. <view class="img-box" v-if="taskStatus === 'rejected'">
  94. <!-- 重新上传按钮样式 -->
  95. <view class="reupload-btn">重新上传</view>
  96. <view class="mock-img"></view>
  97. </view>
  98. <view class="img-box upload-placeholder" v-else-if="taskStatus === 'unaccepted'">
  99. <u-icon name="camera" size="32" color="#FF5A1F"></u-icon>
  100. <text class="upload-text">上传截图</text>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- 步骤二 -->
  106. <view class="step-item">
  107. <view class="step-header">
  108. <view class="step-dot"></view>
  109. <view class="step-badge">第二步</view>
  110. </view>
  111. <view class="step-content">
  112. <text class="step-desc">用手机号进行登录,完成任务</text>
  113. <view class="step-imgs">
  114. <view class="img-box">
  115. <text class="img-label">示例</text>
  116. <view class="mock-img"></view>
  117. </view>
  118. <!-- 右侧上传/重新上传区域 -->
  119. <view class="img-box" v-if="taskStatus === 'rejected'">
  120. <view class="reupload-btn">重新上传</view>
  121. <view class="mock-img"></view>
  122. </view>
  123. <view class="img-box upload-placeholder" v-else-if="taskStatus === 'unaccepted'">
  124. <u-icon name="camera" size="32" color="#FF5A1F"></u-icon>
  125. <text class="upload-text">上传截图</text>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. <!-- 底部安全留白 -->
  133. <view class="bottom-spacer"></view>
  134. </scroll-view>
  135. <!-- 底部固定操作栏 -->
  136. <view class="bottom-action-bar">
  137. <!-- 状态一:被拒绝 (取消任务 / 重新提交) -->
  138. <view class="btn-group double-btn" v-if="taskStatus === 'rejected'">
  139. <button class="btn-outline" @click="handleCancel">取消任务</button>
  140. <button class="btn-primary" @click="handleSubmit">重新提交</button>
  141. </view>
  142. <!-- 状态二:审核中 (任务审核中 - 不可点击) -->
  143. <view class="btn-group single-btn" v-if="taskStatus === 'reviewing'">
  144. <button class="btn-disabled">任务审核中</button>
  145. </view>
  146. <!-- 状态三:可重做 (删除任务 / 再次报名) -->
  147. <view class="btn-group double-btn" v-if="taskStatus === 'canReapply'">
  148. <button class="btn-outline" @click="handleDelete">删除任务</button>
  149. <button class="btn-primary" @click="handleApply">再次报名</button>
  150. </view>
  151. <!-- 状态四:未接单 (换个任务 / 立即报名) -->
  152. <view class="btn-group double-btn" v-if="taskStatus === 'unaccepted'">
  153. <button class="btn-outline with-icon" @click="handleChangeTask">
  154. <u-icon name="reload" size="16" color="#FF5A1F"></u-icon>
  155. <text>换个任务</text>
  156. </button>
  157. <button class="btn-primary" @click="handleApply">立即报名</button>
  158. </view>
  159. </view>
  160. </view>
  161. </template>
  162. <script>
  163. export default {
  164. data() {
  165. return {
  166. // 模拟任务状态,后期根据接口返回动态设置
  167. // 可选值: 'rejected' (不通过), 'reviewing' (审核中), 'canReapply' (删除/再次报名), 'unaccepted' (换个任务/立即报名)
  168. taskStatus: 'rejected'
  169. };
  170. },
  171. methods: {
  172. goBack() {
  173. uni.navigateBack();
  174. },
  175. handleCancel() {
  176. console.log('取消任务');
  177. },
  178. handleSubmit() {
  179. console.log('重新提交');
  180. },
  181. handleDelete() {
  182. console.log('删除任务');
  183. },
  184. handleApply() {
  185. console.log('报名/再次报名');
  186. },
  187. handleChangeTask() {
  188. console.log('换个任务');
  189. }
  190. }
  191. };
  192. </script>
  193. <style lang="scss" scoped>
  194. .task-detail-container {
  195. height: 100vh;
  196. background-color: #F7F8FA;
  197. display: flex;
  198. flex-direction: column;
  199. }
  200. /* 顶部导航栏 */
  201. .nav-header {
  202. display: flex;
  203. justify-content: space-between;
  204. align-items: center;
  205. padding: 80rpx 30rpx 20rpx; /* 适配状态栏高度 */
  206. background-color: #fff;
  207. flex-shrink: 0;
  208. z-index: 10;
  209. }
  210. .nav-left, .nav-right {
  211. width: 60rpx;
  212. display: flex;
  213. align-items: center;
  214. }
  215. .nav-title {
  216. font-size: 36rpx;
  217. font-weight: bold;
  218. color: #333;
  219. flex: 1;
  220. text-align: center;
  221. }
  222. /* 滚动区域 */
  223. .content-scroll {
  224. flex: 1;
  225. height: 0;
  226. }
  227. /* 拒绝原因提示 */
  228. .reject-reason {
  229. background-color: #FFF2F2;
  230. padding: 20rpx 30rpx;
  231. display: flex;
  232. align-items: flex-start;
  233. margin: 20rpx 30rpx 0;
  234. border-radius: 12rpx;
  235. }
  236. .reason-text {
  237. font-size: 26rpx;
  238. color: #E63F3F;
  239. margin-left: 10rpx;
  240. line-height: 1.5;
  241. flex: 1;
  242. }
  243. /* 任务信息卡片 */
  244. .task-info-card {
  245. background-color: #fff;
  246. border-radius: 20rpx;
  247. margin: 20rpx 30rpx;
  248. padding: 30rpx;
  249. }
  250. .card-top {
  251. display: flex;
  252. padding-bottom: 30rpx;
  253. border-bottom: 1px dashed #eee;
  254. }
  255. .task-icon {
  256. width: 100rpx;
  257. height: 100rpx;
  258. border-radius: 16rpx;
  259. margin-right: 20rpx;
  260. }
  261. .task-main-info {
  262. flex: 1;
  263. display: flex;
  264. flex-direction: column;
  265. justify-content: space-between;
  266. }
  267. .task-title {
  268. font-size: 32rpx;
  269. font-weight: bold;
  270. color: #333;
  271. }
  272. .task-tags {
  273. display: flex;
  274. margin-top: 6rpx;
  275. }
  276. .tag {
  277. font-size: 20rpx;
  278. color: #666;
  279. background-color: #F5F6F8;
  280. padding: 4rpx 12rpx;
  281. border-radius: 6rpx;
  282. margin-right: 12rpx;
  283. }
  284. .task-stats-row {
  285. display: flex;
  286. margin-top: 6rpx;
  287. }
  288. .stat-text {
  289. font-size: 22rpx;
  290. color: #999;
  291. margin-right: 20rpx;
  292. }
  293. .task-reward-wrap {
  294. display: flex;
  295. align-items: baseline;
  296. color: #FF5A1F;
  297. }
  298. .reward-sign {
  299. font-size: 28rpx;
  300. }
  301. .reward-num {
  302. font-size: 40rpx;
  303. font-weight: bold;
  304. }
  305. .reward-unit {
  306. font-size: 24rpx;
  307. }
  308. .card-bottom {
  309. display: flex;
  310. justify-content: space-around;
  311. padding-top: 30rpx;
  312. }
  313. .data-item {
  314. display: flex;
  315. flex-direction: column;
  316. align-items: center;
  317. }
  318. .data-val {
  319. font-size: 24rpx;
  320. color: #333;
  321. margin-bottom: 8rpx;
  322. }
  323. .data-val.highlight {
  324. color: #FF5A1F;
  325. }
  326. .data-val .num {
  327. font-size: 36rpx;
  328. font-weight: bold;
  329. margin-right: 4rpx;
  330. }
  331. .data-label {
  332. font-size: 24rpx;
  333. color: #999;
  334. }
  335. /* 详情区块通用样式 */
  336. .section-block {
  337. background-color: #fff;
  338. border-radius: 20rpx;
  339. margin: 0 30rpx 20rpx;
  340. padding: 30rpx;
  341. }
  342. .section-title {
  343. display: flex;
  344. align-items: center;
  345. font-size: 32rpx;
  346. font-weight: bold;
  347. color: #333;
  348. margin-bottom: 20rpx;
  349. }
  350. .title-line {
  351. width: 6rpx;
  352. height: 28rpx;
  353. background-color: #FF5A1F;
  354. border-radius: 4rpx;
  355. margin-right: 12rpx;
  356. }
  357. .desc-text {
  358. font-size: 28rpx;
  359. color: #666;
  360. line-height: 1.6;
  361. }
  362. .detail-img-placeholder {
  363. width: 100%;
  364. height: 600rpx;
  365. background: linear-gradient(180deg, #6B94FF 0%, #B9CBFF 100%);
  366. border-radius: 12rpx;
  367. margin-top: 20rpx;
  368. display: flex;
  369. justify-content: center;
  370. align-items: center;
  371. }
  372. /* 任务步骤区 */
  373. .steps-list {
  374. padding-left: 10rpx;
  375. }
  376. .step-item {
  377. position: relative;
  378. padding-left: 40rpx;
  379. padding-bottom: 40rpx;
  380. border-left: 2rpx dashed #FF9E7F;
  381. }
  382. .step-item:last-child {
  383. border-left: none;
  384. padding-bottom: 0;
  385. }
  386. .step-header {
  387. position: relative;
  388. display: flex;
  389. align-items: center;
  390. left: -40rpx; /* 抵消 padding-left */
  391. top: -10rpx;
  392. }
  393. .step-dot {
  394. width: 16rpx;
  395. height: 16rpx;
  396. border: 4rpx solid #FF5A1F;
  397. border-radius: 50%;
  398. background-color: #fff;
  399. position: absolute;
  400. left: -9rpx; /* 对齐虚线 */
  401. }
  402. .step-badge {
  403. background-color: #FF5A1F;
  404. color: #fff;
  405. font-size: 22rpx;
  406. padding: 4rpx 16rpx;
  407. border-radius: 20rpx;
  408. margin-left: 30rpx;
  409. }
  410. .step-content {
  411. margin-top: 10rpx;
  412. }
  413. .step-desc {
  414. font-size: 28rpx;
  415. color: #333;
  416. display: block;
  417. margin-bottom: 20rpx;
  418. }
  419. .step-imgs {
  420. display: flex;
  421. justify-content: space-between;
  422. }
  423. .img-box {
  424. width: 48%;
  425. height: 300rpx;
  426. background-color: #F5F6F8;
  427. border-radius: 12rpx;
  428. position: relative;
  429. overflow: hidden;
  430. }
  431. .mock-img {
  432. width: 100%;
  433. height: 100%;
  434. background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee), linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee);
  435. background-size: 20px 20px;
  436. background-position: 0 0, 10px 10px;
  437. }
  438. .img-label {
  439. position: absolute;
  440. top: 0;
  441. left: 0;
  442. background-color: rgba(0,0,0,0.5);
  443. color: #fff;
  444. font-size: 20rpx;
  445. padding: 4rpx 12rpx;
  446. border-radius: 0 0 12rpx 0;
  447. z-index: 2;
  448. }
  449. .upload-placeholder {
  450. background-color: #FFF2ED;
  451. border: 2rpx dashed #FF9E7F;
  452. display: flex;
  453. flex-direction: column;
  454. justify-content: center;
  455. align-items: center;
  456. }
  457. .upload-text {
  458. font-size: 24rpx;
  459. color: #FF5A1F;
  460. margin-top: 10rpx;
  461. }
  462. .reupload-btn {
  463. position: absolute;
  464. top: 50%;
  465. left: 50%;
  466. transform: translate(-50%, -50%);
  467. background-color: rgba(255, 90, 31, 0.1);
  468. color: #FF5A1F;
  469. border: 2rpx solid #FF5A1F;
  470. font-size: 24rpx;
  471. padding: 10rpx 16rpx;
  472. border-radius: 30rpx;
  473. z-index: 2;
  474. }
  475. .bottom-spacer {
  476. height: 160rpx; /* 为底部按钮留出空间 */
  477. }
  478. /* 底部操作栏 */
  479. .bottom-action-bar {
  480. position: fixed;
  481. bottom: 0;
  482. left: 0;
  483. width: 100%;
  484. background-color: #fff;
  485. padding: 20rpx 30rpx;
  486. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  487. box-shadow: 0 -4rpx 16rpx rgba(0,0,0,0.05);
  488. box-sizing: border-box;
  489. z-index: 99;
  490. }
  491. .btn-group {
  492. display: flex;
  493. justify-content: space-between;
  494. width: 100%;
  495. }
  496. .single-btn {
  497. justify-content: center;
  498. }
  499. .btn-outline, .btn-primary, .btn-disabled {
  500. height: 88rpx;
  501. line-height: 88rpx;
  502. border-radius: 44rpx;
  503. font-size: 32rpx;
  504. text-align: center;
  505. }
  506. .btn-group.double-btn button {
  507. width: 48%;
  508. }
  509. .btn-group.single-btn button {
  510. width: 100%;
  511. }
  512. .btn-outline {
  513. background-color: #fff;
  514. color: #FF5A1F;
  515. border: 2rpx solid #FF5A1F;
  516. }
  517. .btn-outline.with-icon {
  518. display: flex;
  519. justify-content: center;
  520. align-items: center;
  521. }
  522. .btn-outline.with-icon text {
  523. margin-left: 8rpx;
  524. }
  525. .btn-primary {
  526. background-color: #FF5A1F;
  527. color: #fff;
  528. border: none;
  529. }
  530. .btn-disabled {
  531. background-color: #E2B9AA; /* 审核中偏淡的颜色 */
  532. color: #fff;
  533. border: none;
  534. }
  535. button::after {
  536. border: none;
  537. }
  538. </style>