登录接口完成,到时候改接口地址的时候需要在vue.config.js的代理服务器改下

main
xuan 2 months ago
parent b439d7d5e1
commit 7137f882d8

@ -0,0 +1,229 @@
.chat-totallayout{
display: flex;
flex-direction: row;
height: 85%;
width: 100%;
/* flex-grow: 0;
flex-shrink: 0; */
/* background-color: aqua; */
}
.chat-leftlayout{
/* background-color: azure; */
width: 25%;
height: 100%;
display: flex;
flex-direction: column;
}
.chat-middlelayout{
background: linear-gradient(to top, #fff9a1 65%, #fcdcd7);
width: 55%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
}
.chat-rightlayout{
/* background-color: red; */
position: relative;
width: 20%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 3%;
}
/**************整体布局***************/
/*************左边************** *****/
/* 第一行 */
.chat-leftline1{
display: flex;
/* background-color: antiquewhite; */
align-items: center;
margin-left: 30px;
}
.chat-leftlayout :nth-child(1){
flex-shrink: 0;
font-size: 30px;
font-weight: 600;
}
.chat-leftline1 :nth-child(2){
flex-shrink: 0;
font-size: 20px;
font-weight: 600;
color: rgb(61, 243, 243);
margin-left: 15px;
position: relative;
top: 2px;
}
/* 第二行 */
.chat-leftline2{
display: flex;
align-items: center;
}
#chatSearchImg{
height: 16px;
position: relative;
left: 23px;
top: -18px;
z-index: 1;
}
#chatSearchInput{
outline: none;
height: 30px;
width: 300px;
border: 2px solid #E44B9D;
border-radius: 8px;
padding-left: 30px;
position: relative;
top: -18px;
transition: all 0.5s;
}
#chatSearchInput:focus{
border-color: #fdadd8;
}
/* 第三行 */
.chat-leftline3{
display: flex;
flex-direction: column;
/* align-items: center; */
}
.chat-friends{
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgb(222, 222, 222);
/* background-color: #E44B9D; */
height: 70px;
width: 90%;
margin: 0 auto;
/* transition: all 0.2ss; */
}
.chat-friends:hover{
background-color: #fff2f9;
}
.chat-friends:active{
background-color: #fcb8dd;
}
.chat-friend-text{
position: relative;
width: 60%;
/* background-color: #E44B9D; */
flex-shrink: 0;
}
#chatIconImg{
height: 50px;
width: 50px;
}
/* .chat-friend-text{
background-color: aliceblue;
} */
#chatFriendName{
font-size: medium;
color: black;
line-height: 10px;
}
#chatFriendMsg{
font-size: small;
font-weight: 300;
color: gray;
/* line-height: 0px; */
}
#chatTime{
font-size: small;
font-weight: 300;
color: gray;
/* background-color: #fdadd8; */
}
/*****************中间****************** */
.send-msg{
align-self: center;
justify-self: flex-end;
display: flex;
position: absolute;
bottom: 5%;
width: 80%;
}
#send-msg-input{
outline: none;
border: 1px solid #E44B9D;
border-radius: 10px;
width: 90%;
margin: 5px;
}
.search-btn{
background-image: url("@/assets/pictures/chat/SendBtn.png");
background-size: 100% 100%;
width: 40px;
height: 40px;
border: none;
overflow: hidden;
border-radius: 10px;
}
.search-btn:active{
background-image: url("@/assets/pictures/chat/SendBtn.png");
background-size: 100% 100%;
width: 40px;
height: 40px;
border: none;
overflow: hidden;
border-radius: 10px;
background-color: #a75efb;
}
/*****************右边***************************/
.friend-information{
width: 75%;
display: flex;
justify-content: space-around;
color: gray;
position: relative;
top: 0%;
}
.friend-information p{
position: relative;
top: -31%;
}
.chat-special-btn{
display: flex;
justify-content: space-around;
width: 85%;
height: 20%;
}
.chat-home-tree-btn{
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
}
.chat-home-page-btn{
background-color: #f85096;
background-image: url('../../pictures/chat/portrait.png');
background-size: 60% 60%;
background-position: center center;
background-repeat: no-repeat;
height: 60px;width: 60px; border: none; border-radius: 50%;
}
.chat-tree-btn{
background-color: #a75efb;
background-image: url('../../pictures/chat/tree.png');
background-size: 60% 60%;
background-position: center center;
background-repeat: no-repeat;
height: 60px;width: 60px; border: none; border-radius: 50%;
}
.chat-connection{
display: flex;
width: 62%;
justify-content: space-around;
}
.chat-recomend{
display: flex;
flex-direction: row;
justify-content: space-around;
width: 90%;
}

