tuanshiwei-web/components/AppContactUs.vue

460 lines
12 KiB
Vue
Raw Normal View History

2025-05-27 09:02:43 +08:00
<template>
<!-- PC端布局 -->
<div class="flex justify-between w-full h-full">
<!-- 左边导航栏 -->
2025-05-29 14:42:01 +08:00
2025-05-27 09:02:43 +08:00
<!-- 右边内容栏 -->
2025-07-04 13:15:56 +08:00
<div class="rightcon" id="contid" @scroll="hmScroll">
2025-05-27 09:02:43 +08:00
<div class="flex top_search ">
2025-07-02 17:33:47 +08:00
<div style="width: 350px;">
2025-07-04 17:00:55 +08:00
<img @click="toMore(0)" :src="`/img/index/dlogo.png`" style="cursor: pointer;;width: 100%;height: 100%;object-fit: cover;">
2025-05-27 09:02:43 +08:00
</div>
2025-07-08 15:01:30 +08:00
<div class="inputform">
2025-05-27 09:02:43 +08:00
<input v-model="inputSearch" class="contactInput w-full md:w-[337px]" type="text"
placeholder="请输入搜索关键字" />
2025-07-08 15:01:30 +08:00
<div class="search_rinput" @click="toSearch">
2025-05-27 09:02:43 +08:00
<img src="/img/index/hmsearch.png" alt="">
</div>
2025-07-08 15:01:30 +08:00
</div>
2025-05-27 09:02:43 +08:00
</div>
2025-07-04 17:00:55 +08:00
<div class=" w-full h-full left-msg">
2025-05-27 09:02:43 +08:00
<div
2025-07-04 17:00:55 +08:00
style="position: relative;;z-index: 1;background: #ffffff;padding: 30px;border-radius: 16px;margin-top: 20px;margin-left: 100px;">
<img class="to_img" :src="`/img/tt.png`" alt="">
<div class="liuyanba"></div>
2025-05-27 09:02:43 +08:00
<form class="contactForm w-full" @submit.prevent="submitForm">
<div class="inputforms">
<span>姓名</span>
<input v-model="formData.name"
class="contactInputs mt-[15px] md:mt-[30px] w-full md:w-[600px]" type="text"
2025-07-04 17:00:55 +08:00
placeholder="请输入您的姓名" />
2025-05-27 09:02:43 +08:00
<span>电话</span>
<input v-model="formData.mobile"
2025-07-04 17:00:55 +08:00
class="contactInputs mt-[15px] md:mt-[30px] w-full md:w-[600px]" type="text"
placeholder="请输入电话" />
<span>问题</span>
<input v-model="formData.question"
class="contactInputs mt-[15px] md:mt-[30px] w-full md:w-[600px]" type="text"
placeholder="请输入问题" />
2025-05-27 09:02:43 +08:00
</div>
<div class="relative mt-4 md:mt-8 w-full md:w-[1100px] flex">
2025-07-04 17:00:55 +08:00
<span style="font-size: 18px;font-weight: 400;width: 60px;padding-right: 10px;">描述</span>
2025-05-27 09:02:43 +08:00
<textarea v-model="formData.message" id="myTextarea" placeholder="为了更好地帮助您,请尽量提供详细的信息"
rows="5" maxlength="100"></textarea>
</div>
<button type="submit" class="contactBut">
{{ '提交' }}
</button>
</form>
</div>
<div class="re_top">
<div class="re_col" style="margin-left: 100px;"></div>
<div class="re_tit">精选留言</div>
<div class="re_col"></div>
</div>
2025-07-04 17:00:55 +08:00
<div class="re_list_top ml-[100px]" style="gap: 20px;">
2025-05-29 14:42:01 +08:00
<div class="re_list" v-for="item, index in liuyanList">
2025-05-27 09:02:43 +08:00
<div style="margin: 30px;">
<div class="re_list_tit flex" style="width: 100%;">
2025-07-02 17:33:47 +08:00
<span style="width: 15%">问题</span>
<span style="color: #323232;width:85% ;">{{ item.question }}</span>
2025-05-27 09:02:43 +08:00
</div>
2025-05-29 14:42:01 +08:00
<div class="re_list_tit flex" style="margin-top: 15px;width: 100%;">
2025-07-02 17:33:47 +08:00
<span style="width: 15%">描述</span>
2025-05-29 14:42:01 +08:00
<span :title="item.message" class="three-line-ellipsis"
2025-07-02 17:33:47 +08:00
style="font-weight: 400;font-size: 14px;color: #999999;width:85% ;">{{ item.message
2025-05-29 14:42:01 +08:00
}}</span>
2025-05-27 09:02:43 +08:00
</div>
<div class="re_list_tit flex" style="margin-top: 15px;">
2025-07-02 17:33:47 +08:00
<span style="color: #368FDF;width: 15%;">回复</span>
2025-05-29 14:42:01 +08:00
<span :title="item.answer" class="two-line-ellipsis"
2025-07-02 17:33:47 +08:00
style="font-weight: 400;font-size: 14px;color: #999999;width:85% ;">{{ item.answer
2025-05-29 14:42:01 +08:00
}}</span>
2025-05-27 09:02:43 +08:00
</div>
</div>
</div>
</div>
</div>
2025-07-02 17:33:47 +08:00
<AppFooter></AppFooter>
2025-05-27 09:02:43 +08:00
<!-- 右分享 -->
<!-- <div style="position: absolute;top: 300px;right:36px;" class="flex flex-col fiximg">
<img :src="`/img/index/douyin.png`" alt="">
<img :src="`/img/index/wb.png`" alt="">
<img :src="`/img/index/wx.png`" alt="">
<img :src="`/img/index/blbl.png`" alt="">
</div> -->
<!-- 底部鼠标 -->
2025-07-02 17:33:47 +08:00
<div class="mouse_img">
2025-05-27 09:02:43 +08:00
<img :src="`/img/index/hmouse.png`" alt="">
</div>
</div>
2025-07-04 17:00:55 +08:00
2025-05-27 09:02:43 +08:00
</div>
2025-07-04 17:00:55 +08:00
2025-05-27 09:02:43 +08:00
</template>
<script lang="ts" setup>
2025-07-04 13:15:56 +08:00
import { defineEmits } from 'vue'
2025-05-27 09:02:43 +08:00
import $api from '@/service/webRequest'
const inputSearch = ref('');
// 表单数据
const formData = reactive({
name: '',
mobile: '',
2025-07-04 17:00:55 +08:00
question: '',
2025-05-27 09:02:43 +08:00
message: ''
})
const total = ref(0);
const liuyanList = ref([]);
const getLiuyanList = async () => {
2025-05-29 14:42:01 +08:00
const res = await $api.post('/api/home.leave_word/index',
2025-05-27 09:02:43 +08:00
{
2025-07-04 17:00:55 +08:00
limit: 4,
2025-05-29 14:42:01 +08:00
page: 1,
status: 2,
show: 1
2025-05-27 09:02:43 +08:00
}
)
2025-05-29 14:42:01 +08:00
total.value = res.data.data.count;
liuyanList.value = res.data.data.list;
2025-05-27 09:02:43 +08:00
}
onMounted(() => {
getLiuyanList();
})
2025-07-08 15:01:30 +08:00
const toSearch = () => {
// emit('toSwpe',9);
// emitter.emit('inputSea', {
// keywords:inputSearch.value,
// type: 1,
// });
window.open(`/search_info?type=1&keywords=${inputSearch.value}`)
}
2025-07-04 13:15:56 +08:00
const emit = defineEmits(['toSwpe'])
2025-07-04 17:00:55 +08:00
const toMore = (index:number) => {
emit('toSwpe', index);
}
2025-07-04 13:15:56 +08:00
const hmScroll = () => {
let home = document.getElementById('contid');
console.log(home.scrollTop);
if (home.scrollTop == 0) {
2025-07-04 17:00:55 +08:00
emit('toSwpe', 6);
2025-07-04 13:15:56 +08:00
}
}
2025-05-27 09:02:43 +08:00
// 表单方法
const submitForm = () => {
console.log(formData);
// 这里可以添加表单验证逻辑
if (!formData.name) {
alert('请输入您的姓名')
return
}
if (!formData.mobile) {
alert('请输入您的手机号码')
return
}
2025-07-04 17:00:55 +08:00
if (!formData.question) {
alert('请输入您的问题')
2025-05-27 09:02:43 +08:00
return
}
if (!formData.message) {
alert('请输入您的留言内容')
return
}
$api.post("/api/home.leave_word/add", formData)
.then((res: any) => {
console.log(res)
if (res.status == 200) {
alert('留言成功')
} else {
alert('失败')
}
formData.name = '';
formData.mobile = '';
2025-07-04 17:00:55 +08:00
formData.question = '';
2025-05-27 09:02:43 +08:00
formData.message = '';
})
.catch((err) => {
console.dir(err)
})
// 重置表单
// formData.name = ''
// formData.mobile = ''
// formData.content = ''
}
</script>
<style lang="scss" scoped>
@import '@/assets/index.scss';
/* pc端样式 */
.rightcon {
2025-07-02 17:33:47 +08:00
width: 100%;
height: 100%;
background-image: url('/img/index/rightcons.png');
2025-05-27 09:02:43 +08:00
background-size: 100% 100%;
2025-07-02 17:33:47 +08:00
overflow-y: auto;
overflow-x: hidden;
2025-05-27 09:02:43 +08:00
}
.top_search {
2025-07-08 15:01:30 +08:00
margin: 0 auto;
2025-05-27 09:02:43 +08:00
margin-top: 50px;
height: 70px;
justify-content: space-between;
align-items: center;
2025-07-02 17:33:47 +08:00
margin-left: 415px;
width: 1200px;
2025-05-27 09:02:43 +08:00
}
.inputform {
position: relative;
width: 340px;
}
.contactInput {
width: 337px;
height: 50px;
background: #FFFFFF;
border-radius: 8px;
border: 1px solid #DEE4E8;
padding-left: 15px;
}
.contactInput::placeholder {
color: #999999;
}
.contactInput:focus {
outline: none;
}
.search_rinput {
width: 68px;
height: 50px;
2025-07-08 15:01:30 +08:00
background: #338CDE;
2025-05-27 09:02:43 +08:00
border-radius: 0px 8px 8px 0px;
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
}
//------------------------------------------
.liuyanba {
/* height: 22px; */
2025-07-04 17:00:55 +08:00
margin: 20px auto;
2025-05-27 09:02:43 +08:00
font-family: Microsoft YaHei UI;
font-weight: bold;
font-size: 22px;
color: #358DDE;
}
.contactForm {
width: 100%;
margin-left: 30px;
.inputforms {
display: flex;
justify-content: center;
align-items: center;
width: 1100px;
span {
2025-07-04 17:00:55 +08:00
color: #323232;
font-size: 18px;
2025-05-27 09:02:43 +08:00
width: 50px;
margin-top: 30px;
height: 100%;
2025-07-04 17:00:55 +08:00
font-weight: 400;
2025-05-27 09:02:43 +08:00
}
}
}
.contactInputs {
width: 380px;
height: 50px;
background: #FFFFFF;
border-radius: 6px;
padding-left: 20px;
border: 1px solid #999999;
2025-07-04 17:00:55 +08:00
margin-left: 20px;
margin-right: 20px;
2025-05-27 09:02:43 +08:00
}
.contactInputs::placeholder {
color: #768597;
}
.contactInputs:focus {
outline: none;
}
#myTextarea {
width: 1100px;
height: 167px;
background: #FFFFFF;
border-radius: 6px 6px 6px 6px;
opacity: 0.8;
2025-05-27 18:33:40 +08:00
padding-left: 10px;
padding-top: 10px;
2025-05-27 09:02:43 +08:00
resize: none;
border: 1px solid #999999;
}
#myTextarea::placeholder {
color: #768597;
}
#myTextarea:focus {
outline: none;
}
.contactBut {
width: 140px;
border-radius: 4px 4px 4px 4px;
// position: absolute;
// bottom: 20px;
// right: 30px;
height: 50px;
margin-top: 20px;
2025-07-08 15:01:30 +08:00
margin-left: 60px;
2025-05-27 09:02:43 +08:00
background: linear-gradient(0deg, #338CDE 0%, #469CE2 100%);
border: none;
font-weight: bold;
font-size: 18px;
color: #FFFFFF;
}
.re_top {
width: 100%;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
2025-07-02 17:33:47 +08:00
margin: 50px 0px 40px 0px;
2025-05-27 09:02:43 +08:00
.re_tit {
font-family: Microsoft YaHei;
font-weight: bold;
font-size: 36px;
2025-07-04 17:00:55 +08:00
color: #348CDD;
2025-05-27 09:02:43 +08:00
margin: 0 30px;
}
.re_col {
width: 78px;
height: 3px;
background: #348CDD;
}
}
2025-07-04 17:00:55 +08:00
.re_list_top {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
}
2025-05-27 09:02:43 +08:00
.re_list {
height: 243px;
background: #FFFFFF;
border-radius: 8px;
2025-07-04 17:00:55 +08:00
2025-05-29 14:42:01 +08:00
.re_list_tit {
2025-05-27 09:02:43 +08:00
font-family: Microsoft YaHei;
font-weight: bold;
font-size: 18px;
color: #FFA234;
}
}
2025-07-02 17:33:47 +08:00
.left-msg {
width: 1300px;
margin: 0 auto;
2025-07-04 17:00:55 +08:00
margin-top: 70px;
height: 1050px;
}
.to_img {
width: 275px;
position: absolute;
left: 0px;
right: 0px;
top: -13px;
margin: 0 auto;
2025-07-02 17:33:47 +08:00
}
@media (max-width: 1440px) {
2025-07-08 15:01:30 +08:00
.top_search {
width: 920px;
margin-left: 370px;
}
2025-07-02 17:33:47 +08:00
.left-msg {
width: 1018px;
margin: 0;
margin-left: 270px;
2025-07-08 15:01:30 +08:00
margin-top: 60px;
2025-07-02 17:33:47 +08:00
}
2025-07-04 17:00:55 +08:00
#myTextarea {
2025-07-02 17:33:47 +08:00
width: 752px;
}
2025-07-04 17:00:55 +08:00
.contactInputs {
width: 196px;
2025-07-02 17:33:47 +08:00
}
2025-07-04 17:00:55 +08:00
2025-07-02 17:33:47 +08:00
.inputforms {
display: flex;
2025-07-04 17:00:55 +08:00
justify-content: start !important;
2025-07-02 17:33:47 +08:00
align-items: center;
}
2025-07-04 17:00:55 +08:00
.contactForm .inputforms span {
2025-07-02 17:33:47 +08:00
width: 41px;
}
}
2025-07-08 15:01:30 +08:00
@media (max-width: 1280px) {
.top_search {
width: 800px;
margin-left: 357px;
}
.left-msg {
width: 900px;
margin: 0;
margin-left: 260px;
margin-top: 60px;
}
#myTextarea {
width: 658px;
}
.contactInputs {
width: 165px;
}
.inputforms {
display: flex;
justify-content: start !important;
align-items: center;
}
.contactForm .inputforms span {
width: 41px;
}
}
2025-05-27 09:02:43 +08:00
</style>