Pārlūkot izejas kodu

添加顶部标题

306132416@qq.com 4 gadi atpakaļ
vecāks
revīzija
f69915a456

+ 39 - 0
components/top-title/top-title.vue

@@ -0,0 +1,39 @@
+<template>
+    <view class="title-box">
+	      {{titleValue}}
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: "title-top",
+  props: {
+    titleValue: {
+      type: String,
+      default: '空i企',
+    },
+  },
+  data() {
+    return {};
+  },
+  methods: {
+  },
+};
+</script>
+
+<style>
+.title-box {
+    width: 100%;
+    height: 80rpx;
+    background: transparent;
+    position: absolute;
+    top: 40rpx;
+    color: #fff;
+    letter-spacing: 6rpx;
+    z-index: 9999;
+    text-align: center;
+    line-height: 80rpx;
+	font-size: 28rpx;
+}
+</style>

+ 5 - 1
pages/index/index.vue

@@ -1,5 +1,6 @@
 <template>
   <view class="content">
+	<top-title :titleValue="title" style="width: 100%;"></top-title>  
     <view class="page-section-spacing" style="width: 100%; position: relative">
       <swiper
         class="swiper"
@@ -278,13 +279,16 @@
 
 <script>
 import md5 from "@/common/md5.js";
+import topTitle from '@/components/top-title/top-title.vue';
 import footTabs from '@/components/foot-tabs/footTabs.vue';
 export default {
 	components: {
-		'foot-tabs': footTabs
+		'foot-tabs': footTabs,
+		'top-title': topTitle
 	},
   data() {
     return {
+	  title:"空i企",
       swiperList: [
         {
           img: "/static/swiper/swiper1.jpg",

+ 6 - 3
pages/selfCenter/index.vue

@@ -1,5 +1,6 @@
 <template>
   <view class="content">
+	<top-title :titleValue="title" style="width: 100%;"></top-title>
     <div class="self-inf">
       <div class="img-name-box" v-if="isAuth">
         <image :src="userHeadImg" class="heade-img" mode="aspectFill"></image>
@@ -36,14 +37,16 @@
 
 <script>
 import md5 from "@/common/md5.js";
+import topTitle from '@/components/top-title/top-title.vue';
 import footTabs from '@/components/foot-tabs/footTabs.vue';
 export default {
 	components: {
-		'foot-tabs': footTabs
+		'foot-tabs': footTabs,
+		'top-title': topTitle
 	},
   data() {
     return {
-      message: "我的",
+      title: "个人中心",
       isAuth: true,
       userHeadImg: "",
       userNickName: "",
@@ -252,7 +255,7 @@ export default {
     border-radius: 0rpx 0rpx 100% 100%;
     .img-name-box {
       height: 150rpx;
-      margin-top: 70rpx;
+      margin-top: 110rpx;
       display: flex;
       align-items: center;
       .auth-btn {