fillTeamInfo.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. next:'',
  15. questionnaireId:'',
  16. confirmText:'下一步'
  17. }
  18. },
  19. onLoad(options) {
  20. this.type = options.type;
  21. this.questionnaireId = options.questionnaireId||'';
  22. this.confirmText = options.type?'确定':'下一步';
  23. this.next = options.next;
  24. if(this.next) this.confirmText = '下一步';
  25. },
  26. methods:{
  27. handleConfirm(team){
  28. if(this.next){
  29. team.questionnaireId = this.questionnaireId;
  30. team.coachId = JSON.parse(uni.getStorageSync('userInfo')).id;
  31. this.$api.post('/core/user/team',team).then(({data:res})=>{
  32. if(res.code!==0) return this.$showToast(res.msg)
  33. this.$showToast('保存成功,即将填写问卷')
  34. setTimeout(()=>{
  35. uni.removeStorageSync('newUser')
  36. uni.navigateTo({
  37. url:'/pagesPublish/questionnaireFill?teamQuestionnaireId='+res.data.teamQueId+'&teamId='+res.data.teamId+'&type='+this.type
  38. })
  39. },1500)
  40. })
  41. }else{
  42. this.getOpenerEventChannel().emit('saveTeamInfo',111)
  43. uni.navigateBack()
  44. }
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped lang="scss">
  50. .default_page{
  51. box-sizing: border-box;
  52. }
  53. </style>