调查问卷

This commit is contained in:
yanran200730
2021-11-23 14:18:55 +08:00
parent 02db67eb00
commit b3c12d7204
6 changed files with 68 additions and 43 deletions

View File

@@ -44,20 +44,20 @@
</div> </div>
<div class="components-item__filed"> <div class="components-item__filed">
<template v-if="(item.type === 'radio')"> <template v-if="(item.type === 'radio')">
<radio-group v-model="item.value"> <u-radio-group v-model="item.value" wrap>
<radio class="u-radio" disabled style="display: block;" v-for="(field, i) in item.options" :key="i"> <u-radio class="u-radio" disabled style="display: block;" v-for="(field, i) in item.options" :key="i">
<image :src="field.img[0].url" v-if="field.img.length"/> <image :src="field.img[0].url" v-if="field.img.length"/>
<span>{{ field.label }}</span> <span>{{ field.label }}</span>
</radio> </u-radio>
</radio-group> </u-radio-group>
</template> </template>
<template v-if="(item.type === 'checkbox')"> <template v-if="(item.type === 'checkbox')">
<checkbox-group v-model="item.value" wrap> <u-checkbox-group v-model="item.value" wrap>
<checkbox class="u-checkbox" disabled :name="field.label" v-for="(field, i) in item.options" :key="i"> <u-checkbox class="u-checkbox" disabled :name="field.label" v-for="(field, i) in item.options" :key="i">
<image :src="field.img[0].url" v-if="field.img.length"/> <image :src="field.img[0].url" v-if="field.img.length"/>
<span>{{ field.label }}</span> <span>{{ field.label }}</span>
</checkbox> </u-checkbox>
</checkbox-group> </u-checkbox-group>
</template> </template>
<template v-if="(item.type === 'select')"> <template v-if="(item.type === 'select')">
<div class="components-item__select"> <div class="components-item__select">
@@ -95,7 +95,7 @@
</div> </div>
<div @click="onConfirm">立即发布</div> <div @click="onConfirm">立即发布</div>
</div> </div>
<u-popup :show="isShow" :closeable="false" mode="bottom" @close="isShow = false"> <u-popup v-model="isShow" :closeable="false" mode="bottom" @close="isShow = false">
<div class="add-popup"> <div class="add-popup">
<div class="add-popup__title"> <div class="add-popup__title">
<h2>添加问题</h2> <h2>添加问题</h2>
@@ -114,7 +114,16 @@
<AiBack custom @back="back"></AiBack> <AiBack custom @back="back"></AiBack>
</div> </div>
<div class="detail" v-if="isShowConfig"> <div class="detail" v-if="isShowConfig">
<component :is="component" @change="onChange" @back="isShowConfig = false" :id="id" :type="type" :formConfig="formConfig"></component> <component
:is="component"
:index="filedIndex"
:filed="filed"
@change="onChange"
:filedType="filedType"
@back="isShowConfig = false"
:id="id"
:formConfig="formConfig">
</component>
</div> </div>
</div> </div>
</template> </template>
@@ -156,6 +165,9 @@
isShow: false, isShow: false,
type: 0, type: 0,
id: '', id: '',
filedType: '',
filed: {},
filedIndex: '',
isQuote: false, isQuote: false,
touchStart: 0, touchStart: 0,
component: '', component: '',
@@ -167,7 +179,7 @@
AiBack, AiBack,
draggable, draggable,
FormSetting, FormSetting,
// FiledConfig FiledConfig
}, },
mounted () { mounted () {
@@ -195,6 +207,7 @@
}) })
uni.$on('filedConfig', res => { uni.$on('filedConfig', res => {
console.log(33)
if (res.index === '-1') { if (res.index === '-1') {
this.targetList.push(res.config) this.targetList.push(res.config)
} else { } else {
@@ -205,9 +218,6 @@
methods: { methods: {
toSetting () { toSetting () {
// uni.navigateTo({
// url: `/pages/askForm/formSetting?id=${this.id}&formConfig=${JSON.stringify(this.formConfig)}`
// })
this.component = 'FormSetting' this.component = 'FormSetting'
this.isShowConfig = true this.isShowConfig = true
}, },
@@ -364,18 +374,21 @@
}, },
toFiledSetting (type, index) { toFiledSetting (type, index) {
if (index != undefined) { console.log(index)
uni.navigateTo({ this.isShow = false
url: `/pages/askForm/filedConfig?config=${JSON.stringify(type)}&index=${index}` if (index > -1) {
}) this.filed = type
this.filedIndex = index
this.component = 'FiledConfig'
this.isShowConfig = true
return false return false
} }
this.isShow = false this.filedIndex = ''
uni.navigateTo({ this.filedType = type
url: `/pages/askForm/filedConfig?type=${type}` this.component = 'FiledConfig'
}) this.isShowConfig = true
}, },
init () { init () {

View File

@@ -133,9 +133,10 @@
<script> <script>
import { components } from './config' import { components } from './config'
export default { export default {
props: ['filed', 'index', 'filedType'],
data () { data () {
return { return {
index: '',
isShowType: false, isShowType: false,
isShowAnswer: false, isShowAnswer: false,
config: { config: {
@@ -143,13 +144,17 @@ export default {
} }
}, },
onLoad (query) { mounted () {
if (query.type) { console.log('11' + this.index)
this.config = JSON.parse(JSON.stringify(components.filter(v => v.type === query.type)[0])) if (this.index != undefined) {
} else { this.config = this.filed
this.config = JSON.parse(query.config) this.index = this.index
this.index = query.index
return false
} }
console.log(components)
this.config = JSON.parse(JSON.stringify(components.filter(v => v.type === this.filedType)[0]))
}, },
computed: { computed: {
@@ -253,9 +258,7 @@ export default {
}, },
back () { back () {
uni.navigateBack({ this.$emit('back')
delta: 1
})
}, },
confirm () { confirm () {
@@ -263,9 +266,8 @@ export default {
config: this.config, config: this.config,
index: this.index === '' ? '-1' : this.index index: this.index === '' ? '-1' : this.index
}) })
uni.navigateBack({
delta: 1 this.back()
})
}, },
addOptions () { addOptions () {

View File

@@ -9,8 +9,8 @@
</div> </div>
<div class="setting-item__right"> <div class="setting-item__right">
<u-radio-group v-model="periodValidityType" active-color="#1088F9"> <u-radio-group v-model="periodValidityType" active-color="#1088F9">
<u-radio name="0" label="永久有效" style="padding-right: 20rpx;"></u-radio> <u-radio name="0" label="永久有效" style="padding-right: 20rpx;">永久有效</u-radio>
<u-radio name="1" label="自定义时间"></u-radio> <u-radio name="1" label="自定义时间">自定义时间</u-radio>
</u-radio-group> </u-radio-group>
<u-icon name="arrow-right" color="#E1E2E3" /> <u-icon name="arrow-right" color="#E1E2E3" />
</div> </div>
@@ -40,8 +40,8 @@
</div> </div>
<div class="setting-item__right"> <div class="setting-item__right">
<u-radio-group v-model="commitType" active-color="#1088F9"> <u-radio-group v-model="commitType" active-color="#1088F9">
<u-radio name="0" label="不限次数" style="padding-right: 20rpx;"></u-radio> <u-radio name="0" label="不限次数" style="padding-right: 20rpx;">不限次数</u-radio>
<u-radio name="1" label="限提交一次"></u-radio> <u-radio name="1" label="限提交一次">限提交一次</u-radio>
</u-radio-group> </u-radio-group>
</div> </div>
</div> </div>
@@ -51,7 +51,7 @@
<image :src="`${$cdn}askform/bz.png`" @click="tips = '当客户点击或者发布表单时,发送表单的员工将会受到消息提醒' , isShowModal = true" /> <image :src="`${$cdn}askform/bz.png`" @click="tips = '当客户点击或者发布表单时,发送表单的员工将会受到消息提醒' , isShowModal = true" />
</div> </div>
<div class="setting-item__right"> <div class="setting-item__right">
<u-switch v-model="actionNotice" active-value="1" :size="20" active-color="#1088F9"></u-switch> <u-switch v-model="actionNotice" active-value="1" :size="40" active-color="#1088F9"></u-switch>
</div> </div>
</div> </div>
<div class="setting-item"> <div class="setting-item">
@@ -60,7 +60,7 @@
<image :src="`${$cdn}askform/bz.png`" @click="tips = '当客户点击或者发布表单时,会将客户的打开行为记录在客户动态里' , isShowModal = true" /> <image :src="`${$cdn}askform/bz.png`" @click="tips = '当客户点击或者发布表单时,会将客户的打开行为记录在客户动态里' , isShowModal = true" />
</div> </div>
<div class="setting-item__right"> <div class="setting-item__right">
<u-switch v-model="dynamicNotice" active-value="1" :size="20" active-color="#1088F9"></u-switch> <u-switch v-model="dynamicNotice" active-value="1" :size="40" active-color="#1088F9"></u-switch>
</div> </div>
</div> </div>
</div> </div>
@@ -71,7 +71,7 @@
<div @click="confirm">{{ type === 'edit' ? '发布' : '确定' }}</div> <div @click="confirm">{{ type === 'edit' ? '发布' : '确定' }}</div>
</div> </div>
<u-modal v-model="isShowModal" :content="tips"></u-modal> <u-modal v-model="isShowModal" :content="tips"></u-modal>
<u-picker mode="time" :show="isShowTime" :show-time-tag="true" @close="isShowTime = false" @confirm="onTimeChange" :params="params"></u-picker> <u-picker mode="time" v-model="isShowTime" :show-time-tag="true" @close="isShowTime = false" @confirm="onTimeChange" :params="params"></u-picker>
</div> </div>
</template> </template>

View File

@@ -83,6 +83,7 @@
</template> </template>
<script> <script>
import AiTopFixed from '@/components/AiTopFixed'
import {mapActions} from 'vuex' import {mapActions} from 'vuex'
export default { export default {
@@ -105,6 +106,10 @@ export default {
} }
}, },
components: {
AiTopFixed
},
mounted() { mounted() {
this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact']) this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact'])
this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']).then(() => { this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']).then(() => {

View File

@@ -11,7 +11,7 @@
<script> <script>
import AddList from './AddList.vue' import AddList from './AddList.vue'
import List from './List.vue' import List from './List.vue'
import AiTabbar from '@/components/AiTabbar' import AiTabbar from './AiTabbar'
export default { export default {
name: 'AppAskForm', name: 'AppAskForm',

View File

@@ -83,6 +83,7 @@
</template> </template>
<script> <script>
import AiTopFixed from '@/components/AiTopFixed'
import {mapActions} from 'vuex' import {mapActions} from 'vuex'
export default { export default {
@@ -105,6 +106,10 @@ export default {
} }
}, },
components: {
AiTopFixed
},
mounted() { mounted() {
this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact']) this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact'])
this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']).then(() => { this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']).then(() => {