Feedback.vue 3.23 KB
<template>
	<view class="page">
		<!-- 反馈内容 -->
		<view class="feedback-data">
			<view class="titleall-box">
				<view class="titleall-left"><view class="titleall-left-line"></view>填写诉求</view>
			</view>
			<view class="content">
				<textarea v-model="requires" placeholder="请填写您的诉求..." />
			</view>
			<view class="voucher-img">
				<view class="list">
					<image src="/static/voucher_bg.png"></image>
				</view>
				<view class="list">
					<image src="/static/img/yf_01.png"></image>
				</view>
				<view class="list">
					<image src="/static/img/yf_01.png"></image>
				</view>
			</view>
		</view>
		<!-- 选择反馈类型 -->
		<view class="feedback-type">
			<view class="feedback-type-left">隶属类别</view>
			<view class="feedback-type-right">
				<view class="title">
					<text>{{TypeArray[TypeIndex]}}</text>
				</view>
				<view class="picker">
					<picker @change="FeedbackTypeCh" :value="TypeIndex" :range="TypeArray">
							<view class="uni-input">{{TypeArray[TypeIndex]}}</view>
					</picker>
				</view>
				<view class="more">
					<image src="../../static/down1.png"></image>
				</view>
			</view>
		</view>
		<!-- 提交 -->
		<view class="submit-btn" @click="submitContent">
			<text>提交</text>
		</view>
	</view>
</template>

<script>
import { data } from '../../uview-ui/libs/mixin/mixin';
import request from '@/utils/request.js'
	export default {
		data() {
			return {
				TypeArray: ['行政审批', '生产运营', '金融服务', '其他'],
				TypeIndex: 0,
				// 填写诉求内容
				requires:'',
				type:"",
				lastModifyUserId:''
			};
			
		},
		onLoad() {
			this.getUser()
			let user = uni.getStorageSync('user')
			this.lastModifyUserId = user.userInfo.userId
			
		},
		methods:{
			// 获取用户信息
			getUser(){
				if (uni.getStorageSync('user')) {
					// this.userCode = uni.getStorageSync('user').data.user.userInfo
					// this.userInfo = this.userCode.userAccount
					// this.userInfo = '123456'
					console.log('用户已登录!')
				} else {
					uni.showToast({
						title: '请登录',
						icon: 'none'
					})
					setTimeout(() => {
						uni.reLaunch({
							url: '/pages/login/index'
						})
					})
				}
			},
			// 提交内容
			submitContent(){
				let that = this
				let query = {
					content:this.requires,
					type:this.TypeArray[this.TypeIndex],
					creatorUserId:this.lastModifyUserId,
					lastModifyUserId:this.lastModifyUserId,
					plate:'诉求模块'
				}
				console.log(query)
				request({
					url: '/api/Extend/baseappealinformation',
					method: 'post',
					data: {
						content:this.requires,
						type:this.TypeArray[this.TypeIndex],
						creatorUserId:this.lastModifyUserId,
						lastModifyUserId:this.lastModifyUserId,
						plate:'诉求模块'
					},
				}).then(res=>{
					console.log(res)
					if(res.code === 200){
						uni.showToast({
							icon:"success",
							title:"提交成功"
						})
					}else{
						uni.showToast({
							icon:"error",
							title:'提交失败'
						})
					}
				})
			},
			/**
			 * 反馈类型
			 * @param {Object} val
			 */
			FeedbackTypeCh(val){
				console.log(val);
				this.TypeIndex = val.detail.value;
			}
		}
	}
</script>

<style scoped lang="scss">
	@import 'Feedback.scss';
</style>