wangliang_wd

feat:优化兴趣询问页,优化启动引导

@@ -224,7 +224,7 @@ export struct MorningEveningPaperComponent { @@ -224,7 +224,7 @@ export struct MorningEveningPaperComponent {
224 if (imageSource) { 224 if (imageSource) {
225 const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); 225 const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
226 effectKit.createColorPicker(pixelMap, (err, colorPicker) => { 226 effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
227 - let color = colorPicker.getMainColorSync(); 227 + let color = colorPicker.getLargestProportionColor();
228 Logger.debug(TAG, "compInfoBean compStyle = " + color) 228 Logger.debug(TAG, "compInfoBean compStyle = " + color)
229 // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) 229 // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
230 // 将取色器选取的color示例转换为十六进制颜色代码 230 // 将取色器选取的color示例转换为十六进制颜色代码
@@ -273,6 +273,7 @@ export struct MorningEveningPaperComponent { @@ -273,6 +273,7 @@ export struct MorningEveningPaperComponent {
273 } 273 }
274 } 274 }
275 // .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`) 275 // .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
  276 + .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
276 .scrollBar(BarState.Off) 277 .scrollBar(BarState.Off)
277 .onWillScroll(scrollOffset =>{ 278 .onWillScroll(scrollOffset =>{
278 this.scrollOffset = this.scrollOffset + scrollOffset as number 279 this.scrollOffset = this.scrollOffset + scrollOffset as number
@@ -7,8 +7,8 @@ struct GuidePages { @@ -7,8 +7,8 @@ struct GuidePages {
7 // guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')] 7 // guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')]
8 // guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')] 8 // guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')]
9 // guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')] 9 // guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')]
10 - guideImage = [$r('app.media.guide_Static')]  
11 - guideIndex = [$r('app.media.guide_button')] 10 + guideImage = [$r('app.media.guide_Static'),'']
  11 + guideIndex = [$r('app.media.guide_button'),'']
12 12
13 build() { 13 build() {
14 Column() { 14 Column() {
@@ -17,10 +17,16 @@ struct GuidePages { @@ -17,10 +17,16 @@ struct GuidePages {
17 this.ChildItem(index) 17 this.ChildItem(index)
18 18
19 }, (item: number) => JSON.stringify(item)) 19 }, (item: number) => JSON.stringify(item))
20 - }.loop(false).disableSwipe(true) 20 + }.loop(false)
21 .indicator(false) 21 .indicator(false)
22 .width('100%') 22 .width('100%')
23 .height('100%') 23 .height('100%')
  24 + .effectMode(EdgeEffect.None)
  25 + .onChange(index => {
  26 + if (index == 1) {
  27 + WDRouterRule.jumpWithReplacePage(WDRouterPage.launchInterestsPage)
  28 + }
  29 + })
24 }.width('100%') 30 }.width('100%')
25 .height('100%') 31 .height('100%')
26 32
@@ -103,8 +103,8 @@ struct LaunchAdvertisingPage { @@ -103,8 +103,8 @@ struct LaunchAdvertisingPage {
103 .fontSize('24lpx') 103 .fontSize('24lpx')
104 .width('72lpx') 104 .width('72lpx')
105 .height('36lpx') 105 .height('36lpx')
106 - .borderRadius(5)  
107 - .margin({top:'10lpx',left:'19lpx'}) 106 + .borderRadius(2)
  107 + .margin({top:'15lpx',left:'19lpx'})
108 .backgroundColor('#80000000') 108 .backgroundColor('#80000000')
109 } 109 }
110 .width('100%') 110 .width('100%')
@@ -191,7 +191,7 @@ struct LaunchAdvertisingPage { @@ -191,7 +191,7 @@ struct LaunchAdvertisingPage {
191 this.trackingLaunchClick() 191 this.trackingLaunchClick()
192 192
193 if(this.defaultModel.linkUrl.length > 0){ 193 if(this.defaultModel.linkUrl.length > 0){
194 - if (this.defaultModel.objectType == '2') { 194 + if (this.defaultModel.openType == '2') {
195 //端外打开 195 //端外打开
196 ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl) 196 ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl)
197 }else { 197 }else {
@@ -3,8 +3,9 @@ import { WDRouterRule } from 'wdRouter'; @@ -3,8 +3,9 @@ import { WDRouterRule } from 'wdRouter';
3 import { WDRouterPage } from 'wdRouter'; 3 import { WDRouterPage } from 'wdRouter';
4 import { SPHelper } from 'wdKit/Index'; 4 import { SPHelper } from 'wdKit/Index';
5 import { SpConstants } from 'wdConstant/Index'; 5 import { SpConstants } from 'wdConstant/Index';
6 -import { ButtonOptions, promptAction } from '@kit.ArkUI'; 6 +import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
7 import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; 7 import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
  8 +import { ImageKnifeComponent } from '@ohos/imageknife';
8 9
9 @Entry 10 @Entry
10 @Component 11 @Component
@@ -13,7 +14,6 @@ struct LaunchInterestsHobbiesPage { @@ -13,7 +14,6 @@ struct LaunchInterestsHobbiesPage {
13 @State selectCount: number = 0 14 @State selectCount: number = 0
14 @State interestsArray: InterestsList[] = [] 15 @State interestsArray: InterestsList[] = []
15 16
16 -  
17 aboutToAppear(){ 17 aboutToAppear(){
18 //请求接口,获取兴趣偏好数据 18 //请求接口,获取兴趣偏好数据
19 this.requestInterestsData() 19 this.requestInterestsData()
@@ -21,106 +21,116 @@ struct LaunchInterestsHobbiesPage { @@ -21,106 +21,116 @@ struct LaunchInterestsHobbiesPage {
21 21
22 build() { 22 build() {
23 Column() { 23 Column() {
24 - Row(){  
25 - Blank()  
26 - Text('跳过')  
27 - .fontSize('27lpx')  
28 - .fontColor('#333333')  
29 - .width('54lpx')  
30 - .height('35lpx')  
31 - .margin({top:'27lpx',right:'46lpx'})  
32 - .onClick(()=>{  
33 - //直接跳过到首页  
34 - //跳转首页  
35 - WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)  
36 -  
37 - this.trackingLaunchJumpOver(false)  
38 - })  
39 - }  
40 - .width('100%')  
41 - .justifyContent(FlexAlign.End)  
42 -  
43 - Text('选择感兴趣的内容')  
44 - .fontSize('46lpx')  
45 - .fontWeight(FontWeight.Bold)  
46 - .textAlign(TextAlign.Center)  
47 - .fontColor('#333333')  
48 - .width('100%')  
49 - .height('61lpx')  
50 - .margin({top:'84lpx'})  
51 - Text('完善信息,将为您推荐个性化的内容')  
52 - .fontSize('27lpx')  
53 - .textAlign(TextAlign.Center)  
54 - .fontColor('#9E9E9E')  
55 - .width('100%')  
56 - .height('35lpx')  
57 - .margin({top:'12lpx'})  
58 -  
59 - Grid( ){  
60 - ForEach(this.interestsArray,(item:InterestsList,index:number)=>{  
61 - GridItem(){  
62 - Stack({alignContent:Alignment.TopStart}){  
63 -  
64 - Image(item.pic)  
65 - .width('100%')  
66 - .height('100%')  
67 - .backgroundColor(Color.White)  
68 - .borderRadius(5)  
69 - Stack(){  
70 - Image('')  
71 - .width('100%')  
72 - .height('100%')  
73 - .backgroundColor(Color.Black)  
74 - .opacity(item.choose?0.5:0)  
75 - .borderRadius(5)  
76 - }  
77 -  
78 - Stack(){  
79 - Column({}){  
80 - Text(item.name)  
81 - .fontSize(18)  
82 - .fontColor('#FFFFFF')  
83 - .margin({top:'21lpx',left:'19lpx'})  
84 - .width('100%')  
85 - .height('46lpx')  
86 - .fontWeight(FontWeight.Bold)  
87 - Text(item.title)  
88 - .fontSize('23lpx')  
89 - .fontColor('#FFFFFF')  
90 - .margin({top:'2lpx',left:'19lpx'}) 24 + Stack(){
  25 + Column(){
  26 + Row(){
  27 + Blank()
  28 + Text('跳过')
  29 + .fontSize('27lpx')
  30 + .fontColor('#333333')
  31 + .width('54lpx')
  32 + .height('35lpx')
  33 + .margin({right:'46lpx'})
  34 + .onClick(()=>{
  35 + //直接跳过到首页
  36 + //跳转首页
  37 + WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
  38 +
  39 + this.trackingLaunchJumpOver(false)
  40 + })
  41 + }
  42 + .width('100%')
  43 + .justifyContent(FlexAlign.End)
  44 +
  45 + Text('选择感兴趣的内容')
  46 + .fontSize('46lpx')
  47 + .fontWeight(FontWeight.Bold)
  48 + .textAlign(TextAlign.Center)
  49 + .fontColor('#333333')
  50 + .width('100%')
  51 + .height('61lpx')
  52 + .margin({top:'84lpx'})
  53 + Text('完善信息,将为您推荐个性化的内容')
  54 + .fontSize('27lpx')
  55 + .textAlign(TextAlign.Center)
  56 + .fontColor('#9E9E9E')
  57 + .width('100%')
  58 + .height('35lpx')
  59 + .margin({top:'12lpx'})
  60 +
  61 + Grid( ){
  62 + ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
  63 + GridItem(){
  64 + Stack({alignContent:Alignment.TopStart}){
  65 + ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}})
91 .width('100%') 66 .width('100%')
92 - .height('31lpx')  
93 - Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))  
94 - .height('32lpx')  
95 - .width('32lpx')  
96 - .margin({top:'80lpx',left:'110lpx'})  
97 -  
98 - }.justifyContent(FlexAlign.Start) 67 + .height('100%')
  68 + .backgroundColor(Color.White)
  69 + .borderRadius(5)
  70 + // Image(item.pic)
  71 + // .width('100%')
  72 + // .height('100%')
  73 + // .backgroundColor(Color.White)
  74 + // .borderRadius(5)
  75 + Stack(){
  76 + Image('')
  77 + .width('100%')
  78 + .height('100%')
  79 + .backgroundColor(Color.Black)
  80 + .opacity(item.choose?0.5:0)
  81 + .borderRadius(5)
  82 + }
  83 + Stack(){
  84 + Column({}){
  85 + Text(item.name)
  86 + .fontSize(18)
  87 + .fontColor('#FFFFFF')
  88 + .margin({top:'21lpx',left:'19lpx'})
  89 + .width('100%')
  90 + .height('46lpx')
  91 + .fontWeight(FontWeight.Bold)
  92 + Text(item.title)
  93 + .fontSize('23lpx')
  94 + .fontColor('#FFFFFF')
  95 + .margin({top:'2lpx',left:'19lpx'})
  96 + .width('100%')
  97 + .height('31lpx')
  98 + Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
  99 + .height('32lpx')
  100 + .width('32lpx')
  101 + .margin({top:'80lpx',left:'110lpx'})
  102 +
  103 + }.justifyContent(FlexAlign.Start)
  104 + }
  105 +
  106 + }
99 } 107 }
  108 + .width('192lpx')
  109 + .height('230lpx')
  110 + .borderRadius('8lpx')
  111 + .onClick(()=>{
  112 + //选择后改变已选择属性
  113 + item.choose = !item.choose
  114 + this.interestsArray.splice(index,1,item)
  115 + this.selectCount = this.interestsArray.filter(item => item.choose).length
  116 + })
100 117
101 - } 118 + })
102 } 119 }
103 - .width('192lpx')  
104 - .height('230lpx')  
105 - .borderRadius('8lpx')  
106 - .onClick(()=>{  
107 - //选择后改变已选择属性  
108 - item.choose = !item.choose  
109 - this.interestsArray.splice(index,1,item)  
110 - this.selectCount = this.interestsArray.filter(item => item.choose).length  
111 - })  
112 -  
113 - })  
114 - 120 + .width('90%')
  121 + // .height('70%')
  122 + .margin({top:'61lpx',bottom:'240lpx'})
  123 + .columnsTemplate('1fr 1fr 1fr')
  124 + .columnsGap('23lpx')
  125 + .rowsGap('23lpx')
  126 + .scrollBar(BarState.Off)
  127 + }
  128 + .width('100%')
  129 + .height('100%')
115 } 130 }
116 - .width('90%')  
117 - .height('70%')  
118 - .margin({top:'61lpx'})  
119 - .columnsTemplate('1fr 1fr 1fr')  
120 - // .rowsTemplate('1fr 1fr 1fr 1fr')  
121 - .columnsGap('23lpx')  
122 - .rowsGap('23lpx')  
123 - .scrollBar(BarState.Off) 131 + .width('100%')
  132 + .height(`calc(100% - ${108 + 'lpx'})`)
  133 + // .backgroundColor(Color.Red)
124 134
125 Stack({alignContent:Alignment.Center}){ 135 Stack({alignContent:Alignment.Center}){
126 Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')') 136 Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')')
@@ -131,9 +141,11 @@ struct LaunchInterestsHobbiesPage { @@ -131,9 +141,11 @@ struct LaunchInterestsHobbiesPage {
131 .borderRadius('10lpx') 141 .borderRadius('10lpx')
132 .width('662lpx') 142 .width('662lpx')
133 .height('84lpx') 143 .height('84lpx')
  144 + .margin({top:'10lpx'})
134 Image('') 145 Image('')
135 .width('662lpx') 146 .width('662lpx')
136 .height('84lpx') 147 .height('84lpx')
  148 + .margin({top:'10lpx'})
137 .backgroundColor(Color.White) 149 .backgroundColor(Color.White)
138 .opacity(this.selectCount == 0 ? 0.6 : 0) 150 .opacity(this.selectCount == 0 ? 0.6 : 0)
139 .borderRadius('10lpx') 151 .borderRadius('10lpx')
@@ -156,10 +168,8 @@ struct LaunchInterestsHobbiesPage { @@ -156,10 +168,8 @@ struct LaunchInterestsHobbiesPage {
156 } 168 }
157 .width('100%') 169 .width('100%')
158 .height('108lpx') 170 .height('108lpx')
159 - // .position({y:})  
160 - // .margin({bottom:'1',top:'1'})  
161 - .backgroundColor('#FFFFFF')  
162 - 171 + .margin({top:0})
  172 + // .backgroundColor(Color.Orange)
163 } 173 }
164 .width('100%') 174 .width('100%')
165 .height('100%') 175 .height('100%')