wangliang_wd

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

... ... @@ -188,7 +188,7 @@ class CommentViewModel {
bean['userName'] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string
}
HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
HttpBizUtil.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
if (data.code != 0) {
ToastUtils.showToast(data.message, 1000);
fail()
... ...
... ... @@ -97,7 +97,7 @@ export struct ZhSingleRow02 {
.margin({ right: 8 })
})
}
if (this.compDTO.operDataList.length >= 2 && this.showMore()) {
if (this.compDTO.operDataList.length > 2 && this.showMore()) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
... ...
... ... @@ -13,6 +13,7 @@ export struct FollowChildComponent{
@State type:number = 0
@State columnHeight:number = 202
@State isLoadingAttention:boolean = false
aboutToAppear(): void {
if(this.type == 0 && StringUtils.isEmpty(this.data.introduction)){
... ... @@ -81,11 +82,18 @@ export struct FollowChildComponent{
if(this.data.status == "1"){
Row(){
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
if(this.isLoadingAttention) {
LoadingProgress()
.width(20)
.height(20)
.color( $r('app.color.color_CCCCCC'))
}else {
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}
}
.justifyContent(FlexAlign.Center)
.width('100lpx')
... ... @@ -93,19 +101,30 @@ export struct FollowChildComponent{
.borderRadius("6lpx")
.height('46lpx')
.onClick(()=>{
if (this.isLoadingAttention) return
this.isLoadingAttention = true
this.followOperation()
}).margin({top:'29lpx'})
}else{
Row(){
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
if(this.isLoadingAttention) {
LoadingProgress()
.width(20)
.height(20)
.color($r('app.color.main_red'))
}else {
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}
}.borderColor($r('app.color.color_1AED2800'))
.borderRadius('6lpx')
.borderWidth('2lpx')
... ... @@ -114,6 +133,9 @@ export struct FollowChildComponent{
.height('46lpx')
.margin({top:'29lpx'})
.onClick(()=>{
if (this.isLoadingAttention) return
this.isLoadingAttention = true
this.followOperation()
})
}
... ... @@ -199,11 +221,18 @@ export struct FollowChildComponent{
}else {
if(this.data.status == "1"){
Row(){
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
if(this.isLoadingAttention) {
LoadingProgress()
.width(20)
.height(20)
.color( $r('app.color.color_CCCCCC'))
}else {
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}
}
.backgroundColor($r("app.color.color_F5F5F5"))
.justifyContent(FlexAlign.Center)
... ... @@ -211,19 +240,29 @@ export struct FollowChildComponent{
.width('100lpx')
.height('46lpx')
.onClick(()=>{
if (this.isLoadingAttention) return
this.isLoadingAttention = true
this.followOperation()
})
}else{
Row(){
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
if(this.isLoadingAttention) {
LoadingProgress()
.width(20)
.height(20)
.color($r('app.color.main_red'))
}else {
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}
}.borderColor($r('app.color.color_1AED2800'))
.borderRadius('6lpx')
.borderWidth('2lpx')
... ... @@ -231,6 +270,9 @@ export struct FollowChildComponent{
.width('100lpx')
.height('46lpx')
.onClick(()=>{
if (this.isLoadingAttention) return
this.isLoadingAttention = true
this.followOperation()
})
}
... ... @@ -265,6 +307,8 @@ export struct FollowChildComponent{
if(isLogin){
let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,HttpUtils.getUserType(),HttpUtils.getUserId(),this.data.status==="0" ? 1:0)
MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{
this.isLoadingAttention = false
if(value!=null){
if (value.code === 0 || value.code.toString() === "0") {
this.data.status = this.data.status ==="0"?"1":"0"
... ... @@ -280,6 +324,7 @@ export struct FollowChildComponent{
}
})
}else{
this.isLoadingAttention = false
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
}
}
... ...
... ... @@ -17,7 +17,7 @@ struct LaunchAdvertisingPage {
pageParam: ParamType = {}
@State defaultModel:defaultLaunchModel = new defaultLaunchModel()
@State dataModel : LaunchDataModel = {} as LaunchDataModel
private controller:VideoController | undefined;
enter() {
... ... @@ -27,31 +27,36 @@ struct LaunchAdvertisingPage {
aboutToAppear(): void {
let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string
let dataModel : LaunchDataModel = JSON.parse(dataModelStr)
this.dataModel = JSON.parse(dataModelStr)
console.log(dataModelStr)
this.rebaseDefaultModel(dataModel)
this.rebaseDefaultModel(this.dataModel)
if(this.defaultModel){
//设置倒计时时间
this.time = this.defaultModel.durations
}
if (this.dataModel.launchPageInfo || this.dataModel.launchAdInfo.length) {
if(this.defaultModel){
//设置倒计时时间
this.time = this.defaultModel.durations
}
this.contentTrackingDict()
this.contentTrackingDict()
this.trackingLaunchShow()
this.trackingLaunchShow()
} else {
this.enter()
}
}
onPageShow(){
this.timer = setInterval(() => {
this.time--
if (this.time < 1) {
this.enter()
clearInterval(this.timer)
}
},1000)
if (this.dataModel.launchPageInfo || this.dataModel.launchAdInfo.length) {
this.timer = setInterval(() => {
this.time--
if (this.time < 1) {
this.enter()
clearInterval(this.timer)
}
},1000)
}
}
build(){
... ... @@ -63,18 +68,18 @@ struct LaunchAdvertisingPage {
//显示视频播放
Video({
src: this.defaultModel.bootVideoUrl,
// previewUri: this.defaultModel.bootVideoScreenUrl,
previewUri: this.defaultModel.bootVideoScreenUrl,
controller: this.controller
}).controls(false)
.autoPlay(true)
// .objectFit(ImageFit.Fill) //设置视频适配模式
// .objectFit(ImageFit.Fill) //设置视频适配模式
.width('100%')
.height('100%')
}else {
//显示图片
Image(this.defaultModel.bootScreenUrl)
.objectFit(ImageFit.Contain)
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
.height('100%')
}
... ...