questionnaire.vue 4.6 KB

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