Blame view

yslvdao-miniapp/pages/questionnaire/questionnaire.vue 2.88 KB
d64cd58f   wesley88   上传验收小程序
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
  <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 class="screen-list">
  			<view class="list" @click="show = true">
  				<text>问卷类型</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">
  			<view class='listbox' v-for="(item,index) in tableData" @click="go(`/pages/questionnaire/questDetail/questDetail?detail=${JSON.stringify(item)}`)">
  				 <view class="img">
  					 <image :src="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 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,
  				},
  				tableData:[],
  				pagesize:{
  				pageNumber: 0,
  				pageSize: 10,
  				}
  			};
  		},
  		mounted() {
  			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
  					this.query =  {
  					questionnaireType: '',
  					title: '',
  					pageNumber: 1,
  					pageSize: 2
  					}
  				})
  			},
  			createWen(){
  				uni.navigateTo({
  					url: '/pages/createQuestionnaire/createQuestionnaire'
  				})
  			}
  		}
  	}
  </script>
  
  <style scoped lang="scss">
  @import 'questionnaire.scss';
  </style>