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,22 +82,38 @@ export struct FollowChildComponent{ @@ -81,22 +82,38 @@ export struct FollowChildComponent{
81 82
82 if(this.data.status == "1"){ 83 if(this.data.status == "1"){
83 Row(){ 84 Row(){
  85 + if(this.isLoadingAttention) {
  86 + LoadingProgress()
  87 + .width(20)
  88 + .height(20)
  89 + .color( $r('app.color.color_CCCCCC'))
  90 + }else {
84 Text(`已关注`) 91 Text(`已关注`)
85 .fontColor($r('app.color.color_CCCCCC')) 92 .fontColor($r('app.color.color_CCCCCC'))
86 .fontSize('23lpx') 93 .fontSize('23lpx')
87 .fontWeight('500lpx') 94 .fontWeight('500lpx')
88 .lineHeight('35lpx') 95 .lineHeight('35lpx')
89 } 96 }
  97 + }
90 .justifyContent(FlexAlign.Center) 98 .justifyContent(FlexAlign.Center)
91 .width('100lpx') 99 .width('100lpx')
92 .backgroundColor($r("app.color.color_F5F5F5")) 100 .backgroundColor($r("app.color.color_F5F5F5"))
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(){
  111 + if(this.isLoadingAttention) {
  112 + LoadingProgress()
  113 + .width(20)
  114 + .height(20)
  115 + .color($r('app.color.main_red'))
  116 + }else {
100 Image($r('app.media.follow_icon')) 117 Image($r('app.media.follow_icon'))
101 .margin({right:'4lpx'}) 118 .margin({right:'4lpx'})
102 .width('23lpx') 119 .width('23lpx')
@@ -106,6 +123,8 @@ export struct FollowChildComponent{ @@ -106,6 +123,8 @@ export struct FollowChildComponent{
106 .fontSize('23lpx') 123 .fontSize('23lpx')
107 .fontWeight('500lpx') 124 .fontWeight('500lpx')
108 .lineHeight('35lpx') 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,22 +221,38 @@ export struct FollowChildComponent{ @@ -199,22 +221,38 @@ export struct FollowChildComponent{
199 }else { 221 }else {
200 if(this.data.status == "1"){ 222 if(this.data.status == "1"){
201 Row(){ 223 Row(){
  224 + if(this.isLoadingAttention) {
  225 + LoadingProgress()
  226 + .width(20)
  227 + .height(20)
  228 + .color( $r('app.color.color_CCCCCC'))
  229 + }else {
202 Text(`已关注`) 230 Text(`已关注`)
203 .fontColor($r('app.color.color_CCCCCC')) 231 .fontColor($r('app.color.color_CCCCCC'))
204 .fontSize('23lpx') 232 .fontSize('23lpx')
205 .fontWeight('500lpx') 233 .fontWeight('500lpx')
206 .lineHeight('35lpx') 234 .lineHeight('35lpx')
207 } 235 }
  236 + }
208 .backgroundColor($r("app.color.color_F5F5F5")) 237 .backgroundColor($r("app.color.color_F5F5F5"))
209 .justifyContent(FlexAlign.Center) 238 .justifyContent(FlexAlign.Center)
210 .borderRadius("6lpx") 239 .borderRadius("6lpx")
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(){
  250 + if(this.isLoadingAttention) {
  251 + LoadingProgress()
  252 + .width(20)
  253 + .height(20)
  254 + .color($r('app.color.main_red'))
  255 + }else {
218 Image($r('app.media.follow_icon')) 256 Image($r('app.media.follow_icon'))
219 .margin({right:'4lpx'}) 257 .margin({right:'4lpx'})
220 .width('23lpx') 258 .width('23lpx')
@@ -224,6 +262,7 @@ export struct FollowChildComponent{ @@ -224,6 +262,7 @@ export struct FollowChildComponent{
224 .fontSize('23lpx') 262 .fontSize('23lpx')
225 .fontWeight('500lpx') 263 .fontWeight('500lpx')
226 .lineHeight('35lpx') 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,12 +27,12 @@ struct LaunchAdvertisingPage { @@ -27,12 +27,12 @@ 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
  35 + if (this.dataModel.launchPageInfo || this.dataModel.launchAdInfo.length) {
36 if(this.defaultModel){ 36 if(this.defaultModel){
37 //设置倒计时时间 37 //设置倒计时时间
38 this.time = this.defaultModel.durations 38 this.time = this.defaultModel.durations
@@ -41,10 +41,14 @@ struct LaunchAdvertisingPage { @@ -41,10 +41,14 @@ struct LaunchAdvertisingPage {
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(){
  51 + if (this.dataModel.launchPageInfo || this.dataModel.launchAdInfo.length) {
48 this.timer = setInterval(() => { 52 this.timer = setInterval(() => {
49 this.time-- 53 this.time--
50 if (this.time < 1) { 54 if (this.time < 1) {
@@ -53,6 +57,7 @@ struct LaunchAdvertisingPage { @@ -53,6 +57,7 @@ struct LaunchAdvertisingPage {
53 } 57 }
54 },1000) 58 },1000)
55 } 59 }
  60 + }
56 61
57 build(){ 62 build(){
58 Column(){ 63 Column(){
@@ -63,7 +68,7 @@ struct LaunchAdvertisingPage { @@ -63,7 +68,7 @@ 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)