@@ -31,12 +31,7 @@ import {
onUnmounted, // 组件销毁前执行
} from "vue";
const refname = ref('');
-import {
- Document,
- Mic,
- Coin,
- List
-} from '@element-plus/icons-vue';
+
import PointsList from "@/components/mineSubComponent/PointsList";
import PKRecord from "@/components/mineSubComponent/PKRecord";
import PKmessage from "@/components/mineSubComponent/PKmessage";
@@ -48,24 +43,33 @@ const options = [
{
label: '主播库',
value: 1,
- icon: Coin,
+ icon: require("@/assets/AnchorLibrary.png"),
},
{
label: 'PK信息',
value: 2,
- icon: Mic,
+ icon: require("@/assets/PKInformation.png"),
},
{
label: '我的PK记录',
- value: 3,
- icon: List,
+ value: 3,
+ icon: require("@/assets/PKRecord.png"),
},
{
label: '积分列表',
value: 4,
- icon: Document,
+ icon: require("@/assets/PointsList.png"),
},
]
+import { throttle } from 'lodash-es';
+
+const throttledUpdate = throttle((value) => {
+ segmentedvalue.value = value;
+}, 500);
+
+function SelectorClick(value) {
+ throttledUpdate(value);
+}
const segmentedvalue = ref(1);
watch(refname, async (newQuestion, oldQuestion) => {
@@ -89,18 +93,62 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
}
-.custom-style .el-segmented {
- height: 70px;
- --el-segmented-item-selected-color: var(--el-text-color-primary);
- --el-segmented-item-selected-bg-color: @border-color;
- --el-border-radius-base: 20px;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
+.custom-style{
+ width: 100%;
+ height: 100px;
+ display: flex;
+ align-items: center;
+ justify-content:space-between;
+}
+.Selector{
+ width: 420px;
+ height: 110px;
+}
+.card{
+ width: 100%;
+ height: 90px;
+ border-radius: 24px;
+ background-color: #CEF1EB;
+ border: 2px solid #ffffff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.card-icon{
+ height: 100%;
+ display: flex;
+ align-items: center;
}
.mine-content{
width: 100%;
- height: calc(100% - 70px);
+ height: calc(100% - 110px);
+ background-color: #ffffff;
+ border-radius: 16px;
+}
+.icon{
+ width:65px;
+ height: 65px;
+}
+.card-content{
+ margin-left: 62px;
+}
+.card-title{
+ font-size: 24px;
+ color: #636363;
+}
+.pk-info-icon {
+ width:50px;
+ height:72px;
+}
+.PointsList-icon{
+ width: 65px;
+ height: 69px;
+}
+.active{
+ background-image: linear-gradient(90deg, #E4FFFF, #FFFFFF);
+ border: 1px solid #03ABA8;
+}
+.active-text{
+ color: #03ABA8;
}
\ No newline at end of file
diff --git a/src/views/hosts/pk.vue b/src/views/hosts/pk.vue
index 0d99ff6..8debf50 100644
--- a/src/views/hosts/pk.vue
+++ b/src/views/hosts/pk.vue
@@ -9,31 +9,22 @@
@@ -195,50 +237,266 @@ import {
onMounted, // 组件挂载完成后执行
onUpdated, // 组件更新后执行
onUnmounted, // 组件销毁前执行
+ computed, // 计算属性
} from "vue";
import { getCountryNamesArray } from "../../utils/countryUtil";
-import { time } from "echarts";
+import { getPkList } from "@/api/account";
+import { setStorage, getStorage, getPromiseStorage } from "@/utils/storage.js";
+import { TimestamptolocalTime } from "@/utils/timeConversion.js";
+
+import { ElMessage } from "element-plus";
const country = ref([]);
country.value = getCountryNamesArray(); //国家条目
const PKistodayorhall = ref(true); // 选择今日PK还是PK大厅/false 今日PK/true PK大厅
-const genderOptions = [
- { value: 1, label: "男" },
- { value: 2, label: "女" },
-]; // 性别选项
const searchStatus = ref(false); // 搜索状态
-
const countryvalue = ref(null); //选中的国家
const gendervalue = ref(null); // 选中的性别
const minnum = ref(null); // 最小金币
const maxnum = ref(null); // 最大金币
const timevalue = ref(null); // 时间
const textarea = ref(""); // 聊天输入框
+const list = ref([]); // 列表数据
+const HallList = ref([]); // PK大厅列表数据
+const TodayList = ref([]); // PK列表数据
+const page = ref(0); // 页码
+const user = ref({}); // 用户信息
+const genderOptions = [
+ { value: 1, label: "男" },
+ { value: 2, label: "女" },
+]; // 性别选项
-const list = ref([{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]); // 列表数据
+// 获取pk列表
+function PkList(body) {
+ getPkList(body).then((res) => {
+ if (body.condition.type == 2 || body.condition.type == undefined) {
+ HallList.value.push(...res);
+ if (PKistodayorhall.value) {
+ list.value = HallList.value;
+ }
+ } else {
+ TodayList.value.push(...res);
+ if (!PKistodayorhall.value) {
+ list.value = TodayList.value;
+ }
+ }
+ });
+}
+// 加载更多
+function load() {
+ page.value++;
+ if (searchStatus.value) {
+ const body = {
+ status: 0,
+ page: page.value,
+ size: 10,
+ userId: user.value.id,
+ condition: {},
+ };
+ if (timevalue.value == null) {
+ if (PKistodayorhall.value) {
+ body.condition.type = 2;
+ } else {
+ body.condition.type = 2;
+ }
+ } else {
+ if (PKistodayorhall.value) {
+ } else {
+ body.condition.type = 1;
+ }
+ }
+ if (countryvalue.value != null) {
+ body.condition.country = countryvalue.value;
+ }
+ if (gendervalue.value != null) {
+ body.condition.sex = gendervalue.value;
+ }
-//搜索按钮
-function search() {
- searchStatus.value = true;
+ if (minnum.value != null && maxnum.value != null) {
+ body.condition.coin = {
+ start: minnum.value,
+ end: maxnum.value,
+ };
+ } else if (minnum.value != null && maxnum.value == null) {
+ ElMessage.error("请输入最大金币数");
+ return;
+ } else if (minnum.value == null && maxnum.value != null) {
+ ElMessage.error("请输入最小金币数");
+ return;
+ }
+ if (timevalue.value != null) {
+ const currentTime = Date.now();
+ if (timevalue.value[0] < currentTime) {
+ ElMessage.error("开始时间不能小于当前时间");
+ return;
+ }
+ body.condition.pkTime = {
+ start: timevalue.value[0] / 1000,
+ end: timevalue.value[1] / 1000,
+ };
+ }
+ PkList(body);
+ } else {
+ const body = {
+ status: 0,
+ page: page.value,
+ size: 10,
+ userId: user.value.id,
+ condition: {},
+ };
+ if (timevalue.value == null) {
+ if (PKistodayorhall.value) {
+ body.condition.type = 2;
+ } else {
+ body.condition.type = 2;
+ }
+ } else {
+ if (PKistodayorhall.value) {
+ } else {
+ body.condition.type = 1;
+ }
+ }
+ PkList(body);
+ }
}
+// 切换今日PK还是PK大厅
+function Switch() {
+ searchStatus.value = false;
+ PKistodayorhall.value = !PKistodayorhall.value;
+ if (PKistodayorhall.value) {
+ list.value = HallList.value;
+ } else {
+ list.value = TodayList.value;
+ }
+}
+
+//搜索按钮
+function search(data) {
+ const body = {
+ status: 0,
+ size: 10,
+ userId: user.value.id,
+ condition: {},
+ };
+ if (timevalue.value == null) {
+ if (PKistodayorhall.value) {
+ body.condition.type = 2;
+ } else {
+ body.condition.type = 2;
+ }
+ } else {
+ if (PKistodayorhall.value) {
+ } else {
+ body.condition.type = 1;
+ }
+ }
+ if (countryvalue.value != null) {
+ body.condition.country = countryvalue.value;
+ }
+ if (gendervalue.value != null) {
+ body.condition.sex = gendervalue.value;
+ }
+
+ if (minnum.value != null && maxnum.value != null) {
+ body.condition.coin = {
+ start: minnum.value,
+ end: maxnum.value,
+ };
+ } else if (minnum.value != null && maxnum.value == null) {
+ ElMessage.error("请输入最大金币数");
+ return;
+ } else if (minnum.value == null && maxnum.value != null) {
+ ElMessage.error("请输入最小金币数");
+ return;
+ }
+ if (timevalue.value != null) {
+ const currentTime = Date.now();
+ if (timevalue.value[0] < currentTime) {
+ ElMessage.error("开始时间不能小于当前时间");
+ return;
+ }
+ body.condition.pkTime = {
+ start: timevalue.value[0] / 1000,
+ end: timevalue.value[1] / 1000,
+ };
+ }
+ if (PKistodayorhall) {
+ HallList.value = [];
+ } else {
+ TodayList.value = [];
+ }
+ body.page = 0;
+ page.value = 0;
+ list.value = [];
+ if (data = 'Refresh') {
+ searchStatus.value = false;
+ }else{
+ searchStatus.value = true;
+ }
+ PkList(body);
+}
//重置按钮
function reset() {
searchStatus.value = false;
- countryvalue.value = null;
gendervalue.value = null;
minnum.value = null;
maxnum.value = null;
+ countryvalue.value = null;
timevalue.value = null;
+ page.value = 0;
+ search('Refresh');
}
-function load() {} // 加载更多
-
+// 计算滑块位置
+const sliderPosition = computed(() => {
+ return PKistodayorhall.value ? "1%" : "13%";
+});
+// 触摸事件处理
+const touchStartX = ref(0);
+const touchEndX = ref(0);
+function handleTouchStart(e) {
+ touchStartX.value = e.touches[0].clientX;
+}
+function handleTouchMove(e) {
+ touchEndX.value = e.touches[0].clientX;
+}
+function handleTouchEnd() {
+ const diff = touchStartX.value - touchEndX.value;
+ if (Math.abs(diff) > 50) {
+ // 滑动阈值
+ PKistodayorhall.value = diff > 0;
+ }
+}
const refname = ref(""); //
watch(refname, async (newQuestion, oldQuestion) => {
// 变化后执行
});
onMounted(() => {
- // 组件挂载完成后执行
+ getPromiseStorage("user")
+ .then((res) => {
+ user.value = res;
+ PkList({
+ status: 0,
+ page: 1,
+ size: 10,
+ userId: user.value.id,
+ condition: {
+ type: 1,
+ },
+ });
+ PkList({
+ status: 0,
+ page: 1,
+ size: 10,
+ userId: user.value.id,
+ condition: {
+ type: 2,
+ },
+ });
+ })
+ .catch((err) => {
+ console.log(err);
+ });
});
onUpdated(() => {
// 组件更新后执行
@@ -270,35 +528,39 @@ onUnmounted(() => {
.controlPanel {
width: 100%;
height: 100%;
- background-image: linear-gradient(
- 30deg,
- @bg-Sidebar-color-bottom,
- @bg-Sidebar-color-top
- );
display: flex;
align-items: center;
justify-content: space-around;
}
.today {
- width: 150px;
- height: 50px;
- background-color: #ffffff;
- border-radius: 50px;
- transition: all 0.4s ease;
- color: #e9e8e8;
- font-size: 20px;
- font-weight: bold;
+ width: 320px;
+ height: 60px;
+ background-color: #4fcacd;
+ border-radius: 30px;
+ box-shadow: -5px 5px 6px #45aaac inset;
+ display: flex;
+ justify-content: space-around;
+}
+.today-text {
+ width: 50%;
+ height: 60px;
text-align: center;
- line-height: 50px;
- letter-spacing: 3px;
+ color: #ffffff;
+ font-size: 24px;
+ line-height: 60px;
}
-.today:hover {
- box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
- transform: scale(1.1);
- opacity: 0.8;
-}
-.today:active {
- transform: scale(1.1) rotate(10deg);
+.slider {
+ position: absolute;
+ width: 160px;
+ height: 60px;
+ border-radius: 30px;
+ color: #03aba8;
+ text-align: center;
+ line-height: 60px;
+ font-size: 24px;
+ background-image: linear-gradient(180deg, #e4ffff, #ffffff);
+ left: v-bind(sliderPosition);
+ transition: left 0.3s ease;
}
.hall {
width: 150px;
@@ -329,10 +591,12 @@ onUnmounted(() => {
.select {
width: 150px;
margin-top: 10px;
+ margin-left: 50px;
}
.Goldcoinbox {
width: 330px;
display: flex;
+ margin-top: -5px;
align-items: center;
justify-content: space-between;
}
@@ -355,8 +619,11 @@ onUnmounted(() => {
}
.timebox {
width: 410px;
+ margin-top: 10px;
}
.btnbox {
+ padding-left: 20px;
+ padding-right: 20px;
height: 100%;
display: flex;
justify-content: center;
@@ -365,28 +632,31 @@ onUnmounted(() => {
.primary {
width: 80px;
height: 30px;
- background-color: #e9e7e7;
- border-radius: 10px;
- color: @Supplementary-text-color;
- font-size: 12px;
- font-weight: bold;
- text-align: center;
- line-height: 30px;
- letter-spacing: 2px;
+ border-radius: 5px;
+ background-image: url(../../assets/Reset.png);
+ background-size: 100% 100%;
transition: all 0.4s ease;
}
.search {
- margin-bottom: 20px;
+ width: 80px;
+ height: 30px;
+ border-radius: 5px;
+ background-image: url(../../assets/Search.png);
+ background-size: 100% 100%;
+ transition: all 0.4s ease;
+}
+.search:hover {
+ transform: scale(1.2);
+ opacity: 0.8;
}
.primary:hover {
- background-color: #5a6268;
- color: #ffffff;
- transform: scale(1.1);
+ transform: scale(1.2);
opacity: 0.8;
}
.infinite-list {
width: 100%;
height: 100%;
+ border-radius: 16px;
background-color: #ffffff;
}
.infinite-list-item {
@@ -405,13 +675,14 @@ onUnmounted(() => {
align-items: center;
justify-content: space-between;
background-image: linear-gradient(0deg, @bg-Sidebar-color-top, @bg-color);
- border-radius: 20px;
- box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
+ border-radius: 11px;
+ background-image: url(../../assets/PKbackground.png);
+ background-size: 100% 100%;
transition: all 0.4s ease;
}
.infinite-card:hover {
- box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);
- transform: scale(1.1);
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
+ transform: scale(1.05);
opacity: 0.8;
}
.Avatar {
@@ -423,7 +694,7 @@ onUnmounted(() => {
}
.Information {
width: calc(100% - 160px);
- height: 90%;
+ height: 80%;
display: flex;
flex-direction: column;
justify-content: space-between;
@@ -443,7 +714,7 @@ onUnmounted(() => {
height: 20px;
background-color: #e9e7e7;
border-radius: 10px;
- color: @Prompt-text-color;
+ color: #ffffff;
font-size: 12px;
font-weight: bold;
text-align: center;
@@ -454,9 +725,9 @@ onUnmounted(() => {
.Information-Country {
width: auto;
height: 20px;
- background-color: #e9e7e7;
+ background-color: #e4f9f9;
border-radius: 10px;
- color: @Prompt-text-color;
+ color: #03aba8;
font-size: 12px;
font-weight: bold;
text-align: center;
@@ -500,11 +771,15 @@ onUnmounted(() => {
.chat {
width: 100%;
height: 100%;
+ background-color: #ffffff;
+ border-top-right-radius: 16px;
+ border-left: 1px solid #03aba82f;
}
.chat-name {
width: 100%;
height: 50px;
background-color: #ffffff;
+ border-radius: 16px;
// border-bottom: 3px solid #b9b9b9;
color: @Prompt-text-color;
font-size: 16px;
@@ -518,21 +793,88 @@ onUnmounted(() => {
}
.chat-content {
width: 100%;
- height: calc(100% - 200px);
+ height: calc(100% - 170px);
}
.chat-input {
width: 100%;
- height: 150px;
- // border-top: 3px solid #b9b9b9;
+ height: 110px;
+ // border-top: 1px solid #03aba8;
+ // background-color: #dfdfdf;
}
.chat-input-Controls {
width: 100%;
height: 50px;
- background-color: @border-color;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.chat-input-Other {
+ width: auto;
+ height: 100%;
+ display: flex;
+ align-items: center;
+}
+.messageModule {
+ width: 50px;
+ height: 50px;
+ background-color: #03aba8;
+}
+.chat-input-Send {
+ width: 20%;
+ height: 70%;
+ text-align: center;
+ line-height: 35px;
+ font-size: 16px;
+ color: #03aba8;
+ border-radius: 10px;
+ margin-right: 6px;
+ transition: all 0.4s ease;
+}
+.chat-input-Send:hover {
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
+ background-color: #03aba82d;
+ // color: #ffffff;
}
.chat-input-Textarea {
width: 100%;
- height: 80px;
- // background-color: #ffffff;
+ height: 60px;
+}
+.inputBox {
+ width: 100%;
+ height: 100%;
+ border-top: 2px solid #03aba82f;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+.input {
+ width: 98%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 10px;
+}
+.textarea {
+ width: 90%;
+ height: 90%;
+ max-height: 90%;
+ border: none;
+ outline: none;
+ overflow: hidden;
+ background-color: #ff000000;
+ font-size: 12px;
+ margin-left: 5px;
+ margin-right: 5px;
+ color: #000000;
+ letter-spacing: 1px;
+ resize: none;
+}
+
+
+
diff --git a/src/views/nav.vue b/src/views/nav.vue
index e28ac8c..050c3ae 100644
--- a/src/views/nav.vue
+++ b/src/views/nav.vue
@@ -30,16 +30,17 @@ html {
.common-layout {
width: 100vw;
height: 100vh;
+ background-image: url(../assets/bg.png);
+ background-size: 100% 100%;
}
.nav-main {
width: 95vw;
height: 100vh;
- background-color:@bg-color;
}
.nav-aside {
width: 5vw;
height: 100vh;
- background-image: linear-gradient(0deg, @bg-Sidebar-color-top, @bg-color);
- border: 2px solid @border-color;
+ // background-image: linear-gradient(0deg, @bg-Sidebar-color-top, @bg-color);
+ // border: 2px solid @border-color;
}
\ No newline at end of file
diff --git a/vue.config.js b/vue.config.js
index 088f42b..32105c4 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -8,8 +8,8 @@ module.exports = defineConfig({
postcssOptions: {
plugins: [
require('postcss-px-to-viewport')({
- viewportWidth: 1600, // 视窗的宽度,对应设计稿宽度
- viewportHeight: 900, // 视窗的高度,对应设计稿高度
+ viewportWidth: 1920, // 视窗的宽度,对应设计稿宽度
+ viewportHeight: 1080, // 视窗的高度,对应设计稿高度
unitPrecision: 3, // 指定 px 转换为视窗单位值的小数位数
viewportUnit: 'vw', // 指定需要转换成的视窗单位,vw 或者 vh
selectorBlackList: ['.ignore', '.hairlines'], // 指定不需要转换的类