Showing
11 changed files
with
131 additions
and
51 deletions
| 1 | -import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean'; | ||
| 2 | -import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 1 | +import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean'; |
| 3 | import { StringUtils } from 'wdKit'; | 2 | import { StringUtils } from 'wdKit'; |
| 4 | -import { WDRouterRule } from 'wdRouter'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 4 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 6 | 5 | ||
| 7 | @Component | 6 | @Component |
| @@ -62,21 +61,15 @@ export struct ENewspaperItemComponent { | @@ -62,21 +61,15 @@ export struct ENewspaperItemComponent { | ||
| 62 | } | 61 | } |
| 63 | if (event.type === TouchType.Up) { | 62 | if (event.type === TouchType.Up) { |
| 64 | this.context.clearRect(0, 0, this.context.width, this.context.height) | 63 | this.context.clearRect(0, 0, this.context.width, this.context.height) |
| 65 | - if (this.itemBeanClicked && this.itemBeanClicked.newsId) { | ||
| 66 | - let taskAction: Action = { | ||
| 67 | - type: 'JUMP_INNER_NEW_PAGE', | ||
| 68 | - params: { | ||
| 69 | - contentID: '' + this.itemBeanClicked.newsId, | ||
| 70 | - pageID: 'IMAGE_TEXT_DETAIL', | ||
| 71 | - extra: { | ||
| 72 | - relType: this.itemBeanClicked.relType ?? '', | ||
| 73 | - relId: '' + this.itemBeanClicked.relId, | ||
| 74 | - sourcePage: '5' | ||
| 75 | - } as ExtraDTO | ||
| 76 | - } as Params, | ||
| 77 | - }; | ||
| 78 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 79 | - | 64 | + if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) { |
| 65 | + //公共跳转 | ||
| 66 | + let content: ContentDTO = { | ||
| 67 | + objectId:this.itemBeanClicked.newsId+'', | ||
| 68 | + objectType:this.itemBeanClicked.newsType+'', | ||
| 69 | + relId:this.itemBeanClicked.relId+'', | ||
| 70 | + relType:this.itemBeanClicked.relType ?? '0' | ||
| 71 | + } as ContentDTO | ||
| 72 | + ProcessUtils.processPage(content) | ||
| 80 | this.itemBeanClicked = {} as NewspaperPositionItemBean | 73 | this.itemBeanClicked = {} as NewspaperPositionItemBean |
| 81 | } | 74 | } |
| 82 | } | 75 | } |
| @@ -139,7 +132,6 @@ export struct ENewspaperItemComponent { | @@ -139,7 +132,6 @@ export struct ENewspaperItemComponent { | ||
| 139 | } | 132 | } |
| 140 | 133 | ||
| 141 | } | 134 | } |
| 142 | - | ||
| 143 | if (vp2px(x) > minX && vp2px(x) < maxX && vp2px(y) > minY && vp2px(y) < maxY) { | 135 | if (vp2px(x) > minX && vp2px(x) < maxX && vp2px(y) > minY && vp2px(y) < maxY) { |
| 144 | this.itemBeanClicked = itemBean; | 136 | this.itemBeanClicked = itemBean; |
| 145 | return xys; | 137 | return xys; |
| @@ -52,7 +52,7 @@ export struct Card19Component { | @@ -52,7 +52,7 @@ export struct Card19Component { | ||
| 52 | .fontColor(0xED2800) | 52 | .fontColor(0xED2800) |
| 53 | Span(this.str03) | 53 | Span(this.str03) |
| 54 | } else { | 54 | } else { |
| 55 | - Span(this.contentDTO.newsTitle) | 55 | + Span(this.contentDTO.newsTitle=='null'?"":this.contentDTO.newsTitle) |
| 56 | } | 56 | } |
| 57 | } | 57 | } |
| 58 | .fontSize($r('app.float.font_size_18')) | 58 | .fontSize($r('app.float.font_size_18')) |
| 1 | +import { TrackConstants, TrackingButton } from 'wdTracking/Index' | ||
| 1 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 2 | import { onlyWifiLoadImg } from '../../../utils/lazyloadImg' | 3 | import { onlyWifiLoadImg } from '../../../utils/lazyloadImg' |
| 3 | import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem' | 4 | import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem' |
| @@ -200,6 +201,10 @@ export struct AppointmentListChildComponent { | @@ -200,6 +201,10 @@ export struct AppointmentListChildComponent { | ||
| 200 | if (value != null) { | 201 | if (value != null) { |
| 201 | if (value.code === 0 || value.code.toString() === "0") { | 202 | if (value.code === 0 || value.code.toString() === "0") { |
| 202 | this.item.isAppointment = !this.item.isAppointment | 203 | this.item.isAppointment = !this.item.isAppointment |
| 204 | + | ||
| 205 | + if(!this.item.isAppointment){ | ||
| 206 | + TrackingButton.click("mySavedLivePageUnSubscribe",TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live) | ||
| 207 | + } | ||
| 203 | } | 208 | } |
| 204 | } | 209 | } |
| 205 | }) | 210 | }) |
| @@ -2,6 +2,7 @@ import { SpConstants } from 'wdConstant/Index' | @@ -2,6 +2,7 @@ import { SpConstants } from 'wdConstant/Index' | ||
| 2 | import { SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index' | 2 | import { SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index' |
| 3 | import { HttpUtils } from 'wdNetwork/Index' | 3 | import { HttpUtils } from 'wdNetwork/Index' |
| 4 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | 4 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' |
| 5 | +import { TrackConstants, TrackingContent } from 'wdTracking/Index' | ||
| 5 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 6 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 6 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' | 7 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' |
| 7 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem' | 8 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem' |
| @@ -266,6 +267,12 @@ export struct FollowChildComponent{ | @@ -266,6 +267,12 @@ export struct FollowChildComponent{ | ||
| 266 | this.data.status = this.data.status ==="0"?"1":"0" | 267 | this.data.status = this.data.status ==="0"?"1":"0" |
| 267 | 268 | ||
| 268 | UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status) | 269 | UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status) |
| 270 | + | ||
| 271 | + if(this.data.status == "1"){//关注 | ||
| 272 | + TrackingContent.follow(true,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow) | ||
| 273 | + }else {//取消关注 | ||
| 274 | + TrackingContent.follow(false,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow) | ||
| 275 | + } | ||
| 269 | } | 276 | } |
| 270 | } | 277 | } |
| 271 | }) | 278 | }) |
| 1 | import { EmitterUtils, EmitterEventId, Logger, NetworkUtil } from 'wdKit/Index' | 1 | import { EmitterUtils, EmitterEventId, Logger, NetworkUtil } from 'wdKit/Index' |
| 2 | +import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index' | ||
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 3 | import { FollowListItem } from '../../../viewmodel/FollowListItem' | 4 | import { FollowListItem } from '../../../viewmodel/FollowListItem' |
| 4 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 5 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| @@ -70,6 +71,7 @@ export struct FollowFirstTabsComponent{ | @@ -70,6 +71,7 @@ export struct FollowFirstTabsComponent{ | ||
| 70 | }.onClick(()=>{ | 71 | }.onClick(()=>{ |
| 71 | this.currentIndex = index | 72 | this.currentIndex = index |
| 72 | this.controller.changeIndex(this.currentIndex) | 73 | this.controller.changeIndex(this.currentIndex) |
| 74 | + trackTabFirstClick(item.directoryName) | ||
| 73 | }) | 75 | }) |
| 74 | .height('100%') | 76 | .height('100%') |
| 75 | .margin({right:'9lpx'}) | 77 | .margin({right:'9lpx'}) |
| @@ -103,6 +105,7 @@ export struct FollowFirstTabsComponent{ | @@ -103,6 +105,7 @@ export struct FollowFirstTabsComponent{ | ||
| 103 | .animationDuration(0) | 105 | .animationDuration(0) |
| 104 | .onChange((index: number) => { | 106 | .onChange((index: number) => { |
| 105 | this.currentIndex = index | 107 | this.currentIndex = index |
| 108 | + trackTabFirstClick(this.data[index].directoryName) | ||
| 106 | }) | 109 | }) |
| 107 | .width('100%') | 110 | .width('100%') |
| 108 | .layoutWeight(1) | 111 | .layoutWeight(1) |
| @@ -118,3 +121,12 @@ export struct FollowFirstTabsComponent{ | @@ -118,3 +121,12 @@ export struct FollowFirstTabsComponent{ | ||
| 118 | } | 121 | } |
| 119 | } | 122 | } |
| 120 | } | 123 | } |
| 124 | + | ||
| 125 | + function trackTabFirstClick(firstLevelTabName: string){ | ||
| 126 | + let params: ParamType = {} | ||
| 127 | + params["firstLevelTabName"] = firstLevelTabName | ||
| 128 | + params["pageName"] = TrackConstants.PageName.My_Follow | ||
| 129 | + params["pageId"] = TrackConstants.PageName.My_Follow | ||
| 130 | + | ||
| 131 | + Tracking.event("my_follow_page_tab_click", params) | ||
| 132 | + } |
| @@ -6,6 +6,7 @@ import PageAdModel from '../viewmodel/PageAdvModel'; | @@ -6,6 +6,7 @@ import PageAdModel from '../viewmodel/PageAdvModel'; | ||
| 6 | import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; | 6 | import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; |
| 7 | import { Logger } from 'wdKit/Index'; | 7 | import { Logger } from 'wdKit/Index'; |
| 8 | 8 | ||
| 9 | +const TAG = 'PullDownRefresh' | ||
| 9 | /***********新的下拉、上拉手势 start **********/ | 10 | /***********新的下拉、上拉手势 start **********/ |
| 10 | export function onActionStart(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) { | 11 | export function onActionStart(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) { |
| 11 | if (event === undefined) { | 12 | if (event === undefined) { |
| @@ -157,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod | @@ -157,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod | ||
| 157 | let advSelf: PageAdModel = pageAdvModel; | 158 | let advSelf: PageAdModel = pageAdvModel; |
| 158 | PageHelper.refreshUI(self, advSelf) | 159 | PageHelper.refreshUI(self, advSelf) |
| 159 | }, Const.DELAY_TIME); | 160 | }, Const.DELAY_TIME); |
| 161 | + setRefreshTimeoutTimer(pageModel) | ||
| 160 | } else { | 162 | } else { |
| 161 | closeRefresh(pageModel, false); | 163 | closeRefresh(pageModel, false); |
| 162 | } | 164 | } |
| 163 | } | 165 | } |
| 164 | 166 | ||
| 167 | +export function setRefreshTimeoutTimer(pageModel: PageModel) { | ||
| 168 | + let timeoutId = setTimeout(() => { | ||
| 169 | + closeRefresh(pageModel, false); | ||
| 170 | + Logger.error(TAG, 'closeRefresh by timeout') | ||
| 171 | + }, Const.REFRESH_TIMEOUT__TIME); | ||
| 172 | + // 取消超时关闭定时器 | ||
| 173 | + clearTimeout(pageModel.refreshTimeoutTimerId) | ||
| 174 | + pageModel.refreshTimeoutTimerId = timeoutId | ||
| 175 | +} | ||
| 176 | + | ||
| 165 | /** | 177 | /** |
| 166 | * 自动刷新接口,如首页底导,双击按钮自动刷新 | 178 | * 自动刷新接口,如首页底导,双击按钮自动刷新 |
| 167 | * @param pageModel 页面数据 | 179 | * @param pageModel 页面数据 |
| @@ -177,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) { | @@ -177,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) { | ||
| 177 | pullRefreshState(pageModel, RefreshState.Refreshing); | 189 | pullRefreshState(pageModel, RefreshState.Refreshing); |
| 178 | pageModel.currentPage = 1; | 190 | pageModel.currentPage = 1; |
| 179 | PageHelper.refreshUI(pageModel, pageAdvModel) | 191 | PageHelper.refreshUI(pageModel, pageAdvModel) |
| 192 | + setRefreshTimeoutTimer(pageModel) | ||
| 180 | } | 193 | } |
| 181 | 194 | ||
| 182 | export function pullRefreshState(pageModel: PageModel, state: number) { | 195 | export function pullRefreshState(pageModel: PageModel, state: number) { |
| @@ -225,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | @@ -225,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | ||
| 225 | 238 | ||
| 226 | export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) { | 239 | export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) { |
| 227 | let self = pageModel; | 240 | let self = pageModel; |
| 241 | + // 取消超时关闭定时器 | ||
| 242 | + clearTimeout(self.refreshTimeoutTimerId) | ||
| 228 | setTimeout(() => { | 243 | setTimeout(() => { |
| 229 | let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH; | 244 | let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH; |
| 230 | if (self.isCanRefresh === true) { | 245 | if (self.isCanRefresh === true) { |
| 1 | import PageModel from '../viewmodel/PageModel'; | 1 | import PageModel from '../viewmodel/PageModel'; |
| 2 | import { RefreshConstants as Const } from './RefreshConstants'; | 2 | import { RefreshConstants as Const } from './RefreshConstants'; |
| 3 | import PageHelper from '../viewmodel/PageHelper'; | 3 | import PageHelper from '../viewmodel/PageHelper'; |
| 4 | +import { Logger } from 'wdKit/Index'; | ||
| 5 | + | ||
| 6 | +const TAG = 'PullUpLoadMore' | ||
| 4 | 7 | ||
| 5 | export function touchMoveLoadMore(model: PageModel, event: TouchEvent) { | 8 | export function touchMoveLoadMore(model: PageModel, event: TouchEvent) { |
| 6 | // list size +1 | 9 | // list size +1 |
| 7 | - if (model.endIndex >= model.compList.totalCount()-3 && model.endIndex <= model.compList.totalCount()) { | 10 | + if (model.endIndex >= model.compList.totalCount() - 3 && model.endIndex <= model.compList.totalCount()) { |
| 8 | // model.offsetY = event.touches[0].y - model.downY; | 11 | // model.offsetY = event.touches[0].y - model.downY; |
| 9 | // if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) { | 12 | // if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) { |
| 10 | // model.isCanLoadMore = true; | 13 | // model.isCanLoadMore = true; |
| @@ -32,6 +35,7 @@ export function touchUpLoadMore(model: PageModel) { | @@ -32,6 +35,7 @@ export function touchUpLoadMore(model: PageModel) { | ||
| 32 | // closeLoadMore(model); | 35 | // closeLoadMore(model); |
| 33 | PageHelper.loadMore(self) | 36 | PageHelper.loadMore(self) |
| 34 | }, Const.DELAY_TIME); | 37 | }, Const.DELAY_TIME); |
| 38 | + setLoadMoreTimeoutTimer(self) | ||
| 35 | } else { | 39 | } else { |
| 36 | closeLoadMore(self); | 40 | closeLoadMore(self); |
| 37 | } | 41 | } |
| @@ -42,3 +46,13 @@ export function closeLoadMore(model: PageModel) { | @@ -42,3 +46,13 @@ export function closeLoadMore(model: PageModel) { | ||
| 42 | model.isLoading = false; | 46 | model.isLoading = false; |
| 43 | model.isVisiblePullUpLoad = false; | 47 | model.isVisiblePullUpLoad = false; |
| 44 | } | 48 | } |
| 49 | + | ||
| 50 | +export function setLoadMoreTimeoutTimer(pageModel: PageModel) { | ||
| 51 | + let timeoutId = setTimeout(() => { | ||
| 52 | + closeLoadMore(pageModel); | ||
| 53 | + Logger.error(TAG, 'closeLoadMore by timeout') | ||
| 54 | + }, Const.REFRESH_TIMEOUT__TIME); | ||
| 55 | + // 取消超时关闭定时器 | ||
| 56 | + clearTimeout(pageModel.loadMoreTimeoutTimerId) | ||
| 57 | + pageModel.loadMoreTimeoutTimerId = timeoutId | ||
| 58 | +} |
| @@ -14,7 +14,7 @@ export class RefreshConstants { | @@ -14,7 +14,7 @@ export class RefreshConstants { | ||
| 14 | * The delay time. | 14 | * The delay time. |
| 15 | */ | 15 | */ |
| 16 | static readonly DELAY_TIME: number = 50; | 16 | static readonly DELAY_TIME: number = 50; |
| 17 | - | 17 | + static readonly REFRESH_TIMEOUT__TIME: number = 10000; |
| 18 | /** | 18 | /** |
| 19 | * The animation duration. | 19 | * The animation duration. |
| 20 | */ | 20 | */ |
| @@ -25,12 +25,10 @@ export class RefreshConstants { | @@ -25,12 +25,10 @@ export class RefreshConstants { | ||
| 25 | static readonly RefreshConstant_DELAY_PULL_DOWN_REFRESH: number = 50; | 25 | static readonly RefreshConstant_DELAY_PULL_DOWN_REFRESH: number = 50; |
| 26 | static readonly RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME: number = 150; | 26 | static readonly RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME: number = 150; |
| 27 | static readonly RefreshConstant_DELAY_SHRINK_ANIMATION_TIME: number = 1500; | 27 | static readonly RefreshConstant_DELAY_SHRINK_ANIMATION_TIME: number = 1500; |
| 28 | - | ||
| 29 | /** | 28 | /** |
| 30 | * The page size. | 29 | * The page size. |
| 31 | */ | 30 | */ |
| 32 | static readonly PAGE_SIZE: number = 20; | 31 | static readonly PAGE_SIZE: number = 20; |
| 33 | - | ||
| 34 | /** | 32 | /** |
| 35 | * The refresh and load height. | 33 | * The refresh and load height. |
| 36 | */ | 34 | */ |
| @@ -59,6 +57,7 @@ export class RefreshConstants { | @@ -59,6 +57,7 @@ export class RefreshConstants { | ||
| 59 | static readonly RefreshLayout_IMAGE_WIDTH: number = 18; | 57 | static readonly RefreshLayout_IMAGE_WIDTH: number = 18; |
| 60 | static readonly RefreshLayout_IMAGE_HEIGHT: number = 18; | 58 | static readonly RefreshLayout_IMAGE_HEIGHT: number = 18; |
| 61 | } | 59 | } |
| 60 | + | ||
| 62 | /** | 61 | /** |
| 63 | * The refresh state enum. | 62 | * The refresh state enum. |
| 64 | */ | 63 | */ |
| @@ -49,6 +49,9 @@ export class PageHelper { | @@ -49,6 +49,9 @@ export class PageHelper { | ||
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) { | 51 | private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) { |
| 52 | + if (pageModel.loadStrategy != 2) { | ||
| 53 | + return | ||
| 54 | + } | ||
| 52 | closeRefresh(pageModel, isRefreshSuccess) | 55 | closeRefresh(pageModel, isRefreshSuccess) |
| 53 | } | 56 | } |
| 54 | 57 | ||
| @@ -119,6 +122,7 @@ export class PageHelper { | @@ -119,6 +122,7 @@ export class PageHelper { | ||
| 119 | } | 122 | } |
| 120 | }).catch((err: string | Resource) => { | 123 | }).catch((err: string | Resource) => { |
| 121 | promptAction.showToast({ message: err }); | 124 | promptAction.showToast({ message: err }); |
| 125 | + this.refreshUIEnd(pageModel, false) | ||
| 122 | }) | 126 | }) |
| 123 | } else { | 127 | } else { |
| 124 | Logger.debug(TAG, 'getPageInfo') | 128 | Logger.debug(TAG, 'getPageInfo') |
| @@ -127,6 +131,7 @@ export class PageHelper { | @@ -127,6 +131,7 @@ export class PageHelper { | ||
| 127 | if (pageInfo == null) { | 131 | if (pageInfo == null) { |
| 128 | pageModel.viewType = ViewType.EMPTY; | 132 | pageModel.viewType = ViewType.EMPTY; |
| 129 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; | 133 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 134 | + this.refreshUIEnd(pageModel, false) | ||
| 130 | return; | 135 | return; |
| 131 | } | 136 | } |
| 132 | pageModel.pageInfo = pageInfo; | 137 | pageModel.pageInfo = pageInfo; |
| @@ -146,6 +151,7 @@ export class PageHelper { | @@ -146,6 +151,7 @@ export class PageHelper { | ||
| 146 | Logger.debug(TAG, 'getPageInfo go on') | 151 | Logger.debug(TAG, 'getPageInfo go on') |
| 147 | this.parseGroup(pageModel, false) | 152 | this.parseGroup(pageModel, false) |
| 148 | }).catch(() => { | 153 | }).catch(() => { |
| 154 | + this.refreshUIEnd(pageModel, false) | ||
| 149 | if (this.isPageLoaded(pageModel)) { | 155 | if (this.isPageLoaded(pageModel)) { |
| 150 | return | 156 | return |
| 151 | } | 157 | } |
| @@ -406,7 +412,7 @@ export class PageHelper { | @@ -406,7 +412,7 @@ export class PageHelper { | ||
| 406 | /** | 412 | /** |
| 407 | * 竖直方向list,将数据拆出来,组装成comp | 413 | * 竖直方向list,将数据拆出来,组装成comp |
| 408 | */ | 414 | */ |
| 409 | - private createSpecialComp(compList: CompDTO[]): CompDTO[]{ | 415 | + private createSpecialComp(compList: CompDTO[]): CompDTO[] { |
| 410 | if (!compList) { | 416 | if (!compList) { |
| 411 | return compList | 417 | return compList |
| 412 | } | 418 | } |
| @@ -28,13 +28,28 @@ export default class PageModel { | @@ -28,13 +28,28 @@ export default class PageModel { | ||
| 28 | loadStrategy: number = 1; | 28 | loadStrategy: number = 1; |
| 29 | currentPage: number = 1; | 29 | currentPage: number = 1; |
| 30 | pageSize: number = Const.PAGE_SIZE; | 30 | pageSize: number = Const.PAGE_SIZE; |
| 31 | + /** | ||
| 32 | + * @deprecated | ||
| 33 | + */ | ||
| 31 | pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text'); | 34 | pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text'); |
| 35 | + /** | ||
| 36 | + * @deprecated | ||
| 37 | + */ | ||
| 32 | pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh'); | 38 | pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh'); |
| 33 | pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; | 39 | pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; |
| 34 | isVisiblePullDown: boolean = false; | 40 | isVisiblePullDown: boolean = false; |
| 35 | load: LoadStatus = LoadStatus.IDLE; | 41 | load: LoadStatus = LoadStatus.IDLE; |
| 42 | + /** | ||
| 43 | + * @deprecated | ||
| 44 | + */ | ||
| 36 | pullUpLoadText: Resource = $r('app.string.pull_up_load_text'); | 45 | pullUpLoadText: Resource = $r('app.string.pull_up_load_text'); |
| 46 | + /** | ||
| 47 | + * @deprecated | ||
| 48 | + */ | ||
| 37 | pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load'); | 49 | pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load'); |
| 50 | + /** | ||
| 51 | + * @deprecated | ||
| 52 | + */ | ||
| 38 | pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; | 53 | pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; |
| 39 | isVisiblePullUpLoad: boolean = false; | 54 | isVisiblePullUpLoad: boolean = false; |
| 40 | offsetY: number = 0; | 55 | offsetY: number = 0; |
| @@ -50,6 +65,8 @@ export default class PageModel { | @@ -50,6 +65,8 @@ export default class PageModel { | ||
| 50 | isPullRefreshOperation = false; | 65 | isPullRefreshOperation = false; |
| 51 | isLoading: boolean = false; | 66 | isLoading: boolean = false; |
| 52 | isCanLoadMore: boolean = false; | 67 | isCanLoadMore: boolean = false; |
| 68 | + refreshTimeoutTimerId: number = 0; | ||
| 69 | + loadMoreTimeoutTimerId: number = 0; | ||
| 53 | // keyGenerator相关字符串,用于刷新list布局 | 70 | // keyGenerator相关字符串,用于刷新list布局 |
| 54 | timestamp: String = '1'; | 71 | timestamp: String = '1'; |
| 55 | 72 |
| @@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String | @@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String | ||
| 2 | import router from '@ohos.router' | 2 | import router from '@ohos.router' |
| 3 | import { LoginViewModel } from './LoginViewModel' | 3 | import { LoginViewModel } from './LoginViewModel' |
| 4 | import { LoginInputComponent } from './LoginInputComponent' | 4 | import { LoginInputComponent } from './LoginInputComponent' |
| 5 | -import { ErrorToastUtils, SPHelper } from 'wdKit' | ||
| 6 | import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; | 5 | import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; |
| 7 | import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; | 6 | import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; |
| 8 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params' | 7 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params' |
| 9 | import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' | 8 | import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' |
| 10 | -import HuaweiAuth from '../../utils/HuaweiAuth' | ||
| 11 | -import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent' | ||
| 12 | -import { BusinessError } from '@ohos.base' | ||
| 13 | -import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index' | 9 | +import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index' |
| 14 | 10 | ||
| 15 | @Extend(Row) | 11 | @Extend(Row) |
| 16 | function otherStyle() { | 12 | function otherStyle() { |
| @@ -43,7 +39,6 @@ struct LoginPage { | @@ -43,7 +39,6 @@ struct LoginPage { | ||
| 43 | @State isSubmit: boolean = false | 39 | @State isSubmit: boolean = false |
| 44 | @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录 | 40 | @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录 |
| 45 | @State passwordSwitch: boolean = true //密码显示 | 41 | @State passwordSwitch: boolean = true //密码显示 |
| 46 | - // @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录 | ||
| 47 | lastTime: number = 0 | 42 | lastTime: number = 0 |
| 48 | @State codeStateSuccess:boolean=false | 43 | @State codeStateSuccess:boolean=false |
| 49 | @State toastText:string = "" | 44 | @State toastText:string = "" |
| @@ -64,6 +59,7 @@ struct LoginPage { | @@ -64,6 +59,7 @@ struct LoginPage { | ||
| 64 | onCodeSend() { | 59 | onCodeSend() { |
| 65 | Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "") | 60 | Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "") |
| 66 | if (this.isCodeSend) { | 61 | if (this.isCodeSend) { |
| 62 | + TrackingButton.click("loginPageGetVerificationCode",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 67 | this.sendVerifyCode() | 63 | this.sendVerifyCode() |
| 68 | } | 64 | } |
| 69 | } | 65 | } |
| @@ -81,8 +77,13 @@ struct LoginPage { | @@ -81,8 +77,13 @@ struct LoginPage { | ||
| 81 | this.pageHideTime = DateTimeUtils.getTimeStamp() | 77 | this.pageHideTime = DateTimeUtils.getTimeStamp() |
| 82 | let duration = 0 | 78 | let duration = 0 |
| 83 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | 79 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) |
| 80 | + | ||
| 81 | + if(this.checkCodePage){ | ||
| 82 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page,duration) | ||
| 83 | + }else{ | ||
| 84 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) | 84 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) |
| 85 | } | 85 | } |
| 86 | + } | ||
| 86 | 87 | ||
| 87 | build() { | 88 | build() { |
| 88 | Stack() { | 89 | Stack() { |
| @@ -122,11 +123,21 @@ struct LoginPage { | @@ -122,11 +123,21 @@ struct LoginPage { | ||
| 122 | Text() { | 123 | Text() { |
| 123 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) | 124 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) |
| 124 | Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => { | 125 | Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 126 | + if(this.checkCodePage){ | ||
| 127 | + TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 128 | + }else{ | ||
| 129 | + TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) | ||
| 130 | + } | ||
| 125 | let bean = { contentID: "1", pageID: "" } as Params | 131 | let bean = { contentID: "1", pageID: "" } as Params |
| 126 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 132 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 127 | }) | 133 | }) |
| 128 | Span("及").fontColor("#999999").fontSize(12) | 134 | Span("及").fontColor("#999999").fontSize(12) |
| 129 | Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => { | 135 | Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 136 | + if(this.checkCodePage){ | ||
| 137 | + TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 138 | + }else{ | ||
| 139 | + TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) | ||
| 140 | + } | ||
| 130 | let bean = { contentID: "2", pageID: "" } as Params | 141 | let bean = { contentID: "2", pageID: "" } as Params |
| 131 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 142 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 132 | }) | 143 | }) |
| @@ -162,7 +173,7 @@ struct LoginPage { | @@ -162,7 +173,7 @@ struct LoginPage { | ||
| 162 | if (!this.checkCodePage) { | 173 | if (!this.checkCodePage) { |
| 163 | Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 }) | 174 | Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 }) |
| 164 | .onClick(() => { | 175 | .onClick(() => { |
| 165 | - // router.pushUrl({ url: 'pages/login/ForgetPasswordPage' }) | 176 | + TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) |
| 166 | if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){ | 177 | if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){ |
| 167 | let pageType = { 'pageType': 0, 'phone': Number(this.accountContent) } as Record<string, number>; | 178 | let pageType = { 'pageType': 0, 'phone': Number(this.accountContent) } as Record<string, number>; |
| 168 | WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) | 179 | WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) |
| @@ -289,24 +300,6 @@ struct LoginPage { | @@ -289,24 +300,6 @@ struct LoginPage { | ||
| 289 | }.width('100%') | 300 | }.width('100%') |
| 290 | 301 | ||
| 291 | Row() { | 302 | Row() { |
| 292 | - /*Row() { | ||
| 293 | - Image($r('app.media.login_wx')) | ||
| 294 | - .width(20).height(20).onClick(()=>{ | ||
| 295 | - ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK) | ||
| 296 | - }) | ||
| 297 | - }.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat) | ||
| 298 | - .otherStyle() | ||
| 299 | - | ||
| 300 | - Row() { | ||
| 301 | - Image($r('app.media.login_qq')).size({ width: 20, height: 20 }) | ||
| 302 | - }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat) | ||
| 303 | - .otherStyle() | ||
| 304 | - | ||
| 305 | - Row() { | ||
| 306 | - Image($r('app.media.login_wb')).size({ width: 20, height: 20 }) | ||
| 307 | - }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat) | ||
| 308 | - .otherStyle()*/ | ||
| 309 | - | ||
| 310 | Row() { | 303 | Row() { |
| 311 | Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) | 304 | Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) |
| 312 | .size({ width: "35lpx", height: "35lpx" }) | 305 | .size({ width: "35lpx", height: "35lpx" }) |
| @@ -320,10 +313,19 @@ struct LoginPage { | @@ -320,10 +313,19 @@ struct LoginPage { | ||
| 320 | .lineHeight("38lpx") | 313 | .lineHeight("38lpx") |
| 321 | } | 314 | } |
| 322 | .onClick(() => { | 315 | .onClick(() => { |
| 316 | + this.onPageHide() | ||
| 317 | + | ||
| 318 | + if(this.checkCodePage){ | ||
| 319 | + trackTypeClick(0,TrackConstants.PageName.Phone_Login_Page) | ||
| 320 | + }else{ | ||
| 321 | + trackTypeClick(6,TrackConstants.PageName.Login_Page) | ||
| 322 | + } | ||
| 323 | + | ||
| 323 | this.updateAccount() | 324 | this.updateAccount() |
| 324 | - this.checkCodePage = !this.checkCodePage; | 325 | + this.checkCodePage = !this.checkCodePage |
| 325 | this.passwordSwitch = true | 326 | this.passwordSwitch = true |
| 326 | this.isSubmit = false | 327 | this.isSubmit = false |
| 328 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 327 | }).width('100%') | 329 | }).width('100%') |
| 328 | .alignItems(VerticalAlign.Center) | 330 | .alignItems(VerticalAlign.Center) |
| 329 | .justifyContent(FlexAlign.Center) | 331 | .justifyContent(FlexAlign.Center) |
| @@ -374,6 +376,7 @@ struct LoginPage { | @@ -374,6 +376,7 @@ struct LoginPage { | ||
| 374 | requestLogin() { | 376 | requestLogin() { |
| 375 | Logger.debug('LoginViewModel', "requestLogin") | 377 | Logger.debug('LoginViewModel', "requestLogin") |
| 376 | if (this.checkCodePage) { | 378 | if (this.checkCodePage) { |
| 379 | + TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 377 | this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => { | 380 | this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => { |
| 378 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) | 381 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) |
| 379 | ///同步兴趣tag | 382 | ///同步兴趣tag |
| @@ -385,6 +388,7 @@ struct LoginPage { | @@ -385,6 +388,7 @@ struct LoginPage { | ||
| 385 | this.showToastTip(error) | 388 | this.showToastTip(error) |
| 386 | }) | 389 | }) |
| 387 | } else { | 390 | } else { |
| 391 | + TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) | ||
| 388 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { | 392 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { |
| 389 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) | 393 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) |
| 390 | this.showToastTip('登录成功') | 394 | this.showToastTip('登录成功') |
| @@ -588,3 +592,12 @@ struct ProtocolComponent { | @@ -588,3 +592,12 @@ struct ProtocolComponent { | ||
| 588 | 592 | ||
| 589 | } | 593 | } |
| 590 | } | 594 | } |
| 595 | + | ||
| 596 | +function trackTypeClick(typeValue: number,pageId: string){ | ||
| 597 | + let params: ParamType = {} | ||
| 598 | + params["loginType"] = typeValue | ||
| 599 | + params["pageName"] = pageId | ||
| 600 | + params["pageId"] = pageId | ||
| 601 | + | ||
| 602 | + Tracking.event("login_type_click", params) | ||
| 603 | +} |
-
Please register or login to post a comment