调查问卷

This commit is contained in:
yanran200730
2021-11-23 11:51:14 +08:00
parent 2ccd572a11
commit 2fba037d57
10 changed files with 325 additions and 215 deletions

View File

@@ -1,69 +1,57 @@
<template>
<div class="form">
<div class="form-content">
<add-list ref="addList" v-if="currIndex === 1"></add-list>
<list ref="list" v-if="currIndex === 0"></list>
</div>
<ai-tabbar :active.sync="currIndex" :list="tabBar"/>
<div class="form-footer"></div>
<component
:is="component"
@change="onChange"
:params="params">
</component>
</div>
</template>
<script>
import addList from './components/addList.vue'
import list from './components/list.vue'
import AiTabbar from '../../components/AiTabbar'
import Tabbar from './components/Tabbar.vue'
import AddForm from './components/AddForm.vue'
export default {
name: 'AppAskForm',
appName: '问卷表单',
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()
data () {
return {
component: 'Tabbar',
params: {}
}
})
},
},
onReachBottom() {
if (this.currIndex === 0) {
this.$refs.list.getList()
components: {
Tabbar,
AddForm
},
onLoad () {
uni.$on('reload', () => {
if (this.currIndex === 0) {
this.$refs.list.reload()
} else {
this.$refs.addList.getList()
}
})
},
methods: {
onChange (e) {
this.params = e.params
this.component = e.type
},
},
onReachBottom() {
if (this.currIndex === 0) {
this.$refs.list.getList()
}
}
}
}
</script>
<style lang="scss" scoped>
.form {
padding-bottom: 98px;
}
</style>