yangchenggong1_wd

desc:tab 样式修改

@@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI { @@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI {
33 Stack(){ 33 Stack(){
34 Image(this.headPhotoUrl) 34 Image(this.headPhotoUrl)
35 .alt($r('app.media.default_head')) 35 .alt($r('app.media.default_head'))
36 - .width('108lpx')  
37 - .height('108lpx') 36 + .width('100lpx')
  37 + .height('100lpx')
38 .objectFit(ImageFit.Cover) 38 .objectFit(ImageFit.Cover)
39 .borderRadius(50) 39 .borderRadius(50)
40 Image(this.levelHead) 40 Image(this.levelHead)
@@ -18,7 +18,7 @@ export struct FollowFirstTabsComponent{ @@ -18,7 +18,7 @@ export struct FollowFirstTabsComponent{
18 value.forEach((element)=>{ 18 value.forEach((element)=>{
19 this.data.push(element) 19 this.data.push(element)
20 }) 20 })
21 - console.log("ycg",this.data.length.toString()); 21 +
22 if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ 22 if(this.controller != null && this.data.length>1 && this.changeIndex === 1){
23 //个人主页 跳转 关注页 tab 2 23 //个人主页 跳转 关注页 tab 2
24 let intervalID = setInterval(() => { 24 let intervalID = setInterval(() => {
@@ -171,6 +171,7 @@ struct ChildComponent { @@ -171,6 +171,7 @@ struct ChildComponent {
171 .fontSize('31lpx') 171 .fontSize('31lpx')
172 .lineHeight('38lpx') 172 .lineHeight('38lpx')
173 .fontColor($r('app.color.color_222222')) 173 .fontColor($r('app.color.color_222222'))
  174 + .maxLines(1)
174 Text(`粉丝${this.data.cnFansNum}`) 175 Text(`粉丝${this.data.cnFansNum}`)
175 .fontColor($r('app.color.color_B0B0B0')) 176 .fontColor($r('app.color.color_B0B0B0'))
176 .fontSize('23lpx') 177 .fontSize('23lpx')
@@ -35,25 +35,45 @@ export struct FollowSecondTabsComponent{ @@ -35,25 +35,45 @@ export struct FollowSecondTabsComponent{
35 35
36 @Builder FollowSecondUI(){ 36 @Builder FollowSecondUI(){
37 Row() { 37 Row() {
  38 + Row(){
  39 + // 页签
  40 + Column({ space: 7 }) {
  41 + Scroll() {
  42 + Column() {
  43 + ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => {
  44 + this.TabBuilder(index,item)
  45 + })
  46 + }
  47 + .justifyContent(FlexAlign.Start)
  48 + }
  49 + .align(Alignment.Top)
  50 + .scrollable(ScrollDirection.Vertical)
  51 + .scrollBar(BarState.Off)
  52 + .height('100%')
  53 + }.height('100%')
  54 + .alignItems(HorizontalAlign.Center)
  55 + }
  56 + .alignItems(VerticalAlign.Top)
  57 + .height('100%')
  58 +
38 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 59 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
39 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { 60 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => {
40 TabContent(){ 61 TabContent(){
41 FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) 62 FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index})
42 - }.tabBar(this.TabBuilder(index,item)) 63 + }
43 .backgroundColor($r('app.color.white')) 64 .backgroundColor($r('app.color.white'))
44 }, (item: FollowListItem, index: number) => index.toString()) 65 }, (item: FollowListItem, index: number) => index.toString())
45 } 66 }
46 .vertical(true) 67 .vertical(true)
47 .barMode(BarMode.Scrollable) 68 .barMode(BarMode.Scrollable)
48 - .barWidth('140lpx')  
49 .animationDuration(0) 69 .animationDuration(0)
50 .onChange((index: number) => { 70 .onChange((index: number) => {
51 this.currentIndex = index 71 this.currentIndex = index
52 }) 72 })
53 - .width('100%') 73 + .barWidth(0)
  74 + .height('100%')
  75 + .layoutWeight(1)
54 }.width('100%') 76 }.width('100%')
55 - .alignItems(VerticalAlign.Top)  
56 - .backgroundColor('#0FF')  
57 } 77 }
58 78
59 @Builder TabBuilder(index: number, item: FollowSecondListItem) { 79 @Builder TabBuilder(index: number, item: FollowSecondListItem) {
@@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{ @@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{
73 }) 93 })
74 .justifyContent(FlexAlign.Center) 94 .justifyContent(FlexAlign.Center)
75 .height('84lpx') 95 .height('84lpx')
  96 + .width('140lpx')
76 .backgroundColor(this.currentIndex === index?$r('app.color.white'):$r('app.color.color_F9F9F9')) 97 .backgroundColor(this.currentIndex === index?$r('app.color.white'):$r('app.color.color_F9F9F9'))
77 } 98 }
78 99
@@ -34,19 +34,45 @@ export struct FollowThirdTabsComponent{ @@ -34,19 +34,45 @@ export struct FollowThirdTabsComponent{
34 .lineHeight('38lpx') 34 .lineHeight('38lpx')
35 .backgroundColor($r('app.color.color_F9F9F9')) 35 .backgroundColor($r('app.color.color_F9F9F9'))
36 .padding('13lpx') 36 .padding('13lpx')
  37 + .maxLines(1)
37 } 38 }
38 .onClick(()=>{ 39 .onClick(()=>{
39 this.currentIndex = index 40 this.currentIndex = index
40 this.controller.changeIndex(this.currentIndex) 41 this.controller.changeIndex(this.currentIndex)
41 }) 42 })
42 - .height('100%') 43 + .height('84lpx')
43 .margin({right:'9lpx'}) 44 .margin({right:'9lpx'})
44 .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"}) 45 .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"})
45 .justifyContent(FlexAlign.Center) 46 .justifyContent(FlexAlign.Center)
46 } 47 }
47 48
48 @Builder FollowThirdUI(){ 49 @Builder FollowThirdUI(){
  50 +
  51 + Column(){
  52 + Column() {
  53 + // 页签
  54 + Row({ space: 7 }) {
  55 + Scroll() {
49 Row() { 56 Row() {
  57 + ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
  58 + this.TabBuilder(index,item)
  59 + })
  60 + }
  61 + .justifyContent(FlexAlign.Start)
  62 + }
  63 + .align(Alignment.Start)
  64 + .scrollable(ScrollDirection.Horizontal)
  65 + .scrollBar(BarState.Off)
  66 + .width('90%')
  67 + .padding({left:'11lpx'})
  68 + }
  69 + .alignItems(VerticalAlign.Bottom)
  70 + .width('100%')
  71 + }
  72 + .backgroundColor($r('app.color.white'))
  73 + .alignItems(HorizontalAlign.Start)
  74 + .width('100%')
  75 +
50 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 76 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
51 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { 77 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
52 TabContent(){ 78 TabContent(){
@@ -58,20 +84,19 @@ export struct FollowThirdTabsComponent{ @@ -58,20 +84,19 @@ export struct FollowThirdTabsComponent{
58 .margin({left:'20lpx'}) 84 .margin({left:'20lpx'})
59 FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) 85 FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id})
60 } 86 }
61 - }.tabBar(this.TabBuilder(index,item)) 87 + }
62 .backgroundColor($r('app.color.white')) 88 .backgroundColor($r('app.color.white'))
63 }, (item: FollowListItem, index: number) => index.toString()) 89 }, (item: FollowListItem, index: number) => index.toString())
64 } 90 }
  91 + .barHeight(0)
