questionnaire.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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="42rpx" color="#B3BFC8"></u-icon>
  11. <view class="query-inp">
  12. <u-input v-model="keyword" border="none" fontSize="28rpx" color="#002846" confirmType="search"
  13. placeholder="请输入团队名称查询" @confirm="getList"></u-input>
  14. </view>
  15. <view class="query-right" @click="getList">搜索</view>
  16. </view>
  17. <view class="box">
  18. <template v-if="tindex===0">
  19. <receive-list :list="receiveList" @scrolltolower="receiveScrolltolower" @showDialogFn="showDialog"></receive-list>
  20. </template>
  21. <template v-else-if="tindex===1">
  22. <create-list :list="createList" @scrolltolower="createScrolltolower" @showDialogFn="showDialog"></create-list>
  23. </template>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import ReceiveList from './components/receiveList.vue'
  29. import CreateList from './components/createList.vue'
  30. export default {
  31. components:{ ReceiveList, CreateList },
  32. data(){
  33. return {
  34. title:'问卷管理',
  35. tindex:0,
  36. keyword:'',
  37. receiveList:[],
  38. createList:[],
  39. teamUserShow:false,
  40. dto:null
  41. }
  42. },
  43. onShareAppMessage(res) {
  44. const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id||'';
  45. return {
  46. title: this.dto.title || '发现一个好物,分享给你!',
  47. path: `/pages/home?shareTQId=${this.dto.teamQuestionnaireId}&shareUserId=${sharerId}&shareType=Questionnaire`,
  48. };
  49. },
  50. onShow() {
  51. if(this.tindex===0){
  52. this.receiveList = [];
  53. this.getReceiveList();
  54. }else if(this.tindex===1){
  55. this.createList = [];
  56. this.getCreateList();
  57. }
  58. },
  59. onLoad(options) {
  60. if(options.type==='receive'){
  61. this.title = 'PERILL团队发展动态评估';
  62. this.tindex = 0;
  63. this.receiveList = [];
  64. this.getReceiveList();
  65. }
  66. else if(options.type==='create'){
  67. this.title = '问卷管理';
  68. this.tindex = 1;
  69. this.createList = [];
  70. this.getCreateList();
  71. }
  72. },
  73. methods:{
  74. showDialog(dto){
  75. this.dto = dto;
  76. },
  77. changeTab(index){
  78. if(this.tindex===index) return
  79. this.tindex = index;
  80. if(index===0){
  81. this.receiveList = [];
  82. this.getReceiveList();
  83. }else if(index===1){
  84. this.createList = [];
  85. this.getCreateList();
  86. }
  87. },
  88. getList(){
  89. let index = this.tindex;
  90. if(index===0){
  91. this.receiveList = [];
  92. this.getReceiveList();
  93. }else if(index===1){
  94. this.createList = [];
  95. this.getCreateList();
  96. }
  97. },
  98. getReceiveList(){
  99. this.$api.get('/core/teammember/que/personalList',{teamName:this.keyword}).then(({data:res})=>{
  100. if(res.code!==0) return this.$showToast(res.msg)
  101. this.receiveList = res.data||[];
  102. if(this.receiveList.length===0) return this.$showToast('暂无数据')
  103. })
  104. },
  105. getCreateList(){
  106. this.$api.get('/core/teammember/que/createList',{teamName:this.keyword}).then(({data:res})=>{
  107. if(res.code!==0) return this.$showToast(res.msg)
  108. this.createList = res.data;
  109. if(this.createList.length===0) return this.$showToast('暂无数据')
  110. })
  111. },
  112. receiveScrolltolower(){
  113. console.log(1);
  114. },
  115. createScrolltolower(){
  116. console.log(2);
  117. }
  118. }
  119. }
  120. </script>
  121. <style scoped lang="scss">
  122. .default_page{
  123. padding: 0 24rpx 40rpx;
  124. background: #F7F7F7;
  125. box-sizing: border-box;
  126. .top_bg{
  127. width: 100%;
  128. position: absolute;
  129. left: 0;
  130. top: 0;
  131. }
  132. .query{
  133. width: calc(100% - 12rpx);
  134. margin: 40rpx 6rpx 0;
  135. height: 72rpx;
  136. background: #FFFFFF;
  137. border-radius: 36rpx;
  138. padding: 0 36rpx;
  139. box-sizing: border-box;
  140. position: relative;
  141. &-inp{
  142. flex: 1;
  143. padding: 0 20rpx;
  144. box-sizing: border-box;
  145. }
  146. &-right{
  147. font-size: 28rpx;
  148. color: #33A7A7;
  149. padding-left: 20rpx;
  150. position: relative;
  151. &::before{
  152. content: '';
  153. width: 1rpx;
  154. height: 30rpx;
  155. background: rgba(51, 167, 167, .5);
  156. position: absolute;
  157. left: 0;
  158. top: 50%;
  159. margin-top: -15rpx;
  160. }
  161. }
  162. }
  163. .box{
  164. flex: 1;
  165. overflow-y: auto;
  166. margin-top: 20rpx;
  167. }
  168. .tab{
  169. margin-top: 20rpx;
  170. position: relative;
  171. &-pre{
  172. width: 50%;
  173. font-family: PingFangSC, PingFang SC;
  174. font-weight: 400;
  175. font-size: 30rpx;
  176. color: #002846;
  177. line-height: 42rpx;
  178. text-align: center;
  179. &.active{
  180. font-weight: bold;
  181. font-size: 32rpx;
  182. line-height: 45rpx;
  183. position: relative;
  184. &::after{
  185. content: '';
  186. width: 48rpx;
  187. height: 6rpx;
  188. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  189. border-radius: 9rpx;
  190. position: absolute;
  191. left: 50%;
  192. margin-left: -24rpx;
  193. bottom: -22rpx;
  194. }
  195. }
  196. }
  197. }
  198. }
  199. </style>