From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示
---
src/components/CommonTitle.vue | 107 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 72 insertions(+), 35 deletions(-)
diff --git a/src/components/CommonTitle.vue b/src/components/CommonTitle.vue
index d92d71c..9066cc0 100644
--- a/src/components/CommonTitle.vue
+++ b/src/components/CommonTitle.vue
@@ -1,42 +1,79 @@
<template>
- <div class="overview-title">
- <div class="left">{{ title }}</div>
- <div class="right">详情 ></div>
+ <div class="overview-title">
+ <div class="left">
+ {{ title }}
</div>
+ <div class="right" v-if="show && text!=='返回'" @click="attrs.onDetails()">{{ text }} ></div>
+ <div v-if="title=='机巢概况' && text=='返回'" class="do-return" @click="attrs.onDetails()">
+ <img src="@/assets/images/return.png" alt="" />
+ </div>
+ </div>
</template>
<script setup>
- const props = defineProps({
- title: {
- type: String,
- default: '机巢概况'
- }
- })
+const props = defineProps({
+ title: {
+ type: String,
+ default: '标题',
+ },
+ text: {
+ type: String,
+ default: '详情',
+ },
+});
+const attrs = useAttrs();
+const show = ref(attrs.onDetails);
</script>
<style scoped lang="scss">
- .overview-title {
- height: hToV(42);
- background-image: url(@/assets/images/title-bg.png);
- background-repeat: no-repeat;
- display: flex;
- justify-content: space-between;
- margin-bottom: 18px;
- .left {
- margin-left: 66px;
- font-weight: 400;
- font-size: 20px;
- color: #FFFFFF;
- line-height: 23px;
- text-shadow: 0px 0px 7px rgba(75,180,229,0.69), 0px 2px 8px rgba(5,28,55,0.42);
- text-align: left;
- font-style: normal;
- text-transform: none;
- }
- .right {
- width: 42px;
- font-weight: 500;
- font-size: 14px;
- color: #0BE7F6;
- line-height: hToV(42);
- }
+.overview-title {
+ position: relative;
+ width: 404px;
+ height: 43px;
+ background-image: url(@/assets/images/title-bg.png);
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+ display: flex;
+ justify-content: space-between;
+
+ .left {
+ position: absolute;
+ left: 49px;
+ bottom: 16px;
+ font-weight: 400;
+ font-size: 20px;
+ color: #ffffff;
+ text-shadow: 0px 0px 7px rgba(75, 180, 229, 0.69), 0px 2px 8px rgba(5, 28, 55, 0.42);
+ text-align: left;
+ font-style: normal;
+ text-transform: none;
+ font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
+ height: 26px;
+ line-height: 23px;
+ }
+
+ .right {
+ position: absolute;
+ font-weight: 500;
+ font-size: 14px;
+ color: #0be7f6;
+ height: 21px;
+ line-height: 21px;
+ font-family: Source Han Sans CN, Source Han Sans CN, serif;
+ text-align: right;
+ font-style: normal;
+ text-transform: none;
+ bottom: 16px;
+ right: 11px;
+ cursor: pointer;
+ }
+ .do-return {
+ position: absolute;
+ top: 3px;
+ right: -50px;
+ cursor: pointer;
+ img {
+ width: 60px;
+ height: 33px;
}
-</style>
\ No newline at end of file
+ }
+}
+</style>
--
Gitblit v1.9.3