questionnaire.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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" @showDialogFn="showDialog"></receive-list>
  19. </template>
  20. <template v-else-if="tindex===1">
  21. <create-list :list="createList" @scrolltolower="createScrolltolower" @showDialogFn="showDialog"></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. dto:null
  40. }
  41. },
  42. onShareAppMessage(res) {
  43. const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
  44. return {
  45. title: this.dto.title || '发现一个好物,分享给你!',
  46. path: `/pages/home?shareTQId=${this.dto.teamQuestionnaireId}&shareUserId=${sharerId}&shareType=Questionnaire`,
  47. };
  48. },
  49. onShow() {
  50. if(this.tindex===0){
  51. this.receiveList = [];
  52. this.getReceiveList();
  53. }else if(this.tindex===1){
  54. this.createList = [];
  55. this.getCreateList();
  56. }
  57. },
  58. onLoad(options) {
  59. if(options.type==='receive'){
  60. this.title = 'PREILL评估';
  61. this.tindex = 0;
  62. this.receiveList = [];
  63. this.getReceiveList();
  64. }
  65. else if(options.type==='create'){
  66. this.title = '问卷管理';
  67. this.tindex = 1;
  68. this.createList = [];
  69. this.getCreateList();
  70. }
  71. },
  72. methods:{
  73. showDialog(dto){
  74. this.dto = dto;
  75. },
  76. changeTab(index){
  77. if(this.tindex===index) return
  78. this.tindex = index;
  79. if(index===0){
  80. this.receiveList = [];
  81. this.getReceiveList();
  82. }else if(index===1){
  83. this.createList = [];
  84. this.getCreateList();
  85. }
  86. },
  87. getReceiveList(){
  88. this.$api.get('/core/teammember/que/personalList',{teamName:this.keyword}).then(({data:res})=>{
  89. if(res.code!==0) return this.$showToast(res.msg)
  90. this.receiveList = res.data
  91. })
  92. },
  93. getCreateList(){
  94. this.$api.get('/core/teammember/que/createList',{teamName:this.keyword}).then(({data:res})=>{
  95. if(res.code!==0) return this.$showToast(res.msg)
  96. this.createList = res.data
  97. })
  98. },
  99. receiveScrolltolower(){
  100. console.log(1);
  101. },
  102. createScrolltolower(){
  103. console.log(2);
  104. }
  105. }
  106. }
  107. </script>
  108. <style scoped lang="scss">
  109. .default_page{
  110. padding: 0 24rpx 40rpx;
  111. background: #F7F7F7;
  112. box-sizing: border-box;
  113. .top_bg{
  114. width: 100%;
  115. position: absolute;
  116. left: 0;
  117. top: 0;
  118. }
  119. .query{
  120. width: calc(100% - 12rpx);
  121. margin: 40rpx 6rpx 0;
  122. height: 72rpx;
  123. background: #FFFFFF;
  124. border-radius: 36rpx;
  125. padding: 0 36rpx;
  126. box-sizing: border-box;
  127. position: relative;
  128. &-inp{
  129. width: calc(100% - 55rpx);
  130. }
  131. }
  132. .box{
  133. flex: 1;
  134. }
  135. .tab{
  136. margin-top: 20rpx;
  137. position: relative;
  138. &-pre{
  139. width: 50%;
  140. font-family: PingFangSC, PingFang SC;
  141. font-weight: 400;
  142. font-size: 30rpx;
  143. color: #002846;
  144. line-height: 42rpx;
  145. text-align: center;
  146. &.active{
  147. font-weight: bold;
  148. font-size: 32rpx;
  149. line-height: 45rpx;
  150. position: relative;
  151. &::after{
  152. content: '';
  153. width: 48rpx;
  154. height: 6rpx;
  155. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  156. border-radius: 9rpx;
  157. position: absolute;
  158. left: 50%;
  159. margin-left: -24rpx;
  160. bottom: -22rpx;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. </style>