fillTeamInfo.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='填写所在团队信息'></cus-header>
  4. <cus-team-info-fill @handleConfirm="handleConfirm" :confirmText="confirmText"></cus-team-info-fill>
  5. </view>
  6. </template>
  7. <script>
  8. import CusTeamInfoFill from '@/components/CusTeamInfoFill/index.vue'
  9. export default {
  10. components:{ CusTeamInfoFill },
  11. data(){
  12. return {
  13. type:'',
  14. questionnaireId:'',
  15. confirmText:'下一步'
  16. }
  17. },
  18. onLoad(options) {
  19. this.type = options.type||''
  20. this.questionnaireId = options.id||''
  21. this.confirmText = options.type?'确定':'下一步'
  22. },
  23. methods:{
  24. handleConfirm(team){
  25. if(!this.type){
  26. team.questionnaireId = this.questionnaireId;
  27. this.$api.post('/core/user/team',team).then(({data:res})=>{
  28. if(res.code!==0) return this.$showToast(res.msg)
  29. this.$showToast('保存成功,即将填写问卷')
  30. setTimeout(()=>{
  31. uni.navigateTo({
  32. url:'/pagesPublish/questionnaireFill'
  33. })
  34. },1500)
  35. })
  36. }else{
  37. this.getOpenerEventChannel().emit('saveTeamInfo',111)
  38. uni.navigateBack()
  39. }
  40. }
  41. }
  42. }
  43. </script>
  44. <style scoped lang="scss">
  45. .default_page{
  46. box-sizing: border-box;
  47. }
  48. </style>