questionnaire.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="default_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的问卷' bgColor="transparent"></cus-header>
  4. <image class="top_bg" :src="imgBase+'questionnaire_top_bg.png'" mode="widthFix"></image>
  5. <view class="tab adfac">
  6. <view class="tab-pre" :class="{'active':tindex===0}" @click="changeTab(0)">我收到的</view>
  7. <view class="tab-pre" :class="{'active':tindex===1}" @click="changeTab(1)">我创建的</view>
  8. </view>
  9. <view class="query adfacjb">
  10. <u-icon name="search" size="38rpx" color="#B3BFC8"></u-icon>
  11. <view class="query-inp">
  12. <u-input v-model="keyword" border="none" fontSize="26rpx" color="#002846" clearable
  13. placeholder="请输入团队名称查询" @confirm="getList"></u-input>
  14. </view>
  15. </view>
  16. <view class="box">
  17. <template v-if="tindex===0">
  18. <receive-list :list="receiveList" @scrolltolower="receiveScrolltolower"></receive-list>
  19. </template>
  20. <template v-else-if="tindex===1">
  21. <create-list :list="createList" @scrolltolower="createScrolltolower"></create-list>
  22. </template>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import ReceiveList from './components/receiveList.vue'
  28. import CreateList from './components/createList.vue'
  29. export default {
  30. components:{ ReceiveList, CreateList },
  31. data(){
  32. return {
  33. tindex:0,
  34. keyword:'',
  35. receiveList:[],
  36. createList:[],
  37. teamUserShow:false,
  38. }
  39. },
  40. onLoad() {
  41. this.getReceiveList();
  42. },
  43. methods:{
  44. changeTab(index){
  45. if(this.tindex===index) return
  46. this.tindex = index;
  47. if(index===0){
  48. this.receiveList = [];
  49. this.getReceiveList();
  50. }else if(index===1){
  51. this.createList = [];
  52. this.getCreateList();
  53. }
  54. },
  55. getReceiveList(){
  56. this.$api.get('/core/teammember/que/listByUser',{queType:1,teamName:this.keyword}).then(({data:res})=>{
  57. if(res.code!==0) return this.$showToast(res.msg)
  58. this.receiveList = res.data
  59. })
  60. },
  61. getCreateList(){
  62. this.$api.get('/core/teammember/que/listByUser',{queType:0,teamName:this.keyword}).then(({data:res})=>{
  63. if(res.code!==0) return this.$showToast(res.msg)
  64. this.createList = res.data
  65. })
  66. },
  67. receiveScrolltolower(){
  68. console.log(1);
  69. },
  70. createScrolltolower(){
  71. console.log(2);
  72. }
  73. }
  74. }
  75. </script>
  76. <style scoped lang="scss">
  77. .default_page{
  78. padding: 0 24rpx 40rpx;
  79. background: #F7F7F7;
  80. box-sizing: border-box;
  81. .top_bg{
  82. width: 100%;
  83. position: absolute;
  84. left: 0;
  85. top: 0;
  86. }
  87. .query{
  88. width: calc(100% - 12rpx);
  89. margin: 40rpx 6rpx 0;
  90. height: 72rpx;
  91. background: #FFFFFF;
  92. border-radius: 36rpx;
  93. padding: 0 36rpx;
  94. box-sizing: border-box;
  95. position: relative;
  96. &-inp{
  97. width: calc(100% - 55rpx);
  98. }
  99. }
  100. .box{
  101. flex: 1;
  102. }
  103. .tab{
  104. margin-top: 20rpx;
  105. position: relative;
  106. &-pre{
  107. width: 50%;
  108. font-family: PingFangSC, PingFang SC;
  109. font-weight: 400;
  110. font-size: 30rpx;
  111. color: #002846;
  112. line-height: 42rpx;
  113. text-align: center;
  114. &.active{
  115. font-weight: bold;
  116. font-size: 32rpx;
  117. line-height: 45rpx;
  118. position: relative;
  119. &::after{
  120. content: '';
  121. width: 48rpx;
  122. height: 6rpx;
  123. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  124. border-radius: 9rpx;
  125. position: absolute;
  126. left: 50%;
  127. margin-left: -24rpx;
  128. bottom: -22rpx;
  129. }
  130. }
  131. }
  132. }
  133. }
  134. </style>