questionnaire.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的问卷'></cus-header>
  4. <div class="tabs adf">
  5. <div class="t_pre" :class="{'active':tidx===1}" @tap="changeTab(1)">待完成</div>
  6. <div class="t_pre" :class="{'active':tidx===2}" @tap="changeTab(2)">已完成</div>
  7. </div>
  8. <template v-if="list.length">
  9. <div class="list">
  10. <div class="l_item" v-for="(item,index) in list" :key="index">
  11. <div class="li_top adfacjb">
  12. <div class="lt_l">{{item.title||''}}</div>
  13. <div class="lt_r" :class="{'dcy':item.status===0,'ycy':item.status===1}">{{item.status===0?'待完成':item.status===1?'已完成':''}}</div>
  14. </div>
  15. <div class="li_text">
  16. 所属项目:<span>{{item.enterpriseName||''}}</span>
  17. </div>
  18. <div class="li_text">
  19. 所属团队:<span>{{item.teamName||''}}</span>
  20. </div>
  21. <div class="li_bottom adfacjb">
  22. <div class="lb_l adfac">
  23. <u-icon name="clock" color="#FD4F66" size="32"></u-icon>
  24. <span v-if="item.status===0">截止时间:{{ item.endTime||''}}</span>
  25. <span v-else-if="item.status===1">完成时间:{{ item.updateDate||''}}</span>
  26. </div>
  27. <div class="lb_r">
  28. <div class="lr_btn" v-if="item.status===0" @tap="toFill(item)">立即作答</div>
  29. <div class="lr_btn" v-if="item.status===1" @tap="toRepoer(item)">查看报告</div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <template v-else>
  36. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  37. </template>
  38. </view>
  39. </template>
  40. <script>
  41. import pageEmpty from '@/components/pageEmpty/index.vue'
  42. export default {
  43. components:{ pageEmpty },
  44. data(){
  45. return {
  46. tidx:1,
  47. list:[]
  48. }
  49. },
  50. onLoad() {
  51. this.getList();
  52. },
  53. methods:{
  54. getList(){
  55. this.$api.get('/core/teammember/que/listByUser').then(res=>{
  56. if(res.data.code!==0) return this.$showToast(res.data.msg)
  57. this.list = res.data.data.filter(d=>d.status===this.tidx-1)
  58. })
  59. },
  60. changeTab(index){
  61. this.tidx = index;
  62. this.getList();
  63. },
  64. toFill(item){
  65. if(Date.parse(new Date())-Date.parse(item.endTime)>0) return this.$showToast('已过截止时间,无法作答!')
  66. uni.navigateTo({
  67. url:`/pages/questionnaireFill?teamQuestionnaireId=${item.teamQuestionnaireId}&title=${item.title}`
  68. })
  69. },
  70. toRepoer(item){
  71. if(!item.fileUrl) return this.$showToast('报告为空,请联系教练。')
  72. },
  73. }
  74. }
  75. </script>
  76. <style scoped lang="less">
  77. .page{
  78. background: #F7F7F7;
  79. padding-bottom: 40rpx;
  80. box-sizing: border-box;
  81. .tabs{
  82. width: 100%;
  83. height: 90rpx;
  84. background: #FFFFFF;
  85. .t_pre{
  86. width: 50%;
  87. height: 90rpx;
  88. font-family: PingFang-SC, PingFang-SC;
  89. font-weight: bold;
  90. font-size: 32rpx;
  91. color: #666666;
  92. line-height: 90rpx;
  93. text-align: center;
  94. position: relative;
  95. &.active{
  96. color: #761E6A;
  97. &::after{
  98. content: '';
  99. width: 148rpx;
  100. height: 6rpx;
  101. background: #761E6A;
  102. border-radius: 9rpx;
  103. position: absolute;
  104. left: 50%;
  105. margin-left: -74rpx;
  106. bottom: 0;
  107. }
  108. }
  109. }
  110. }
  111. .list{
  112. .l_item{
  113. background: #FFFFFF;
  114. margin-top: 20rpx;
  115. width: 100%;
  116. padding: 36rpx 30rpx;
  117. box-sizing: border-box;
  118. .li_top{
  119. .lt_l{
  120. width: calc(100% - 142rpx);
  121. font-family: PingFang-SC, PingFang-SC;
  122. font-weight: bold;
  123. font-size: 30rpx;
  124. color: #252525;
  125. line-height: 40rpx;
  126. }
  127. .lt_r{
  128. width: 142rpx;
  129. font-family: PingFang-SC, PingFang-SC;
  130. font-weight: bold;
  131. font-size: 30rpx;
  132. line-height: 40rpx;
  133. text-align: right;
  134. &.dcy{
  135. color: #FD4F66;
  136. }
  137. &.ycy{
  138. color: #999999;
  139. }
  140. }
  141. }
  142. .li_text{
  143. font-family: PingFangSC, PingFang SC;
  144. font-weight: 400;
  145. font-size: 24rpx;
  146. color: #666666;
  147. line-height: 51rpx;
  148. margin-top: 15rpx;
  149. }
  150. .li_bottom{
  151. margin-top: 8rpx;
  152. padding-top: 29rpx;
  153. border-top: 1rpx solid #F0F2F8;
  154. .lb_l{
  155. background: rgba(253, 79, 102, 0.06);
  156. border-radius: 16rpx;
  157. padding: 3rpx 16rpx;
  158. span{
  159. font-family: PingFangSC, PingFang SC;
  160. font-weight: 400;
  161. font-size: 24rpx;
  162. color: #FD4F66;
  163. line-height: 51rpx;
  164. margin-left: 6rpx;
  165. }
  166. }
  167. .lb_r{
  168. .lr_btn{
  169. width: 142rpx;
  170. height: 64rpx;
  171. background: #833478;
  172. border-radius: 24rpx;
  173. font-family: PingFang-SC, PingFang-SC;
  174. font-weight: bold;
  175. font-size: 24rpx;
  176. color: #FFFFFF;
  177. line-height: 64rpx;
  178. text-align: center;
  179. letter-spacing: 2rpx;
  180. }
  181. }
  182. }
  183. }
  184. }
  185. }
  186. </style>