wangliang_wd

feat:优化启动广告,优化关注动效

@@ -188,7 +188,7 @@ class CommentViewModel { @@ -188,7 +188,7 @@ class CommentViewModel {
188 bean['userName'] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string 188 bean['userName'] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string
189 } 189 }
190 190
191 - HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => { 191 + HttpBizUtil.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
192 if (data.code != 0) { 192 if (data.code != 0) {
193 ToastUtils.showToast(data.message, 1000); 193 ToastUtils.showToast(data.message, 1000);
194 fail() 194 fail()
@@ -97,7 +97,7 @@ export struct ZhSingleRow02 { @@ -97,7 +97,7 @@ export struct ZhSingleRow02 {
97 .margin({ right: 8 }) 97 .margin({ right: 8 })
98 }) 98 })
99 } 99 }
100 - if (this.compDTO.operDataList.length >= 2 && this.showMore()) { 100 + if (this.compDTO.operDataList.length > 2 && this.showMore()) {
101 Row() { 101 Row() {
102 Ellipse() 102 Ellipse()
103 .width(2* (this.moreWidth - this.initMoreWidth - 1)) 103 .width(2* (this.moreWidth - this.initMoreWidth - 1))
@@ -13,6 +13,7 @@ export struct FollowChildComponent{ @@ -13,6 +13,7 @@ export struct FollowChildComponent{
13 @State type:number = 0 13 @State type:number = 0
14 @State columnHeight:number = 202 14 @State columnHeight:number = 202
15 15
  16 + @State isLoadingAttention:boolean = false
16 17
17 aboutToAppear(): void { 18 aboutToAppear(): void {
18 if(this.type == 0 && StringUtils.isEmpty(this.data.introduction)){ 19 if(this.type == 0 && StringUtils.isEmpty(this.data.introduction)){
@@ -81,11 +82,18 @@ export struct FollowChildComponent{ @@ -81,11 +82,18 @@ export struct FollowChildComponent{
81 82
82 if(this.data.status == "1"){ 83 if(this.data.status == "1"){
83 Row(){ 84 Row(){
84 - Text(`已关注`)  
85 - .fontColor($r('app.color.color_CCCCCC'))  
86 - .fontSize('23lpx')  
87 - .fontWeight('500lpx')  
88 - .lineHeight('35lpx') 85 + if(this.isLoadingAttention) {
  86 + LoadingProgress()
  87 + .width(20)
  88 + .height(20)
  89 + .color( $r('app.color.color_CCCCCC'))
  90 + }else {
  91 + Text(`已关注`)
  92 + .fontColor($r('app.color.color_CCCCCC'))
  93 + .fontSize('23lpx')
  94 + .fontWeight('500lpx')
  95 + .lineHeight('35lpx')
  96 + }
89 } 97 }
90 .justifyContent(FlexAlign.Center) 98 .justifyContent(FlexAlign.Center)
91 .width('100lpx') 99 .width('100lpx')
@@ -93,19 +101,30 @@ export struct FollowChildComponent{ @@ -93,19 +101,30 @@ export struct FollowChildComponent{
93 .borderRadius("6lpx") 101 .borderRadius("6lpx")
94 .height('46lpx') 102 .height('46lpx')
95 .onClick(()=>{ 103 .onClick(()=>{
  104 + if (this.isLoadingAttention) return
  105 + this.isLoadingAttention = true
  106 +
96 this.followOperation() 107 this.followOperation()
97 }).margin({top:'29lpx'}) 108 }).margin({top:'29lpx'})
98 }else{ 109 }else{
99 Row(){ 110 Row(){
100 - Image($r('app.media.follow_icon'))  
101 - .margin({right:'4lpx'})  
102 - .width('23lpx')  
103 - .height('23lpx')  
104 - Text(`关注`)  
105 - .fontColor($r('app.color.color_ED2800'))  
106 - .fontSize('23lpx')  
107 - .fontWeight('500lpx')  
108 - .lineHeight('35lpx') 111 + if(this.isLoadingAttention) {
  112 + LoadingProgress()
  113 + .width(20)
  114 + .height(20)
  115 + .color($r('app.color.main_red'))
  116 + }else {
  117 + Image($r('app.media.follow_icon'))
  118 + .margin({right:'4lpx'})
  119 + .width('23lpx')
  120 + .height('23lpx')
  121 + Text(`关注`)
  122 + .fontColor($r('app.color.color_ED2800'))
  123 + .fontSize('23lpx')
  124 + .fontWeight('500lpx')
  125 + .lineHeight('35lpx')
  126 + }
  127 +
109 }.borderColor($r('app.color.color_1AED2800')) 128 }.borderColor($r('app.color.color_1AED2800'))
110 .borderRadius('6lpx') 129 .borderRadius('6lpx')
111 .borderWidth('2lpx') 130 .borderWidth('2lpx')
@@ -114,6 +133,9 @@ export struct FollowChildComponent{ @@ -114,6 +133,9 @@ export struct FollowChildComponent{
114 .height('46lpx') 133 .height('46lpx')
115 .margin({top:'29lpx'}) 134 .margin({top:'29lpx'})
116 .onClick(()=>{ 135 .onClick(()=>{
  136 + if (this.isLoadingAttention) return
  137 + this.isLoadingAttention = true
  138 +
117 this.followOperation() 139 this.followOperation()
118 }) 140 })
119 } 141 }
@@ -199,11 +221,18 @@ export struct FollowChildComponent{ @@ -199,11 +221,18 @@ export struct FollowChildComponent{
199 }else { 221 }else {
200 if(this.data.status == "1"){ 222 if(this.data.status == "1"){
201 Row(){ 223 Row(){
202 - Text(`已关注`)  
203 - .fontColor($r('app.color.color_CCCCCC'))  
204 - .fontSize('23lpx')  
205 - .fontWeight('500lpx')  
206 - .lineHeight('35lpx') 224 + if(this.isLoadingAttention) {
  225 + LoadingProgress()
  226 + .width(20)
  227 + .height(20)
  228 + .color( $r('app.color.color_CCCCCC'))
  229 + }else {
  230 + Text(`已关注`)
  231 + .fontColor($r('app.color.color_CCCCCC'))
  232 + .fontSize('23lpx')
  233 + .fontWeight('500lpx')
  234 + .lineHeight('35lpx')
  235 + }
207 } 236 }
208 .backgroundColor($r("app.color.color_F5F5F5")) 237 .backgroundColor($r("app.color.color_F5F5F5"))
209 .justifyContent(FlexAlign.Center) 238 .justifyContent(FlexAlign.Center)
@@ -211,19 +240,29 @@ export struct FollowChildComponent{ @@ -211,19 +240,29 @@ export struct FollowChildComponent{
211 .width('100lpx') 240 .width('100lpx')
212 .height('46lpx') 241 .height('46lpx')
213 .onClick(()=>{ 242 .onClick(()=>{
  243 + if (this.isLoadingAttention) return
  244 + this.isLoadingAttention = true
  245 +
214 this.followOperation() 246 this.followOperation()
215 }) 247 })
216 }else{ 248 }else{
217 Row(){ 249 Row(){
218 - Image($r('app.media.follow_icon'))  
219 - .margin({right:'4lpx'})  
220 - .width('23lpx')  
221 - .height('23lpx')  
222 - Text(`关注`)  
223 - .fontColor($r('app.color.color_ED2800'))  
224 - .fontSize('23lpx')  
225 - .fontWeight('500lpx')  
226 - .lineHeight('35lpx') 250 + if(this.isLoadingAttention) {
  251 + LoadingProgress()
  252 + .width(20)
  253 + .height(20)
  254 + .color($r('app.color.main_red'))
  255 + }else {
  256 + Image($r('app.media.follow_icon'))
  257 + .margin({right:'4lpx'})
  258 + .width('23lpx')
  259 + .height('23lpx')
  260 + Text(`关注`)
  261 + .fontColor($r('app.color.color_ED2800'))
  262 + .fontSize('23lpx')
  263 + .fontWeight('500lpx')
  264 + .lineHeight('35lpx')
  265 + }
227 }.borderColor($r('app.color.color_1AED2800')) 266 }.borderColor($r('app.color.color_1AED2800'))
228 .borderRadius('6lpx') 267 .borderRadius('6lpx')
229 .borderWidth('2lpx') 268 .borderWidth('2lpx')
@@ -231,6 +270,9 @@ export struct FollowChildComponent{ @@ -231,6 +270,9 @@ export struct FollowChildComponent{
231 .width('100lpx') 270 .width('100lpx')
232 .height('46lpx') 271 .height('46lpx')
233 .onClick(()=>{ 272 .onClick(()=>{
  273 + if (this.isLoadingAttention) return
  274 + this.isLoadingAttention = true
  275 +
234 this.followOperation() 276 this.followOperation()
235 }) 277 })
236 } 278 }
@@ -265,6 +307,8 @@ export struct FollowChildComponent{ @@ -265,6 +307,8 @@ export struct FollowChildComponent{
265 if(isLogin){ 307 if(isLogin){
266 let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,HttpUtils.getUserType(),HttpUtils.getUserId(),this.data.status==="0" ? 1:0) 308 let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,HttpUtils.getUserType(),HttpUtils.getUserId(),this.data.status==="0" ? 1:0)
267 MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{ 309 MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{
  310 + this.isLoadingAttention = false
  311 +
268 if(value!=null){ 312 if(value!=null){
269 if (value.code === 0 || value.code.toString() === "0") { 313 if (value.code === 0 || value.code.toString() === "0") {
270 this.data.status = this.data.status ==="0"?"1":"0" 314 this.data.status = this.data.status ==="0"?"1":"0"
@@ -280,6 +324,7 @@ export struct FollowChildComponent{ @@ -280,6 +324,7 @@ export struct FollowChildComponent{
280 } 324 }
281 }) 325 })
282 }else{ 326 }else{
  327 + this.isLoadingAttention = false
283 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 328 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
284 } 329 }
285 } 330 }
@@ -17,7 +17,7 @@ struct LaunchAdvertisingPage { @@ -17,7 +17,7 @@ struct LaunchAdvertisingPage {
17 pageParam: ParamType = {} 17 pageParam: ParamType = {}
18 18
19 @State defaultModel:defaultLaunchModel = new defaultLaunchModel() 19 @State defaultModel:defaultLaunchModel = new defaultLaunchModel()
20 - 20 + @State dataModel : LaunchDataModel = {} as LaunchDataModel
21 private controller:VideoController | undefined; 21 private controller:VideoController | undefined;
22 22
23 enter() { 23 enter() {
@@ -27,31 +27,36 @@ struct LaunchAdvertisingPage { @@ -27,31 +27,36 @@ struct LaunchAdvertisingPage {
27 27
28 aboutToAppear(): void { 28 aboutToAppear(): void {
29 let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string 29 let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string
30 - let dataModel : LaunchDataModel = JSON.parse(dataModelStr) 30 + this.dataModel = JSON.parse(dataModelStr)
31 console.log(dataModelStr) 31 console.log(dataModelStr)
32 32
33 - this.rebaseDefaultModel(dataModel)  
34 - 33 + this.rebaseDefaultModel(this.dataModel)
35 34
36 - if(this.defaultModel){  
37 - //设置倒计时时间  
38 - this.time = this.defaultModel.durations  
39 - } 35 + if (this.dataModel.launchPageInfo || this.dataModel.launchAdInfo.length) {
  36 + if(this.defaultModel){
  37 + //设置倒计时时间
  38 + this.time = this.defaultModel.durations
  39 + }
40 40
41 - this.contentTrackingDict() 41 + this.contentTrackingDict()
42 42
43 - this.trackingLaunchShow() 43 + this.trackingLaunchShow()
  44 + } else {
  45 + this.enter()
  46 + }
44 } 47 }
45 48
46 49
47 onPageShow(){ 50 onPageShow(){
48 - this.timer = setInterval(() => {  
49 - this.time--  
50 - if (this.time < 1) {  
51 - this.enter()  
52 - clearInterval(this.timer)  
53 - }  
54 - },1000) 51 + if (this.dataModel.launchPageInfo || this.dataModel.launchAdInfo.length) {
  52 + this.timer = setInterval(() => {
  53 + this.time--
  54 + if (this.time < 1) {
  55 + this.enter()
  56 + clearInterval(this.timer)
  57 + }
  58 + },1000)
  59 + }
55 } 60 }
56 61
57 build(){ 62 build(){
@@ -63,18 +68,18 @@ struct LaunchAdvertisingPage { @@ -63,18 +68,18 @@ struct LaunchAdvertisingPage {
63 //显示视频播放 68 //显示视频播放
64 Video({ 69 Video({
65 src: this.defaultModel.bootVideoUrl, 70 src: this.defaultModel.bootVideoUrl,
66 - // previewUri: this.defaultModel.bootVideoScreenUrl, 71 + previewUri: this.defaultModel.bootVideoScreenUrl,
67 controller: this.controller 72 controller: this.controller
68 }).controls(false) 73 }).controls(false)
69 .autoPlay(true) 74 .autoPlay(true)
70 - // .objectFit(ImageFit.Fill) //设置视频适配模式 75 + // .objectFit(ImageFit.Fill) //设置视频适配模式
71 .width('100%') 76 .width('100%')
72 .height('100%') 77 .height('100%')
73 }else { 78 }else {
74 //显示图片 79 //显示图片
75 Image(this.defaultModel.bootScreenUrl) 80 Image(this.defaultModel.bootScreenUrl)
76 .objectFit(ImageFit.Contain) 81 .objectFit(ImageFit.Contain)
77 - // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 82 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
78 .width('100%') 83 .width('100%')
79 .height('100%') 84 .height('100%')
80 } 85 }