@ -1,27 +0,0 @@
/* 给圆形定义关键帧 */
@keyframes switch {
0% {
left: calc(4px * 0.2);
}
60% {
left:calc(4px * 0.2);
width: calc(112px * 0.2);
}
100%{
left: calc(104px * 0.2);
}
}
@keyframes reverse_switch {
0% {
left: calc(104px * 0.2);
}
60%{
left: calc(74px * 0.2);
width: calc(112px * 0.2);
}
100%{
left: calc(4px * 0.2);
}
}

@ -4,7 +4,8 @@ import {getToken} from '@/token/auth' // 注意这里使用了解构赋值来导
// 创建axios实例
const service = axios.create({
baseURL: 'http://47.122.59.26:8080/api', // 配置基础URL
// baseURL: 'http://47.122.59.26:8080/api', // 配置基础URL 如果服务器域名发生变化统一可以去.env文件修改
// baseURL: 'http://10.205.10.22:8081/loveforest/api/',
timeout: 5000, // 请求超时时间
});
@ -41,6 +42,7 @@ service.interceptors.response.use(
// 业务错误处理,比如弹窗提示等
// return Promise.reject(new Error(res.message || 'Error'));
// } else {
console.log(res)
return res;
// }
},

@ -1,10 +1,10 @@
<template>
<div v-if="name == yours" class="card-layout-1">
<img id="card-icon-1" :src="your_icon" alt="" style="width: 50px;height:50px">
<div class="card-color-size-1">{{ content }} {{ console.log(content) }}</div>
<div class="card-color-size-1">{{ content }}</div>
</div>
<div v-else class="card-layout-2">
<div class="card-color-size-2">{{ content }} {{ console.log(content) }}</div>
<div class="card-color-size-2">{{ content }}</div>
<img id="card-icon-2" :src="my_icon" alt="" style="width: 50px;height:50px">
</div>
</template>

@ -1,7 +1,7 @@
<template>
<div class="container" :style="{height: containerHeight}" @scroll="scroll_event">
<div ref="scrollDiv" class="container" :style="{height: containerHeight}" @scroll="scroll_event">
<div class="list" :style="{top: listTop}">
<slot :show_list="getShowList" :show_height="one_height"></slot>
<slot :show_list="getShowList" :show_height="one_height" @chatWithEvent="chatWithHandle"></slot>
<div :style="{height: barHeight}"></div>
</div>
</div>
@ -21,6 +21,12 @@ export default{
shownum: Number,
items: Array,
one_height: Number,
status:{
type: Boolean,
default: false
}
},
mounted(){
},
computed:{
containerHeight(){
@ -34,16 +40,36 @@ export default{
return this.one_height * (this.items.length-this.start-this.shownum+1) + 'px'
},
listTop(){
console.log(this.items,this.shownum,this.one_height)
// console.log(this.items,this.shownum,this.one_height)
return this.one_height * this.start + 'px'
}
},
},
methods:{
scroll_event(e){
const top = e.target.scrollTop
this.start = Math.floor(top / this.one_height)
this.end = this.start + this.shownum
},
chatWithHandle(){
console.log(1)
if(this.status == true){
this.end = this.items.length
// console.log(this.end)
this.start = this.end - this.shownum
if(this.start < 0 ){
this.start = 0
}else{
let scrollElem = this.$refs.scrollDiv
scrollElem.scrollTo({top: scrollElem
,behavior: 'smooth'})
console.log(1)
}
}
}
},
watch:{
status(){
console.log(1)
}
}
}

