You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

366 lines
8.5 KiB

  1. <template>
  2. <view class="task-detail">
  3. <!-- 任务头部信息 -->
  4. <view class="task-header">
  5. <view class="task-title">{{taskInfo.title}}</view>
  6. <view class="task-deadline">请于{{taskInfo.deadline}}之前上传任务超时将自动取消</view>
  7. </view>
  8. <!-- 任务进度 -->
  9. <view class="task-progress">
  10. <view class="progress-title">任务进度</view>
  11. <uni-steps :options="stepsList" :active="currentStep" active-icon="checkbox-filled" active-color="#ffaa48"></uni-steps>
  12. </view>
  13. <!-- 任务说明 -->
  14. <view class="task-instruction">
  15. <view class="instruction-header">
  16. <image class="instruction-icon" src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png"></image>
  17. <view class="instruction-title">悬赏任务说明</view>
  18. </view>
  19. <view class="instruction-content">
  20. <view class="instruction-main">
  21. <text>请以"{{taskInfo.description}}"为主题编辑小红书宣传笔记~</text>
  22. </view>
  23. <view class="requirement-section">
  24. <view class="requirement-title">封面和配图要求</view>
  25. <view class="requirement-content">
  26. <text>封面: 个人宠物图片</text>
  27. <text>配图: 个人宠物图片或小程序页面截图(共2-3)</text>
  28. </view>
  29. </view>
  30. <view class="requirement-section">
  31. <view class="requirement-title">标题示例 (实际发布可以参照以下)</view>
  32. <view class="title-examples">
  33. <view class="example-item">
  34. <view class="example-tag">H1</view>
  35. <view class="example-text">春节回家猫咪/狗狗怎么办?</view>
  36. </view>
  37. <view class="example-item">
  38. <view class="example-tag">H2</view>
  39. <view class="example-text">今年过年不用担心宠物没人照顾啦~</view>
  40. </view>
  41. <view class="example-item">
  42. <view class="example-tag">H3</view>
  43. <view class="example-text">关于宠物喂养平台的真实体验</view>
  44. </view>
  45. <view class="example-item">
  46. <view class="example-tag">H4</view>
  47. <view class="example-text">出门旅游再也不用担心宠物啦</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="requirement-section">
  52. <view class="requirement-title">其他要求</view>
  53. <view class="other-requirements">
  54. <view class="requirement-item">
  55. <view class="requirement-tag"></view>
  56. <view class="requirement-text">文案内容不少于400字</view>
  57. </view>
  58. <view class="requirement-item">
  59. <view class="requirement-tag"></view>
  60. <view class="requirement-text">提及关键词上门猫咪/上门狗狗/上门喂养</view>
  61. </view>
  62. <view class="requirement-item">
  63. <view class="requirement-tag"></view>
  64. <view class="requirement-text">提及猫狗宠物平台并适当好评</view>
  65. </view>
  66. <view class="requirement-item">
  67. <view class="requirement-tag"></view>
  68. <view class="requirement-text">评论区@猫狗宠物官方账号</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="note-text">
  73. <text>注意是评论区请务必在正文@官方账号</text>
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 底部按钮 -->
  78. <view class="footer-buttons">
  79. <u-button shape="circle" plain @click="cancelTask">取消</u-button>
  80. <u-button shape="circle" color="#ffaa48" @click="reuploadTask">重新上传</u-button>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import {
  86. getTaskDetail
  87. } from "@/api/system/task.js"
  88. export default {
  89. data() {
  90. return {
  91. taskInfo: {
  92. id: 0,
  93. title: '发布小红书宣传笔记',
  94. description: '主题: 猫狗狗食使用感受&体验',
  95. deadline: '2025-03-28',
  96. taskType: '悬赏任务',
  97. reward: '2',
  98. status: 'PENDING'
  99. },
  100. stepsList: [
  101. {
  102. title: '接受任务'
  103. },
  104. {
  105. title: '上传任务'
  106. },
  107. {
  108. title: '平台审核'
  109. },
  110. {
  111. title: '酬劳到账'
  112. }
  113. ],
  114. currentStep: 0
  115. }
  116. },
  117. onLoad(options) {
  118. if (options.id) {
  119. this.loadTaskDetail(options.id);
  120. }
  121. },
  122. methods: {
  123. loadTaskDetail(taskId) {
  124. // 实际项目中取消注释下面的代码
  125. /*
  126. getTaskDetail(taskId).then(res => {
  127. if (res && res.code === 200) {
  128. this.taskInfo = res.data;
  129. // 根据任务状态设置当前步骤
  130. switch(this.taskInfo.status) {
  131. case 'PENDING':
  132. this.currentStep = 0;
  133. break;
  134. case 'ACCEPTED':
  135. this.currentStep = 1;
  136. break;
  137. case 'SUBMITTED':
  138. this.currentStep = 2;
  139. break;
  140. case 'COMPLETED':
  141. this.currentStep = 3;
  142. break;
  143. }
  144. }
  145. });
  146. */
  147. // 模拟数据
  148. console.log('加载任务详情,ID:', taskId);
  149. // 设置当前步骤为1(已接受)
  150. this.currentStep = 1;
  151. },
  152. cancelTask() {
  153. uni.showToast({
  154. title: '已取消任务',
  155. icon: 'none'
  156. });
  157. setTimeout(() => {
  158. uni.navigateBack();
  159. }, 1500);
  160. },
  161. reuploadTask() {
  162. uni.showToast({
  163. title: '准备重新上传',
  164. icon: 'none'
  165. });
  166. // 这里可以添加上传逻辑或跳转到上传页面
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. .task-detail {
  173. background-color: #f5f5f7;
  174. min-height: 100vh;
  175. padding-bottom: 120rpx;
  176. .task-header {
  177. background-color: #FFFFFF;
  178. padding: 30rpx;
  179. .task-title {
  180. font-size: 36rpx;
  181. font-weight: bold;
  182. color: #333;
  183. margin-bottom: 20rpx;
  184. }
  185. .task-deadline {
  186. font-size: 24rpx;
  187. color: #999;
  188. }
  189. }
  190. .task-progress {
  191. background-color: #FFFFFF;
  192. margin-top: 20rpx;
  193. padding: 30rpx;
  194. .progress-title {
  195. font-size: 30rpx;
  196. font-weight: bold;
  197. color: #333;
  198. margin-bottom: 30rpx;
  199. }
  200. }
  201. .task-instruction {
  202. background-color: #FFFFFF;
  203. margin-top: 20rpx;
  204. padding: 30rpx;
  205. .instruction-header {
  206. display: flex;
  207. align-items: center;
  208. margin-bottom: 30rpx;
  209. .instruction-icon {
  210. width: 60rpx;
  211. height: 60rpx;
  212. margin-right: 20rpx;
  213. }
  214. .instruction-title {
  215. font-size: 32rpx;
  216. font-weight: bold;
  217. color: #A94F20;
  218. }
  219. }
  220. .instruction-content {
  221. .instruction-main {
  222. padding: 20rpx 0;
  223. border-bottom: 1px solid #EEEEEE;
  224. margin-bottom: 20rpx;
  225. text {
  226. font-size: 28rpx;
  227. color: #666;
  228. line-height: 1.6;
  229. }
  230. }
  231. .requirement-section {
  232. margin-bottom: 30rpx;
  233. .requirement-title {
  234. font-size: 28rpx;
  235. font-weight: bold;
  236. color: #333;
  237. margin-bottom: 20rpx;
  238. }
  239. .requirement-content {
  240. padding: 20rpx;
  241. background-color: #FFF4E5;
  242. border-radius: 10rpx;
  243. text {
  244. display: block;
  245. font-size: 26rpx;
  246. color: #A94F20;
  247. line-height: 1.8;
  248. }
  249. }
  250. .title-examples {
  251. background-color: #FFF4E5;
  252. padding: 20rpx;
  253. border-radius: 10rpx;
  254. .example-item {
  255. display: flex;
  256. align-items: center;
  257. margin-bottom: 15rpx;
  258. .example-tag {
  259. width: 50rpx;
  260. height: 50rpx;
  261. background-color: #ffaa48;
  262. color: #FFFFFF;
  263. border-radius: 25rpx;
  264. display: flex;
  265. justify-content: center;
  266. align-items: center;
  267. font-size: 24rpx;
  268. margin-right: 20rpx;
  269. }
  270. .example-text {
  271. font-size: 26rpx;
  272. color: #A94F20;
  273. }
  274. }
  275. }
  276. .other-requirements {
  277. background-color: #FFF4E5;
  278. padding: 20rpx;
  279. border-radius: 10rpx;
  280. .requirement-item {
  281. display: flex;
  282. align-items: center;
  283. margin-bottom: 15rpx;
  284. .requirement-tag {
  285. width: 40rpx;
  286. height: 40rpx;
  287. color: #A94F20;
  288. display: flex;
  289. justify-content: center;
  290. align-items: center;
  291. font-size: 24rpx;
  292. margin-right: 20rpx;
  293. }
  294. .requirement-text {
  295. font-size: 26rpx;
  296. color: #A94F20;
  297. }
  298. }
  299. }
  300. }
  301. .note-text {
  302. text-align: center;
  303. margin-top: 20rpx;
  304. text {
  305. font-size: 24rpx;
  306. color: #FF5722;
  307. }
  308. }
  309. }
  310. }
  311. .footer-buttons {
  312. position: fixed;
  313. bottom: 0;
  314. left: 0;
  315. right: 0;
  316. background-color: #FFFFFF;
  317. padding: 20rpx 30rpx;
  318. display: flex;
  319. justify-content: space-around;
  320. align-items: center;
  321. box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
  322. .u-button {
  323. width: 300rpx;
  324. height: 80rpx;
  325. font-size: 28rpx;
  326. }
  327. }
  328. }
  329. </style>