questionnaire.vue 4.0 KB

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