主页样式调整
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
|
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
|
|
||||||
|
<p class="welcome">{{userName}},欢迎来到炬融圈</p>
|
||||||
<!-- 轮播图 -->
|
<!-- 轮播图 -->
|
||||||
<div class="carousel">
|
<div class="carousel">
|
||||||
<swiper
|
<swiper
|
||||||
@@ -41,13 +43,13 @@
|
|||||||
<div class="action-area">
|
<div class="action-area">
|
||||||
<div class="action-grid-horizontal">
|
<div class="action-grid-horizontal">
|
||||||
<router-link to="/matching?quantitative=true" class="action-item">
|
<router-link to="/matching?quantitative=true" class="action-item">
|
||||||
<img src="/imgs/mainpage/dinglianghuoqu1.png" alt="定量获取" class="action-image" />
|
<img src="/imgs/mainpage/dinglianghuoqu1.png" alt="定量获取" class="action-image1" />
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link to="/matching" class="action-item">
|
<router-link to="/matching" class="action-item">
|
||||||
<img src="/imgs/mainpage/huoqurongdou1.png" alt="获取融豆" class="action-image" />
|
<img src="/imgs/mainpage/huoqurongdou1.png" alt="获取融豆" class="action-image2" />
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link to="/myshop" class="action-item">
|
<router-link to="/myshop" class="action-item">
|
||||||
<img src="/imgs/mainpage/shangcheng1.png" alt="商城" class="action-image" />
|
<img src="/imgs/mainpage/shangcheng1.png" alt="商城" class="action-image3" />
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 欢迎弹窗 -->
|
<!-- 欢迎弹窗 -->
|
||||||
<el-dialog
|
<!-- <el-dialog
|
||||||
v-model="showWelcomeDialog"
|
v-model="showWelcomeDialog"
|
||||||
width="90%"
|
width="90%"
|
||||||
:style="{ height: '425px' }"
|
:style="{ height: '425px' }"
|
||||||
@@ -97,16 +99,17 @@
|
|||||||
<el-button @click="showWelcomeDialog = false">关闭</el-button>
|
<el-button @click="showWelcomeDialog = false">关闭</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Swiper, SwiperSlide } from 'swiper/vue';
|
import { Swiper, SwiperSlide } from 'swiper/vue';
|
||||||
import { Autoplay, Pagination } from 'swiper';
|
import { Autoplay, Pagination } from 'swiper';
|
||||||
import { ref, onMounted, onUnmounted } from 'vue';
|
import { ref, onMounted, onUnmounted, computed } from 'vue';
|
||||||
import { ElMessage, ElDialog, ElButton } from 'element-plus';
|
import { ElMessage, ElDialog, ElButton } from 'element-plus';
|
||||||
import { transferAPI } from '../utils/api';
|
import { transferAPI } from '../utils/api';
|
||||||
|
import { useUserStore } from '../stores/user';
|
||||||
import 'swiper/css';
|
import 'swiper/css';
|
||||||
import 'swiper/css/autoplay';
|
import 'swiper/css/autoplay';
|
||||||
import 'swiper/css/pagination';
|
import 'swiper/css/pagination';
|
||||||
@@ -117,9 +120,17 @@ export default {
|
|||||||
SwiperSlide,
|
SwiperSlide,
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
|
// 用户store
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const userPoints = ref(0);
|
const userPoints = ref(0);
|
||||||
const showWelcomeDialog = ref(false);
|
const showWelcomeDialog = ref(false);
|
||||||
|
|
||||||
|
// 计算属性 - 获取用户名
|
||||||
|
const userName = computed(() => {
|
||||||
|
return userStore.user?.username || '用户';
|
||||||
|
});
|
||||||
const carouselItems = ref([
|
const carouselItems = ref([
|
||||||
{ image: '/imgs/top/1.jpg', title: '限时优惠活动' },
|
{ image: '/imgs/top/1.jpg', title: '限时优惠活动' },
|
||||||
{ image: '/imgs/top/2.jpg', title: '新用户专享' },
|
{ image: '/imgs/top/2.jpg', title: '新用户专享' },
|
||||||
@@ -189,6 +200,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
modules: [Autoplay, Pagination],
|
modules: [Autoplay, Pagination],
|
||||||
userPoints,
|
userPoints,
|
||||||
|
userName,
|
||||||
carouselItems,
|
carouselItems,
|
||||||
headerItems,
|
headerItems,
|
||||||
newsItems,
|
newsItems,
|
||||||
@@ -227,7 +239,7 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
background-image: url('/imgs/mainpage/jingganglan-1.png'), url('/imgs/mainpage/jingganglan-2.png');
|
background-image: url('/imgs/mainpage/jingganglan-1.png'), url('/imgs/mainpage/jingganglan-2.png');
|
||||||
background-size: 100% 10%, 100% 100%;
|
background-size: 100% 10%, 100% 100%;
|
||||||
background-position: center 24%, center 100%;
|
background-position: center 28%, center 100%;
|
||||||
background-repeat: no-repeat, no-repeat;
|
background-repeat: no-repeat, no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,6 +254,13 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 欢迎文字 */
|
||||||
|
.welcome {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
@@ -346,12 +365,31 @@ export default {
|
|||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-image {
|
.action-image1 {
|
||||||
width: 100%;
|
width: 300%;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-width: 110px;
|
max-width: 180px;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-image2 {
|
||||||
|
width: 300%;
|
||||||
|
height: auto;
|
||||||
|
max-width: 180px;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-image3 {
|
||||||
|
width: 300%;
|
||||||
|
height: auto;
|
||||||
|
max-width: 180px;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-left: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 热门资讯 */
|
/* 热门资讯 */
|
||||||
@@ -360,7 +398,8 @@ export default {
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
box-shadow: var(--box-shadow);
|
border: 1px solid #e0e0e0;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user