@ -2,7 +2,7 @@
<!-- <h4>我是动效滚动</h4> -->
<div>
<input type="checkbox" class="honneyBtn" v-model="status" :id="cnt">
<label for="honneyBtn" class="test">{{ status }}</label>
<label for="honneyBtn" class="test"></label>
</div>
</template>
@ -28,7 +28,7 @@ export default{
status(newvalue){
this.status = newvalue
this.ReviseStatus2Father(this.status)
console.log(this.newvalue)
// console.log(this.newvalue)
},
Status(){
this.status = this.Status

@ -24,7 +24,7 @@
</div>
</div>
<div class="chat-middlelayout">
<ChatList v-if="chatWith == '' ? false : true" :shownum="Number(5)" :items="getFriendObject.chatHistory" :one_height="Number(100)" v-slot="a">
<ChatList v-if="chatWith == '' ? false : true" :shownum="Number(5)" :items="getFriendObject.chatHistory" :one_height="Number(100)" :status="true" v-slot="a">
<div v-for="(item,index) of a.show_list" :key="index">
<ChatCard :your_icon="getFriendObject.icon" :my_icon="userInfo.icon" :name="item.name" :yours="chatWith" :content="historyContentHandle(item.content)"></ChatCard>
</div>
@ -59,12 +59,12 @@
<div style="position: relative;top: -1%;font-size: small;">你和他已经聊了{{ getFriendObject.beeing_friends_time }}</div>
<div class="chat-connection" style="position: relative;top: 1%;">
<img src="../../assets/pictures/chat/GuanZhu.png" style="height: 23px;">
<p style="position: relative;top: -27%;">关注他{{ getFriendObject.concern_status }}</p>
<p style="position: relative;top: -27%;">关注他</p>
<HonneyBtn style="position: relative;top: 6%;" cnt="1" :Status="getFriendObject.concern_status " :ReviseStatus2Father="concernStatusRevise"></HonneyBtn>
</div>
<div class="chat-connection" style="position: relative;top: -2%;">
<img src="../../assets/pictures/chat/HeiMinDan.png" style="height: 25px;">
<p style="position: relative;top: -25%;">拉黑他{{ getFriendObject.black_status }}</p>
<p style="position: relative;top: -25%;">拉黑他</p>
<HonneyBtn style="position: relative;top: 10%;" cnt="2" :Status="getFriendObject.black_status" :ReviseStatus2Father="blackStatusRevise"></HonneyBtn>
</div>
<div style="position:relative;top: -4%;width: 60%; height: 2px; background: linear-gradient(to right, transparent, gray, transparent);opacity: 0.7;"></div>
@ -183,7 +183,7 @@ export default {
this.sendingMsg = ''
}
this.chatWith = item.name
console.log(this.chatWith)
// console.log(this.chatWith)
},
sendMsg(){
@ -242,7 +242,7 @@ export default {
}
})
}
}
},
},
computed:{
getFriendObject(){
@ -262,234 +262,5 @@ export default {
</script>
<style scoped>
.chat-totallayout{
display: flex;
flex-direction: row;
height: 85%;
width: 100%;
/* flex-grow: 0;
flex-shrink: 0; */
/* background-color: aqua; */
}
.chat-leftlayout{
/* background-color: azure; */
width: 25%;
height: 100%;
display: flex;
flex-direction: column;
}
.chat-middlelayout{
background: linear-gradient(to top, #fff9a1 65%, #fcdcd7);
width: 55%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
}
.chat-rightlayout{
/* background-color: red; */
position: relative;
width: 20%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 3%;
}
/**************整体布局***************/
/*************左边************** *****/
/* 第一行 */
.chat-leftline1{
display: flex;
/* background-color: antiquewhite; */
align-items: center;
margin-left: 30px;
}
.chat-leftlayout :nth-child(1){
flex-shrink: 0;
font-size: 30px;
font-weight: 600;
}
.chat-leftline1 :nth-child(2){
flex-shrink: 0;
font-size: 20px;
font-weight: 600;
color: rgb(61, 243, 243);
margin-left: 15px;
position: relative;
top: 2px;
}
/* 第二行 */
.chat-leftline2{
display: flex;
align-items: center;
}
#chatSearchImg{
height: 16px;
position: relative;
left: 23px;
top: -18px;
z-index: 1;
}
#chatSearchInput{
outline: none;
height: 30px;
width: 300px;
border: 2px solid #E44B9D;
border-radius: 8px;
padding-left: 30px;
position: relative;
top: -18px;
transition: all 0.5s;
}
#chatSearchInput:focus{
border-color: #fdadd8;
}
/* 第三行 */
.chat-leftline3{
display: flex;
flex-direction: column;
/* align-items: center; */
}
.chat-friends{
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgb(222, 222, 222);
/* background-color: #E44B9D; */
height: 70px;
width: 90%;
margin: 0 auto;
/* transition: all 0.2ss; */
}
.chat-friends:hover{
background-color: #fff2f9;
}
.chat-friends:active{
background-color: #fcb8dd;
}
.chat-friend-text{
position: relative;
width: 60%;
/* background-color: #E44B9D; */
flex-shrink: 0;
}
#chatIconImg{
height: 50px;
width: 50px;
}
/* .chat-friend-text{
background-color: aliceblue;
} */
#chatFriendName{
font-size: medium;
color: black;
line-height: 10px;
}
#chatFriendMsg{
font-size: small;
font-weight: 300;
color: gray;
/* line-height: 0px; */
}
#chatTime{
font-size: small;
font-weight: 300;
color: gray;
/* background-color: #fdadd8; */
}
/*****************中间****************** */
.send-msg{
align-self: center;
justify-self: flex-end;
display: flex;
position: absolute;
bottom: 5%;
width: 80%;
}
#send-msg-input{
outline: none;
border: 1px solid #E44B9D;
border-radius: 10px;
width: 90%;
margin: 5px;
}
.search-btn{
background-image: url("@/assets/pictures/chat/SendBtn.png");
background-size: 100% 100%;
width: 40px;
height: 40px;
border: none;
overflow: hidden;
border-radius: 10px;
}
.search-btn:active{
background-image: url("@/assets/pictures/chat/SendBtn.png");
background-size: 100% 100%;
width: 40px;
height: 40px;
border: none;
overflow: hidden;
border-radius: 10px;
background-color: #a75efb;
}
/*****************右边***************************/
.friend-information{
width: 75%;
display: flex;
justify-content: space-around;
color: gray;
position: relative;
top: 0%;
}
.friend-information p{
position: relative;
top: -31%;
}
.chat-special-btn{
display: flex;
justify-content: space-around;
width: 85%;
height: 20%;
}
.chat-home-tree-btn{
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
}
.chat-home-page-btn{
background-color: #f85096;
background-image: url('../../assets/pictures/chat/portrait.png');
background-size: 60% 60%;
background-position: center center;
background-repeat: no-repeat;
height: 60px;width: 60px; border: none; border-radius: 50%;
}
.chat-tree-btn{
background-color: #a75efb;
background-image: url('../../assets/pictures/chat/tree.png');
background-size: 60% 60%;
background-position: center center;
background-repeat: no-repeat;
height: 60px;width: 60px; border: none; border-radius: 50%;
}
.chat-connection{
display: flex;
width: 62%;
justify-content: space-around;
}
.chat-recomend{
display: flex;
flex-direction: row;
justify-content: space-around;
width: 90%;
}
@import url('../../assets/css/chat/chat.css');
</style>

@ -225,15 +225,13 @@ export default {
this.isShow = !this.isShow
},
async UserLogin() {
this.$router.push('/main');
// this.$router.push('/main');
if(this.loginUser.code === 'Yj98') {
try {
const response = await axios.post('', null, {
params: {
const response = await axios.post('/auth/login', {
username: this.loginUser.name,
password: this.loginUser.password
}
});
})
console.log('登录成功', response)
// tokendata
// !!!

@ -1,4 +1,15 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
devServer:{
host: 'localhost',
port: 8080,
https: false,
proxy:{
'/auth/login':{
target : 'https://911fb0525ms3.vicp.fun/loveforest/api',
changeOrigin : true,
},
}
},
transpileDependencies: true
})

Loading…
Cancel
Save