task-audit.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="">
  3. <navbar :config="config" backColor="#999999"></navbar>
  4. <view class="task-audit">
  5. <template v-if="TaskInfo">
  6. <view class="task-title">
  7. {{TaskInfo.childTaskTitle}}
  8. </view>
  9. <view class="task-explain">
  10. {{TaskInfo.childTaskRemark}}
  11. </view>
  12. <share :sharePoster="mainTask.sharePoster" :taskId="mainTask.taskId" />
  13. <taskContent v-if="mainTask">
  14. <view class="task-info-item">
  15. <text class="task-info-title">任务时间:</text>
  16. <text class="task-info-val">{{mainTask.startTime}} - {{mainTask.endTime}}</text>
  17. </view>
  18. <view class="task-info-item">
  19. <text class="task-info-title">任务领取后完成时间:</text>
  20. <text class="task-info-val">{{mainTask.completionDays}}天</text>
  21. </view>
  22. <view class="task-info-item">
  23. <text class="task-info-title">任务奖励:</text>
  24. <text class="task-info-val task-info-integral">{{mainTask.rewardPoints}}积分</text>
  25. </view>
  26. </taskContent>
  27. </template>
  28. <template v-if="TaskInfo">
  29. <view class="task-title-2">
  30. 审核信息
  31. </view>
  32. <taskContent>
  33. <view class="task-info-item">
  34. <text class="task-info-title">提交时间:</text>
  35. <text class="task-info-val">{{ TaskInfo.submitTime }}</text>
  36. </view>
  37. <view class="task-info-item">
  38. <text class="task-info-title">审核状态:</text>
  39. <text class="task-info-val">{{$TaskStatusText(TaskInfo.checkStatus)}}</text>
  40. </view>
  41. <view class="task-info-item" v-if="TaskInfo.checkStatus === 2">
  42. <text class="task-info-title">驳回原因:</text>
  43. <text class="task-info-val">{{ TaskInfo.rejectReason }}</text>
  44. </view>
  45. </taskContent>
  46. </template>
  47. </view>
  48. <template v-if="TaskInfo">
  49. <task-bottom-btn v-if="TaskInfo.checkStatus === 3" btnName="去查看"
  50. @onClick="onSubmit(mainTask.taskType , true )" />
  51. <task-bottom-btn v-if="[0,1,2].includes(TaskInfo.checkStatus)" btnName="去提交"
  52. @onClick="onSubmit(mainTask.taskType, false )" />
  53. </template>
  54. </view>
  55. </template>
  56. <script>
  57. import share from "./components/share.vue"
  58. import taskContent from "./components/task-content.vue"
  59. import taskBottomBtn from "./components/task-bottom-btn.vue"
  60. import {
  61. getMyTaskInfo_Api,
  62. getMyMoreTaskInfo_Api,
  63. onSubmitCheck_Api
  64. } from "@/api/task.js"
  65. import {
  66. onSubmint_val
  67. } from "./task_common.js"
  68. export default {
  69. components: {
  70. share,
  71. taskContent,
  72. taskBottomBtn
  73. },
  74. data() {
  75. return {
  76. config: {
  77. back: true,
  78. title: '审核详情',
  79. color: 'black',
  80. backgroundColor: [1, '#fff'],
  81. statusBarFontColor: 'black'
  82. },
  83. mainTask: null, // 主任务
  84. TaskInfo: null, // 子任务
  85. receiveTaskId: null, // 单任务审核详情
  86. receiveChildTaskId: null,
  87. }
  88. },
  89. onLoad(opt) {
  90. this.receiveTaskId = opt.receiveTaskId;
  91. this.receiveChildTaskId = opt.receiveChildTaskId;
  92. this.init();
  93. },
  94. methods: {
  95. init() {
  96. if (this.receiveTaskId) {
  97. this.getMyTaskInfo()
  98. }
  99. if (this.receiveChildTaskId) {
  100. this.getMyMoreTaskInfo()
  101. }
  102. },
  103. // 查询单任务详情
  104. getMyTaskInfo() {
  105. getMyTaskInfo_Api(this.receiveTaskId || this.receiveChildTaskId).then(res => {
  106. const childTask = res.data ? res.data.childTaskVoList[0] : null
  107. this.mainTask = res.data;
  108. if (childTask) {
  109. this.TaskInfo = childTask;
  110. this.TaskRule = childTask.childTaskRule || null
  111. };
  112. })
  113. },
  114. // 多任务
  115. getMyMoreTaskInfo() {
  116. getMyMoreTaskInfo_Api(this.receiveChildTaskId).then(res => {
  117. const childTask = res.data || null
  118. this.TaskInfo = childTask;
  119. this.mainTask = childTask.myTaskVo;
  120. this.TaskRule = childTask?.childTaskRule || null
  121. console.log(this.TaskInfo, '------TaskInfo--------')
  122. })
  123. },
  124. onSubmit(type, checkPage = false, page = 'submitDetails') {
  125. const taskInfo = this.TaskInfo;
  126. onSubmint_val(type, taskInfo, checkPage, page)
  127. },
  128. // onSubmit(type) {
  129. // onSubmit(type, checkPage = false) {
  130. // const taskInfo = this.taskInfo.childTaskVoList[0];
  131. // onSubmint_val(type, taskInfo, checkPage)
  132. // }
  133. // // onSubmitCheck_Api(this.TaskInfo.receiveChildTaskId).then(res => {
  134. // // let path = '/pages/task/submit-task';
  135. // // if (type === 0) {
  136. // // // 单任务提交
  137. // // path = `${path}?receiveTaskId=${this.receiveTaskId}`
  138. // // } else {
  139. // // // 多任务下子任务提交
  140. // // path = `${path}?receiveChildTaskId=${this.TaskInfo.receiveChildTaskId}`
  141. // // };
  142. // // uni.navigateTo({
  143. // // url: path
  144. // // })
  145. // // })
  146. // },
  147. onExamine() {
  148. let path = '/pages/task/submit-task';
  149. if (type === 0) {
  150. // 单任务提交
  151. path = `${path}?receiveTaskId=${this.receiveTaskId}`
  152. } else {
  153. // 多任务下子任务提交
  154. path = `${path}?receiveChildTaskId=${this.TaskInfo.receiveChildTaskId}`
  155. };
  156. uni.navigateTo({
  157. url: path
  158. })
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. @import "./common.scss";
  165. .task-audit {
  166. padding: 0 30rpx;
  167. }
  168. </style>