65 .vertical(false) 92 .vertical(false)
66 .barMode(BarMode.Scrollable) 93 .barMode(BarMode.Scrollable)
67 - .barWidth('100%')  
68 - .barHeight('84lpx')  
69 .animationDuration(0) 94 .animationDuration(0)
70 .onChange((index: number) => { 95 .onChange((index: number) => {
71 this.currentIndex = index 96 this.currentIndex = index
72 }) 97 })
73 .width('100%') 98 .width('100%')
74 - }.width('100%') 99 + }
75 } 100 }
76 101
77 } 102 }
  1 +import { SearchResultContentComponent } from './SearchResultContentComponent'
1 2
2 const TAG = "SearchResultComponent" 3 const TAG = "SearchResultComponent"
3 /** 4 /**
@@ -19,7 +20,7 @@ export struct SearchResultComponent{ @@ -19,7 +20,7 @@ export struct SearchResultComponent{
19 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 20 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
20 ForEach(this.count, (item: string, index: number ) => { 21 ForEach(this.count, (item: string, index: number ) => {
21 TabContent(){ 22 TabContent(){
22 - Text(item) 23 + SearchResultContentComponent()
23 }.tabBar(this.TabBuilder(index,item)) 24 }.tabBar(this.TabBuilder(index,item))
24 }, (item: string, index: number) => index.toString()) 25 }, (item: string, index: number) => index.toString())
25 } 26 }
@@ -63,4 +64,5 @@ export struct SearchResultComponent{ @@ -63,4 +64,5 @@ export struct SearchResultComponent{
63 .margin({right:'9lpx'}) 64 .margin({right:'9lpx'})
64 .padding({left:'31lpx',right:index === this.count.length-1?"31lpx":"0lpx"}) 65 .padding({left:'31lpx',right:index === this.count.length-1?"31lpx":"0lpx"})
65 } 66 }
  67 +
66 } 68 }
  1 +const TAG = "SearchResultContentComponent"
  2 +
  3 +@Component
  4 +export struct SearchResultContentComponent{
  5 +
  6 + aboutToAppear(): void {
  7 +
  8 + }
  9 +
  10 +
  11 +
  12 + build() {
  13 +
  14 + }
  15 +}
@@ -2,6 +2,7 @@ import router from '@ohos.router' @@ -2,6 +2,7 @@ import router from '@ohos.router'
2 import { Params } from 'wdBean'; 2 import { Params } from 'wdBean';
3 import { StringUtils } from 'wdKit'; 3 import { StringUtils } from 'wdKit';
4 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 4 import { WDRouterPage, WDRouterRule } from 'wdRouter';
  5 +import { CardParser } from '../components/CardParser';
5 import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; 6 import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent';
6 import MinePageDatasModel from '../model/MinePageDatasModel'; 7 import MinePageDatasModel from '../model/MinePageDatasModel';
7 8
@@ -182,14 +183,37 @@ struct MineHomePage { @@ -182,14 +183,37 @@ struct MineHomePage {
182 183
183 Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') 184 Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx')
184 185
  186 + Column(){
  187 + Column() {
  188 + // 页签
  189 + Row({ space: 7 }) {
  190 + Scroll() {
  191 + Row() {
  192 + this.TabBuilder(0,"评论")
  193 + this.TabBuilder(1,"关注")
  194 + }
  195 + .justifyContent(FlexAlign.Start)
  196 + }
  197 + .align(Alignment.Start)
  198 + .scrollable(ScrollDirection.Horizontal)
  199 + .scrollBar(BarState.Off)
  200 + .width('90%')
  201 + .padding({left:'31lpx'})
  202 + }
  203 + .alignItems(VerticalAlign.Bottom)
  204 + .width('100%')
  205 + }
  206 + .alignItems(HorizontalAlign.Start)
  207 + .width('100%')
  208 +
185 //tab 页面 209 //tab 页面
186 Tabs({controller: this.controller}) { 210 Tabs({controller: this.controller}) {
187 TabContent() { 211 TabContent() {
188 HomePageBottomComponent({style:0}) 212 HomePageBottomComponent({style:0})
189 - }.tabBar(this.TabBuilder(0,"评论")) 213 + }
190 TabContent() { 214 TabContent() {
191 HomePageBottomComponent({style:1}) 215 HomePageBottomComponent({style:1})
192 - }.tabBar(this.TabBuilder(1,"关注")) 216 + }
193 } 217 }
194 .backgroundColor($r('app.color.white')) 218 .backgroundColor($r('app.color.white'))
195 .animationDuration(0) 219 .animationDuration(0)
@@ -197,6 +221,8 @@ struct MineHomePage { @@ -197,6 +221,8 @@ struct MineHomePage {
197 this.currentIndex = index 221 this.currentIndex = index
198 }) 222 })
199 .vertical(false) 223 .vertical(false)
  224 + .barHeight(0)
  225 + }
200 }.width("100%") 226 }.width("100%")
201 } 227 }
202 .edgeEffect(EdgeEffect.None) 228 .edgeEffect(EdgeEffect.None)
@@ -206,8 +232,8 @@ struct MineHomePage { @@ -206,8 +232,8 @@ struct MineHomePage {
206 } 232 }
207 }.width('100%') 233 }.width('100%')
208 .layoutWeight(1) 234 .layoutWeight(1)
209 -  
210 } 235 }
  236 +
211 @Builder MineHomeTitleTransparent() { 237 @Builder MineHomeTitleTransparent() {
212 RelativeContainer() { 238 RelativeContainer() {
213 //标题栏目 239 //标题栏目
@@ -342,9 +368,9 @@ struct MineHomePage { @@ -342,9 +368,9 @@ struct MineHomePage {
342 this.currentIndex = index 368 this.currentIndex = index
343 this.controller.changeIndex(this.currentIndex) 369 this.controller.changeIndex(this.currentIndex)
344 }) 370 })
345 - .height('100%')  
346 - .width('100%')  
347 - .margin({right:'9lpx'}) 371 + .height('77lpx')
  372 + .width('70lpx')
  373 + .margin({right:'29lpx'})
348 } 374 }
349 375
350 /** 376 /**
@@ -172,17 +172,42 @@ struct OtherNormalUserHomePage { @@ -172,17 +172,42 @@ struct OtherNormalUserHomePage {
172 .width('100%') 172 .width('100%')
173 .backgroundColor($r('app.color.white')) 173 .backgroundColor($r('app.color.white'))
174 } 174 }
  175 +
175 //间隔符 176 //间隔符
176 Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') 177 Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx')
177 178
  179 + Column(){
  180 + Column() {
  181 + // 页签
  182 + Row({ space: 7 }) {
  183 + Scroll() {
  184 + Row() {
  185 + this.TabBuilder(0,"评论")
  186 + this.TabBuilder(1,"关注")
  187 + }
  188 + .justifyContent(FlexAlign.Start)
  189 + }
  190 + .align(Alignment.Start)
  191 + .scrollable(ScrollDirection.Horizontal)
  192 + .scrollBar(BarState.Off)
  193 + .width('90%')
  194 + .padding({left:'31lpx'})
  195 + }
  196 + .alignItems(VerticalAlign.Bottom)
  197 + .width('100%')
  198 + }
  199 + .backgroundColor($r('app.color.white'))
  200 + .alignItems(HorizontalAlign.Start)
  201 + .width('100%')
  202 +
178 //tab 页面 203 //tab 页面
179 Tabs({controller: this.controller}) { 204 Tabs({controller: this.controller}) {
180 TabContent() { 205 TabContent() {
181 OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) 206 OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum})
182 - }.tabBar(this.TabBuilder(0,"评论")) 207 + }
183 TabContent() { 208 TabContent() {
184 OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) 209 OtherHomePageBottomFollowComponent({curUserId:this.curUserId})
185 - }.tabBar(this.TabBuilder(1,"关注")) 210 + }
186 } 211 }
187 .backgroundColor($r('app.color.white')) 212 .backgroundColor($r('app.color.white'))
188 .animationDuration(0) 213 .animationDuration(0)
@@ -190,6 +215,8 @@ struct OtherNormalUserHomePage { @@ -190,6 +215,8 @@ struct OtherNormalUserHomePage {
190 this.currentIndex = index 215 this.currentIndex = index
191 }) 216 })
192 .vertical(false) 217 .vertical(false)
  218 + .barHeight(0)
  219 + }
193 }.width("100%") 220 }.width("100%")
194 } 221 }
195 .edgeEffect(EdgeEffect.None) 222 .edgeEffect(EdgeEffect.None)
@@ -300,9 +327,9 @@ struct OtherNormalUserHomePage { @@ -300,9 +327,9 @@ struct OtherNormalUserHomePage {
300 this.currentIndex = index 327 this.currentIndex = index
301 this.controller.changeIndex(this.currentIndex) 328 this.controller.changeIndex(this.currentIndex)
302 }) 329 })
303 - .height('100%')  
304 - .width('100%')  
305 - .margin({right:'9lpx'}) 330 + .height('77lpx')
  331 + .width('70lpx')
  332 + .margin({right:'29lpx'})
306 } 333 }
307 334
308 335
  1 +import { SearchResultContentItem } from './SearchResultContentItem'
  2 +
  3 +@Observed
  4 +export class SearchResultContentData{
  5 + list:SearchResultContentItem[] = []
  6 +
  7 + keyword:string = ""
  8 + pageNum: number = 0
  9 + pageSize: number = 20
  10 + totalCount: number = 0
  11 +
  12 +
  13 +}
  1 +import { ContentDTO } from 'wdBean/Index'
  2 +
  3 +export interface SearchResultContentItem{
  4 + data:ContentDTO
  5 + resultType:string
  6 +
  7 +}