task_detail.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view>
  3. <view class="dtop">
  4. <view class="title">{{ item.title || '' }}</view>
  5. </view>
  6. <view class="mbos">
  7. <view class="ms mt0">
  8. <view class="mtitle">兼职金额</view>
  9. <view class="desc mb15">{{ item.salary }}元</view>
  10. <view class="mtitle">兼职时间</view>
  11. <view class="desc mb15">{{ item.startDate }}至{{ item.endDate }},共计:{{ item.days }}天</view>
  12. <view class="mtitle">兼职地点</view>
  13. <view class="desc mb15">{{ item.address || '工作地点不限' }}</view>
  14. <view class="mtitle">结算方式</view>
  15. <view class="desc mb15">在规定时间内完工结算(平台打款)</view>
  16. <view class="mtitle">兼职描述</view>
  17. <u-parse :content="item.contents" class="item"></u-parse>
  18. </view>
  19. </view>
  20. <view class="mfooter">
  21. <view class="cn">
  22. <view class="f">
  23. <button class="btn" style="background-color: #607d8b" @click="go('/pages/user/resume/application/task_list?taskId=' + obj.id + '&role=' + obj.role)">
  24. <text class="icon">&#xe656;</text>
  25. <text>任务日志</text>
  26. </button>
  27. </view>
  28. <view class="f" style="flex: 1.4">
  29. <button class="btn" @click="send()" :disabled="obj.isComplete == 1 || obj.isComplete == 2" v-if="obj.role == 1">
  30. <text class="icon">&#xe612;</text>
  31. <text v-if="obj.isComplete == 0">确认完成</text>
  32. <text v-if="obj.isComplete == 1">等待甲方确认</text>
  33. <text v-if="obj.isComplete == 2">任务完成</text>
  34. <text v-if="obj.isComplete == 3">申请驳回,重新提交</text>
  35. </button>
  36. <button class="btn" @click="show()" :disabled="obj.isComplete != 1" v-else>
  37. <text class="icon">&#xe612;</text>
  38. <text v-if="obj.isComplete == 0">任务进行中...</text>
  39. <text v-if="obj.isComplete == 1">确认完成</text>
  40. <text v-if="obj.isComplete == 2">任务完成</text>
  41. <text v-if="obj.isComplete == 3">申请完成驳回</text>
  42. </button>
  43. </view>
  44. </view>
  45. </view>
  46. <complete ref="complete" @confirm="confirm"></complete>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. item: {},
  54. obj: {}
  55. };
  56. },
  57. onLoad(e) {
  58. this.obj = JSON.parse(e.item);
  59. this.http.request({
  60. url: '/app/position/detail/' + this.obj.positionId,
  61. success: (res) => {
  62. this.item = res.data.data.position;
  63. this.item.days = this.util.days(this.item.startDate, this.item.endDate);
  64. }
  65. });
  66. },
  67. methods: {
  68. go(url) {
  69. uni.navigateTo({ url: url });
  70. },
  71. send() {
  72. uni.showModal({
  73. title: '提示',
  74. content: '确定提交完成申请?',
  75. success: (res) => {
  76. if (res.confirm) {
  77. this.http.request({
  78. url: '/app/deliver/yTaskComplete',
  79. data: { id: this.obj.id },
  80. method: 'POST',
  81. success: (res) => {
  82. //通知模板订阅消息
  83. uni.requestSubscribeMessage({
  84. tmplIds: ['87jYTnpeZJnvdQ6gHcscZ96eQYlSXpfGeFU3g9deTeA'],
  85. complete: (c) => {
  86. uni.showModal({ content: '提交完成申请成功,等待甲方确认', showCancel: false });
  87. uni.$emit('task_to_do');
  88. uni.navigateBack();
  89. }
  90. });
  91. }
  92. });
  93. }
  94. }
  95. });
  96. },
  97. confirm() {
  98. uni.$emit('task_to_do');
  99. uni.navigateBack();
  100. },
  101. show() {
  102. this.$refs.complete.init(this.obj.id);
  103. }
  104. }
  105. };
  106. </script>
  107. <style lang="scss">
  108. .mfooter {
  109. background-color: white;
  110. bottom: 0px;
  111. border-top: 1px solid $line;
  112. .cn {
  113. padding: 0px 10px 15px 10px;
  114. overflow: hidden;
  115. display: flex;
  116. .f {
  117. flex: 1;
  118. padding: 0px 10px 0px 10px;
  119. .btn {
  120. width: 100%;
  121. }
  122. }
  123. }
  124. }
  125. </style>