Browse Source

修改首页

master
xh-pan1 1 year ago
parent
commit
650ac343e9
  1. 35
      components/canvasShow/basics/classifyHeader/app/index.vue
  2. 13
      pages/tabbar/index/component/FixedHead.vue
  3. 38
      pages/tabbar/index/index.vue

35
components/canvasShow/basics/classifyHeader/app/index.vue

@ -72,28 +72,37 @@ export default {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: space-between; justify-content: space-between;
padding-left: 20upx;
padding-right: 20upx;
.li{ .li{
flex: 1 0 auto; flex: 1 0 auto;
margin-left: 36upx;
margin-left: 5upx;
margin-right: 5upx;
font-size: 30upx; font-size: 30upx;
color: #999999;
color: #252744;
position: relative; position: relative;
padding-bottom: 18upx;
padding-bottom: 15upx;
padding-left: 27upx;
padding-right: 27upx;
padding-top: 15upx;
text-align: center; text-align: center;
&:first-child{ &:first-child{
margin-left: 0; margin-left: 0;
} }
&.on{ &.on{
&:after{
content: '';
width: 100%;
height: 4upx;
background: #C5AA7B;
position: absolute;
left: 0;
bottom: 0;
}
font-weight:bold;
// &:after{
// content: '';
// width: 100%;
// height: 4upx;
// background: #252744;
// position: absolute;
// left: 0;
// bottom: 0;
// }
background: #252744;
box-shadow: 0upx 7upx 14upx 0upx #C5C8ED;
border-radius: 40upx;
color: white;
} }
} }
} }

13
pages/tabbar/index/component/FixedHead.vue

@ -23,7 +23,12 @@
> >
<!-- logo --> <!-- logo -->
<view class="logo_box"> <view class="logo_box">
<image src="https://wechat.hnthee.com/ceres-local-file/image/logo_wechat.png" />
<!-- <image src="https://wechat.hnthee.com/ceres-local-file/image/logo_wechat.png" /> -->
<image v-if="componentContent.logoType === 1" class="logo"
:src="componentContent.imageUrl"
mode="heightFix"></image>
<view v-else class="h3"
:style="{fontSize:componentContent.fontSizeNum+'px',fontWeight:componentContent.textFontW,color:componentContent.titColor}">{{componentContent.title}}</view>
</view> </view>
<!-- 右侧搜索 --> <!-- 右侧搜索 -->
<template> <template>
@ -70,6 +75,11 @@ export default {
components: { components: {
DefaultHead DefaultHead
}, },
props: {
componentContent: {
type: Object,
},
},
data() { data() {
return { return {
// //
@ -155,6 +165,7 @@ export default {
.logo_box { .logo_box {
width: 265rpx; width: 265rpx;
height: 50rpx; height: 50rpx;
margin-left: 24rpx;
} }
.search_box { .search_box {

38
pages/tabbar/index/index.vue

@ -1,8 +1,9 @@
<template> <template>
<div class="hom-page home_page_content"> <div class="hom-page home_page_content">
<!-- 头部 --> <!-- 头部 -->
<FixedHead v-if="isShowCavansHead">
<category-list @tabChange="tabChange"></category-list>
<FixedHead v-if="isShowCavansHead"
:componentContent="headComponentsData.componentContent">
<category-list @tabChange="tabChange" v-if="false"></category-list>
</FixedHead> </FixedHead>
<!-- 首页画布骨架屏 --> <!-- 首页画布骨架屏 -->
@ -81,7 +82,24 @@ export default {
terminal: API.terminal, terminal: API.terminal,
activeTab: 0, activeTab: 0,
componentsData: [], componentsData: [],
headComponentsData : {},
headComponentsData : {
title: '',
iconClass: 'icon-dianputoubu',
type: 'header',
undraggable: true, //
onlyAdmin: true, //
onlyApp: true, // app
componentContent: {
logoType:1,
imageUrl: '',
title: '',
fontSizeNum: '',
textFontW: 'normal',
titColor: '#CD5353',
showTitle: 1,
useSelfTitle : 2,
}
},
typeId: 1, typeId: 1,
scrollTop: 0 scrollTop: 0
} }
@ -109,7 +127,12 @@ export default {
if (JSON.stringify(data) !== '{}') { if (JSON.stringify(data) !== '{}') {
this.componentsData = JSON.parse(data.json) this.componentsData = JSON.parse(data.json)
let headIndex = this.componentsData.findIndex(item => item.type==='header') let headIndex = this.componentsData.findIndex(item => item.type==='header')
if(headIndex < 0){
this.headComponentsData = {}
if(headIndex >= 0){
this.headComponentsData = this.componentsData[headIndex]
this.componentsData.splice(headIndex, 1)
}
if(!this.headComponentsData.title){
this.headComponentsData = { this.headComponentsData = {
title: '商城头部', title: '商城头部',
iconClass: 'icon-dianputoubu', iconClass: 'icon-dianputoubu',
@ -128,13 +151,8 @@ export default {
useSelfTitle : 2, useSelfTitle : 2,
} }
} }
}else{
this.headComponentsData = this.componentsData[headIndex]
}
if(this.headComponentsData == 2 && headIndex >= 0){
this.componentsData.splice(headIndex, 1)
} }
this.isShowCavansHead = this.headComponentsData == 2
this.isShowCavansHead = true
this.isFirst = false this.isFirst = false
this.loading = false this.loading = false
} }

Loading…
Cancel
Save