questionnaire.vue
3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
<view class="page">
<!-- <view class="head-search">
<u-search bg-color="#fff" placeholder="请输入关键词" v-model="query.title" :show-action="false" @search="search"></u-search>
<u-button type="success" @click="search">搜索</u-button>
</view> -->
<view
style="margin: 20rpx 0;background-color: #FFFFFF;border-radius: 18rpx;border: 2rpx solid #E8E8E8; margin: 22rpx 24rpx;overflow: hidden;">
<u-search
:action-style="{'background':'#19be6b','color':'#fff','height':'32px','line-height':'32px','border-radius':'18rpx'}"
bg-color="#fff" placeholder="请输入关键词" v-model="query.title" action-text="搜索" @clear="search"
@search="search" @custom="search"></u-search>
</view>
<view class="screen-list">
<view class="list" @click="show = true">
<text>{{query.questionnaireType?query.questionnaireType:'问卷类型'}}</text>
<image :src="$imgUrl('/down.png')"></image>
<u-select v-model="show" :list="areList"
@confirm="(v) => {queryChange('questionnaireType', v)}"></u-select>
</view>
<!-- <view class="list" @click="setList(1)">
<text>最新发布</text>
<image :src="$imgUrl('/down.png')"></image>
</view> -->
</view>
<view class="list-scorll">
<!-- @click="go(`/pages/questionnaire/questDetail/questDetail?detail=${JSON.stringify(item)}`)" -->
<view class='listbox' v-for="(item,index) in tableData" @click="goview(item)">
<view class="img">
<image :src="imgurl+item.coverImage"></image>
</view>
<view class="info">
<view class="title">{{item.title}}</view>
<view class="info-item">填写时长:<span>{{item.estimatedTime}}分钟</span></view>
<view class="info-item">填写时段:<span>{{item.startDate}}至{{item.endDate}}</span></view>
<view class="info-item">问卷类型:<span>{{item.questionnaireType}}</span></view>
</view>
</view>
</view>
<view v-if="tableData.length == 0" style="text-align: center;margin-top: 50rpx;color: #555555;font-size: 24rpx;"> 暂无数据</view>
<!-- <view style="height: 120rpx;"></view>
<view class="page-footer">
<u-button type="success" @click="createWen">创建问卷</u-button>
</view> -->
</view>
</template>
<script>
export default {
data() {
return {
show: false,
areList: [{
value: '物业问卷',
label: '物业问卷'
},
{
value: '招商问卷',
label: '招商问卷'
},
{
value: '满意度问卷',
label: '满意度问卷'
},
{
value: '社会调查问卷',
label: '社会调查问卷'
},
], // 区域列表
query: {
questionnaireType: '',
title: '',
pageNumber: 0,
pageSize: 10,
publishPort: '商家端',
reviewStatus:'3'
},
tableData: [],
pagesize: {
pageNumber: 0,
pageSize: 10,
publishPort: '商家端',
reviewStatus:'3'
},
imgurl:''
};
},
mounted() {
this.imgurl = this.$img
this.getAll()
},
methods: {
getAll() {
this.$http.sendRequest('/cereQuestionnaireTable/queryByPage', 'POST', this.pagesize, 1).then(res => {
//成功回调
this.tableData = res.data.data.content
})
},
go(urls) {
uni.navigateTo({
url: urls
})
},
queryChange(key, val) {
this.query[`${key}`] = val[0].value;
this.search();
},
search() {
this.$http.sendRequest('/cereQuestionnaireTable/queryByPage', 'POST', this.query, 1).then(res => {
//成功回调
this.tableData = res.data.data.content
})
},
createWen() {
uni.navigateTo({
url: '/pages/createQuestionnaire/createQuestionnaire'
})
},
goview(item) {
uni.navigateTo({
url: `/pages/questionnaire/questionWeb?id=${item.id}`
})
}
}
}
</script>
<style scoped lang="scss">
@import 'questionnaire.scss';
</style>