flat: 添加 调研

This commit is contained in:
Apcallover
2024-04-29 11:32:35 +08:00
parent 02a96dd80e
commit 9f16b866e0
5 changed files with 241 additions and 0 deletions

View File

@@ -20,4 +20,21 @@ export const replyQuestionnaireSurveyInfo = (params) => request({
url: '/api/jobslink-api/content/questionnaireSurveyInfo/reply', url: '/api/jobslink-api/content/questionnaireSurveyInfo/reply',
method: 'post', method: 'post',
data: params data: params
});
// 调研
export const listEmploymentSurveyManage = (params) => request({
url: '/api/jobslink-api/content/employmentSurveyManage/list',
method: 'get',
params
});
export const queryByIdEmploymentSurveyManage = (params) => request({
url: '/api/jobslink-api/content/employmentSurveyManage/queryById',
method: 'get',
params
});
export const replyEmploymentSurveyManage = (params) => request({
url: '/api/jobslink-api/content/employmentSurveyManage/reply',
method: 'post',
data: params
}); });

View File

@@ -0,0 +1,101 @@
<template>
<view class="app_cotainer">
<view class="content">
<p>描述{{infoMation.surveyContent}}</p>
</view>
<u--form labelPosition="left" :fromData="fromData" :model="fromData" :rules="rules" ref="uForm1">
<u-form-item label="" prop="replyContent" labelWidth="80" borderBottom>
<u--textarea v-model="fromData.replyContent" placeholder="回复内容"></u--textarea>
</u-form-item>
</u--form>
<view class="btn_add">
<u-button type="primary" size="large" text="发送信件" @click="submit"></u-button>
</view>
</view>
</template>
<script>
const rules = {
'replyContent': {
type: 'string',
required: true,
message: '请填写投诉标题',
trigger: ['blur', 'change']
},
}
import {
queryByIdEmploymentSurveyManage,
replyEmploymentSurveyManage
} from '@/api/help.js'
export default {
data() {
return {
infoMation: {},
fromData: {},
rules: Object.assign({}, rules),
isNext: true,
}
},
onLoad({
id
}) {
this.getDetail(id)
},
created() {
},
methods: {
async submit() {
if (this.isNext) {
this.isNext = false
} else {
return
}
if (!this.fromData.replyContent) {
this.isNext = true
return this.$api.mag('请输入回复内容')
}
console.log('submit', this.fromData)
let params = {
surveyId: this.infoMation.id,
...this.fromData,
}
uni.showLoading({
title: '请求中'
})
let resData = await replyEmploymentSurveyManage(params)
uni.hideLoading()
this.isNext = true
if (resData.data?.code === 200) {
uni.$u.toast(resData.data.msg)
this.$api.sleep(1000).then(() => {
uni.navigateBack(1)
})
}
},
getDetail(id) {
return new Promise(async (resolve, reject) => {
let resData = await queryByIdEmploymentSurveyManage({
id
})
if (resData.data.code === 200) {
this.infoMation = resData.data.data
resolve(resData.data.data)
} else {
reject()
}
})
}
}
}
</script>
<style scoped>
.app_cotainer {
padding: 24rpx;
}
.content {
margin-bottom: 100rpx;
}
</style>

View File

@@ -0,0 +1,104 @@
<template>
<view>
<view v-if="dataSource.length">
<block v-for="(item, index) in dataSource" :key="item.id">
<view class="search-item" @click="toDetail(item)">
{{item.surveyTitle}}
<view style="flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{ item.workname }}
</view>
<image src="../../static/img/eyeopen.svg" style="width: 32rpx;height: 32rpx;margin-right: 10rpx;"
mode="">
</image>
<view class="baddd"></view>
</view>
</block>
</view>
<empty v-else content="暂无问卷" mrTop="300"></empty>
</view>
</template>
<script>
import {
listEmploymentSurveyManage
} from '@/api/help.js'
export default {
data() {
return {
dataSource: [],
pageNumber: 1,
}
},
created() {
this.getList("refresh");
},
onReachBottom() {
this.getList();
},
onPullDownRefresh() {
this.getList("refresh");
},
methods: {
toDetail(row) {
this.navTo(`/pageMy/setUserBase/sub/surveyDetail?id=${row.id}`)
},
async getList(type = 'add') {
if (type === "refresh") {
this.pageNumber = 1;
}
let params = {
size: 10,
page: this.pageNumber
}
let resData = await listEmploymentSurveyManage(params)
uni.stopPullDownRefresh()
if (resData.data.code === 200) {
const {
current,
records,
total,
size
} = resData.data.data
if (!records.length) {
return this.$api.msg("没有更多");
}
switch (type) {
case "add":
this.dataSource = [...this.dataSource, ...records];
break;
case "refresh":
this.dataSource = records;
break;
}
this.pageNumber += 1;
}
}
}
}
</script>
<style scoped>
.baddd {
background: #f6f6f6;
height: 20rpx;
}
.search-item {
display: flex;
align-items: center;
font-size: 26rpx;
border-bottom: 1rpx solid #ddd;
height: 80rpx;
line-height: 80rpx;
padding: 10rpx 30rpx;
}
.search-item .type {
font-size: 20rpx;
color: #707070;
background-color: #dddddd;
border-radius: 15rpx;
height: 30rpx;
line-height: 30rpx;
padding: 0 20rpx;
}
</style>

View File

@@ -721,6 +721,20 @@
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "setUserBase/survey",
"style": {
"navigationBarTitleText": "用户调研列表",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
}, {
"path": "setUserBase/sub/surveyDetail",
"style": {
"navigationBarTitleText": "用户调研",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
}, },
{ {
"path": "help/questions/questionDetail", "path": "help/questions/questionDetail",

View File

@@ -67,6 +67,11 @@
问卷调查 问卷调查
<image src="../../static/img/right.svg" mode=""></image> <image src="../../static/img/right.svg" mode=""></image>
</view> </view>
<view class="btnList" @click="navTo('/pageMy/setUserBase/survey')">
<image src="../../static/img/phone.svg" mode=""></image>
用户调研
<image src="../../static/img/right.svg" mode=""></image>
</view>
<view class="btnList" @click="navTo('/pageMy/setUserBase/complain')"> <view class="btnList" @click="navTo('/pageMy/setUserBase/complain')">
<image src="../../static/img/vip.svg" mode=""></image> <image src="../../static/img/vip.svg" mode=""></image>
投诉建议 投诉建议