diff --git a/src/components/common/AppTitleHeader.vue b/src/components/common/AppTitleHeader.vue
deleted file mode 100644
index b3d7f87..0000000
--- a/src/components/common/AppTitleHeader.vue
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/common/NavBar.vue b/src/components/common/NavBar.vue
index ace2e82..f3aec09 100644
--- a/src/components/common/NavBar.vue
+++ b/src/components/common/NavBar.vue
@@ -1,18 +1,23 @@
-
-
-
-
-
-
-
-
-
- {{ translatedTitle }}
-
-
+
+
+
-
+
+
+
+ {{ translatedSubTitle }}
@@ -30,6 +35,10 @@ const props = defineProps({
type: String,
default: ''
},
+ subTitle: {
+ type: String,
+ default: ''
+ },
backgroundColor: {
type: String,
default: '#22486e'
@@ -44,17 +53,8 @@ const props = defineProps({
}
})
-const systemInfo = uni.getSystemInfoSync()
-const statusBarHeight = ref(systemInfo.statusBarHeight || 0)
const currentPagesLength = ref(1)
-const navBodyHeight = computed(() => {
- const platform = systemInfo.platform || ''
- if (platform === 'android') return 48
- if (platform === 'ios') return 44
- return 44
-})
-
const isLoginPage = computed(() => {
const pages = getCurrentPages()
if (pages && pages.length > 0) {
@@ -68,19 +68,24 @@ const showBackBtn = computed(() => {
return currentPagesLength.value > 1
})
-const navbarStyle = computed(() => {
- const bg = isLoginPage.value ? '#ffffff' : props.backgroundColor
- return {
- backgroundColor: bg,
- paddingTop: '0px'
- }
+const navbarBgColor = computed(() => {
+ return isLoginPage.value ? '#ffffff' : props.backgroundColor
+})
+
+const navTextColor = computed(() => {
+ return isLoginPage.value ? '#000000' : props.textColor
})
const translatedTitle = computed(() => translateLiteral(props.title))
-const textColor = computed(() => {
- if (isLoginPage.value) return '#000000'
- return props.textColor
+const translatedSubTitle = computed(() => translateLiteral(props.subTitle))
+
+const titleStyleObj = computed(() => {
+ return {
+ color: navTextColor.value,
+ fontWeight: '700',
+ fontSize: '34rpx'
+ }
})
onShow(() => {
@@ -89,6 +94,7 @@ onShow(() => {
})
function handleBack() {
+ if (!showBackBtn.value) return
uni.navigateBack({
fail: () => {
uni.reLaunch({
@@ -100,62 +106,14 @@ function handleBack() {
\ No newline at end of file
+
diff --git a/src/pages_function/pages/criticalComponent/detail.vue b/src/pages_function/pages/criticalComponent/detail.vue
index 62c48c3..ac72026 100644
--- a/src/pages_function/pages/criticalComponent/detail.vue
+++ b/src/pages_function/pages/criticalComponent/detail.vue
@@ -1,7 +1,7 @@
@@ -53,7 +53,7 @@
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
-import AppTitleHeader from '@/components/common/AppTitleHeader.vue'
+import NavBar from '@/components/common/NavBar.vue'
import { getCriticalComponent } from '@/api/mes/criticalComponent'
const { t } = useI18n()
diff --git a/src/pages_function/pages/criticalComponent/index.vue b/src/pages_function/pages/criticalComponent/index.vue
index 11675c9..86b665c 100644
--- a/src/pages_function/pages/criticalComponent/index.vue
+++ b/src/pages_function/pages/criticalComponent/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -132,7 +132,7 @@
import { ref, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
-import AppTitleHeader from '@/components/common/AppTitleHeader.vue'
+import NavBar from '@/components/common/NavBar.vue'
import { getCriticalComponentPage, getCriticalComponent, createCriticalComponent, updateCriticalComponent, deleteCriticalComponent } from '@/api/mes/criticalComponent'
const { t } = useI18n()
diff --git a/src/pages_function/pages/equipment/detail.vue b/src/pages_function/pages/equipment/detail.vue
index 125aaa6..537ad47 100644
--- a/src/pages_function/pages/equipment/detail.vue
+++ b/src/pages_function/pages/equipment/detail.vue
@@ -1,6 +1,6 @@
-
+
@@ -203,7 +203,7 @@