调查问卷
This commit is contained in:
		
							
								
								
									
										74
									
								
								src/apps/AppAskForm/components/Tabbar.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								src/apps/AppAskForm/components/Tabbar.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="form">
 | 
			
		||||
    <div class="form-content">
 | 
			
		||||
      <add-list ref="addList" v-if="currIndex === 1" @change="onChange"></add-list>
 | 
			
		||||
      <list ref="list" v-if="currIndex === 0" @change="onChange"></list>
 | 
			
		||||
    </div>
 | 
			
		||||
    <ai-tabbar :active.sync="currIndex" :list="tabBar"/>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddList from './AddList.vue'
 | 
			
		||||
import List from './List.vue'
 | 
			
		||||
import AiTabbar from '@/components/AiTabbar'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'AppAskForm',
 | 
			
		||||
  appName: '问卷表单',
 | 
			
		||||
 | 
			
		||||
  data () {
 | 
			
		||||
    return {
 | 
			
		||||
      currIndex: 0
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  components: {
 | 
			
		||||
    AddList,
 | 
			
		||||
    AiTabbar,
 | 
			
		||||
    List
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  computed: {
 | 
			
		||||
    tabBar () {
 | 
			
		||||
      const link = icon => `${this.$cdn}askform/${icon}.png`
 | 
			
		||||
      return [
 | 
			
		||||
        {text: "表单列表", iconPath: "bdlb1", selectedIconPath: "bdlb2" },
 | 
			
		||||
        {text: "新建项目", iconPath: "xjxm1", selectedIconPath: "xjxm2" }
 | 
			
		||||
      ].map(e => ({
 | 
			
		||||
        ...e,
 | 
			
		||||
        iconPath: link(e.iconPath),
 | 
			
		||||
        selectedIconPath: link(e.selectedIconPath)
 | 
			
		||||
      }))
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  onLoad () {
 | 
			
		||||
    uni.$on('reload', () => {
 | 
			
		||||
      if (this.currIndex === 0) {
 | 
			
		||||
        this.$refs.list.reload()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$refs.addList.getList()
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  methods: {
 | 
			
		||||
    onChange (e) {
 | 
			
		||||
      this.$emit('change', e)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  onReachBottom() {
 | 
			
		||||
    if (this.currIndex === 0) {
 | 
			
		||||
      this.$refs.list.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  .form {
 | 
			
		||||
    padding-bottom: 98px;
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
		Reference in New Issue
	
	Block a user