style: 修改页面样式

This commit is contained in:
hzj 2025-09-23 19:16:24 +08:00
parent 2cfa82819c
commit c7dc60d121
5 changed files with 355 additions and 494 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,154 @@
<template>
<div style="position: relative; width: 100%">
<img :src="whiteBox" alt="" width="100%" style="display: block" />
<div
style="
width: 48%;
height: 46%;
border-radius: 12px;
margin: 2.5%;
position: absolute;
top: 0;
right: 0;
z-index: -1;
display: flex;
justify-content: flex-end;
"
:style="{ backgroundImage }"
>
<div
style="width: 50%; height: 50%; display: flex; justify-content: center; align-items: center"
>
<div class="type" :style="{ fontSize }">{{ type }}</div>
</div>
</div>
<div style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; padding: 4%">
<div
style="height: 100%; display: flex; flex-direction: column; justify-content: space-around"
>
<div class="contentTime">{{ date }}</div>
<div style="display: grid; grid-template-columns: repeat(2, 1fr)">
<div class="contentText">Target: {{ target }}</div>
<div class="contentText">Salary: ${{ salary }}</div>
</div>
<div class="contentText">Time(Days):{{ days }}</div>
</div>
<div
v-if="more"
class="moreBt"
style="position: absolute; bottom: 8%; right: 4%; color: #bb92ff; font-weight: 500"
>
More >
</div>
</div>
</div>
</template>
<script setup>
import whiteBox from '@/assets/images/HostCenter/whitebox.png'
import { computed, ref, watch } from 'vue'
const props = defineProps({
type: {
type: String,
default: '',
},
date: {
type: String,
default: '',
},
target: {
type: String,
default: '',
},
salary: {
type: String,
default: '',
},
days: {
type: String,
default: '',
},
more: {
type: Boolean,
default: false,
},
})
const backgroundImage = ref('')
const fontSize = ref('')
watch(
() => props.type,
(newType) => {
if (newType == 'In progress') {
backgroundImage.value = 'linear-gradient(112deg, #759CFF 5.66%, #3D73FF 42.49%)'
fontSize.value = '1.1em'
}
if (newType == 'Pending') {
backgroundImage.value = 'linear-gradient(112deg, #FF7578 5.66%, #FF3D40 42.49%)'
fontSize.value = '1.1em'
}
if (newType == 'Completed') {
backgroundImage.value = 'linear-gradient(112deg, #75FF98 5.66%, #3DFF54 42.49%)'
fontSize.value = '1.1em'
}
if (newType == 'Out Of Account') {
backgroundImage.value = 'linear-gradient(112deg, #BDBDBD 5.66%, #AEAEAE 42.49%)'
fontSize.value = '0.9em'
}
return
},
{ immediate: true }
)
</script>
<style lang="scss" scoped>
* {
color: rgba(0, 0, 0, 0.8);
font-family: 'SF Pro Text';
font-weight: 700;
}
.type {
font-size: 0.9em;
color: #fff;
font-weight: 600;
}
.contentTime {
font-size: 1.3em;
}
.contentText {
font-size: 1em;
}
.moreBt {
font-size: 1em;
}
@media screen and (max-width: 360px) {
* {
font-size: 10px;
}
}
@media screen and (min-width: 360px) {
* {
font-size: 12px;
}
}
@media screen and (min-width: 768px) {
* {
font-size: 24px;
}
}
</style>

View File

