mirror of
https://github.com/201206030/novel-front-web.git
synced 2025-04-27 07:50:50 +00:00
feat: 增加用户反馈功能
This commit is contained in:
parent
bdea1a7bff
commit
29a03d9e4e
@ -7,3 +7,7 @@ export function register(params) {
|
||||
export function login(params) {
|
||||
return request.post('/user/login', params);
|
||||
}
|
||||
|
||||
export function submitFeedBack(params) {
|
||||
return request.post('/user/feedBack', params);
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
><a href="/">网站首页</a><i class="line">|</i
|
||||
><a href="/about/default.html">关于我们</a><i class="line">|</i
|
||||
><a href="/about/contact.html">联系我们</a><i class="line">|</i
|
||||
><a href="/user/feedback.html">反馈留言</a><i class="line">|</i
|
||||
><router-link :to="{ name: 'feadBack' }" class="line" >反馈留言</router-link><i class="line">|</i
|
||||
><a href="/author/index.html">作家专区</a><i class="line">|</i
|
||||
><a href="/mobile/fiction_house.apk">客户端</a>
|
||||
</li>
|
||||
|
@ -24,6 +24,11 @@ const router = createRouter({
|
||||
name: 'login',
|
||||
component: () => import('@/views/Login')
|
||||
},
|
||||
{
|
||||
path: '/feadBack',
|
||||
name: 'feadBack',
|
||||
component: () => import('@/views/FeadBack')
|
||||
},
|
||||
{
|
||||
path: '/news/:id',
|
||||
name: 'news',
|
||||
|
97
src/views/FeadBack.vue
Normal file
97
src/views/FeadBack.vue
Normal file
@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<Header />
|
||||
|
||||
<div class="main box_center cf">
|
||||
<div class="channelWrap channelFeedback cf">
|
||||
<div class="userBox cf">
|
||||
<div class="viewhistoryBox">
|
||||
<div class="my_bookshelf">
|
||||
<div class="title cf">
|
||||
<h2 class="fl ml10">
|
||||
<a href="javascript:void(0);">反馈留言</a>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="feedbackBox">
|
||||
|
||||
<ul class="reg_list">
|
||||
<li>
|
||||
<textarea
|
||||
v-model="content"
|
||||
name="txtDescription"
|
||||
rows="2"
|
||||
cols="20"
|
||||
id="txtDescription"
|
||||
class="textarea"
|
||||
placeholder="请说明情况,并留下联系方式,你可以在个人中心【我的反馈】里查看回复~"
|
||||
></textarea>
|
||||
</li>
|
||||
<li class="mb20">
|
||||
<input
|
||||
@click="submit"
|
||||
type="submit"
|
||||
name="btnSave"
|
||||
value="提交"
|
||||
id="btnSave"
|
||||
class="btn_red btn_big"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span id="LabErr"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Footer />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import "@/assets/styles/user.css";
|
||||
import { reactive, toRefs, onMounted, ref } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { submitFeedBack } from "@/api/user";
|
||||
import { setToken, setNickName } from "@/utils/auth";
|
||||
import Header from "@/components/common/Header";
|
||||
import Footer from "@/components/common/Footer";
|
||||
export default {
|
||||
name: "feadBack",
|
||||
components: {
|
||||
Header,
|
||||
Footer,
|
||||
},
|
||||
setup() {
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const state = reactive({
|
||||
content: "",
|
||||
});
|
||||
|
||||
const submit = async () => {
|
||||
if (!state.content) {
|
||||
ElMessage.error("反馈内容不能为空!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.content.length < 10) {
|
||||
ElMessage.error("反馈内容不能少于 10 个字符!");
|
||||
return;
|
||||
}
|
||||
await submitFeedBack(state.content);
|
||||
state.content = "";
|
||||
ElMessage.success("提交成功!");
|
||||
};
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
submit,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user