questionnaire.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. onShow() {
  41. if(this.tindex===0){
  42. this.receiveList = [];
  43. this.getReceiveList();
  44. }else if(this.tindex===1){
  45. this.createList = [];
  46. this.getCreateList();
  47. }
  48. },
  49. methods:{
  50. changeTab(index){
  51. if(this.tindex===index) return
  52. this.tindex = index;
  53. if(index===0){
  54. this.receiveList = [];
  55. this.getReceiveList();
  56. }else if(index===1){
  57. this.createList = [];
  58. this.getCreateList();
  59. }
  60. },
  61. getReceiveList(){
  62. this.$api.get('/core/teammember/que/personalList',{teamName:this.keyword}).then(({data:res})=>{
  63. if(res.code!==0) return this.$showToast(res.msg)
  64. this.receiveList = res.data
  65. })
  66. },
  67. getCreateList(){
  68. this.$api.get('/core/teammember/que/createList',{teamName:this.keyword}).then(({data:res})=>{
  69. if(res.code!==0) return this.$showToast(res.msg)
  70. this.createList = res.data
  71. })
  72. },
  73. receiveScrolltolower(){
  74. console.log(1);
  75. },
  76. createScrolltolower(){
  77. console.log(2);
  78. }
  79. }
  80. }
  81. </script>
  82. <style scoped lang="scss">
  83. .default_page{
  84. padding: 0 24rpx 40rpx;
  85. background: #F7F7F7;
  86. box-sizing: border-box;
  87. .top_bg{
  88. width: 100%;
  89. position: absolute;
  90. left: 0;
  91. top: 0;
  92. }
  93. .query{
  94. width: calc(100% - 12rpx);
  95. margin: 40rpx 6rpx 0;
  96. height: 72rpx;
  97. background: #FFFFFF;
  98. border-radius: 36rpx;
  99. padding: 0 36rpx;
  100. box-sizing: border-box;
  101. position: relative;
  102. &-inp{
  103. width: calc(100% - 55rpx);
  104. }
  105. }
  106. .box{
  107. flex: 1;
  108. }
  109. .tab{
  110. margin-top: 20rpx;
  111. position: relative;
  112. &-pre{
  113. width: 50%;
  114. font-family: PingFangSC, PingFang SC;
  115. font-weight: 400;
  116. font-size: 30rpx;
  117. color: #002846;
  118. line-height: 42rpx;
  119. text-align: center;
  120. &.active{
  121. font-weight: bold;
  122. font-size: 32rpx;
  123. line-height: 45rpx;
  124. position: relative;
  125. &::after{
  126. content: '';
  127. width: 48rpx;
  128. height: 6rpx;
  129. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  130. border-radius: 9rpx;
  131. position: absolute;
  132. left: 50%;
  133. margin-left: -24rpx;
  134. bottom: -22rpx;
  135. }
  136. }
  137. }
  138. }
  139. }
  140. </style>