@ -5,15 +5,42 @@
<!-- 主要内容 --> <!-- 主要内容 -->
<div class="content"> <div class="content">
<!-- 用户信息卡片 --> <!-- 身份 -->
<div class="user-card"> <div
<!-- APP连接状态指示 --> style="
<div v-if="isInApp() && !appConnected" class="app-status connecting"> margin: 0 1%;
<div class="status-indicator"></div> margin-bottom: 12px;
<span>正在连接APP...</span> font-weight: 600;
</div> display: flex;
align-items: center;
font-size: 1.3em;
"
>
My account
<img
src="/src/assets/images/HostCenter/hostTab.png"
alt=""
height="20px"
style="margin-left: 10px"
/>
</div>
<div class="user-info"> <!-- 用户信息卡片 -->
<div
style="
background-color: white;
padding: 16px;
border-radius: 12px;
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
margin: 0 1%;
margin-bottom: 12px;
display: flex;
flex-direction: column;
justify-content: space-between;
"
>
<!-- 头像信息 -->
<div style="display: flex; align-items: center; margin-bottom: 12px">
<div class="avatar"> <div class="avatar">
<img <img
v-if="userInfo.userAvatar" v-if="userInfo.userAvatar"
@ -23,103 +50,127 @@
/> />
<span v-else class="avatar-placeholder">{{ getAvatarPlaceholder() }}</span> <span v-else class="avatar-placeholder">{{ getAvatarPlaceholder() }}</span>
</div> </div>
<div class="user-details"> <div style="flex: 1">
<h3>{{ userInfo.userNickname || userInfo.name }}</h3> <div style="margin: 0 0 4px 0; font-size: 16px; font-weight: 600; color: #333">
<p>ID: {{ userInfo.id || userInfo.id }}</p> {{ userInfo.userNickname || userInfo.name }}
</div> </div>
<button class="notification-btn" @click="goToNotification"> <div style="margin: 0; font-size: 14px; color: #666">ID: {{ userInfo.id }}</div>
<span></span> </div>
</button> <button
</div> style="width: 32px; height: 32px; border: none; background: none; font-size: 16px"
@click="goToNotification"
<!-- 账户状态标签 --> >
<div class="account-tags"> <img src="/src/assets/images/HostCenter/edit.png" alt="" width="70%" />
<span class="tag host-tag">👑 Host</span> </button>
</div> </div>
</div> <!-- 我的薪资 -->
<div>
<!-- My salary 区域 --> <div style="display: flex; justify-content: space-between; margin-bottom: 5px">
<div class="salary-section"> <div style="font-weight: 600">My salary:</div>
<div class="salary-header"> <button
<h3>My salary:</h3> style="
<button class="personal-salary-btn" @click="showDatePicker"> font-weight: 500;
Personal Salary <span class="arrow">></span> color: rgba(0, 0, 0, 0.4);
</button> border: 0;
</div> background-color: transparent;
"
<div class="salary-content"> @click="showDatePicker"
<!--暂时禁用后面补充--> >
<!-- <div class="salary-item"> Personal Salary >
<p class="salary-label">History Salary:</p> </button>
<p class="salary-amount">${{ salaryInfo.hostSalary }}</p> </div>
</div> </div>
<div class="salary-separator"></div>-->
<div class="salary-item"> <!-- 历史薪资 -->
<p class="salary-label">Current Salary:</p> <div style="display: grid; grid-template-columns: repeat(2, 1fr)">
<p class="salary-amount">${{ salaryInfo.currentSalary }}</p> <div>
</div> <div style="font-weight: 500; color: rgba(0, 0, 0, 0.4); margin-bottom: 5px">
</div> History Salary:
</div> </div>
<div style="font-weight: 600">${{ salaryInfo.hostSalary }}</div>
<!-- Today's Task --> </div>
<div class="task-section"> <div>
<div class="task-header"> <div style="font-weight: 500; color: rgba(0, 0, 0, 0.4); margin-bottom: 5px">
<h3>Today's Task:</h3> Current Salary:
<button class="platform-policy-btn" @click="goToPlatformPolicy"> </div>
Platform Policy <span class="arrow">></span> <div style="font-weight: 600">${{ salaryInfo.currentSalary }}</div>
</button> </div>
</div> </div>
</div>
<!-- 任务表格 -->
<div class="task-table"> <!-- 今日任务 -->
<div class="table-row table-header"> <div
<div class="table-cell">Anchor type</div> class="task-section"
<div class="table-cell">Minutes</div> style="display: flex; flex-direction: column; justify-content: space-between; gap: 5px"
<div class="table-cell">Gift Task</div> >
</div> <div style="display: flex; justify-content: space-between">
<div class="table-row table-data"> <div style="font-weight: 600">Today's Task:</div>
<div class="table-cell">{{ taskInfo.anchorType }}</div> <button
<div class="table-cell"> style="
<span class="minutes-progress">{{ taskInfo.minutesProgress }}</span> font-weight: 500;
<span class="minutes-completed">/{{ taskInfo.minutesTotal }}</span> color: rgba(0, 0, 0, 0.4);
border: 0;
background-color: transparent;
"
@click="goToPlatformPolicy"
>
Platform Policy >
</button>
</div>
<div style="display: flex">
<div style="flex: 1">
<div
style="
width: max-content;
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
"
>
<div style="font-weight: 600">Anchor Type</div>
<div style="font-weight: 600">{{ taskInfo.anchorType }}</div>
</div>
</div>
<div
style="flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px"
>
<div style="font-weight: 600">Minutes</div>
<div style="font-weight: 600">
{{ taskInfo.minutesProgress }}/{{ taskInfo.minutesTotal }}
</div>
</div>
<div style="flex: 1; display: flex; justify-content: flex-end">
<div
style="
width: max-content;
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
"
>
<div style="font-weight: 600">Gift Task</div>
<div style="font-weight: 600">{{ taskInfo.giftTask }}</div>
</div> </div>
<div class="table-cell">{{ taskInfo.giftTask }}</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 进度信息 --> <!-- 进度信息 -->
<div class="progress-section"> <workReportBox
<div class="progress-header"> style="margin-bottom: 10px"
<span class="progress-date"> :type="progressInfo.status"
<span v-if="loadingProgressInfo.value">Loading...</span> :date="progressInfo.date"
<span v-else>{{ progressInfo.date }}</span> :target="progressInfo.target"
</span> :salary="progressInfo.salary"
<span class="progress-status"> :days="progressInfo.timeDays"
<span v-if="loadingProgressInfo.value"></span> ></workReportBox>
<span v-else>{{ progressInfo.status }}</span>
</span>
</div>
<div class="progress-details">
<div class="progress-item">
<span>Level: {{ loadingProgressInfo.value ? '' : progressInfo.target }}</span>
<span>Salary: ${{ loadingProgressInfo.value ? '' : progressInfo.salary }}</span>
</div>
<div class="progress-item">
<span>Time(Days): {{ loadingProgressInfo.value ? '' : progressInfo.timeDays }}</span>
</div>
</div>
</div>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div class="action-buttons"> <div class="action-buttons">
<button class="action-btn exchange-btn" @click="exchangeGoldCoins"> <button class="action-btn exchange-btn" @click="exchangeGoldCoins">Exchange</button>
Exchange <button class="action-btn transfer-btn" @click="transfer">Transfer</button>
</button>
<button class="action-btn transfer-btn" @click="transfer">
Transfer
</button>
<!-- <!--
<button class="action-btn withdraw-btn" @click="cashWithdraw"> <button class="action-btn withdraw-btn" @click="cashWithdraw">
Cash<br>Withdraw Cash<br>Withdraw
@ -131,17 +182,17 @@
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue' import { onMounted, reactive } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import MobileHeader from '../components/MobileHeader.vue' import MobileHeader from '../components/MobileHeader.vue'
import {usePageInitializationWithConfig} from "@/utils/pageConfig.js"; import { usePageInitializationWithConfig } from '@/utils/pageConfig.js'
import {isInApp} from "@/utils/appBridge.js"; import { isInApp } from '@/utils/appBridge.js'
import {getTeamMemberWork} from "@/api/teamBill.js"; import { getTeamMemberWork } from '@/api/teamBill.js'
import {getUserId} from "@/utils/userStore.js"; import { getUserId } from '@/utils/userStore.js'
import workReportBox from '@/components/HostCenter/workReportBox.vue'
const router = useRouter() const router = useRouter()
// //
const progressInfo = reactive({ const progressInfo = reactive({
date: '', date: '',
@ -151,7 +202,7 @@ const progressInfo = reactive({
timeDays: '', timeDays: '',
hostSalary: '', hostSalary: '',
agentSalary: '', agentSalary: '',
total: '' total: '',
}) })
const loadingProgressInfo = reactive({ value: false }) const loadingProgressInfo = reactive({ value: false })
@ -182,24 +233,25 @@ const fetchMemberWorkData = async () => {
// //
const formatStatus = (status) => { const formatStatus = (status) => {
const statusMap = { const statusMap = {
'SETTLED': 'Settled', SETTLED: 'Settled',
'UNPAID': 'Pending', UNPAID: 'Pending',
'HANG_UP': 'Pending', HANG_UP: 'Pending',
'PAID': 'Completed' PAID: 'Completed',
} }
return statusMap[status] || status return statusMap[status] || status
} }
// level // level
const level = latestTarget.target?.settlementResult?.level || latestTarget.target?.level || '' const level =
latestTarget.target?.settlementResult?.level || latestTarget.target?.level || ''
// //
Object.assign(progressInfo, { Object.assign(progressInfo, {
date: `${month}/${year}`, date: `${month}.${year}`,
status: formatStatus(latestTarget.status), status: formatStatus(latestTarget.status),
target: level, target: level,
salary: latestTarget.target?.settlementResult?.ownSalary?.toFixed(2) || '', salary: latestTarget.target?.settlementResult?.ownSalary?.toFixed(2) || '',
timeDays: latestTarget.target?.effectiveDay || '' timeDays: latestTarget.target?.effectiveDay || '',
}) })
} else { } else {
console.warn('No targets data available') console.warn('No targets data available')
@ -234,79 +286,36 @@ const transfer = () => {
router.push('/transfer') router.push('/transfer')
} }
const { const { appConnected, userInfo, salaryInfo, taskInfo, handleImageError, getAvatarPlaceholder } =
appConnected, usePageInitializationWithConfig('HOST_CENTER', {
userInfo, needsTeamInfo: true,
salaryInfo, onDataLoaded: () => {
taskInfo, fetchMemberWorkData() //
handleImageError, },
getAvatarPlaceholder })
} = usePageInitializationWithConfig('HOST_CENTER', {
needsTeamInfo: true,
onDataLoaded: () => {
fetchMemberWorkData() //
}
})
onMounted(() => {
console.log('userInfo:', userInfo)
console.log('salaryInfo:', salaryInfo)
console.log('userInfo:', userInfo)
})
</script> </script>
<style scoped> <style scoped>
.host-center { * {
font-family: -apple-system, BlinkMacSystemFont, sans-serif; color: rgba(0, 0, 0, 0.8);
font-family: 'SF Pro Text';
} }
.content { .content {
padding: 16px; padding: 16px;
position: relative; position: relative;
z-index: 2; z-index: 2;
} }
/* 用户信息卡片 */
.user-card {
background-color: white;
padding: 16px;
border-radius: 12px;
margin-bottom: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* APP连接状态 */
.app-status {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 8px;
margin-bottom: 12px;
font-size: 12px;
font-weight: 500;
}
.app-status.connecting {
background-color: #fef3c7;
color: #d97706;
}
.app-status.connected {
background-color: #d1fae5;
color: #059669;
}
.status-indicator {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: currentColor;
}
.app-status.connecting .status-indicator {
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { @keyframes pulse {
0%, 100% { 0%,
100% {
opacity: 1; opacity: 1;
} }
50% { 50% {
@ -314,17 +323,11 @@ const {
} }
} }
.user-info {
display: flex;
align-items: center;
margin-bottom: 12px;
}
.avatar { .avatar {
width: 50px; width: 50px;
height: 50px; height: 50px;
border-radius: 25px; border-radius: 25px;
background-color: #8B5CF6; background-color: #8b5cf6;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -349,201 +352,14 @@ const {
font-weight: 600; font-weight: 600;
} }
.user-details {
flex: 1;
}
.user-details h3 {
margin: 0 0 4px 0;
font-size: 16px;
font-weight: 600;
color: #333;
}
.user-details p {
margin: 0;
font-size: 14px;
color: #666;
}
.system-info {
font-size: 12px !important;
color: #8B5CF6 !important;
margin-top: 2px !important;
}
.edit-btn {
width: 32px;
height: 32px;
border: none;
background: none;
font-size: 16px;
cursor: pointer;
}
.notification-btn {
width: 32px;
height: 32px;
border: none;
background: none;
font-size: 16px;
cursor: pointer;
}
/* 身份切换标签 */
.identity-tabs {
display: flex;
gap: 8px;
margin: 12px 0;
}
.identity-tab {
padding: 6px 12px;
border: 1px solid #e5e7eb;
border-radius: 16px;
background-color: white;
color: #666;
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.identity-tab.active {
background-color: #8B5CF6;
color: white;
border-color: #8B5CF6;
}
.identity-tab:not(.active):hover {
border-color: #8B5CF6;
color: #8B5CF6;
}
.identity-tab.disabled {
cursor: not-allowed;
opacity: 0.6;
}
.identity-tab.disabled:hover {
border-color: #e5e7eb;
color: #666;
}
.identity-tab.disabled.active:hover {
border-color: #8B5CF6;
color: white;
}
.account-tags {
display: flex;
gap: 8px;
}
.tag {
padding: 4px 12px;
border-radius: 16px;
font-size: 12px;
font-weight: 600;
}
.host-tag {
background-color: #E0E7FF;
color: #5B21B6;
}
.agency-tag {
background-color: #DBEAFE;
color: #1E40AF;
}
.coin-tag {
background-color: #FEF3C7;
color: #D97706;
}
.salary-tag {
background-color: #FEF3C7;
color: #D97706;
}
/* My salary 区域 */
.salary-section {
background-color: white;
padding: 16px;
border-radius: 12px;
margin-bottom: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.salary-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
.salary-header h3 {
margin: 0;
font-size: 16px;
font-weight: 600;
color: #333;
}
.personal-salary-btn {
background: none;
border: none;
color: #8B5CF6;
font-size: 14px;
font-weight: 500;
cursor: pointer;
display: flex;
align-items: center;
gap: 4px;
transition: all 0.2s;
}
.personal-salary-btn:hover {
color: #7C3AED;
}
.salary-content {
display: flex;
align-items: center;
gap: 20px;
}
.salary-item {
flex: 1;
text-align: center;
}
.salary-label {
margin: 0 0 8px 0;
font-size: 14px;
color: #666;
}
.salary-amount {
margin: 0;
font-size: 20px;
font-weight: 600;
color: #333;
}
.salary-separator {
width: 1px;
height: 40px;
background-color: #8B5CF6;
}
/* Today's Task 区域 */ /* Today's Task 区域 */
.task-section { .task-section {
background-color: white; background-color: white;
padding: 16px; padding: 16px;
border-radius: 12px; border-radius: 12px;
margin: 0 1%;
margin-bottom: 12px; margin-bottom: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1); box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
} }
/* 任务区域头部样式 */ /* 任务区域头部样式 */
@ -576,124 +392,6 @@ const {
margin-bottom: 12px; margin-bottom: 12px;
} }
.table-row {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
.table-header {
background-color: #f8f9fa;
border-bottom: 1px solid #e5e7eb;
}
.table-data {
background-color: white;
}
.table-cell {
padding: 12px 8px;
text-align: center;
border-right: 1px solid #e5e7eb;
font-size: 14px;
}
.table-cell:last-child {
border-right: none;
}
.table-header .table-cell {
font-weight: 600;
color: #374151;
}
.table-data .table-cell {
color: #111827;
}
.minutes-progress {
color: #6B7280;
}
.minutes-completed {
color: #10B981;
font-weight: 600;
}
.platform-policy-btn {
background: none;
border: none;
color: #8B5CF6;
font-size: 14px;
font-weight: 500;
cursor: pointer;
display: flex;
align-items: center;
gap: 4px;
transition: all 0.2s;
}
.platform-policy-btn:hover {
color: #7C3AED;
}
.platform-policy-btn .arrow {
font-size: 16px;
font-weight: bold;
color: #8B5CF6;
}
/* 进度信息 */
.progress-section {
background-color: white;
padding: 16px;
border-radius: 12px;
margin-bottom: 16px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.progress-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.progress-date {
font-size: 16px;
font-weight: 600;
color: #333;
}
.progress-status {
background: linear-gradient(to right, #FF7578, #FF3D40);
color: white;
padding: 4px 12px;
border-radius: 12px;
font-size: 12px;
font-weight: 600;
}
.progress-details {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.progress-item {
display: flex;
flex-direction: column;
gap: 8px;
}
.progress-item span {
font-size: 14px;
color: #333;
}
/* 操作按钮 */ /* 操作按钮 */
.action-buttons { .action-buttons {
display: grid; display: grid;
@ -707,7 +405,6 @@ const {
border-radius: 12px; border-radius: 12px;
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
cursor: pointer;
text-align: center; text-align: center;
line-height: 1.2; line-height: 1.2;
transition: all 0.2s; transition: all 0.2s;
@ -719,26 +416,36 @@ const {
} }
.exchange-btn { .exchange-btn {
background-color: #FDE68A; background: linear-gradient(135deg, #f1eca6 2.82%, #ffd22f 99.15%), #fff;
color: #D97706; box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
color: white;
} }
.transfer-btn { .transfer-btn {
background-color: #8B5CF6; background: linear-gradient(135deg, #a6aaf1 2.82%, #592fff 99.15%), #fff;
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
color: white; color: white;
} }
.withdraw-btn { .withdraw-btn {
background-color: #10B981;
color: white; color: white;
} }
@media screen and (max-width: 360px) {
* {
font-size: 10px;
}
}
@media screen and (min-width: 360px) {
* {
font-size: 12px;
}
}
/* 通用箭头样式 */ @media screen and (min-width: 768px) {
.arrow { * {
font-size: 16px; font-size: 24px;
font-weight: bold; }
color: #8B5CF6;
} }
</style> </style>