Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
52 changed files
with
4494 additions
and
118 deletions
Too many changes to show.
To preserve performance only 52 of 52+ files are displayed.
| 1 | + | ||
| 2 | +import { FollowFirstTabsComponent } from 'wdComponent' | ||
| 3 | + | ||
| 4 | +@Entry | ||
| 5 | +@Component | ||
| 6 | +struct FollowListPage { | ||
| 7 | + | ||
| 8 | + build() { | ||
| 9 | + Column() { | ||
| 10 | + //Tab 详情 | ||
| 11 | + FollowFirstTabsComponent() | ||
| 12 | + } | ||
| 13 | + .backgroundColor($r('app.color.color_F9F9F9')) | ||
| 14 | + .height('100%') | ||
| 15 | + .width('100%') | ||
| 16 | + } | ||
| 17 | +} |
| 1 | +import ArrayList from '@ohos.util.ArrayList' | ||
| 2 | +import { MineSettingComponent } from 'wdComponent'; | ||
| 3 | +import { AccountAndSecurityLayout } from 'wdComponent'; | ||
| 4 | +import router from '@ohos.router'; | ||
| 5 | + | ||
| 6 | +@Entry | ||
| 7 | +@Component | ||
| 8 | +struct SettingPage { | ||
| 9 | + @State message: string = 'Hello World 02' | ||
| 10 | + @State pageType: string = ''; | ||
| 11 | + @State params:any = router.getParams(); | ||
| 12 | + | ||
| 13 | + onPageShow() { | ||
| 14 | + | ||
| 15 | + this.pageType = this.params.pageType; | ||
| 16 | + | ||
| 17 | + // this.pageType = 'mainSetting';// 获取info属性的值 | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + build() { | ||
| 21 | + Column() { | ||
| 22 | + if (this.pageType == 'mainSetting') { | ||
| 23 | + MineSettingComponent() | ||
| 24 | + } else { | ||
| 25 | + AccountAndSecurityLayout() | ||
| 26 | + } | ||
| 27 | + }.setFullWidth() | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + // 私有方法 | ||
| 31 | + @Styles setFullWidth(){ | ||
| 32 | + .width('100%') | ||
| 33 | + } | ||
| 34 | +} | ||
| 35 | +/* | ||
| 36 | + | ||
| 37 | +* */ |
| 1 | +import { SettingPasswordLayout } from 'wdComponent'; | ||
| 2 | + | ||
| 3 | +@Entry | ||
| 4 | +@Component | ||
| 5 | +struct SettingPasswordPage { | ||
| 6 | + @State message: string = 'Hello World' | ||
| 7 | + | ||
| 8 | + build() { | ||
| 9 | + Row() { | ||
| 10 | + Column() { | ||
| 11 | + SettingPasswordLayout() | ||
| 12 | + } | ||
| 13 | + .width('100%') | ||
| 14 | + } | ||
| 15 | + .height('100%') | ||
| 16 | + } | ||
| 17 | +} |
| @@ -32,6 +32,58 @@ | @@ -32,6 +32,58 @@ | ||
| 32 | } | 32 | } |
| 33 | ] | 33 | ] |
| 34 | } | 34 | } |
| 35 | + ], | ||
| 36 | + "requestPermissions": [ | ||
| 37 | + { | ||
| 38 | + "name": "ohos.permission.CAMERA", | ||
| 39 | + "reason": "$string:EntryAbility_desc", | ||
| 40 | + "usedScene": { | ||
| 41 | + "abilities": [ | ||
| 42 | + "FormAbility" | ||
| 43 | + ], | ||
| 44 | + "when": "inuse" | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + "name": "ohos.permission.READ_MEDIA", | ||
| 49 | + "reason": "$string:EntryAbility_desc", | ||
| 50 | + "usedScene": { | ||
| 51 | + "abilities": [ | ||
| 52 | + "FormAbility" | ||
| 53 | + ], | ||
| 54 | + "when": "inuse" | ||
| 55 | + } | ||
| 56 | + }, | ||
| 57 | + { | ||
| 58 | + "name": "ohos.permission.WRITE_MEDIA", | ||
| 59 | + "reason": "$string:EntryAbility_desc", | ||
| 60 | + "usedScene": { | ||
| 61 | + "abilities": [ | ||
| 62 | + "FormAbility" | ||
| 63 | + ], | ||
| 64 | + "when": "inuse" | ||
| 65 | + } | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + "name": "ohos.permission.LOCATION", | ||
| 69 | + "reason": "$string:EntryAbility_desc", | ||
| 70 | + "usedScene": { | ||
| 71 | + "abilities": [ | ||
| 72 | + "FormAbility" | ||
| 73 | + ], | ||
| 74 | + "when": "inuse" | ||
| 75 | + } | ||
| 76 | + }, | ||
| 77 | + { | ||
| 78 | + "name": "ohos.permission.MICROPHONE", | ||
| 79 | + "reason": "$string:EntryAbility_desc", | ||
| 80 | + "usedScene": { | ||
| 81 | + "abilities": [ | ||
| 82 | + "FormAbility" | ||
| 83 | + ], | ||
| 84 | + "when": "inuse" | ||
| 85 | + } | ||
| 86 | + } | ||
| 35 | ] | 87 | ] |
| 36 | } | 88 | } |
| 37 | } | 89 | } |
| @@ -2,6 +2,13 @@ | @@ -2,6 +2,13 @@ | ||
| 2 | "src": [ | 2 | "src": [ |
| 3 | "pages/Index", | 3 | "pages/Index", |
| 4 | "pages/MainPage", | 4 | "pages/MainPage", |
| 5 | - "pages/ColumnPage" | 5 | + "pages/ColumnPage", |
| 6 | + "pages/TestPage", | ||
| 7 | + "components/page/SettingPage", | ||
| 8 | + "components/page/PrivacySettingPage", | ||
| 9 | + "components/page/SettingAboutPage", | ||
| 10 | + "pages/AppointmentListPage", | ||
| 11 | + "components/page/SettingPasswordPage", | ||
| 12 | + "pages/FollowListPage" | ||
| 6 | ] | 13 | ] |
| 7 | -} | ||
| 14 | +} |
| 1 | +{ | ||
| 2 | + "code": "0", | ||
| 3 | + "data": { | ||
| 4 | + "list": [{ | ||
| 5 | + "appStyle": "15", | ||
| 6 | + "imageUrl": ["https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20231204/image/live/563cc8ce1ecc43b288f6cf60da66579c.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"], | ||
| 7 | + "liveId": 20000007348, | ||
| 8 | + "planStartTime": "2023-12-05 15:26:10", | ||
| 9 | + "relId": "500000017021", | ||
| 10 | + "relType": 1, | ||
| 11 | + "startTime": "", | ||
| 12 | + "status": "wait", | ||
| 13 | + "title": "视界运营位加权-加权中删除" | ||
| 14 | + }, { | ||
| 15 | + "appStyle": "null", | ||
| 16 | + "imageUrl": ["https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20230914/image/display/9af825a00abf490d8a8698f4fc079447.jpg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"], | ||
| 17 | + "liveId": 20000007492, | ||
| 18 | + "planStartTime": "2024-01-12 20:00:00", | ||
| 19 | + "relId": "500000020284", | ||
| 20 | + "relType": 1, | ||
| 21 | + "startTime": "", | ||
| 22 | + "status": "wait", | ||
| 23 | + "title": "QA|汉阴县凤堰古梯田" | ||
| 24 | + }, { | ||
| 25 | + "appStyle": "null", | ||
| 26 | + "imageUrl": ["https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20230915/image/display/e908748c62a44109bbb7214f3fed458c.jpg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"], | ||
| 27 | + "liveId": 20000007493, | ||
| 28 | + "planStartTime": "2024-01-12 20:00:00", | ||
| 29 | + "relId": "500000020286", | ||
| 30 | + "relType": 1, | ||
| 31 | + "startTime": "", | ||
| 32 | + "status": "wait", | ||
| 33 | + "title": "二十四节气-夏至" | ||
| 34 | + }, { | ||
| 35 | + "appStyle": "null", | ||
| 36 | + "imageUrl": ["https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20240118/image/display/732d6166103d4d2f9fbf512b128a3486.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"], | ||
| 37 | + "liveId": 20000007495, | ||
| 38 | + "planStartTime": "2024-01-18 10:51:33", | ||
| 39 | + "relId": "500000030122", | ||
| 40 | + "relType": 1, | ||
| 41 | + "startTime": "", | ||
| 42 | + "status": "wait", | ||
| 43 | + "title": "01181050文字直播没有预告片" | ||
| 44 | + }, { | ||
| 45 | + "appStyle": "null", | ||
| 46 | + "imageUrl": ["https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20240127/image/live/6359d000bba24812b7ca1765bb106a49.png?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"], | ||
| 47 | + "liveId": 20000007519, | ||
| 48 | + "planStartTime": "2024-02-27 18:18:16", | ||
| 49 | + "relId": "500000034054", | ||
| 50 | + "relType": 1, | ||
| 51 | + "startTime": "", | ||
| 52 | + "status": "wait", | ||
| 53 | + "title": "错搞民宿33" | ||
| 54 | + }, { | ||
| 55 | + "appStyle": "15", | ||
| 56 | + "imageUrl": ["https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20240228/image/live/e6998ab547af472dbc19ba2fd68959b9.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"], | ||
| 57 | + "liveId": 20000007521, | ||
| 58 | + "planStartTime": "2024-02-28 19:01:50", | ||
| 59 | + "relId": "500000034162", | ||
| 60 | + "relType": 1, | ||
| 61 | + "startTime": "", | ||
| 62 | + "status": "wait", | ||
| 63 | + "title": "保存编辑弹幕开关" | ||
| 64 | + }], | ||
| 65 | + "pageNum": 1, | ||
| 66 | + "pageSize": 20, | ||
| 67 | + "totalCount": 6 | ||
| 68 | + }, | ||
| 69 | + "message": "Success", | ||
| 70 | + "requestId": "65289f1217934cffb7587ff4d6ce4689", | ||
| 71 | + "success": true, | ||
| 72 | + "timestamp": 1710555152344 | ||
| 73 | +} |
| 1 | +{ | ||
| 2 | + "code": "0", | ||
| 3 | + "data": [ | ||
| 4 | + { | ||
| 5 | + "children": [], | ||
| 6 | + "directoryName": "阅读", | ||
| 7 | + "directoryWeight": 99, | ||
| 8 | + "id": 165, | ||
| 9 | + "isShow": 1, | ||
| 10 | + "level": 1, | ||
| 11 | + "parentId": 0, | ||
| 12 | + "rootId": 0 | ||
| 13 | + }, | ||
| 14 | + { | ||
| 15 | + "children": [ | ||
| 16 | + { | ||
| 17 | + "children": [ | ||
| 18 | + { | ||
| 19 | + "directoryName": "三二", | ||
| 20 | + "directoryWeight": 2, | ||
| 21 | + "id": 120, | ||
| 22 | + "isShow": 1, | ||
| 23 | + "level": 3, | ||
| 24 | + "parentId": 118, | ||
| 25 | + "rootId": 117 | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + "directoryName": "三级", | ||
| 29 | + "directoryWeight": 1, | ||
| 30 | + "id": 119, | ||
| 31 | + "isShow": 1, | ||
| 32 | + "level": 3, | ||
| 33 | + "parentId": 118, | ||
| 34 | + "rootId": 117 | ||
| 35 | + } | ||
| 36 | + ], | ||
| 37 | + "directoryName": "二级", | ||
| 38 | + "directoryWeight": 1, | ||
| 39 | + "id": 118, | ||
| 40 | + "isShow": 1, | ||
| 41 | + "level": 2, | ||
| 42 | + "parentId": 117, | ||
| 43 | + "rootId": 117 | ||
| 44 | + } | ||
| 45 | + ], | ||
| 46 | + "directoryName": "幽游白书", | ||
| 47 | + "directoryWeight": 33, | ||
| 48 | + "id": 117, | ||
| 49 | + "isShow": 1, | ||
| 50 | + "level": 1, | ||
| 51 | + "parentId": 0, | ||
| 52 | + "rootId": 0 | ||
| 53 | + }, | ||
| 54 | + { | ||
| 55 | + "children": [], | ||
| 56 | + "directoryName": "推荐", | ||
| 57 | + "directoryWeight": 9, | ||
| 58 | + "id": 386, | ||
| 59 | + "isShow": 1, | ||
| 60 | + "level": 1, | ||
| 61 | + "parentId": 0, | ||
| 62 | + "rootId": 0 | ||
| 63 | + }, | ||
| 64 | + { | ||
| 65 | + "children": [], | ||
| 66 | + "directoryName": "政务", | ||
| 67 | + "directoryWeight": 9, | ||
| 68 | + "id": 379, | ||
| 69 | + "isShow": 1, | ||
| 70 | + "level": 1, | ||
| 71 | + "parentId": 0, | ||
| 72 | + "rootId": 0 | ||
| 73 | + }, | ||
| 74 | + { | ||
| 75 | + "children": [ | ||
| 76 | + { | ||
| 77 | + "children": [], | ||
| 78 | + "directoryName": "推荐", | ||
| 79 | + "directoryWeight": 0, | ||
| 80 | + "id": 335, | ||
| 81 | + "isShow": 1, | ||
| 82 | + "level": 2, | ||
| 83 | + "parentId": 320, | ||
| 84 | + "rootId": 320 | ||
| 85 | + } | ||
| 86 | + ], | ||
| 87 | + "directoryName": "推荐", | ||
| 88 | + "directoryWeight": 9, | ||
| 89 | + "id": 320, | ||
| 90 | + "isShow": 1, | ||
| 91 | + "level": 1, | ||
| 92 | + "parentId": 0, | ||
| 93 | + "rootId": 0 | ||
| 94 | + }, | ||
| 95 | + { | ||
| 96 | + "children": [], | ||
| 97 | + "directoryName": "媒体", | ||
| 98 | + "directoryWeight": 8, | ||
| 99 | + "id": 390, | ||
| 100 | + "isShow": 1, | ||
| 101 | + "level": 1, | ||
| 102 | + "parentId": 0, | ||
| 103 | + "rootId": 0 | ||
| 104 | + }, | ||
| 105 | + { | ||
| 106 | + "children": [], | ||
| 107 | + "directoryName": "媒体", | ||
| 108 | + "directoryWeight": 8, | ||
| 109 | + "id": 323, | ||
| 110 | + "isShow": 1, | ||
| 111 | + "level": 1, | ||
| 112 | + "parentId": 0, | ||
| 113 | + "rootId": 0 | ||
| 114 | + }, | ||
| 115 | + { | ||
| 116 | + "children": [], | ||
| 117 | + "directoryName": "自媒体", | ||
| 118 | + "directoryWeight": 7, | ||
| 119 | + "id": 329, | ||
| 120 | + "isShow": 1, | ||
| 121 | + "level": 1, | ||
| 122 | + "parentId": 0, | ||
| 123 | + "rootId": 0 | ||
| 124 | + }, | ||
| 125 | + { | ||
| 126 | + "children": [], | ||
| 127 | + "directoryName": "名人", | ||
| 128 | + "directoryWeight": 6, | ||
| 129 | + "id": 389, | ||
| 130 | + "isShow": 1, | ||
| 131 | + "level": 1, | ||
| 132 | + "parentId": 0, | ||
| 133 | + "rootId": 0 | ||
| 134 | + }, | ||
| 135 | + { | ||
| 136 | + "children": [ | ||
| 137 | + { | ||
| 138 | + "children": [], | ||
| 139 | + "directoryName": "测试", | ||
| 140 | + "directoryWeight": 0, | ||
| 141 | + "id": 338, | ||
| 142 | + "isShow": 1, | ||
| 143 | + "level": 2, | ||
| 144 | + "parentId": 324, | ||
| 145 | + "rootId": 324 | ||
| 146 | + } | ||
| 147 | + ], | ||
| 148 | + "directoryName": "名人", | ||
| 149 | + "directoryWeight": 6, | ||
| 150 | + "id": 324, | ||
| 151 | + "isShow": 1, | ||
| 152 | + "level": 1, | ||
| 153 | + "parentId": 0, | ||
| 154 | + "rootId": 0 | ||
| 155 | + }, | ||
| 156 | + { | ||
| 157 | + "children": [ | ||
| 158 | + { | ||
| 159 | + "children": [], | ||
| 160 | + "directoryName": "2级目录", | ||
| 161 | + "directoryWeight": 0, | ||
| 162 | + "id": 340, | ||
| 163 | + "isShow": 1, | ||
| 164 | + "level": 2, | ||
| 165 | + "parentId": 312, | ||
| 166 | + "rootId": 312 | ||
| 167 | + }, | ||
| 168 | + { | ||
| 169 | + "children": [ | ||
| 170 | + { | ||
| 171 | + "directoryName": "3级测试", | ||
| 172 | + "directoryWeight": 0, | ||
| 173 | + "id": 368, | ||
| 174 | + "isShow": 1, | ||
| 175 | + "level": 3, | ||
| 176 | + "parentId": 339, | ||
| 177 | + "rootId": 312 | ||
| 178 | + } | ||
| 179 | + ], | ||
| 180 | + "directoryName": "二级目录", | ||
| 181 | + "directoryWeight": 0, | ||
| 182 | + "id": 339, | ||
| 183 | + "isShow": 1, | ||
| 184 | + "level": 2, | ||
| 185 | + "parentId": 312, | ||
| 186 | + "rootId": 312 | ||
| 187 | + }, | ||
| 188 | + { | ||
| 189 | + "children": [ | ||
| 190 | + { | ||
| 191 | + "directoryName": "企业", | ||
| 192 | + "directoryWeight": 1, | ||
| 193 | + "id": 348, | ||
| 194 | + "isShow": 1, | ||
| 195 | + "level": 3, | ||
| 196 | + "parentId": 336, | ||
| 197 | + "rootId": 312 | ||
| 198 | + }, | ||
| 199 | + { | ||
| 200 | + "directoryName": "部委", | ||
| 201 | + "directoryWeight": 0, | ||
| 202 | + "id": 344, | ||
| 203 | + "isShow": 1, | ||
| 204 | + "level": 3, | ||
| 205 | + "parentId": 336, | ||
| 206 | + "rootId": 312 | ||
| 207 | + }, | ||
| 208 | + { | ||
| 209 | + "directoryName": "地方", | ||
| 210 | + "directoryWeight": 0, | ||
| 211 | + "id": 341, | ||
| 212 | + "isShow": 1, | ||
| 213 | + "level": 3, | ||
| 214 | + "parentId": 336, | ||
| 215 | + "rootId": 312 | ||
| 216 | + } | ||
| 217 | + ], | ||
| 218 | + "directoryName": "类型", | ||
| 219 | + "directoryWeight": 0, | ||
| 220 | + "id": 336, | ||
| 221 | + "isShow": 1, | ||
| 222 | + "level": 2, | ||
| 223 | + "parentId": 312, | ||
| 224 | + "rootId": 312 | ||
| 225 | + }, | ||
| 226 | + { | ||
| 227 | + "children": [ | ||
| 228 | + { | ||
| 229 | + "directoryName": "贵州省", | ||
| 230 | + "directoryWeight": 0, | ||
| 231 | + "id": 378, | ||
| 232 | + "isShow": 1, | ||
| 233 | + "level": 3, | ||
| 234 | + "parentId": 332, | ||
| 235 | + "rootId": 312 | ||
| 236 | + }, | ||
| 237 | + { | ||
| 238 | + "directoryName": "西藏自治区", | ||
| 239 | + "directoryWeight": 0, | ||
| 240 | + "id": 377, | ||
| 241 | + "isShow": 1, | ||
| 242 | + "level": 3, | ||
| 243 | + "parentId": 332, | ||
| 244 | + "rootId": 312 | ||
| 245 | + }, | ||
| 246 | + { | ||
| 247 | + "directoryName": "四川省", | ||
| 248 | + "directoryWeight": 0, | ||
| 249 | + "id": 376, | ||
| 250 | + "isShow": 1, | ||
| 251 | + "level": 3, | ||
| 252 | + "parentId": 332, | ||
| 253 | + "rootId": 312 | ||
| 254 | + }, | ||
| 255 | + { | ||
| 256 | + "directoryName": "重庆市", | ||
| 257 | + "directoryWeight": 0, | ||
| 258 | + "id": 375, | ||
| 259 | + "isShow": 1, | ||
| 260 | + "level": 3, | ||
| 261 | + "parentId": 332, | ||
| 262 | + "rootId": 312 | ||
| 263 | + }, | ||
| 264 | + { | ||
| 265 | + "directoryName": "湖南省", | ||
| 266 | + "directoryWeight": 0, | ||
| 267 | + "id": 374, | ||
| 268 | + "isShow": 1, | ||
| 269 | + "level": 3, | ||
| 270 | + "parentId": 332, | ||
| 271 | + "rootId": 312 | ||
| 272 | + }, | ||
| 273 | + { | ||
| 274 | + "directoryName": "云南省", | ||
| 275 | + "directoryWeight": 0, | ||
| 276 | + "id": 373, | ||
| 277 | + "isShow": 1, | ||
| 278 | + "level": 3, | ||
| 279 | + "parentId": 332, | ||
| 280 | + "rootId": 312 | ||
| 281 | + }, | ||
| 282 | + { | ||
| 283 | + "directoryName": "广西壮族自治区", | ||
| 284 | + "directoryWeight": 0, | ||
| 285 | + "id": 372, | ||
| 286 | + "isShow": 1, | ||
| 287 | + "level": 3, | ||
| 288 | + "parentId": 332, | ||
| 289 | + "rootId": 312 | ||
| 290 | + }, | ||
| 291 | + { | ||
| 292 | + "directoryName": "宁夏回族自治区", | ||
| 293 | + "directoryWeight": 0, | ||
| 294 | + "id": 371, | ||
| 295 | + "isShow": 1, | ||
| 296 | + "level": 3, | ||
| 297 | + "parentId": 332, | ||
| 298 | + "rootId": 312 | ||
| 299 | + }, | ||
| 300 | + { | ||
| 301 | + "directoryName": "湖北省", | ||
| 302 | + "directoryWeight": 0, | ||
| 303 | + "id": 370, | ||
| 304 | + "isShow": 1, | ||
| 305 | + "level": 3, | ||
| 306 | + "parentId": 332, | ||
| 307 | + "rootId": 312 | ||
| 308 | + }, | ||
| 309 | + { | ||
| 310 | + "directoryName": "青海省", | ||
| 311 | + "directoryWeight": 0, | ||
| 312 | + "id": 369, | ||
| 313 | + "isShow": 1, | ||
| 314 | + "level": 3, | ||
| 315 | + "parentId": 332, | ||
| 316 | + "rootId": 312 | ||
| 317 | + }, | ||
| 318 | + { | ||
| 319 | + "directoryName": "陕西省", | ||
| 320 | + "directoryWeight": 0, | ||
| 321 | + "id": 367, | ||
| 322 | + "isShow": 1, | ||
| 323 | + "level": 3, | ||
| 324 | + "parentId": 332, | ||
| 325 | + "rootId": 312 | ||
| 326 | + }, | ||
| 327 | + { | ||
| 328 | + "directoryName": "甘肃省", | ||
| 329 | + "directoryWeight": 0, | ||
| 330 | + "id": 366, | ||
| 331 | + "isShow": 1, | ||
| 332 | + "level": 3, | ||
| 333 | + "parentId": 332, | ||
| 334 | + "rootId": 312 | ||
| 335 | + }, | ||
| 336 | + { | ||
| 337 | + "directoryName": "吉林省", | ||
| 338 | + "directoryWeight": 0, | ||
| 339 | + "id": 365, | ||
| 340 | + "isShow": 1, | ||
| 341 | + "level": 3, | ||
| 342 | + "parentId": 332, | ||
| 343 | + "rootId": 312 | ||
| 344 | + }, | ||
| 345 | + { | ||
| 346 | + "directoryName": "广东省", | ||
| 347 | + "directoryWeight": 0, | ||
| 348 | + "id": 364, | ||
| 349 | + "isShow": 1, | ||
| 350 | + "level": 3, | ||
| 351 | + "parentId": 332, | ||
| 352 | + "rootId": 312 | ||
| 353 | + }, | ||
| 354 | + { | ||
| 355 | + "directoryName": "海南省", | ||
| 356 | + "directoryWeight": 0, | ||
| 357 | + "id": 363, | ||
| 358 | + "isShow": 1, | ||
| 359 | + "level": 3, | ||
| 360 | + "parentId": 332, | ||
| 361 | + "rootId": 312 | ||
| 362 | + }, | ||
| 363 | + { | ||
| 364 | + "directoryName": "辽宁省", | ||
| 365 | + "directoryWeight": 0, | ||
| 366 | + "id": 362, | ||
| 367 | + "isShow": 1, | ||
| 368 | + "level": 3, | ||
| 369 | + "parentId": 332, | ||
| 370 | + "rootId": 312 | ||
| 371 | + }, | ||
| 372 | + { | ||
| 373 | + "directoryName": "江苏省", | ||
| 374 | + "directoryWeight": 0, | ||
| 375 | + "id": 361, | ||
| 376 | + "isShow": 1, | ||
| 377 | + "level": 3, | ||
| 378 | + "parentId": 332, | ||
| 379 | + "rootId": 312 | ||
| 380 | + }, | ||
| 381 | + { | ||
| 382 | + "directoryName": "新疆维吾尔族自治区", | ||
| 383 | + "directoryWeight": 0, | ||
| 384 | + "id": 360, | ||
| 385 | + "isShow": 1, | ||
| 386 | + "level": 3, | ||
| 387 | + "parentId": 332, | ||
| 388 | + "rootId": 312 | ||
| 389 | + }, | ||
| 390 | + { | ||
| 391 | + "directoryName": "福建省", | ||
| 392 | + "directoryWeight": 0, | ||
| 393 | + "id": 359, | ||
| 394 | + "isShow": 1, | ||
| 395 | + "level": 3, | ||
| 396 | + "parentId": 332, | ||
| 397 | + "rootId": 312 | ||
| 398 | + }, | ||
| 399 | + { | ||
| 400 | + "directoryName": "山东省", | ||
| 401 | + "directoryWeight": 0, | ||
| 402 | + "id": 358, | ||
| 403 | + "isShow": 1, | ||
| 404 | + "level": 3, | ||
| 405 | + "parentId": 332, | ||
| 406 | + "rootId": 312 | ||
| 407 | + }, | ||
| 408 | + { | ||
| 409 | + "directoryName": "河南省", | ||
| 410 | + "directoryWeight": 0, | ||
| 411 | + "id": 357, | ||
| 412 | + "isShow": 1, | ||
| 413 | + "level": 3, | ||
| 414 | + "parentId": 332, | ||
| 415 | + "rootId": 312 | ||
| 416 | + }, | ||
| 417 | + { | ||
| 418 | + "directoryName": "浙江省", | ||
| 419 | + "directoryWeight": 0, | ||
| 420 | + "id": 356, | ||
| 421 | + "isShow": 1, | ||
| 422 | + "level": 3, | ||
| 423 | + "parentId": 332, | ||
| 424 | + "rootId": 312 | ||
| 425 | + }, | ||
| 426 | + { | ||
| 427 | + "directoryName": "安徽省", | ||
| 428 | + "directoryWeight": 0, | ||
| 429 | + "id": 355, | ||
| 430 | + "isShow": 1, | ||
| 431 | + "level": 3, | ||
| 432 | + "parentId": 332, | ||
| 433 | + "rootId": 312 | ||
| 434 | + }, | ||
| 435 | + { | ||
| 436 | + "directoryName": "上海市", | ||
| 437 | + "directoryWeight": 0, | ||
| 438 | + "id": 354, | ||
| 439 | + "isShow": 1, | ||
| 440 | + "level": 3, | ||
| 441 | + "parentId": 332, | ||
| 442 | + "rootId": 312 | ||
| 443 | + }, | ||
| 444 | + { | ||
| 445 | + "directoryName": "河北省", | ||
| 446 | + "directoryWeight": 0, | ||
| 447 | + "id": 353, | ||
| 448 | + "isShow": 1, | ||
| 449 | + "level": 3, | ||
| 450 | + "parentId": 332, | ||
| 451 | + "rootId": 312 | ||
| 452 | + }, | ||
| 453 | + { | ||
| 454 | + "directoryName": "黑龙江省", | ||
| 455 | + "directoryWeight": 0, | ||
| 456 | + "id": 352, | ||
| 457 | + "isShow": 1, | ||
| 458 | + "level": 3, | ||
| 459 | + "parentId": 332, | ||
| 460 | + "rootId": 312 | ||
| 461 | + }, | ||
| 462 | + { | ||
| 463 | + "directoryName": "江西省", | ||
| 464 | + "directoryWeight": 0, | ||
| 465 | + "id": 351, | ||
| 466 | + "isShow": 1, | ||
| 467 | + "level": 3, | ||
| 468 | + "parentId": 332, | ||
| 469 | + "rootId": 312 | ||
| 470 | + }, | ||
| 471 | + { | ||
| 472 | + "directoryName": "内蒙古自治区", | ||
| 473 | + "directoryWeight": 0, | ||
| 474 | + "id": 350, | ||
| 475 | + "isShow": 1, | ||
| 476 | + "level": 3, | ||
| 477 | + "parentId": 332, | ||
| 478 | + "rootId": 312 | ||
| 479 | + }, | ||
| 480 | + { | ||
| 481 | + "directoryName": "北京市", | ||
| 482 | + "directoryWeight": 0, | ||
| 483 | + "id": 349, | ||
| 484 | + "isShow": 1, | ||
| 485 | + "level": 3, | ||
| 486 | + "parentId": 332, | ||
| 487 | + "rootId": 312 | ||
| 488 | + }, | ||
| 489 | + { | ||
| 490 | + "directoryName": "山西省", | ||
| 491 | + "directoryWeight": 0, | ||
| 492 | + "id": 346, | ||
| 493 | + "isShow": 1, | ||
| 494 | + "level": 3, | ||
| 495 | + "parentId": 332, | ||
| 496 | + "rootId": 312 | ||
| 497 | + } | ||
| 498 | + ], | ||
| 499 | + "directoryName": "地域", | ||
| 500 | + "directoryWeight": 0, | ||
| 501 | + "id": 332, | ||
| 502 | + "isShow": 1, | ||
| 503 | + "level": 2, | ||
| 504 | + "parentId": 312, | ||
| 505 | + "rootId": 312 | ||
| 506 | + } | ||
| 507 | + ], | ||
| 508 | + "directoryName": "政务", | ||
| 509 | + "directoryWeight": 5, | ||
| 510 | + "id": 312, | ||
| 511 | + "isShow": 1, | ||
| 512 | + "level": 1, | ||
| 513 | + "parentId": 0, | ||
| 514 | + "rootId": 0 | ||
| 515 | + }, | ||
| 516 | + { | ||
| 517 | + "children": [], | ||
| 518 | + "directoryName": "学校", | ||
| 519 | + "directoryWeight": 4, | ||
| 520 | + "id": 331, | ||
| 521 | + "isShow": 1, | ||
| 522 | + "level": 1, | ||
| 523 | + "parentId": 0, | ||
| 524 | + "rootId": 0 | ||
| 525 | + }, | ||
| 526 | + { | ||
| 527 | + "children": [], | ||
| 528 | + "directoryName": "机构", | ||
| 529 | + "directoryWeight": 3, | ||
| 530 | + "id": 330, | ||
| 531 | + "isShow": 1, | ||
| 532 | + "level": 1, | ||
| 533 | + "parentId": 0, | ||
| 534 | + "rootId": 0 | ||
| 535 | + }, | ||
| 536 | + { | ||
| 537 | + "children": [ | ||
| 538 | + { | ||
| 539 | + "children": [ | ||
| 540 | + { | ||
| 541 | + "directoryName": "新闻联播", | ||
| 542 | + "directoryWeight": 3, | ||
| 543 | + "id": 79, | ||
| 544 | + "isShow": 1, | ||
| 545 | + "level": 3, | ||
| 546 | + "parentId": 75, | ||
| 547 | + "rootId": 74 | ||
| 548 | + }, | ||
| 549 | + { | ||
| 550 | + "directoryName": "第三季", | ||
| 551 | + "directoryWeight": 2, | ||
| 552 | + "id": 78, | ||
| 553 | + "isShow": 1, | ||
| 554 | + "level": 3, | ||
| 555 | + "parentId": 75, | ||
| 556 | + "rootId": 74 | ||
| 557 | + }, | ||
| 558 | + { | ||
| 559 | + "directoryName": "三级", | ||
| 560 | + "directoryWeight": 1, | ||
| 561 | + "id": 76, | ||
| 562 | + "isShow": 1, | ||
| 563 | + "level": 3, | ||
| 564 | + "parentId": 75, | ||
| 565 | + "rootId": 74 | ||
| 566 | + } | ||
| 567 | + ], | ||
| 568 | + "directoryName": "短视频", | ||
| 569 | + "directoryWeight": 1, | ||
| 570 | + "id": 75, | ||
| 571 | + "isShow": 1, | ||
| 572 | + "level": 2, | ||
| 573 | + "parentId": 74, | ||
| 574 | + "rootId": 74 | ||
| 575 | + } | ||
| 576 | + ], | ||
| 577 | + "directoryName": "创作", | ||
| 578 | + "directoryWeight": 3, | ||
| 579 | + "id": 74, | ||
| 580 | + "isShow": 1, | ||
| 581 | + "level": 1, | ||
| 582 | + "parentId": 0, | ||
| 583 | + "rootId": 0 | ||
| 584 | + }, | ||
| 585 | + { | ||
| 586 | + "children": [ | ||
| 587 | + { | ||
| 588 | + "children": [], | ||
| 589 | + "directoryName": "教学", | ||
| 590 | + "directoryWeight": 2, | ||
| 591 | + "id": 72, | ||
| 592 | + "isShow": 1, | ||
| 593 | + "level": 2, | ||
| 594 | + "parentId": 64, | ||
| 595 | + "rootId": 64 | ||
| 596 | + }, | ||
| 597 | + { | ||
| 598 | + "children": [], | ||
| 599 | + "directoryName": "热门", | ||
| 600 | + "directoryWeight": 1, | ||
| 601 | + "id": 73, | ||
| 602 | + "isShow": 1, | ||
| 603 | + "level": 2, | ||
| 604 | + "parentId": 64, | ||
| 605 | + "rootId": 64 | ||
| 606 | + }, | ||
| 607 | + { | ||
| 608 | + "children": [], | ||
| 609 | + "directoryName": "赛事", | ||
| 610 | + "directoryWeight": 1, | ||
| 611 | + "id": 71, | ||
| 612 | + "isShow": 1, | ||
| 613 | + "level": 2, | ||
| 614 | + "parentId": 64, | ||
| 615 | + "rootId": 64 | ||
| 616 | + } | ||
| 617 | + ], | ||
| 618 | + "directoryName": "游戏", | ||
| 619 | + "directoryWeight": 2, | ||
| 620 | + "id": 64, | ||
| 621 | + "isShow": 1, | ||
| 622 | + "level": 1, | ||
| 623 | + "parentId": 0, | ||
| 624 | + "rootId": 0 | ||
| 625 | + }, | ||
| 626 | + { | ||
| 627 | + "children": [], | ||
| 628 | + "directoryName": "新闻", | ||
| 629 | + "directoryWeight": 1, | ||
| 630 | + "id": 315, | ||
| 631 | + "isShow": 1, | ||
| 632 | + "level": 1, | ||
| 633 | + "parentId": 0, | ||
| 634 | + "rootId": 0 | ||
| 635 | + }, | ||
| 636 | + { | ||
| 637 | + "children": [ | ||
| 638 | + { | ||
| 639 | + "children": [], | ||
| 640 | + "directoryName": "趣闻", | ||
| 641 | + "directoryWeight": 6, | ||
| 642 | + "id": 70, | ||
| 643 | + "isShow": 1, | ||
| 644 | + "level": 2, | ||
| 645 | + "parentId": 63, | ||
| 646 | + "rootId": 63 | ||
| 647 | + }, | ||
| 648 | + { | ||
| 649 | + "children": [], | ||
| 650 | + "directoryName": "时政", | ||
| 651 | + "directoryWeight": 5, | ||
| 652 | + "id": 69, | ||
| 653 | + "isShow": 1, | ||
| 654 | + "level": 2, | ||
| 655 | + "parentId": 63, | ||
| 656 | + "rootId": 63 | ||
| 657 | + }, | ||
| 658 | + { | ||
| 659 | + "children": [], | ||
| 660 | + "directoryName": "农业", | ||
| 661 | + "directoryWeight": 3, | ||
| 662 | + "id": 68, | ||
| 663 | + "isShow": 1, | ||
| 664 | + "level": 2, | ||
| 665 | + "parentId": 63, | ||
| 666 | + "rootId": 63 | ||
| 667 | + }, | ||
| 668 | + { | ||
| 669 | + "children": [], | ||
| 670 | + "directoryName": "娱乐", | ||
| 671 | + "directoryWeight": 3, | ||
| 672 | + "id": 67, | ||
| 673 | + "isShow": 1, | ||
| 674 | + "level": 2, | ||
| 675 | + "parentId": 63, | ||
| 676 | + "rootId": 63 | ||
| 677 | + }, | ||
| 678 | + { | ||
| 679 | + "children": [], | ||
| 680 | + "directoryName": "科技", | ||
| 681 | + "directoryWeight": 2, | ||
| 682 | + "id": 66, | ||
| 683 | + "isShow": 1, | ||
| 684 | + "level": 2, | ||
| 685 | + "parentId": 63, | ||
| 686 | + "rootId": 63 | ||
| 687 | + }, | ||
| 688 | + { | ||
| 689 | + "children": [], | ||
| 690 | + "directoryName": "国际", | ||
| 691 | + "directoryWeight": 1, | ||
| 692 | + "id": 65, | ||
| 693 | + "isShow": 1, | ||
| 694 | + "level": 2, | ||
| 695 | + "parentId": 63, | ||
| 696 | + "rootId": 63 | ||
| 697 | + } | ||
| 698 | + ], | ||
| 699 | + "directoryName": "新闻", | ||
| 700 | + "directoryWeight": 1, | ||
| 701 | + "id": 63, | ||
| 702 | + "isShow": 1, | ||
| 703 | + "level": 1, | ||
| 704 | + "parentId": 0, | ||
| 705 | + "rootId": 0 | ||
| 706 | + }, | ||
| 707 | + { | ||
| 708 | + "children": [], | ||
| 709 | + "directoryName": "公安", | ||
| 710 | + "directoryWeight": 0, | ||
| 711 | + "id": 388, | ||
| 712 | + "isShow": 1, | ||
| 713 | + "level": 1, | ||
| 714 | + "parentId": 0, | ||
| 715 | + "rootId": 0 | ||
| 716 | + }, | ||
| 717 | + { | ||
| 718 | + "children": [], | ||
| 719 | + "directoryName": "dddd", | ||
| 720 | + "directoryWeight": 0, | ||
| 721 | + "id": 387, | ||
| 722 | + "isShow": 1, | ||
| 723 | + "level": 1, | ||
| 724 | + "parentId": 0, | ||
| 725 | + "rootId": 0 | ||
| 726 | + }, | ||
| 727 | + { | ||
| 728 | + "children": [], | ||
| 729 | + "directoryName": "健康", | ||
| 730 | + "directoryWeight": 0, | ||
| 731 | + "id": 384, | ||
| 732 | + "isShow": 1, | ||
| 733 | + "level": 1, | ||
| 734 | + "parentId": 0, | ||
| 735 | + "rootId": 0 | ||
| 736 | + }, | ||
| 737 | + { | ||
| 738 | + "children": [], | ||
| 739 | + "directoryName": "综合", | ||
| 740 | + "directoryWeight": 0, | ||
| 741 | + "id": 328, | ||
| 742 | + "isShow": 1, | ||
| 743 | + "level": 1, | ||
| 744 | + "parentId": 0, | ||
| 745 | + "rootId": 0 | ||
| 746 | + }, | ||
| 747 | + { | ||
| 748 | + "children": [], | ||
| 749 | + "directoryName": "房产", | ||
| 750 | + "directoryWeight": 0, | ||
| 751 | + "id": 327, | ||
| 752 | + "isShow": 1, | ||
| 753 | + "level": 1, | ||
| 754 | + "parentId": 0, | ||
| 755 | + "rootId": 0 | ||
| 756 | + }, | ||
| 757 | + { | ||
| 758 | + "children": [], | ||
| 759 | + "directoryName": "健康", | ||
| 760 | + "directoryWeight": 0, | ||
| 761 | + "id": 318, | ||
| 762 | + "isShow": 1, | ||
| 763 | + "level": 1, | ||
| 764 | + "parentId": 0, | ||
| 765 | + "rootId": 0 | ||
| 766 | + }, | ||
| 767 | + { | ||
| 768 | + "children": [], | ||
| 769 | + "directoryName": "历史", | ||
| 770 | + "directoryWeight": 0, | ||
| 771 | + "id": 310, | ||
| 772 | + "isShow": 1, | ||
| 773 | + "level": 1, | ||
| 774 | + "parentId": 0, | ||
| 775 | + "rootId": 0 | ||
| 776 | + }, | ||
| 777 | + { | ||
| 778 | + "children": [], | ||
| 779 | + "directoryName": "dddd", | ||
| 780 | + "directoryWeight": 0, | ||
| 781 | + "id": 309, | ||
| 782 | + "isShow": 1, | ||
| 783 | + "level": 1, | ||
| 784 | + "parentId": 0, | ||
| 785 | + "rootId": 0 | ||
| 786 | + }, | ||
| 787 | + { | ||
| 788 | + "children": [ | ||
| 789 | + { | ||
| 790 | + "children": [], | ||
| 791 | + "directoryName": "aaaa", | ||
| 792 | + "directoryWeight": 1, | ||
| 793 | + "id": 333, | ||
| 794 | + "isShow": 1, | ||
| 795 | + "level": 2, | ||
| 796 | + "parentId": 308, | ||
| 797 | + "rootId": 308 | ||
| 798 | + }, | ||
| 799 | + { | ||
| 800 | + "children": [], | ||
| 801 | + "directoryName": "qqq", | ||
| 802 | + "directoryWeight": 0, | ||
| 803 | + "id": 334, | ||
| 804 | + "isShow": 1, | ||
| 805 | + "level": 2, | ||
| 806 | + "parentId": 308, | ||
| 807 | + "rootId": 308 | ||
| 808 | + } | ||
| 809 | + ], | ||
| 810 | + "directoryName": "dddd", | ||
| 811 | + "directoryWeight": 0, | ||
| 812 | + "id": 308, | ||
| 813 | + "isShow": 1, | ||
| 814 | + "level": 1, | ||
| 815 | + "parentId": 0, | ||
| 816 | + "rootId": 0 | ||
| 817 | + } | ||
| 818 | + ], | ||
| 819 | + "message": "Success", | ||
| 820 | + "success": true, | ||
| 821 | + "timestamp": 1710741803593 | ||
| 822 | +} |
| 1 | +{ | ||
| 2 | + "code": "0", | ||
| 3 | + "data": { | ||
| 4 | + "list": [{ | ||
| 5 | + "attentionNum": 0, | ||
| 6 | + "authIcon": "", | ||
| 7 | + "authId": 0, | ||
| 8 | + "authPersonal": "", | ||
| 9 | + "authTitle": "", | ||
| 10 | + "categoryAuth": "", | ||
| 11 | + "city": "110100", | ||
| 12 | + "cnAttentionNum": 0, | ||
| 13 | + "cnCollectNum": 0, | ||
| 14 | + "cnCommentNum": 0, | ||
| 15 | + "cnFansNum": 4, | ||
| 16 | + "cnIsAttention": 1, | ||
| 17 | + "cnIsComment": 1, | ||
| 18 | + "cnIsLike": 1, | ||
| 19 | + "cnLikeNum": 0, | ||
| 20 | + "cnLiveCommentControl": 1, | ||
| 21 | + "cnLiveGiftControl": 1, | ||
| 22 | + "cnLiveLikeControl": 1, | ||
| 23 | + "cnLiveShareControl": 1, | ||
| 24 | + "cnMainControl": 1, | ||
| 25 | + "cnRegistTime": 1695280071000, | ||
| 26 | + "cnShareControl": 1, | ||
| 27 | + "cnShareNum": 0, | ||
| 28 | + "cnUserId": "444937588589253", | ||
| 29 | + "cnUserName": "QACrawler2115", | ||
| 30 | + "cnUserType": "2", | ||
| 31 | + "collectNum": 0, | ||
| 32 | + "creatorId": "3004862", | ||
| 33 | + "district": "110101", | ||
| 34 | + "fansNum": 0, | ||
| 35 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309Th211436299/GLN.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 36 | + "honoraryIcon": "", | ||
| 37 | + "honoraryTitle": "", | ||
| 38 | + "introduction": "知识博主", | ||
| 39 | + "isAttention": 1, | ||
| 40 | + "isComment": 1, | ||
| 41 | + "isLike": 1, | ||
| 42 | + "isVisiable": 1, | ||
| 43 | + "likeNum": 0, | ||
| 44 | + "liveCommentControl": 1, | ||
| 45 | + "liveGiftControl": 1, | ||
| 46 | + "liveLikeControl": 1, | ||
| 47 | + "liveShareControl": 1, | ||
| 48 | + "posterShareControl": 1, | ||
| 49 | + "province": "110000", | ||
| 50 | + "publishNum": 0, | ||
| 51 | + "region": "", | ||
| 52 | + "shareControl": 1, | ||
| 53 | + "shareNum": 0, | ||
| 54 | + "shopOpen": 0, | ||
| 55 | + "storeUrl": "", | ||
| 56 | + "subjectType": 0, | ||
| 57 | + "userId": "", | ||
| 58 | + "userName": "QACrawler2115", | ||
| 59 | + "userType": "2", | ||
| 60 | + "waresSwitch": 1 | ||
| 61 | + }, { | ||
| 62 | + "attentionNum": 0, | ||
| 63 | + "authIcon": "", | ||
| 64 | + "authId": 0, | ||
| 65 | + "authPersonal": "", | ||
| 66 | + "authTitle": "", | ||
| 67 | + "categoryAuth": "", | ||
| 68 | + "city": "230100", | ||
| 69 | + "cnAttentionNum": 0, | ||
| 70 | + "cnCollectNum": 0, | ||
| 71 | + "cnCommentNum": 0, | ||
| 72 | + "cnFansNum": 4, | ||
| 73 | + "cnIsAttention": 1, | ||
| 74 | + "cnIsComment": 1, | ||
| 75 | + "cnIsLike": 1, | ||
| 76 | + "cnLikeNum": 0, | ||
| 77 | + "cnLiveCommentControl": 1, | ||
| 78 | + "cnLiveGiftControl": 1, | ||
| 79 | + "cnLiveLikeControl": 1, | ||
| 80 | + "cnLiveShareControl": 1, | ||
| 81 | + "cnMainControl": 1, | ||
| 82 | + "cnRegistTime": 1695276994000, | ||
| 83 | + "cnShareControl": 1, | ||
| 84 | + "cnShareNum": 0, | ||
| 85 | + "cnUserId": "444911718724933", | ||
| 86 | + "cnUserName": "一休哥", | ||
| 87 | + "cnUserType": "2", | ||
| 88 | + "collectNum": 0, | ||
| 89 | + "creatorId": "3004861", | ||
| 90 | + "district": "230102", | ||
| 91 | + "fansNum": 0, | ||
| 92 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309Th141630857/Ptx.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 93 | + "honoraryIcon": "", | ||
| 94 | + "honoraryTitle": "", | ||
| 95 | + "introduction": "中文端号主", | ||
| 96 | + "isAttention": 1, | ||
| 97 | + "isComment": 1, | ||
| 98 | + "isLike": 1, | ||
| 99 | + "isVisiable": 1, | ||
| 100 | + "likeNum": 0, | ||
| 101 | + "liveCommentControl": 1, | ||
| 102 | + "liveGiftControl": 1, | ||
| 103 | + "liveLikeControl": 1, | ||
| 104 | + "liveShareControl": 1, | ||
| 105 | + "posterShareControl": 1, | ||
| 106 | + "province": "230000", | ||
| 107 | + "publishNum": 0, | ||
| 108 | + "region": "安徽", | ||
| 109 | + "shareControl": 1, | ||
| 110 | + "shareNum": 0, | ||
| 111 | + "shopOpen": 0, | ||
| 112 | + "storeUrl": "", | ||
| 113 | + "subjectType": 2, | ||
| 114 | + "userId": "", | ||
| 115 | + "userName": "一休哥", | ||
| 116 | + "userType": "2", | ||
| 117 | + "waresSwitch": 1 | ||
| 118 | + }, { | ||
| 119 | + "attentionNum": 0, | ||
| 120 | + "authIcon": "", | ||
| 121 | + "authId": 0, | ||
| 122 | + "authPersonal": "", | ||
| 123 | + "authTitle": "", | ||
| 124 | + "categoryAuth": "", | ||
| 125 | + "city": "110100", | ||
| 126 | + "cnAttentionNum": 0, | ||
| 127 | + "cnCollectNum": 0, | ||
| 128 | + "cnCommentNum": 12, | ||
| 129 | + "cnFansNum": 8, | ||
| 130 | + "cnIsAttention": 1, | ||
| 131 | + "cnIsComment": 1, | ||
| 132 | + "cnIsLike": 1, | ||
| 133 | + "cnLikeNum": 2, | ||
| 134 | + "cnLiveCommentControl": 1, | ||
| 135 | + "cnLiveGiftControl": 1, | ||
| 136 | + "cnLiveLikeControl": 1, | ||
| 137 | + "cnLiveShareControl": 1, | ||
| 138 | + "cnMainControl": 1, | ||
| 139 | + "cnRegistTime": 1695275999000, | ||
| 140 | + "cnShareControl": 1, | ||
| 141 | + "cnShareNum": 1, | ||
| 142 | + "cnUserId": "444903323309381", | ||
| 143 | + "cnUserName": "0921媒体", | ||
| 144 | + "cnUserType": "3", | ||
| 145 | + "collectNum": 0, | ||
| 146 | + "creatorId": "3004860", | ||
| 147 | + "district": "110101", | ||
| 148 | + "fansNum": 0, | ||
| 149 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309Th135954709/qdL.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 150 | + "honoraryIcon": "", | ||
| 151 | + "honoraryTitle": "", | ||
| 152 | + "introduction": "0921媒体", | ||
| 153 | + "isAttention": 1, | ||
| 154 | + "isComment": 1, | ||
| 155 | + "isLike": 1, | ||
| 156 | + "isVisiable": 1, | ||
| 157 | + "likeNum": 0, | ||
| 158 | + "liveCommentControl": 1, | ||
| 159 | + "liveGiftControl": 1, | ||
| 160 | + "liveLikeControl": 1, | ||
| 161 | + "liveShareControl": 1, | ||
| 162 | + "posterShareControl": 0, | ||
| 163 | + "province": "110000", | ||
| 164 | + "publishNum": 0, | ||
| 165 | + "region": "上海", | ||
| 166 | + "shareControl": 1, | ||
| 167 | + "shareNum": 0, | ||
| 168 | + "shopOpen": 0, | ||
| 169 | + "storeUrl": "", | ||
| 170 | + "subjectType": 1, | ||
| 171 | + "userId": "", | ||
| 172 | + "userName": "0921媒体", | ||
| 173 | + "userType": "3", | ||
| 174 | + "waresSwitch": 1 | ||
| 175 | + }, { | ||
| 176 | + "attentionNum": 0, | ||
| 177 | + "authIcon": "https://sitcontentjdcdn.aikan.pdnews.cn/creator-category/icon/auth/blue.png", | ||
| 178 | + "authId": 1, | ||
| 179 | + "authPersonal": "", | ||
| 180 | + "authTitle": "黄袍加身V", | ||
| 181 | + "categoryAuth": "黄袍加身V", | ||
| 182 | + "city": "340100", | ||
| 183 | + "cnAttentionNum": 9, | ||
| 184 | + "cnCollectNum": 0, | ||
| 185 | + "cnCommentNum": 3, | ||
| 186 | + "cnFansNum": 9, | ||
| 187 | + "cnIsAttention": 1, | ||
| 188 | + "cnIsComment": 1, | ||
| 189 | + "cnIsLike": 1, | ||
| 190 | + "cnLikeNum": 7, | ||
| 191 | + "cnLiveCommentControl": 1, | ||
| 192 | + "cnLiveGiftControl": 1, | ||
| 193 | + "cnLiveLikeControl": 1, | ||
| 194 | + "cnLiveShareControl": 1, | ||
| 195 | + "cnMainControl": 1, | ||
| 196 | + "cnRegistTime": 1695260417000, | ||
| 197 | + "cnShareControl": 1, | ||
| 198 | + "cnShareNum": 0, | ||
| 199 | + "cnUserId": "444776025830725", | ||
| 200 | + "cnUserName": "李智恩3", | ||
| 201 | + "cnUserType": "2", | ||
| 202 | + "collectNum": 0, | ||
| 203 | + "creatorId": "3004855", | ||
| 204 | + "district": "340102", | ||
| 205 | + "fansNum": 0, | ||
| 206 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309Th094010643/N5o.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 207 | + "honoraryIcon": "", | ||
| 208 | + "honoraryTitle": "", | ||
| 209 | + "introduction": "IU", | ||
| 210 | + "isAttention": 1, | ||
| 211 | + "isComment": 1, | ||
| 212 | + "isLike": 1, | ||
| 213 | + "isVisiable": 1, | ||
| 214 | + "likeNum": 0, | ||
| 215 | + "liveCommentControl": 1, | ||
| 216 | + "liveGiftControl": 1, | ||
| 217 | + "liveLikeControl": 1, | ||
| 218 | + "liveShareControl": 1, | ||
| 219 | + "posterShareControl": 0, | ||
| 220 | + "province": "340000", | ||
| 221 | + "publishNum": 0, | ||
| 222 | + "region": "安徽", | ||
| 223 | + "shareControl": 1, | ||
| 224 | + "shareNum": 0, | ||
| 225 | + "shopOpen": 1, | ||
| 226 | + "storeUrl": "", | ||
| 227 | + "subjectType": 1, | ||
| 228 | + "userId": "", | ||
| 229 | + "userName": "李智恩3", | ||
| 230 | + "userType": "2", | ||
| 231 | + "waresSwitch": 0 | ||
| 232 | + }, { | ||
| 233 | + "attentionNum": 0, | ||
| 234 | + "authIcon": "https://sitcontentjdcdn.aikan.pdnews.cn/creator-category/icon/auth/yellow.png", | ||
| 235 | + "authId": 2, | ||
| 236 | + "authPersonal": "", | ||
| 237 | + "authTitle": "黄VV", | ||
| 238 | + "categoryAuth": "黄VV", | ||
| 239 | + "city": "120100", | ||
| 240 | + "cnAttentionNum": 1, | ||
| 241 | + "cnCollectNum": 1, | ||
| 242 | + "cnCommentNum": 7, | ||
| 243 | + "cnFansNum": 13, | ||
| 244 | + "cnIsAttention": 1, | ||
| 245 | + "cnIsComment": 1, | ||
| 246 | + "cnIsLike": 1, | ||
| 247 | + "cnLikeNum": 0, | ||
| 248 | + "cnLiveCommentControl": 1, | ||
| 249 | + "cnLiveGiftControl": 1, | ||
| 250 | + "cnLiveLikeControl": 1, | ||
| 251 | + "cnLiveShareControl": 1, | ||
| 252 | + "cnMainControl": 1, | ||
| 253 | + "cnRegistTime": 1695202406000, | ||
| 254 | + "cnShareControl": 1, | ||
| 255 | + "cnShareNum": 0, | ||
| 256 | + "cnUserId": "444300764043333", | ||
| 257 | + "cnUserName": "创作者账号7777", | ||
| 258 | + "cnUserType": "2", | ||
| 259 | + "collectNum": 0, | ||
| 260 | + "creatorId": "3004853", | ||
| 261 | + "district": "120101", | ||
| 262 | + "fansNum": 0, | ||
| 263 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/image/creator/2023092715/4727ab5db7604dbbac9ffb94ed03614e.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 264 | + "honoraryIcon": "", | ||
| 265 | + "honoraryTitle": "", | ||
| 266 | + "introduction": "协作平台是进行团队开发、协作的系统,一般是基于互联网,也有用专业网的情况。协作平台的主要功能是:分工合作、进度控制、版本控制等功能。协作平台是进行团队开发、协作的系统,一般是基于互联网,也有用专业网的情况。协作平台的主要功能是:分工合作、进度控制、版本控制等功能。协作平台是进行团队开发、协作的系统,一般是基于互联网,也有用专业网的情况。协作平台的主要功能是:分工合作、进度控制、版本控制等功能。协作", | ||
| 267 | + "isAttention": 1, | ||
| 268 | + "isComment": 1, | ||
| 269 | + "isLike": 1, | ||
| 270 | + "isVisiable": 1, | ||
| 271 | + "likeNum": 0, | ||
| 272 | + "liveCommentControl": 1, | ||
| 273 | + "liveGiftControl": 1, | ||
| 274 | + "liveLikeControl": 1, | ||
| 275 | + "liveShareControl": 1, | ||
| 276 | + "posterShareControl": 0, | ||
| 277 | + "province": "120000", | ||
| 278 | + "publishNum": 0, | ||
| 279 | + "region": "安徽", | ||
| 280 | + "shareControl": 1, | ||
| 281 | + "shareNum": 0, | ||
| 282 | + "shopOpen": 1, | ||
| 283 | + "storeUrl": "", | ||
| 284 | + "subjectType": 0, | ||
| 285 | + "userId": "", | ||
| 286 | + "userName": "创作者账号7777", | ||
| 287 | + "userType": "2", | ||
| 288 | + "waresSwitch": 0 | ||
| 289 | + }, { | ||
| 290 | + "attentionNum": 0, | ||
| 291 | + "authIcon": "", | ||
| 292 | + "authId": 0, | ||
| 293 | + "authPersonal": "", | ||
| 294 | + "authTitle": "", | ||
| 295 | + "categoryAuth": "", | ||
| 296 | + "city": "110100", | ||
| 297 | + "cnAttentionNum": 0, | ||
| 298 | + "cnCollectNum": 0, | ||
| 299 | + "cnCommentNum": 0, | ||
| 300 | + "cnFansNum": 9, | ||
| 301 | + "cnIsAttention": 1, | ||
| 302 | + "cnIsComment": 1, | ||
| 303 | + "cnIsLike": 1, | ||
| 304 | + "cnLikeNum": 6, | ||
| 305 | + "cnLiveCommentControl": 1, | ||
| 306 | + "cnLiveGiftControl": 1, | ||
| 307 | + "cnLiveLikeControl": 1, | ||
| 308 | + "cnLiveShareControl": 1, | ||
| 309 | + "cnMainControl": 1, | ||
| 310 | + "cnRegistTime": 1695201858000, | ||
| 311 | + "cnShareControl": 1, | ||
| 312 | + "cnShareNum": 0, | ||
| 313 | + "cnUserId": "444296355502149", | ||
| 314 | + "cnUserName": "0920个人", | ||
| 315 | + "cnUserType": "2", | ||
| 316 | + "collectNum": 0, | ||
| 317 | + "creatorId": "3004851", | ||
| 318 | + "district": "110101", | ||
| 319 | + "fansNum": 0, | ||
| 320 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309We172415100/h2j.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 321 | + "honoraryIcon": "https://cdn.aikan.pdnews.cn/image/picture/202312/20231223173451966FdV.png", | ||
| 322 | + "honoraryTitle": "快乐星球", | ||
| 323 | + "introduction": "账号简介", | ||
| 324 | + "isAttention": 1, | ||
| 325 | + "isComment": 1, | ||
| 326 | + "isLike": 1, | ||
| 327 | + "isVisiable": 1, | ||
| 328 | + "likeNum": 0, | ||
| 329 | + "liveCommentControl": 1, | ||
| 330 | + "liveGiftControl": 1, | ||
| 331 | + "liveLikeControl": 1, | ||
| 332 | + "liveShareControl": 1, | ||
| 333 | + "posterShareControl": 1, | ||
| 334 | + "province": "110000", | ||
| 335 | + "publishNum": 0, | ||
| 336 | + "region": "上海", | ||
| 337 | + "shareControl": 1, | ||
| 338 | + "shareNum": 0, | ||
| 339 | + "shopOpen": 0, | ||
| 340 | + "storeUrl": "", | ||
| 341 | + "subjectType": 0, | ||
| 342 | + "userId": "", | ||
| 343 | + "userName": "0920个人", | ||
| 344 | + "userType": "2", | ||
| 345 | + "waresSwitch": 1 | ||
| 346 | + }, { | ||
| 347 | + "attentionNum": 0, | ||
| 348 | + "authIcon": "", | ||
| 349 | + "authId": 0, | ||
| 350 | + "authPersonal": "", | ||
| 351 | + "authTitle": "", | ||
| 352 | + "categoryAuth": "", | ||
| 353 | + "city": "120100", | ||
| 354 | + "cnAttentionNum": 0, | ||
| 355 | + "cnCollectNum": 0, | ||
| 356 | + "cnCommentNum": 0, | ||
| 357 | + "cnFansNum": 10, | ||
| 358 | + "cnIsAttention": 1, | ||
| 359 | + "cnIsComment": 1, | ||
| 360 | + "cnIsLike": 1, | ||
| 361 | + "cnLikeNum": 0, | ||
| 362 | + "cnLiveCommentControl": 1, | ||
| 363 | + "cnLiveGiftControl": 1, | ||
| 364 | + "cnLiveLikeControl": 1, | ||
| 365 | + "cnLiveShareControl": 1, | ||
| 366 | + "cnMainControl": 1, | ||
| 367 | + "cnRegistTime": 1695190066000, | ||
| 368 | + "cnShareControl": 1, | ||
| 369 | + "cnShareNum": 0, | ||
| 370 | + "cnUserId": "444200272593477", | ||
| 371 | + "cnUserName": "zhuaqu005", | ||
| 372 | + "cnUserType": "2", | ||
| 373 | + "collectNum": 0, | ||
| 374 | + "creatorId": "3004849", | ||
| 375 | + "district": "120101", | ||
| 376 | + "fansNum": 0, | ||
| 377 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309We140931534/CIX.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 378 | + "honoraryIcon": "", | ||
| 379 | + "honoraryTitle": "", | ||
| 380 | + "introduction": "aaa", | ||
| 381 | + "isAttention": 1, | ||
| 382 | + "isComment": 1, | ||
| 383 | + "isLike": 1, | ||
| 384 | + "isVisiable": 1, | ||
| 385 | + "likeNum": 0, | ||
| 386 | + "liveCommentControl": 1, | ||
| 387 | + "liveGiftControl": 1, | ||
| 388 | + "liveLikeControl": 1, | ||
| 389 | + "liveShareControl": 1, | ||
| 390 | + "posterShareControl": 1, | ||
| 391 | + "province": "120000", | ||
| 392 | + "publishNum": 0, | ||
| 393 | + "region": "上海", | ||
| 394 | + "shareControl": 1, | ||
| 395 | + "shareNum": 0, | ||
| 396 | + "shopOpen": 0, | ||
| 397 | + "storeUrl": "", | ||
| 398 | + "subjectType": 0, | ||
| 399 | + "userId": "", | ||
| 400 | + "userName": "zhuaqu005", | ||
| 401 | + "userType": "2", | ||
| 402 | + "waresSwitch": 1 | ||
| 403 | + }], | ||
| 404 | + "pageNum": 1, | ||
| 405 | + "pageSize": 20, | ||
| 406 | + "totalCount": 7 | ||
| 407 | + }, | ||
| 408 | + "message": "Success", | ||
| 409 | + "success": true, | ||
| 410 | + "timestamp": 1710742034894 | ||
| 411 | +} |
| @@ -27,3 +27,17 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent" | @@ -27,3 +27,17 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent" | ||
| 27 | export { BigPicCardComponent } from "./components/view/BigPicCardComponent" | 27 | export { BigPicCardComponent } from "./components/view/BigPicCardComponent" |
| 28 | 28 | ||
| 29 | export { HeadPictureCardComponent } from "./components/view/HeadPictureCardComponent" | 29 | export { HeadPictureCardComponent } from "./components/view/HeadPictureCardComponent" |
| 30 | + | ||
| 31 | +export { MineSettingComponent } from "./components/page/MineSettingComponent" | ||
| 32 | + | ||
| 33 | +export { AboutPageUI } from "./components/page/about/AboutPageUI" | ||
| 34 | + | ||
| 35 | +export { PrivacySettingComponents } from "./components/page/PrivacySettingComponents" | ||
| 36 | + | ||
| 37 | +export { AppointmentListUI } from "./components/page/mine/AppointmentListUI" | ||
| 38 | + | ||
| 39 | +export { AccountAndSecurityLayout } from "./components/page/AccountAndSecurityLayout" | ||
| 40 | + | ||
| 41 | +export { SettingPasswordLayout } from "./components/page/SettingPasswordLayout" | ||
| 42 | + | ||
| 43 | +export { FollowFirstTabsComponent } from "./components/page/mine/follow/FollowFirstTabsComponent" |
| @@ -4,14 +4,22 @@ import { BannerComponent } from './view/BannerComponent'; | @@ -4,14 +4,22 @@ import { BannerComponent } from './view/BannerComponent'; | ||
| 4 | import { LabelComponent } from './view/LabelComponent'; | 4 | import { LabelComponent } from './view/LabelComponent'; |
| 5 | import { TitleAbbrComponent } from './view/TitleAbbrComponent'; | 5 | import { TitleAbbrComponent } from './view/TitleAbbrComponent'; |
| 6 | import { TitleAllComponent } from './view/TitleAllComponent'; | 6 | import { TitleAllComponent } from './view/TitleAllComponent'; |
| 7 | -import { HorizontalStrokeCardThreeTwoRadioForOneComponent } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; | ||
| 8 | -import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent'; | 7 | +import { |
| 8 | + HorizontalStrokeCardThreeTwoRadioForOneComponent | ||
| 9 | +} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; | ||
| 10 | +import { | ||
| 11 | + HorizontalStrokeCardThreeTwoRadioForMoreComponent | ||
| 12 | +} from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent'; | ||
| 9 | import { BigPicCardComponent } from './view/BigPicCardComponent'; | 13 | import { BigPicCardComponent } from './view/BigPicCardComponent'; |
| 10 | import { TriPicCardComponent } from './view/TriPicCardComponent'; | 14 | import { TriPicCardComponent } from './view/TriPicCardComponent'; |
| 11 | import { HeadPictureCardComponent } from './view/HeadPictureCardComponent'; | 15 | import { HeadPictureCardComponent } from './view/HeadPictureCardComponent'; |
| 12 | 16 | ||
| 13 | import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'; | 17 | import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'; |
| 14 | 18 | ||
| 19 | +import { SmallVideoCardComponent } from './view/SmallVideoCardComponent'; | ||
| 20 | + | ||
| 21 | +import { SmallVideoCardHorComponent } from './view/SmallVideoCardHorComponent'; | ||
| 22 | + | ||
| 15 | /** | 23 | /** |
| 16 | * comp适配器. | 24 | * comp适配器. |
| 17 | */ | 25 | */ |
| @@ -32,7 +40,7 @@ export struct CompParser { | @@ -32,7 +40,7 @@ export struct CompParser { | ||
| 32 | TitleAbbrComponent({ compDTO: compDTO }) | 40 | TitleAbbrComponent({ compDTO: compDTO }) |
| 33 | } else if (compDTO.compStyle === '3') { | 41 | } else if (compDTO.compStyle === '3') { |
| 34 | TitleAllComponent({ compDTO: compDTO }) | 42 | TitleAllComponent({ compDTO: compDTO }) |
| 35 | - } else if (compDTO.compStyle === CompStyle.Carousel_Layout_01) { | 43 | + } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| 36 | BannerComponent({ compDTO: compDTO }) | 44 | BannerComponent({ compDTO: compDTO }) |
| 37 | } else if (compDTO.compStyle === "2") { | 45 | } else if (compDTO.compStyle === "2") { |
| 38 | BigPicCardComponent({ compDTO: compDTO }) | 46 | BigPicCardComponent({ compDTO: compDTO }) |
| @@ -48,7 +56,14 @@ export struct CompParser { | @@ -48,7 +56,14 @@ export struct CompParser { | ||
| 48 | } | 56 | } |
| 49 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | 57 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { |
| 50 | HeadPictureCardComponent({ compDTO: compDTO }) | 58 | HeadPictureCardComponent({ compDTO: compDTO }) |
| 51 | - } else { | 59 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) { |
| 60 | + if (compDTO.operDataList.length > 1) { | ||
| 61 | + SmallVideoCardHorComponent({ compDTO: compDTO }) | ||
| 62 | + } else { | ||
| 63 | + SmallVideoCardComponent({ compDTO: compDTO }) | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + else { | ||
| 52 | // todo:组件未实现 / Component Not Implemented | 67 | // todo:组件未实现 / Component Not Implemented |
| 53 | Text(compDTO.compStyle) | 68 | Text(compDTO.compStyle) |
| 54 | .width(CommonConstants.FULL_PARENT) | 69 | .width(CommonConstants.FULL_PARENT) |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/AccountAndSecurityLayout.ets
0 → 100644
| 1 | +// @ts-nocheck | ||
| 2 | +import { BottomNavi, CommonConstants } from 'wdConstant'; | ||
| 3 | +import { Logger } from 'wdKit'; | ||
| 4 | +import { TopNavigationComponent } from './TopNavigationComponent'; | ||
| 5 | +import { BottomNavDTO } from '../../repository/bean/BottomNavDTO'; | ||
| 6 | +import { UIUtils } from '../../repository/UIUtils'; | ||
| 7 | +import { MinePageComponent } from './MinePageComponent'; | ||
| 8 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 9 | +import MineSettingDatasModel from '../../model/MineSettingDatasModel'; | ||
| 10 | +import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctionItem' | ||
| 11 | + | ||
| 12 | +import storageStatistics from "@ohos.file.storageStatistics"; | ||
| 13 | +import { BusinessError } from '@ohos.base'; | ||
| 14 | +import ArrayList from '@ohos.util.ArrayList'; | ||
| 15 | +import router from '@ohos.router'; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | +@Component | ||
| 19 | +export struct AccountAndSecurityLayout { | ||
| 20 | + @State listData: ArrayList<any> = new ArrayList(); | ||
| 21 | + @State privacySwitch: boolean = false | ||
| 22 | + @State cacheSice: number = 0 | ||
| 23 | + | ||
| 24 | + aboutToAppear() { | ||
| 25 | + // 获取设置页面数据 | ||
| 26 | + this.getAccountAndSecurityData() | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + getAccountAndSecurityData() { | ||
| 30 | + this.listData = MineSettingDatasModel.getAccountAndSecuritySettingData() | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + Navigation() { | ||
| 35 | + //滑动区域 | ||
| 36 | + this.settingList() | ||
| 37 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 38 | + .title('账号与安全') | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + // 页面布局 | ||
| 42 | + @Builder settingList() { | ||
| 43 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 44 | + Column() { | ||
| 45 | + List() { | ||
| 46 | + ForEach(this.listData, (item: MineMainSettingFunctionItem, index: number) => { | ||
| 47 | + ListItem() { | ||
| 48 | + if (item.type == 0) { | ||
| 49 | + Column() { | ||
| 50 | + this.getArrowCell(item) | ||
| 51 | + }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) | ||
| 52 | + } else if (item.type == 1) { | ||
| 53 | + Column() { | ||
| 54 | + this.getSwitchCell(item) | ||
| 55 | + }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) | ||
| 56 | + } else { | ||
| 57 | + Column().width('100%').height('15lpx').backgroundColor(0xf0f0f0) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + .onClick(() => { | ||
| 61 | + console.log(index + "") | ||
| 62 | + if (index == 1) { | ||
| 63 | + router.pushUrl({ | ||
| 64 | + url:"pages/SettingPasswordPage", | ||
| 65 | + params : {'currentType' : 4} | ||
| 66 | + }) | ||
| 67 | + } | ||
| 68 | + }) | ||
| 69 | + | ||
| 70 | + }, item => item) | ||
| 71 | + } | ||
| 72 | + .divider({ | ||
| 73 | + strokeWidth: 1, | ||
| 74 | + startMargin: 15, | ||
| 75 | + endMargin: 10, | ||
| 76 | + color: '#f0f0f0' | ||
| 77 | + }) | ||
| 78 | + .onScrollFrameBegin((offset, state) => { | ||
| 79 | + return { offsetRemain: 0 } | ||
| 80 | + }) | ||
| 81 | + }.height("100%") | ||
| 82 | + | ||
| 83 | + Column() { | ||
| 84 | + Button('退出登录',{ stateEffect: true }).width('90%').height('80lpx').backgroundColor('#da3e22').fontColor('#fff').margin('20lpx').onClick(()=>{ | ||
| 85 | + AlertDialog.show({ | ||
| 86 | + title: '🥟id : ' + "button", | ||
| 87 | + message: '标题:' + '退出登录', | ||
| 88 | + confirm: { | ||
| 89 | + value: "OK", | ||
| 90 | + action: () => { | ||
| 91 | + | ||
| 92 | + }, | ||
| 93 | + } | ||
| 94 | + }) | ||
| 95 | + }) | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + @Builder itemHead(text: string) { | ||
| 102 | + // 列表分组的头部组件,对应联系人分组A、B等位置的组件 | ||
| 103 | + if (text.length > 0) { | ||
| 104 | + Row().width('100%').height('20lpx').backgroundColor(0xf0f0f0) | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + // 右侧开关cell | ||
| 109 | + @Builder getSwitchCell(item: MineMainSettingFunctionItem) { | ||
| 110 | + Column() { | ||
| 111 | + Row() { | ||
| 112 | + // 左侧logo和标题 | ||
| 113 | + Row() { | ||
| 114 | + // 判断有没有图片 | ||
| 115 | + if (item.imgSrc) { | ||
| 116 | + Image(item.imgSrc).height('38lpx').margin({ right: '5lpx' }) | ||
| 117 | + Text(`${item.title}`).margin({ top: '8lpx' }).height('38lpx').fontColor('#333333').fontSize('29lpx') | ||
| 118 | + } else { | ||
| 119 | + Text(`${item.title}`).margin({ top: '8lpx' }).height('38lpx').fontColor('#333333').fontSize('29lpx') | ||
| 120 | + } | ||
| 121 | + }.width('60%') | ||
| 122 | + | ||
| 123 | + // 右侧文案和右箭头 | ||
| 124 | + Row() { | ||
| 125 | + Toggle({ type: ToggleType.Switch, isOn: item.switchState }) | ||
| 126 | + .height('50lpx') | ||
| 127 | + .margin({ left: '81lpx', right: '29lpx' }) | ||
| 128 | + .selectedColor(Color.Pink) | ||
| 129 | + .onChange((isOn: boolean) => { | ||
| 130 | + this.privacySwitch = isOn; | ||
| 131 | + }) | ||
| 132 | + }.width('40%') | ||
| 133 | + .margin({ right: '29lpx' }) | ||
| 134 | + .justifyContent(FlexAlign.End) | ||
| 135 | + | ||
| 136 | + } | ||
| 137 | + .alignItems(VerticalAlign.Center) | ||
| 138 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 139 | + }.height('54lpx') | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + // 右文字+箭头cell | ||
| 143 | + @Builder getArrowCell(item: MineMainSettingFunctionItem) { | ||
| 144 | + Column() { | ||
| 145 | + Row() { | ||
| 146 | + // 左侧logo和标题 | ||
| 147 | + Row() { | ||
| 148 | + // 判断有没有图片 | ||
| 149 | + if (item.imgSrc) { | ||
| 150 | + Image(item.imgSrc) | ||
| 151 | + .height('38lpx') | ||
| 152 | + .margin({ right: '5lpx' }) | ||
| 153 | + } | ||
| 154 | + Text(`${item.title}`) | ||
| 155 | + .margin({ top: '8lpx' }) | ||
| 156 | + .height('38lpx') | ||
| 157 | + .fontColor('#333333') | ||
| 158 | + .fontSize('29lpx') | ||
| 159 | + }.width('60%') | ||
| 160 | + | ||
| 161 | + // 右侧文案和右箭头 | ||
| 162 | + Row() { | ||
| 163 | + Text(item.subTitle ? item.subTitle : '') | ||
| 164 | + .fontColor('#999999') | ||
| 165 | + .maxLines(1) | ||
| 166 | + Image($r('app.media.mine_user_arrow')) | ||
| 167 | + .width('27lpx') | ||
| 168 | + .height('27lpx') | ||
| 169 | + .objectFit(ImageFit.Auto) | ||
| 170 | + Column().width('29lpx') | ||
| 171 | + }.width('40%') | ||
| 172 | + .margin({ right: '29lpx' }) | ||
| 173 | + .justifyContent(FlexAlign.End) | ||
| 174 | + | ||
| 175 | + } | ||
| 176 | + .alignItems(VerticalAlign.Center) | ||
| 177 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 178 | + | ||
| 179 | + } | ||
| 180 | + .height('54lpx') | ||
| 181 | + } | ||
| 182 | +} |
| 1 | -const TAG = 'PageComponent'; | 1 | +import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' |
| 2 | +import MinePageCreatorFunctionsItem from '../../viewmodel/MinePageCreatorFunctionsItem' | ||
| 3 | +import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' | ||
| 4 | +import MinePageDatasModel from '../../model/MinePageDatasModel' | ||
| 5 | +import MinePageUserSimpleInfoUI from '../page/mine/MinePageUserSimpleInfoUI' | ||
| 6 | +import MinePagePersonFunctionUI from '../page/mine/MinePagePersonFunctionUI' | ||
| 7 | +import MinePageCardUI from '../page/mine/MinePageCardUI' | ||
| 8 | +import MinePageCreatorFunctionUI from '../page/mine/MinePageCreatorFunctionUI' | ||
| 9 | +import MinePageMoreFunctionUI from '../page/mine/MinePageMoreFunctionUI' | ||
| 10 | + | ||
| 11 | +const TAG = 'MinePageComponent'; | ||
| 2 | 12 | ||
| 3 | /** | 13 | /** |
| 4 | * 我的页面 | 14 | * 我的页面 |
| 5 | */ | 15 | */ |
| 6 | @Component | 16 | @Component |
| 7 | export struct MinePageComponent { | 17 | export struct MinePageComponent { |
| 8 | - // TODO 待完善 | 18 | + //是否是创作者 |
| 19 | + @State isCreator:boolean = false | ||
| 20 | + @State isLogin:boolean = true | ||
| 21 | + @State personalData:MinePagePersonalFunctionsItem[] = [] | ||
| 22 | + @State creatorData:MinePageCreatorFunctionsItem[] = [] | ||
| 23 | + @State moreData:MinePageMoreFunctionModel[] = [] | ||
| 24 | + scroller: Scroller = new Scroller() | ||
| 25 | + | ||
| 26 | + aboutToAppear(){ | ||
| 27 | + //登录信息 TODO | ||
| 28 | + | ||
| 29 | + this.getFunctionData() | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + getFunctionData(){ | ||
| 33 | + //个人功能数据 | ||
| 34 | + this.personalData = MinePageDatasModel.getPersonalFunctionsData() | ||
| 35 | + //创作者功能数据 | ||
| 36 | + this.creatorData = MinePageDatasModel.getCreatorFunctionsData() | ||
| 37 | + //更多功能数据 | ||
| 38 | + this.moreData = MinePageDatasModel.getMoreFunctionsData() | ||
| 39 | + } | ||
| 40 | + | ||
| 9 | build() { | 41 | build() { |
| 10 | - Text('我的页面') | 42 | + Scroll(this.scroller){ |
| 43 | + Stack(){ | ||
| 44 | + Image($r('app.media.mine_head_bg')) | ||
| 45 | + .width('100%') | ||
| 46 | + .height('657lpx') | ||
| 47 | + .objectFit(ImageFit.Auto) | ||
| 48 | + this.MinePageUI() | ||
| 49 | + } | ||
| 50 | + .alignContent(Alignment.Top) | ||
| 51 | + } | ||
| 52 | + .setFullWidthAndHeight() | ||
| 53 | + .backgroundColor($r('app.color.color_F9F9F9')) | ||
| 54 | + .scrollable(ScrollDirection.Vertical) | ||
| 55 | + .scrollBar(BarState.Off) | ||
| 11 | } | 56 | } |
| 12 | -} | ||
| 13 | 57 | ||
| 58 | + | ||
| 59 | + @Builder MinePageUI(){ | ||
| 60 | + Column(){ | ||
| 61 | + //头像层 | ||
| 62 | + MinePageUserSimpleInfoUI({isLogin:this.isLogin}) | ||
| 63 | + //Grid 区域 | ||
| 64 | + MinePagePersonFunctionUI({personalData:$personalData}) | ||
| 65 | + //Card | ||
| 66 | + MinePageCardUI() | ||
| 67 | + //创作者区域 | ||
| 68 | + | ||
| 69 | + MinePageCreatorFunctionUI({creatorData:$creatorData}) | ||
| 70 | + //更多功能 | ||
| 71 | + MinePageMoreFunctionUI({moreData:$moreData}) | ||
| 72 | + }.width('100%') | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + @Styles setFullWidthAndHeight(){ | ||
| 76 | + .width('100%') | ||
| 77 | + .height('100%') | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | +} |
| 1 | +// @ts-nocheck | ||
| 2 | +import { BottomNavi, CommonConstants } from 'wdConstant'; | ||
| 3 | +import { Logger } from 'wdKit'; | ||
| 4 | +import { TopNavigationComponent } from './TopNavigationComponent'; | ||
| 5 | +import { BottomNavDTO } from '../../repository/bean/BottomNavDTO'; | ||
| 6 | +import { UIUtils } from '../../repository/UIUtils'; | ||
| 7 | +import { MinePageComponent } from './MinePageComponent'; | ||
| 8 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 9 | +import RouteManager from '../../utils/RouteManager' | ||
| 10 | + | ||
| 11 | +import storageStatistics from "@ohos.file.storageStatistics"; | ||
| 12 | +import { BusinessError } from '@ohos.base'; | ||
| 13 | +import RouteManager from '../../utils/RouteManager' | ||
| 14 | +import router from '@ohos.router'; | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +@Component | ||
| 18 | +export struct MineSettingComponent { | ||
| 19 | + @State listData: Array<string | Array<string>> = new Array(); | ||
| 20 | + @State privacySwitch: boolean = false | ||
| 21 | + @State cacheSice: number = 0 | ||
| 22 | + | ||
| 23 | + aboutToAppear() { | ||
| 24 | + // 获取设置页面数据 | ||
| 25 | + this.getSettingPageData() | ||
| 26 | + | ||
| 27 | + // 获取缓存数据 | ||
| 28 | + storageStatistics.getCurrentBundleStats((err: BusinessError, bundleStats: storageStatistics.BundleStats) => { | ||
| 29 | + if (err) { | ||
| 30 | + console.error(`Invoke getCurrentBundleStats failed, code is ${err.code}, message is ${err.message}`); | ||
| 31 | + } else { | ||
| 32 | + this.cacheSice = bundleStats.appSize / 1024.00 / 1024.00.toFixed(2); | ||
| 33 | + } | ||
| 34 | + }); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + getSettingPageData() { | ||
| 38 | + let listArr = [['账户与安全', '接收推送', '隐私设罝', '仅WiFi网络加载图片', 'WiFi网络情况下自动播放视频', '开户播放器悬浮窗'], ['清除缓存', '去评分']]; | ||
| 39 | + this.listData = listArr; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + build() { | ||
| 43 | + Navigation() { | ||
| 44 | + //滑动区域 | ||
| 45 | + this.settingList() | ||
| 46 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 47 | + .title('设置') | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + // 页面布局 | ||
| 51 | + @Builder settingList() { | ||
| 52 | + Column() { | ||
| 53 | + List() { | ||
| 54 | + // 循环渲染ListItemGroup,contactsGroups为多个分组联系人contacts和标题title的数据集合 | ||
| 55 | + ForEach(this.listData, (item: Array<string>, index: number) => { | ||
| 56 | + ListItemGroup({ header: index === 0 ? this.itemHead("") : this.itemHead("1") }) { | ||
| 57 | + // 循环渲染ListItem | ||
| 58 | + ForEach(item, (subItem: string, subIndex: number) => { | ||
| 59 | + ListItem() { | ||
| 60 | + if (subIndex == 6) { | ||
| 61 | + this.getArrowCell(subItem, subIndex, index) | ||
| 62 | + } else if (subIndex == 1 || subIndex == 3 || subIndex == 4 || subIndex == 5) { | ||
| 63 | + this.getSwitchCell(subItem, subIndex) | ||
| 64 | + } else { | ||
| 65 | + this.getArrowCell(subItem, subIndex, index) | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + }.padding({ left: '27lpx' }) | ||
| 69 | + .onClick(() => { | ||
| 70 | + | ||
| 71 | + // // 在Home页面中 | ||
| 72 | + // let paramsInfo: object = { | ||
| 73 | + // pageId: 123, | ||
| 74 | + // pageType:'AccountAndSecurityLayout' | ||
| 75 | + // }; | ||
| 76 | + console.log(subIndex + "") | ||
| 77 | + if (subIndex == 0) { | ||
| 78 | + // router.pushUrl({ | ||
| 79 | + // url:"pages/SettingPasswordPage", | ||
| 80 | + // params : {'currentType' : 4} | ||
| 81 | + // }) | ||
| 82 | + | ||
| 83 | + router.pushUrl({ | ||
| 84 | + url:"pages/SettingPage", | ||
| 85 | + params : {'pageType' : 'AccountAndSecurityLayout'} | ||
| 86 | + }) | ||
| 87 | + //SettingPage | ||
| 88 | + // RouteManager.jumpNewPage("pages/SettingPasswordPage", {'currentType' : 4}) // 调用跳转方法,跳转新页面 | ||
| 89 | + }else if (subIndex == 2) { | ||
| 90 | + // RouteManager.jumpNewPage("pages/SettingPage") // 调用跳转方法,跳转新页面 | ||
| 91 | + RouteManager.jumpNewPage("pages/PrivacySettingPage") | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + }) | ||
| 95 | + .height('117lpx') | ||
| 96 | + }, subItem => subItem) | ||
| 97 | + } | ||
| 98 | + .divider({ | ||
| 99 | + strokeWidth: 1, | ||
| 100 | + startMargin: 15, | ||
| 101 | + endMargin: 10, | ||
| 102 | + color: '#f0f0f0' | ||
| 103 | + }) | ||
| 104 | + }) | ||
| 105 | + }.onScrollFrameBegin((offset, state) => { | ||
| 106 | + return { offsetRemain: 0 } | ||
| 107 | + }) | ||
| 108 | + } | ||
| 109 | + .backgroundColor(Color.White) | ||
| 110 | + .borderRadius(8) | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + @Builder itemHead(text: string) { | ||
| 114 | + // 列表分组的头部组件,对应联系人分组A、B等位置的组件 | ||
| 115 | + if (text.length > 0) { | ||
| 116 | + Row().width('100%').height('20lpx').backgroundColor(0xf0f0f0) | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + // 右侧开关cell | ||
| 121 | + @Builder getSwitchCell(item, index) { | ||
| 122 | + Column() { | ||
| 123 | + Row() { | ||
| 124 | + // 左侧logo和标题 | ||
| 125 | + Row() { | ||
| 126 | + // 判断有没有图片 | ||
| 127 | + if (0) { | ||
| 128 | + Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000') | ||
| 129 | + .height('38lpx') | ||
| 130 | + .margin({ right: '5lpx' }) | ||
| 131 | + | ||
| 132 | + Text(`${item}`) | ||
| 133 | + .margin({ top: '8lpx' }) | ||
| 134 | + .height('38lpx') | ||
| 135 | + .fontColor('#333333') | ||
| 136 | + .fontSize('29lpx') | ||
| 137 | + } else { | ||
| 138 | + Text(`${item}`) | ||
| 139 | + .margin({ top: '8lpx' }) | ||
| 140 | + .height('38lpx') | ||
| 141 | + .fontColor('#333333') | ||
| 142 | + .fontSize('29lpx') | ||
| 143 | + } | ||
| 144 | + }.width('60%') | ||
| 145 | + | ||
| 146 | + // 右侧文案和右箭头 | ||
| 147 | + Row() { | ||
| 148 | + Toggle({ type: ToggleType.Switch, isOn: false }) | ||
| 149 | + .height('50lpx') | ||
| 150 | + .margin({ left: '81lpx', right: '29lpx' }) | ||
| 151 | + .selectedColor(Color.Pink) | ||
| 152 | + .onChange((isOn: boolean) => { | ||
| 153 | + this.privacySwitch = isOn; | ||
| 154 | + }) | ||
| 155 | + }.width('40%') | ||
| 156 | + .margin({ right: '29lpx' }) | ||
| 157 | + .justifyContent(FlexAlign.End) | ||
| 158 | + | ||
| 159 | + } | ||
| 160 | + .alignItems(VerticalAlign.Center) | ||
| 161 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 162 | + }.height('54lpx') | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + // 右文字+箭头cell | ||
| 166 | + @Builder getArrowCell(item, index, mainIndex) { | ||
| 167 | + Column() { | ||
| 168 | + | ||
| 169 | + Row() { | ||
| 170 | + // 左侧logo和标题 | ||
| 171 | + Row() { | ||
| 172 | + // 判断有没有图片 | ||
| 173 | + if (this.privacySwitch) { | ||
| 174 | + Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000') | ||
| 175 | + .height('38lpx') | ||
| 176 | + .margin({ right: '5lpx' }) | ||
| 177 | + } | ||
| 178 | + Text(`${item}`) | ||
| 179 | + .margin({ top: '8lpx' }) | ||
| 180 | + .height('38lpx') | ||
| 181 | + .fontColor('#333333') | ||
| 182 | + .fontSize('29lpx') | ||
| 183 | + }.width('60%') | ||
| 184 | + | ||
| 185 | + // 右侧文案和右箭头 | ||
| 186 | + Row() { | ||
| 187 | + Text((index == 0 && mainIndex != 0) ? this.cacheSice.toFixed(2) + 'MB' : '') | ||
| 188 | + .fontColor('#999999') | ||
| 189 | + .maxLines(1) | ||
| 190 | + Image($r('app.media.mine_user_arrow')) | ||
| 191 | + .width('27lpx') | ||
| 192 | + .height('27lpx') | ||
| 193 | + .objectFit(ImageFit.Auto) | ||
| 194 | + Column().width('29lpx') | ||
| 195 | + }.width('40%') | ||
| 196 | + .margin({ right: '29lpx' }) | ||
| 197 | + .justifyContent(FlexAlign.End) | ||
| 198 | + | ||
| 199 | + } | ||
| 200 | + .alignItems(VerticalAlign.Center) | ||
| 201 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 202 | + | ||
| 203 | + } | ||
| 204 | + .height('54lpx') | ||
| 205 | + } | ||
| 206 | +} |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/PrivacySettingComponents.ets
0 → 100644
| 1 | +import dataPreferences from '@ohos.data.preferences'; | ||
| 2 | +import { PermissionUtil } from 'wdKit' | ||
| 3 | +import { SPHelper } from 'wdKit' | ||
| 4 | +import hilog from '@ohos.hilog'; | ||
| 5 | +import { PrivacySettingModel } from '../../viewmodel/PrivacySettingModel' | ||
| 6 | + | ||
| 7 | +const TAG = 'PrivacySettingComponents'; | ||
| 8 | + | ||
| 9 | +@Component | ||
| 10 | +export struct PrivacySettingComponents { | ||
| 11 | + @State listData: Array<PrivacySettingModel> = [new PrivacySettingModel('开启个性推荐', false, null), new PrivacySettingModel('相册权限', false, 'ohos.permission.READ_MEDIA'), new PrivacySettingModel('相机权限', false, 'ohos.permission.CAMERA'), new PrivacySettingModel('定位权限', false, 'ohos.permission.LOCATION'), new PrivacySettingModel('麦克风权限', false, 'ohos.permission.MICROPHONE')]; | ||
| 12 | + @State tips: string = '设置前可查阅' | ||
| 13 | + @State privacyTips: string = '《隐私政策》' | ||
| 14 | + | ||
| 15 | + aboutToAppear() { | ||
| 16 | + // 获取权限= | ||
| 17 | + // SPHelper.default.save('sdf','sdf'); | ||
| 18 | + // this.initListData(); | ||
| 19 | + this.getPermissionStatus(); | ||
| 20 | + RefreshStatus; | ||
| 21 | + | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + // initListData(){ | ||
| 25 | + // let model1 = new PrivacySettingModel('开启个性推荐', false, null); | ||
| 26 | + // let model2 = new PrivacySettingModel('相册权限', false, 'ohos.permission.READ_MEDIA'); | ||
| 27 | + // let model3 = new PrivacySettingModel('相机权限', false, 'ohos.permission.CAMERA'); | ||
| 28 | + // let model4 = new PrivacySettingModel('定位权限', false, 'ohos.permission.LOCATION'); | ||
| 29 | + // let model5 = new PrivacySettingModel('麦克风权限', false, 'ohos.permission.MICROPHONE'); | ||
| 30 | + // | ||
| 31 | + // this.listData.push(model1, model2, model3, model4, model5); | ||
| 32 | + // } | ||
| 33 | + | ||
| 34 | + async getPermissionStatus() { | ||
| 35 | + const permissionUtil = new PermissionUtil(); | ||
| 36 | + for (const element of this.listData) { | ||
| 37 | + if (!element.permissionKey) { | ||
| 38 | + continue; | ||
| 39 | + } | ||
| 40 | + const result = await permissionUtil.checkPermissions(element.permissionKey); | ||
| 41 | + element.permission = result; | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + build() { | ||
| 46 | + Navigation() { | ||
| 47 | + //滑动区域 | ||
| 48 | + this.PrivacySettingComponentsUI() | ||
| 49 | + | ||
| 50 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 51 | + .title('隐私设置') | ||
| 52 | + .backgroundColor('#F8F8F8') | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + @Builder PrivacySettingComponentsUI() { | ||
| 56 | + Column() { | ||
| 57 | + | ||
| 58 | + List({ space: '23lpx' }) { | ||
| 59 | + ForEach(this.listData, (item: PrivacySettingModel, index) => { | ||
| 60 | + ListItem() { | ||
| 61 | + if (index == 0) { | ||
| 62 | + getTuiJianCell({ item, index }); | ||
| 63 | + } else { | ||
| 64 | + getArrowCell({ item, index }); | ||
| 65 | + } | ||
| 66 | + }.onClick(() => { | ||
| 67 | + if (index != 0) { | ||
| 68 | + if (!item.permission) { | ||
| 69 | + //跳转权限设置 | ||
| 70 | + const permissionUtil = new PermissionUtil(); | ||
| 71 | + PermissionUtil.reqPermissionsFromUser([item.permissionKey]); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + }) | ||
| 75 | + }, item => item) | ||
| 76 | + } | ||
| 77 | + .padding({ left: '29lpx', right: '29lpx' }) | ||
| 78 | + .margin({ top: '38lpx' }) | ||
| 79 | + | ||
| 80 | + Row() { | ||
| 81 | + Text(this.tips) | ||
| 82 | + .fontSize('25lpx') | ||
| 83 | + .textAlign(TextAlign.Start) | ||
| 84 | + .fontColor($r("app.color.color_666666")) | ||
| 85 | + .margin({ left: '29lpx', top: '46lpx' }) | ||
| 86 | + // .backgroundColor(Color.Orange) | ||
| 87 | + Text(this.privacyTips) | ||
| 88 | + .fontSize('25lpx') | ||
| 89 | + .textAlign(TextAlign.Start) | ||
| 90 | + .fontColor('#ED2800') | ||
| 91 | + .margin({ top: '46lpx' }) | ||
| 92 | + .onClick(() => { | ||
| 93 | + //跳转隐私政策 | ||
| 94 | + }) | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + } | ||
| 98 | + .width('100%') | ||
| 99 | + .height('100%') | ||
| 100 | + .backgroundColor('#F8F8F8') | ||
| 101 | + .alignItems(HorizontalAlign.Start) | ||
| 102 | + } | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | + | ||
| 106 | +@Component | ||
| 107 | +struct getArrowCell { | ||
| 108 | + @ObjectLink item: PrivacySettingModel; | ||
| 109 | + index; | ||
| 110 | + // 右文字+箭头cell | ||
| 111 | + // @Builder getArrowCell(item:PrivacySettingModel, index) { | ||
| 112 | + build() { | ||
| 113 | + Row() { | ||
| 114 | + // 左侧标题 | ||
| 115 | + Text(this.item.privacyName) | ||
| 116 | + .fontColor('#666666') | ||
| 117 | + .fontSize('31lpx') | ||
| 118 | + | ||
| 119 | + Row() { | ||
| 120 | + Text(this.item.permission ? '已开启' : '去设置') | ||
| 121 | + .fontColor(this.item.permission ? '#666666' : '#CCCCCC') | ||
| 122 | + .fontSize('31lpx') | ||
| 123 | + .margin({ right: '8lpx' }) | ||
| 124 | + | ||
| 125 | + Image($r('app.media.mine_user_arrow')) | ||
| 126 | + .width('27lpx') | ||
| 127 | + .height('27lpx') | ||
| 128 | + .objectFit(ImageFit.Auto) | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + } | ||
| 132 | + .alignItems(VerticalAlign.Center) | ||
| 133 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 134 | + .height('97lpx') | ||
| 135 | + .width('100%') | ||
| 136 | + .padding({ left: '29lpx', right: '29lpx' }) | ||
| 137 | + .backgroundColor('#FFFFFF') | ||
| 138 | + .borderRadius('8lpx') | ||
| 139 | + } | ||
| 140 | +} | ||
| 141 | + | ||
| 142 | +@Component | ||
| 143 | +struct getTuiJianCell { | ||
| 144 | + @ObjectLink item: PrivacySettingModel; | ||
| 145 | + index; | ||
| 146 | + | ||
| 147 | + build() { | ||
| 148 | + //@Builder getTuiJianCell(item:PrivacySettingModel, index) | ||
| 149 | + Column() { | ||
| 150 | + | ||
| 151 | + Row() { | ||
| 152 | + // 左侧标题 | ||
| 153 | + Text(this.item.privacyName) | ||
| 154 | + .fontColor('#666666') | ||
| 155 | + .fontSize('31lpx') | ||
| 156 | + | ||
| 157 | + Row() { | ||
| 158 | + Toggle({ type: ToggleType.Switch, isOn: this.item.permission }) | ||
| 159 | + .height('58lpx') | ||
| 160 | + .width('96lpx') | ||
| 161 | + // .selectedColor(Color.Pink) | ||
| 162 | + .onChange((isOn: boolean) => { | ||
| 163 | + // this.privacySwitch = isOn; | ||
| 164 | + }) | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + } | ||
| 168 | + .alignItems(VerticalAlign.Center) | ||
| 169 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 170 | + .height('97lpx') | ||
| 171 | + .width('100%') | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + Blank() | ||
| 175 | + .backgroundColor('#EDEDED') | ||
| 176 | + .height('1lpx') | ||
| 177 | + | ||
| 178 | + Text('关闭后,将无法看到个性化推荐的服务') | ||
| 179 | + .fontColor('#999999') | ||
| 180 | + .fontSize('23lpx') | ||
| 181 | + .margin({ right: '8lpx' }) | ||
| 182 | + .height('69lpx') | ||
| 183 | + | ||
| 184 | + } | ||
| 185 | + .alignItems(HorizontalAlign.Start) | ||
| 186 | + .backgroundColor('#FFFFFF') | ||
| 187 | + .borderRadius('8lpx') | ||
| 188 | + .padding({ left: '29lpx', right: '29lpx' }) | ||
| 189 | + } | ||
| 190 | +} |
| 1 | +import ArrayList from '@ohos.util.ArrayList'; | ||
| 2 | +import promptAction from '@ohos.promptAction'; | ||
| 3 | + | ||
| 4 | +export default class AccoutPageDataModel { | ||
| 5 | + // 页面数据 | ||
| 6 | + compType: number // 0:标题 / 1:密码输入框 / 2:验证码输入框 / 3:desc描述 / 4:按钮 / 5:logo / 6:子标题 7:手机号输入框 7:空白 | ||
| 7 | + compLogo: string | ||
| 8 | + compTitle: string | ||
| 9 | + compSubTitle: string | ||
| 10 | + compDesc: string | ||
| 11 | + compButtonTitle: string | ||
| 12 | + inputPlacholder: string | ||
| 13 | + inputTag: number | ||
| 14 | + | ||
| 15 | + constructor(compType: number, compTitle: string, compLogo: string, compDesc: string, compButtonTitle: string, inputPlacholder: string, inputTag: number) { | ||
| 16 | + this.compType = compType | ||
| 17 | + this.compTitle = compTitle | ||
| 18 | + this.compLogo = compLogo | ||
| 19 | + this.compDesc = compDesc | ||
| 20 | + this.compButtonTitle = compButtonTitle | ||
| 21 | + this.inputPlacholder = inputPlacholder | ||
| 22 | + this.inputTag = inputTag | ||
| 23 | + } | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +@Component | ||
| 27 | +export struct SettingPasswordLayout { | ||
| 28 | + @State listData: Array<AccoutPageDataModel> = new Array(); // 页面配置数据 | ||
| 29 | + @State btnStatus: boolean = false | ||
| 30 | + password01: string | ||
| 31 | + password02: string | ||
| 32 | + passwordOri: string | ||
| 33 | + | ||
| 34 | + aboutToAppear() { | ||
| 35 | + this.getPageListData(4) | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + getPageListData(pageId:number) { | ||
| 39 | + switch (pageId) { | ||
| 40 | + case 0: | ||
| 41 | + // 验证/更换手机号 | ||
| 42 | + this.listData.push(new AccoutPageDataModel(0, '更换手机号', null, null, null, null, null)) | ||
| 43 | + this.listData.push(new AccoutPageDataModel(7, null, null, null, null, '请输入手机号', 10010)) | ||
| 44 | + this.listData.push(new AccoutPageDataModel(2, null, null, null, null, '验证码', 10088)) | ||
| 45 | + this.listData.push(new AccoutPageDataModel(4, null, null, null, '确认', null, null)) | ||
| 46 | + break; | ||
| 47 | + | ||
| 48 | + case 1: | ||
| 49 | + // 设置密码 | ||
| 50 | + this.listData.push(new AccoutPageDataModel(0, '设置密码', null, null, null, null, null)) | ||
| 51 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '请输入密码', 10086)) | ||
| 52 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '再次输入密码', 10087)) | ||
| 53 | + this.listData.push(new AccoutPageDataModel(4, null, null, '提示:密码长度6-20位,需答谢字母、小写字母、数字、特殊字符中组合三种及三种以上组成', null, null, null)) | ||
| 54 | + this.listData.push(new AccoutPageDataModel(5, null, null, null, '确认', null, null)) | ||
| 55 | + break; | ||
| 56 | + | ||
| 57 | + case 2: | ||
| 58 | + // 修改密码 | ||
| 59 | + this.listData.push(new AccoutPageDataModel(0, '修改密码', null, null, null, null, null)) | ||
| 60 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '请输入原密码', 10010)) | ||
| 61 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '请输入新密码', 10086)) | ||
| 62 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '请再请输入原密码', 10087)) | ||
| 63 | + this.listData.push(new AccoutPageDataModel(3, null, null, '提示:密码长度6-20位,需答谢字母、小写字母、数字、特殊字符中组合三种及三种以上组成', null, null, null)) | ||
| 64 | + this.listData.push(new AccoutPageDataModel(4, null, null, null, '确认', null, null)) | ||
| 65 | + this.listData.push(new AccoutPageDataModel(3, null, null, '忘记密码', null, null, null)) | ||
| 66 | + break; | ||
| 67 | + | ||
| 68 | + case 3: | ||
| 69 | + // 绑定手机号 | ||
| 70 | + this.listData.push(new AccoutPageDataModel(0, '绑定手机号', null, null, null, null, null)) | ||
| 71 | + this.listData.push(new AccoutPageDataModel(7, null, null, null, null, '请输入手机号', 10010)) | ||
| 72 | + this.listData.push(new AccoutPageDataModel(2, null, null, null, null, '验证码', 10088)) | ||
| 73 | + this.listData.push(new AccoutPageDataModel(4, null, null, null, '确认', null, null)) | ||
| 74 | + break; | ||
| 75 | + | ||
| 76 | + case 4: | ||
| 77 | + // 有logo的 | ||
| 78 | + this.listData.push(new AccoutPageDataModel(5, null, 'https://img-blog.csdnimg.cn/24f43f4d626d428891ebb2adb5c2c2e9.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5YyX5aSn5Z-55paH5byg6ICB5biI,size_20,color_FFFFFF,t_70,g_se,x_16', null, null, null , null)) | ||
| 79 | + this.listData.push(new AccoutPageDataModel(0, '修改密码', null, null, null, null, null)) | ||
| 80 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '请输入原密码', 10010)) | ||
| 81 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '请输入新密码', 10086)) | ||
| 82 | + this.listData.push(new AccoutPageDataModel(1, null, null, null, null, '请再请输入原密码', 10087)) | ||
| 83 | + this.listData.push(new AccoutPageDataModel(2, null, null, null, null, '验证码', 10088)) | ||
| 84 | + this.listData.push(new AccoutPageDataModel(3, null, null, '提示:密码长度6-20位,需答谢字母、小写字母、数字、特殊字符中组合三种及三种以上组成', null, null, null)) | ||
| 85 | + this.listData.push(new AccoutPageDataModel(4, null, null, null, '确认', null, null)) | ||
| 86 | + this.listData.push(new AccoutPageDataModel(3, null, null, '忘记密码', null, null, null)) | ||
| 87 | + break; | ||
| 88 | + | ||
| 89 | + default: | ||
| 90 | + break; | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + build() { | ||
| 95 | + Navigation() { | ||
| 96 | + this.settingList() //滑动区域 | ||
| 97 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 98 | + .title('') | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + // 页面布局 | ||
| 102 | + @Builder settingList() { | ||
| 103 | + Column() { | ||
| 104 | + List() { | ||
| 105 | + ForEach(this.listData, (item: AccoutPageDataModel, index: number) => { | ||
| 106 | + ListItem() { | ||
| 107 | + if (item.compType == 0) { | ||
| 108 | + this.getTitleCell(item, HorizontalAlign.Start) | ||
| 109 | + } else if (item.compType == 1) { | ||
| 110 | + this.getPasswordCell(item) | ||
| 111 | + } else if (item.compType == 2) { | ||
| 112 | + this.getCodeCell(item) | ||
| 113 | + } else if (item.compType == 3) { | ||
| 114 | + if (index == this.listData.length - 1) { | ||
| 115 | + this.getDescCell(item, HorizontalAlign.Center) | ||
| 116 | + } else { | ||
| 117 | + this.getDescCell(item, HorizontalAlign.Start) | ||
| 118 | + } | ||
| 119 | + } else if (item.compType == 4) { | ||
| 120 | + this.getButtonCell(item) | ||
| 121 | + } else if (item.compType == 5) { | ||
| 122 | + this.getLogoCell(item) | ||
| 123 | + } else if (item.compType == 7) { | ||
| 124 | + this.getPhoneCell(item) | ||
| 125 | + } else { | ||
| 126 | + Text('' + item.compType) | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + }) | ||
| 130 | + } | ||
| 131 | + // .divider({ | ||
| 132 | + // strokeWidth: 1, | ||
| 133 | + // startMargin: 15, | ||
| 134 | + // endMargin: 10, | ||
| 135 | + // color: '#f0f0f0' | ||
| 136 | + // }) | ||
| 137 | + }.width('100%').padding('30lpx') | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + /***************************** UI元素 ******************************************/ | ||
| 141 | + | ||
| 142 | + // 标题 | ||
| 143 | + @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { | ||
| 144 | + Column() { | ||
| 145 | + Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1) | ||
| 146 | + } | ||
| 147 | + .width('100%') | ||
| 148 | + .height('75lpx') | ||
| 149 | + .alignItems(alignTitle) | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + // 密码输入框 | ||
| 153 | + @Builder getPasswordCell(item: AccoutPageDataModel) { | ||
| 154 | + Row() { | ||
| 155 | + Row() { | ||
| 156 | + TextInput({ placeholder: item.inputPlacholder }) | ||
| 157 | + .type(InputType.Password) | ||
| 158 | + .backgroundColor('#00000000') | ||
| 159 | + .onChange((value: string) => { | ||
| 160 | + this.inputTextChange(value, item.inputTag) | ||
| 161 | + }) | ||
| 162 | + .onSubmit((EnterKeyType) => { | ||
| 163 | + promptAction.showToast({ message: 'submit' }) | ||
| 164 | + }) | ||
| 165 | + } | ||
| 166 | + .alignItems(VerticalAlign.Center) | ||
| 167 | + .height('80lpx') | ||
| 168 | + .backgroundColor('#f5f5f5') | ||
| 169 | + .borderRadius('4vp') | ||
| 170 | + } | ||
| 171 | + .width('100%') | ||
| 172 | + .height('110lpx') | ||
| 173 | + .backgroundColor(0xffffff0) | ||
| 174 | + .alignItems(VerticalAlign.Center) | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + // 手机号输入框 | ||
| 178 | + @Builder getPhoneCell(item: AccoutPageDataModel) { | ||
| 179 | + Row() { | ||
| 180 | + Row() { | ||
| 181 | + TextInput({ placeholder: item.inputPlacholder }) | ||
| 182 | + .backgroundColor('#00000000') | ||
| 183 | + .onChange((value: string) => { | ||
| 184 | + this.inputTextChange(value, item.inputTag) | ||
| 185 | + }) | ||
| 186 | + .onSubmit((EnterKeyType) => { | ||
| 187 | + promptAction.showToast({ message: 'submit' }) | ||
| 188 | + }) | ||
| 189 | + } | ||
| 190 | + .alignItems(VerticalAlign.Center) | ||
| 191 | + .height('80lpx') | ||
| 192 | + .backgroundColor('#f5f5f5') | ||
| 193 | + .borderRadius('4vp') | ||
| 194 | + } | ||
| 195 | + .width('100%') | ||
| 196 | + .height('110lpx') | ||
| 197 | + .backgroundColor(0xffffff0) | ||
| 198 | + .alignItems(VerticalAlign.Center) | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + // 验证码码输入框 | ||
| 202 | + @Builder getCodeCell(item: AccoutPageDataModel) { | ||
| 203 | + Row() { | ||
| 204 | + Stack() { | ||
| 205 | + Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp') | ||
| 206 | + Row() { | ||
| 207 | + TextInput({ placeholder: item.inputPlacholder }) | ||
| 208 | + .backgroundColor('#00000000') | ||
| 209 | + .width('67.28%') | ||
| 210 | + .onChange((value: string) => { | ||
| 211 | + this.inputTextChange(value, item.inputTag) | ||
| 212 | + }) | ||
| 213 | + Button('发送验证码') | ||
| 214 | + .width('32.71%') | ||
| 215 | + .backgroundColor('#00000000') | ||
| 216 | + .fontColor('#da3e22') | ||
| 217 | + } | ||
| 218 | + .width('100%') | ||
| 219 | + }.height('80lpx') | ||
| 220 | + } | ||
| 221 | + .width('100%') | ||
| 222 | + .height('110lpx') | ||
| 223 | + .backgroundColor(0xffffff0) | ||
| 224 | + .alignItems(VerticalAlign.Center) | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + // desc | ||
| 228 | + @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { | ||
| 229 | + Column() { | ||
| 230 | + Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) | ||
| 231 | + .onClick(()=>{ | ||
| 232 | + if (item.compDesc == '忘记密码') { | ||
| 233 | + promptAction.showToast({ message: '密码不符合密码规范' }) | ||
| 234 | + } | ||
| 235 | + }) | ||
| 236 | + } | ||
| 237 | + .width('100%') | ||
| 238 | + .height('85lpx') | ||
| 239 | + .alignItems(alignTitle) | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + // 按钮 | ||
| 243 | + @Builder getButtonCell(item: AccoutPageDataModel) { | ||
| 244 | + Row() { | ||
| 245 | + Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true }) | ||
| 246 | + .width('100%') | ||
| 247 | + .height('80lpx') | ||
| 248 | + .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d') | ||
| 249 | + .fontColor('#fff') | ||
| 250 | + .borderRadius('4vp') | ||
| 251 | + .onClick(() => { | ||
| 252 | + this.buttonClick() | ||
| 253 | + }) | ||
| 254 | + } | ||
| 255 | + .padding({top:'25lpx'}) | ||
| 256 | + .alignItems(VerticalAlign.Center) | ||
| 257 | + .width('100%') | ||
| 258 | + .height('120lpx') | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + // 标题 | ||
| 262 | + @Builder getLogoCell(item: AccoutPageDataModel) { | ||
| 263 | + Column() { | ||
| 264 | + Image(item.compLogo).height('150lpx').width('150lpx') | ||
| 265 | + } | ||
| 266 | + .width('100%') | ||
| 267 | + .height('200lpx') | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + /***************************** 事件处理 ******************************************/ | ||
| 271 | + // 提交按钮点击事件 | ||
| 272 | + buttonClick() { | ||
| 273 | + if (this.btnStatus) { | ||
| 274 | + // 需要+手机号校验 | ||
| 275 | + if (this.password01.length < 6 || this.password01.length > 20) { | ||
| 276 | + promptAction.showToast({ message: '密码不符合密码规范' }) | ||
| 277 | + return | ||
| 278 | + } | ||
| 279 | + | ||
| 280 | + promptAction.showToast({ message: '请求接口' }) | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + // 输入框数据变动:输入数据处理 | ||
| 285 | + inputTextChange(text: string, tag: number) { | ||
| 286 | + if (tag == 10086) { | ||
| 287 | + this.password01 = text; | ||
| 288 | + } else if (tag == 10087) { | ||
| 289 | + this.password02 = text; | ||
| 290 | + } else { | ||
| 291 | + this.passwordOri = text; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + if (this.password01) { | ||
| 295 | + if (this.password01 == this.password02 && this.password01.length >= 6 && this.password01.length <= 20) { | ||
| 296 | + this.btnStatus = true; | ||
| 297 | + } else { | ||
| 298 | + this.btnStatus = false; | ||
| 299 | + } | ||
| 300 | + } | ||
| 301 | + } | ||
| 302 | +} |
| 1 | +const TAG = 'AboutPageUI'; | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct AboutPageUI { | ||
| 5 | + @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议']; | ||
| 6 | + @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.' | ||
| 7 | + @State version: string = '版本号:v8.0.1.1' | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Navigation() { | ||
| 12 | + //滑动区域 | ||
| 13 | + this.aboutUi() | ||
| 14 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 15 | + .title('关于') | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + @Builder aboutUi() { | ||
| 19 | + Column() { | ||
| 20 | + Image($r('app.media.setting_about_logo')) | ||
| 21 | + .width('278lpx') | ||
| 22 | + .height('154lpx') | ||
| 23 | + .margin({top:'173lpx',bottom:'154lpx'}) | ||
| 24 | + | ||
| 25 | + // Row(){ | ||
| 26 | + // | ||
| 27 | + // }.backgroundColor(Color.Yellow) | ||
| 28 | + // .width('100%') | ||
| 29 | + // .height('97lpx') | ||
| 30 | + | ||
| 31 | + // Row(){ | ||
| 32 | + // | ||
| 33 | + // }.backgroundColor(Color.Yellow) | ||
| 34 | + // .width('100%') | ||
| 35 | + // .height('97lpx') | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + List(){ | ||
| 41 | + ForEach(this.listData, (item, index) =>{ | ||
| 42 | + ListItem() { | ||
| 43 | + this.getArrowCell(item, index) | ||
| 44 | + } | ||
| 45 | + }, item => item) | ||
| 46 | + }.divider({ | ||
| 47 | + strokeWidth: 1, | ||
| 48 | + startMargin: '29lpx', | ||
| 49 | + endMargin: '29lpx', | ||
| 50 | + color: '#EDEDED' | ||
| 51 | + }) | ||
| 52 | + | ||
| 53 | + Blank() | ||
| 54 | + | ||
| 55 | + Image($r('app.media.app_icon')) | ||
| 56 | + .width('192lpx') | ||
| 57 | + .height('192lpx') | ||
| 58 | + | ||
| 59 | + Text(this.version) | ||
| 60 | + .fontSize('25lpx') | ||
| 61 | + .textAlign(TextAlign.Center) | ||
| 62 | + .fontColor($r("app.color.color_666666")) | ||
| 63 | + .margin({bottom:'31lpx'}) | ||
| 64 | + | ||
| 65 | + Text(this.message) | ||
| 66 | + .fontSize('19lpx') | ||
| 67 | + .textAlign(TextAlign.Center) | ||
| 68 | + .fontColor($r("app.color.color_999999")) | ||
| 69 | + .margin({bottom:'35lpx'}) | ||
| 70 | + } | ||
| 71 | + .width('100%') | ||
| 72 | + .height('100%') | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + | ||
| 77 | + // 右文字+箭头cell | ||
| 78 | + @Builder getArrowCell(item, index) { | ||
| 79 | + | ||
| 80 | + Row() { | ||
| 81 | + // 左侧标题 | ||
| 82 | + Text(`${item}`) | ||
| 83 | + .fontColor('#666666') | ||
| 84 | + .fontSize('31lpx') | ||
| 85 | + | ||
| 86 | + Image($r('app.media.mine_user_arrow')) | ||
| 87 | + .width('27lpx') | ||
| 88 | + .height('27lpx') | ||
| 89 | + .objectFit(ImageFit.Auto) | ||
| 90 | + } | ||
| 91 | + .alignItems(VerticalAlign.Center) | ||
| 92 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 93 | + .height('97lpx') | ||
| 94 | + .width('100%') | ||
| 95 | + .padding({left:'29lpx',right:'29lpx'}) | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + | ||
| 99 | +} | ||
| 100 | + | ||
| 101 | + |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/AppointmentListChildComponent.ets
0 → 100644
| 1 | +import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct AppointmentListChildComponent{ | ||
| 5 | + @ObjectLink item: MineAppointmentItem | ||
| 6 | + | ||
| 7 | + build() { | ||
| 8 | + Column(){ | ||
| 9 | + Stack(){ | ||
| 10 | + Image(this.item?.imageUrl[0]) | ||
| 11 | + .objectFit(ImageFit.Auto) | ||
| 12 | + | ||
| 13 | + if(this.item.relType === 1){ | ||
| 14 | + Row(){ | ||
| 15 | + Row(){ | ||
| 16 | + Image($r('app.media.reserve_icon')) | ||
| 17 | + .width('42lpx') | ||
| 18 | + .height('35lpx') | ||
| 19 | + .objectFit(ImageFit.Auto) | ||
| 20 | + Text("预约") | ||
| 21 | + .fontWeight(400) | ||
| 22 | + .fontSize('21lpx') | ||
| 23 | + .backgroundColor($r('app.color.color_4D000000')) | ||
| 24 | + .fontColor($r('app.color.white')) | ||
| 25 | + .lineHeight('31lpx') | ||
| 26 | + .layoutWeight(1) | ||
| 27 | + .textAlign(TextAlign.Center) | ||
| 28 | + }.width('94lpx') | ||
| 29 | + .margin({bottom:'15lpx',right:'15lpx'}) | ||
| 30 | + }.width('100%') | ||
| 31 | + .height('100%') | ||
| 32 | + .alignItems(VerticalAlign.Bottom) | ||
| 33 | + .justifyContent(FlexAlign.End) | ||
| 34 | + } | ||
| 35 | + }.width('100%') | ||
| 36 | + .height('376lpx') | ||
| 37 | + | ||
| 38 | + Column(){ | ||
| 39 | + Text(this.item.title) | ||
| 40 | + .fontWeight('400lpx') | ||
| 41 | + .fontSize('33lpx') | ||
| 42 | + .fontColor($r('app.color.color_222222')) | ||
| 43 | + .lineHeight('48lpx') | ||
| 44 | + .maxLines(2) | ||
| 45 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 46 | + .margin({bottom:'23lpx'}) | ||
| 47 | + .textAlign(TextAlign.Start) | ||
| 48 | + .width('100%') | ||
| 49 | + Row(){ | ||
| 50 | + Row(){ | ||
| 51 | + if(this.item.relType === 2){ | ||
| 52 | + Image($r('app.media.play_status_history_icon')) | ||
| 53 | + .objectFit(ImageFit.Auto) | ||
| 54 | + .width('38lpx') | ||
| 55 | + .height('38lpx') | ||
| 56 | + .margin({right:'12lpx'}) | ||
| 57 | + Text('已结束').fontColor($r('app.color.color_999999')) | ||
| 58 | + .fontWeight('500lpx') | ||
| 59 | + .fontSize('23lpx') | ||
| 60 | + }else { | ||
| 61 | + Image($r('app.media.play_status_icon')) | ||
| 62 | + .objectFit(ImageFit.Auto) | ||
| 63 | + .width('38lpx') | ||
| 64 | + .height('38lpx') | ||
| 65 | + .margin({right:'12lpx'}) | ||
| 66 | + Text(this.item.timePre).fontColor($r('app.color.color_ED2800')) | ||
| 67 | + .fontWeight('500lpx') | ||
| 68 | + .fontSize('23lpx') | ||
| 69 | + Image($r('app.media.point_icon')) | ||
| 70 | + .objectFit(ImageFit.Auto) | ||
| 71 | + .width('12lpx') | ||
| 72 | + .height('31lpx') | ||
| 73 | + .margin({right:'4lpx'}) | ||
| 74 | + Text(`${this.item.timeBack}开始`).fontColor($r('app.color.color_ED2800')) | ||
| 75 | + .fontWeight('500lpx') | ||
| 76 | + .fontSize('23lpx') | ||
| 77 | + .lineHeight('31lpx') | ||
| 78 | + } | ||
| 79 | + }.padding({left:'19lpx',right:'19lpx'}) | ||
| 80 | + .height('46lpx') | ||
| 81 | + .alignItems(VerticalAlign.Center) | ||
| 82 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 83 | + .borderRadius('4lpx') | ||
| 84 | + Blank() | ||
| 85 | + .layoutWeight(1) | ||
| 86 | + if(this.item.relType === 1){ | ||
| 87 | + Text(this.item.isAppointment?"已预约":"预约") | ||
| 88 | + .fontWeight(400) | ||
| 89 | + .fontSize('23lpx') | ||
| 90 | + .backgroundColor(this.item.isAppointment?$r('app.color.color_F5F5F5'):$r('app.color.color_ED2800')) | ||
| 91 | + .fontColor(this.item.isAppointment?$r('app.color.color_CCCCCC'):$r('app.color.white')) | ||
| 92 | + .lineHeight('31lpx') | ||
| 93 | + .textAlign(TextAlign.Center) | ||
| 94 | + .width('100lpx') | ||
| 95 | + .height('46lpx') | ||
| 96 | + .borderRadius('6lpx') | ||
| 97 | + .onClick(()=>{ | ||
| 98 | + this.item.isAppointment = !this.item.isAppointment | ||
| 99 | + //TODO 预约动作 | ||
| 100 | + }) | ||
| 101 | + }else { | ||
| 102 | + Text(this.item.relType === 2?"去观看":"看回放") | ||
| 103 | + .fontWeight(400) | ||
| 104 | + .fontSize('23lpx') | ||
| 105 | + .backgroundColor($r('app.color.color_ED2800')) | ||
| 106 | + .fontColor($r('app.color.white')) | ||
| 107 | + .lineHeight('31lpx') | ||
| 108 | + .textAlign(TextAlign.Center) | ||
| 109 | + .width('100lpx') | ||
| 110 | + .height('46lpx') | ||
| 111 | + .borderRadius('6lpx') | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + .padding({left:'23lpx',right:'23lpx',top:'15lpx',bottom:'23lpx'}) | ||
| 116 | + }.margin({ left: 10, right: 10 }) | ||
| 117 | + .backgroundColor($r('app.color.white')) | ||
| 118 | + .borderRadius('8lpx') | ||
| 119 | + } | ||
| 120 | +} |
| 1 | +import { AppointmentListChildComponent } from '../mine/AppointmentListChildComponent'; | ||
| 2 | +import { CustomTitleUI } from '../../reusable/CustomTitleUI' | ||
| 3 | +import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | ||
| 4 | +import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; | ||
| 5 | +import { LazyDataSource, StringUtils } from 'wdKit'; | ||
| 6 | +import MinePageDatasModel from '../../../model/MinePageDatasModel'; | ||
| 7 | +const TAG = "AppointmentListUI" | ||
| 8 | + | ||
| 9 | +@Component | ||
| 10 | +export struct AppointmentListUI{ | ||
| 11 | + @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource(); | ||
| 12 | + @State isLoading:boolean = false | ||
| 13 | + @State hasMore:boolean = true | ||
| 14 | + curPageNum:number = 1; | ||
| 15 | + | ||
| 16 | + aboutToAppear() { | ||
| 17 | + this.getNewPageData() | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + build() { | ||
| 21 | + Column() { | ||
| 22 | + //标题栏目 | ||
| 23 | + CustomTitleUI({titleName:"预约列表"}) | ||
| 24 | + //刷新控件 TODO | ||
| 25 | + //List | ||
| 26 | + List({ space: '6lpx' }) { | ||
| 27 | + LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { | ||
| 28 | + ListItem() { | ||
| 29 | + AppointmentListChildComponent({item:item}) | ||
| 30 | + } | ||
| 31 | + .onClick(()=>{ | ||
| 32 | + //TODO 跳转 | ||
| 33 | + }) | ||
| 34 | + }, (item: MineAppointmentItem, index: number) => index.toString()) | ||
| 35 | + | ||
| 36 | + //没有更多数据 显示提示 | ||
| 37 | + if(!this.hasMore){ | ||
| 38 | + ListItem(){ | ||
| 39 | + ListHasNoMoreDataUI() | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + }.cachedCount(4) | ||
| 43 | + .margin({top:'23lpx',left:'23lpx',right:'23lpx'}) | ||
| 44 | + .layoutWeight(1) | ||
| 45 | + .onReachEnd(()=>{ | ||
| 46 | + console.log(TAG,"触底了"); | ||
| 47 | + if(!this.isLoading){ | ||
| 48 | + //加载分页数据 | ||
| 49 | + this.getNewPageData() | ||
| 50 | + } | ||
| 51 | + }) | ||
| 52 | + } | ||
| 53 | + .backgroundColor($r('app.color.color_F9F9F9')) | ||
| 54 | + .height('100%') | ||
| 55 | + .width('100%') | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + getNewPageData(){ | ||
| 59 | + this.isLoading = true | ||
| 60 | + if(this.hasMore){ | ||
| 61 | + MinePageDatasModel.getAppointmentListData("20",`${this.curPageNum}`,getContext(this)).then((value)=>{ | ||
| 62 | + if (!this.data || value.list.length == 0){ | ||
| 63 | + this.hasMore = false | ||
| 64 | + }else{ | ||
| 65 | + value.list.forEach((value)=>{ | ||
| 66 | + let dealTime = this.DealStartTime(value.planStartTime) | ||
| 67 | + if(dealTime!=null && dealTime.length === 2){ | ||
| 68 | + this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,dealTime[0],dealTime[1],value.relType)) | ||
| 69 | + }else { | ||
| 70 | + this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,"","",value.relType)) | ||
| 71 | + } | ||
| 72 | + }) | ||
| 73 | + this.data.notifyDataReload() | ||
| 74 | + if (this.data.totalCount() < value.totalCount) { | ||
| 75 | + this.curPageNum++ | ||
| 76 | + }else { | ||
| 77 | + this.hasMore = false | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + }) | ||
| 81 | + } | ||
| 82 | + this.isLoading = false | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + DealStartTime(planStartTime:string):string[]{ | ||
| 86 | + let dealData:string[] = [] | ||
| 87 | + | ||
| 88 | + if(!StringUtils.isNotEmpty(planStartTime)){ | ||
| 89 | + console.log(TAG,"格式有误") | ||
| 90 | + return dealData | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + if(planStartTime.indexOf(" ") === -1){ | ||
| 94 | + console.log(TAG,"格式有误") | ||
| 95 | + return dealData | ||
| 96 | + } | ||
| 97 | + let arr = planStartTime.split(" ") | ||
| 98 | + if(arr!=null && StringUtils.isNotEmpty(arr[0])){ //处理年月日 | ||
| 99 | + let time = arr[0].split("-"); | ||
| 100 | + if(time.length === 3){ | ||
| 101 | + let month = time[1].indexOf("0") === 0 ? time[1].substring(1):time[1] | ||
| 102 | + let day = time[2] | ||
| 103 | + | ||
| 104 | + dealData[0] = `${month}月${day}日` | ||
| 105 | + let today = `${new Date().getMonth()+1}月${new Date().getDate()}日` | ||
| 106 | + if(dealData[0] === today){ | ||
| 107 | + dealData[0] = "今日" | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + if(arr!=null && StringUtils.isNotEmpty(arr[1])){ //处理时分 | ||
| 113 | + let time = arr[1].split(":"); | ||
| 114 | + if(time.length === 3){ | ||
| 115 | + dealData[1] = `${time[0]}:${time[1]}` | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + console.log(TAG,JSON.stringify(dealData)) | ||
| 119 | + return dealData | ||
| 120 | + } | ||
| 121 | +} |
| 1 | +@Component | ||
| 2 | +export default struct MinePageCardUI { | ||
| 3 | + build(){ | ||
| 4 | + Flex(){ | ||
| 5 | + Stack(){ | ||
| 6 | + Image($r('app.media.mine_card_01')) | ||
| 7 | + .setFullWidthAndHeight() | ||
| 8 | + .objectFit(ImageFit.Auto) | ||
| 9 | + Column(){ | ||
| 10 | + Text("积分商城") | ||
| 11 | + .fontColor($r('app.color.color_994D00')) | ||
| 12 | + .width('119lpx') | ||
| 13 | + .height('35lpx') | ||
| 14 | + .textAlign(TextAlign.Start) | ||
| 15 | + .fontSize('29lpx') | ||
| 16 | + .fontWeight(600) | ||
| 17 | + Text("华为MATE40手机") | ||
| 18 | + .width('159lpx') | ||
| 19 | + .height('23lpx') | ||
| 20 | + .fontColor($r('app.color.color_994D00')) | ||
| 21 | + .fontSize('19lpx') | ||
| 22 | + .fontWeight(400) | ||
| 23 | + .textAlign(TextAlign.Start) | ||
| 24 | + .margin({top:'10lpx'}) | ||
| 25 | + }.padding({left:'29lpx'}) | ||
| 26 | + .alignItems(HorizontalAlign.Start) | ||
| 27 | + }.alignContent(Alignment.Start) | ||
| 28 | + .width('349lpx') | ||
| 29 | + .height('115lpx') | ||
| 30 | + | ||
| 31 | + Stack(){ | ||
| 32 | + Image($r('app.media.mine_card_02')) | ||
| 33 | + .setFullWidthAndHeight() | ||
| 34 | + .objectFit(ImageFit.Auto) | ||
| 35 | + Column(){ | ||
| 36 | + Text("数字藏品") | ||
| 37 | + .fontColor($r('app.color.color_B15900')) | ||
| 38 | + .width('119lpx') | ||
| 39 | + .height('35lpx') | ||
| 40 | + .textAlign(TextAlign.Start) | ||
| 41 | + .fontSize('29lpx') | ||
| 42 | + .fontWeight(600) | ||
| 43 | + Text("黑胶唱片NFT") | ||
| 44 | + .width('159lpx') | ||
| 45 | + .height('23lpx') | ||
| 46 | + .fontColor($r('app.color.color_B15900')) | ||
| 47 | + .fontSize('19lpx') | ||
| 48 | + .textAlign(TextAlign.Start) | ||
| 49 | + .margin({top:'10lpx'}) | ||
| 50 | + .fontWeight(400) | ||
| 51 | + }.padding({left:'67lpx'}) | ||
| 52 | + .alignItems(HorizontalAlign.Start) | ||
| 53 | + }.alignContent(Alignment.Start) | ||
| 54 | + .width('348lpx') | ||
| 55 | + .height('115lpx') | ||
| 56 | + }.setFullWidth() | ||
| 57 | + .height('115lpx') | ||
| 58 | + .padding({left:'23lpx',right:'23lpx'}) | ||
| 59 | + .margin({top:'24lpx'}) | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @Styles setFullWidthAndHeight(){ | ||
| 63 | + .width('100%') | ||
| 64 | + .height('100%') | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + @Styles setFullWidth(){ | ||
| 68 | + .width('100%') | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + @Styles setFullHeight(){ | ||
| 72 | + .height('100%') | ||
| 73 | + } | ||
| 74 | +} |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/MinePageCreatorFunctionUI.ets
0 → 100644
| 1 | +import MinePageCreatorFunctionsItem from '../../../viewmodel/MinePageCreatorFunctionsItem' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export default struct MinePageCreatorFunctionUI { | ||
| 5 | + @Link creatorData:MinePageCreatorFunctionsItem[] | ||
| 6 | + | ||
| 7 | + build(){ | ||
| 8 | + Column(){ | ||
| 9 | + Row(){ | ||
| 10 | + Text("创作者中心") | ||
| 11 | + .fontSize('29lpx') | ||
| 12 | + .width('148lpx') | ||
| 13 | + .height('46lpx') | ||
| 14 | + .fontWeight(600) | ||
| 15 | + .fontColor($r('app.color.color_222222')) | ||
| 16 | + | ||
| 17 | + Blank() | ||
| 18 | + | ||
| 19 | + Row(){ | ||
| 20 | + Text("内容管理") | ||
| 21 | + .fontSize('27lpx') | ||
| 22 | + .width('113lpx') | ||
| 23 | + .height('35lpx') | ||
| 24 | + .fontColor($r('app.color.color_999999')) | ||
| 25 | + | ||
| 26 | + Image($r('app.media.mine_right_arrow')) | ||
| 27 | + .width('27lpx') | ||
| 28 | + .height('27lpx') | ||
| 29 | + .objectFit(ImageFit.Auto) | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + }.setFullWidth() | ||
| 33 | + .height('92lpx') | ||
| 34 | + .padding({left:'29lpx',top:'23lpx',right:'31lpx'}) | ||
| 35 | + | ||
| 36 | + Row(){ | ||
| 37 | + Grid(){ | ||
| 38 | + ForEach(this.creatorData,(item:MinePageCreatorFunctionsItem,index:number)=>{ | ||
| 39 | + GridItem(){ | ||
| 40 | + Row(){ | ||
| 41 | + Column(){ | ||
| 42 | + Image(item.imgSrc) | ||
| 43 | + .width('50lpx') | ||
| 44 | + .height('50lpx') | ||
| 45 | + Text(`${item.msg}`) | ||
| 46 | + .margin({top:'15lpx'}) | ||
| 47 | + .width('96lpx') | ||
| 48 | + .height('23lpx') | ||
| 49 | + .fontColor($r('app.color.color_666666')) | ||
| 50 | + .fontSize('23lpx') | ||
| 51 | + } | ||
| 52 | + .alignItems(HorizontalAlign.Center) | ||
| 53 | + .width('100%') | ||
| 54 | + Blank() | ||
| 55 | + .layoutWeight(1) | ||
| 56 | + if(index % 4 < 3 && index != this.creatorData.length){ | ||
| 57 | + Text().backgroundColor($r('app.color.color_222222')) | ||
| 58 | + .opacity(0.1) | ||
| 59 | + .width('2lpx') | ||
| 60 | + .height('29lpx') | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + }.onClick(()=>{ | ||
| 64 | + console.log(index+"") | ||
| 65 | + }).width('169lpx') | ||
| 66 | + .height('117lpx') | ||
| 67 | + }, item => item) | ||
| 68 | + } | ||
| 69 | + .rowsTemplate('1fr') | ||
| 70 | + .columnsTemplate('1fr 1fr 1fr 1fr') | ||
| 71 | + .height('88lpx') | ||
| 72 | + }.setFullWidth() | ||
| 73 | + .height('127lpx') | ||
| 74 | + } | ||
| 75 | + .height('219lpx') | ||
| 76 | + .borderRadius(8) | ||
| 77 | + .margin({top:'19lpx',left:'23lpx',right:'23lpx'}) | ||
| 78 | + .setBackGroundWhite() | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + @Styles setFullWidthAndHeight(){ | ||
| 82 | + .width('100%') | ||
| 83 | + .height('100%') | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + @Styles setFullWidth(){ | ||
| 87 | + .width('100%') | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @Styles setFullHeight(){ | ||
| 91 | + .height('100%') | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + @Styles setBackGroundWhite(){ | ||
| 95 | + .backgroundColor($r('app.color.white')) | ||
| 96 | + } | ||
| 97 | +} |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/MinePageMoreFunctionUI.ets
0 → 100644
| 1 | +import MinePageMoreFunctionModel from '../../../viewmodel/MinePageMoreFunctionModel' | ||
| 2 | +import RouteManager from '../../../utils/RouteManager' | ||
| 3 | +import router from '@ohos.router' | ||
| 4 | + | ||
| 5 | +@Component | ||
| 6 | +export default struct MinePageMoreFunctionUI{ | ||
| 7 | + @Link moreData:MinePageMoreFunctionModel[] | ||
| 8 | + | ||
| 9 | + build(){ | ||
| 10 | + Column(){ | ||
| 11 | + Column(){ | ||
| 12 | + Text(`更多功能`) | ||
| 13 | + .width('456lpx') | ||
| 14 | + .height('38lpx') | ||
| 15 | + .fontColor($r('app.color.color_666666')) | ||
| 16 | + .fontSize('29lpx') | ||
| 17 | + .margin({left:"31lpx"}) | ||
| 18 | + .fontWeight(600) | ||
| 19 | + }.height('92lpx') | ||
| 20 | + .width('100%') | ||
| 21 | + .justifyContent(FlexAlign.Center) | ||
| 22 | + .alignItems(HorizontalAlign.Start) | ||
| 23 | + | ||
| 24 | + Text().backgroundColor($r('app.color.color_F5F5F5')) | ||
| 25 | + .width('100%') | ||
| 26 | + .height('1lpx') | ||
| 27 | + | ||
| 28 | + List(){ | ||
| 29 | + ForEach(this.moreData,(item:MinePageMoreFunctionModel,index:number)=>{ | ||
| 30 | + ListItem(){ | ||
| 31 | + Column(){ | ||
| 32 | + Column(){ | ||
| 33 | + Row(){ | ||
| 34 | + if(item.imgSrc){ | ||
| 35 | + Image(item.imgSrc) | ||
| 36 | + .width('38lpx') | ||
| 37 | + .height('38lpx') | ||
| 38 | + .margin({right:'15lpx'}) | ||
| 39 | + } | ||
| 40 | + Text(`${item.msg}`) | ||
| 41 | + .width('456lpx') | ||
| 42 | + .height('38lpx') | ||
| 43 | + .fontColor($r('app.color.color_666666')) | ||
| 44 | + .fontSize('29lpx') | ||
| 45 | + .fontWeight(400) | ||
| 46 | + | ||
| 47 | + Blank() | ||
| 48 | + Image($r('app.media.mine_user_arrow')) | ||
| 49 | + .width('27lpx') | ||
| 50 | + .height('27lpx') | ||
| 51 | + .objectFit(ImageFit.Auto) | ||
| 52 | + .margin({left:'81lpx',right:'29lpx'}) | ||
| 53 | + }.alignItems(VerticalAlign.Center) | ||
| 54 | + .justifyContent(FlexAlign.Center) | ||
| 55 | + }.height('108lpx') | ||
| 56 | + .justifyContent(FlexAlign.Center) | ||
| 57 | + .alignItems(HorizontalAlign.Start) | ||
| 58 | + .padding({left:'27lpx'}) | ||
| 59 | + | ||
| 60 | + if(index != this.moreData.length -1 ){ | ||
| 61 | + Text().backgroundColor($r('app.color.color_F5F5F5')) | ||
| 62 | + .width('612lpx') | ||
| 63 | + .height('1lpx') | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + .onClick(()=>{ | ||
| 68 | + console.log(index+"") | ||
| 69 | + if (index == 3) { | ||
| 70 | + router.pushUrl({ | ||
| 71 | + url:"pages/SettingPage", | ||
| 72 | + params : {'pageType' : 'mainSetting'} | ||
| 73 | + }) | ||
| 74 | + } else if (index == 2) { | ||
| 75 | + // RouteManager.jumpNewPage("pages/PrivacySettingPage") | ||
| 76 | + } else if (index == 4) { | ||
| 77 | + RouteManager.jumpNewPage("pages/SettingAboutPage") | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + }) | ||
| 81 | + .height('117lpx') | ||
| 82 | + }, item => item) | ||
| 83 | + }.onScrollFrameBegin((offset, state) => { | ||
| 84 | + return { offsetRemain: 0 } | ||
| 85 | + }) | ||
| 86 | + } | ||
| 87 | + .backgroundColor($r('app.color.white')) | ||
| 88 | + .borderRadius(8) | ||
| 89 | + .margin({left:'23lpx',right:'23lpx',top:"19lpx"}) | ||
| 90 | + } | ||
| 91 | +} |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/MinePagePersonFunctionUI.ets
0 → 100644
| 1 | + | ||
| 2 | +import RouteManager from '../../../utils/RouteManager' | ||
| 3 | +import MinePagePersonalFunctionsItem from '../../../viewmodel/MinePagePersonalFunctionsItem' | ||
| 4 | + | ||
| 5 | +@Component | ||
| 6 | +export default struct MinePagePersonFunctionUI { | ||
| 7 | + @Link personalData:MinePagePersonalFunctionsItem[] | ||
| 8 | + | ||
| 9 | + build() { | ||
| 10 | + Grid(){ | ||
| 11 | + ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ | ||
| 12 | + GridItem(){ | ||
| 13 | + Row(){ | ||
| 14 | + Column(){ | ||
| 15 | + Image(item.imgSrc) | ||
| 16 | + .width('46lpx') | ||
| 17 | + .height('46lpx') | ||
| 18 | + Text(`${item.msg}`) | ||
| 19 | + .margin({top:'8lpx'}) | ||
| 20 | + .width('50lpx') | ||
| 21 | + .height('23lpx') | ||
| 22 | + .fontColor($r('app.color.color_222222')) | ||
| 23 | + .fontSize('23lpx') | ||
| 24 | + } | ||
| 25 | + .alignItems(HorizontalAlign.Center) | ||
| 26 | + .width('100%') | ||
| 27 | + Blank() | ||
| 28 | + .layoutWeight(1) | ||
| 29 | + if(index % 4 < 3 && index != this.personalData.length-1){ | ||
| 30 | + Text().backgroundColor($r('app.color.color_222222')) | ||
| 31 | + .opacity(0.1) | ||
| 32 | + .width('2lpx') | ||
| 33 | + .height('29lpx') | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }.onClick(()=>{ | ||
| 37 | + console.log(index+"") | ||
| 38 | + switch (item.msg){ | ||
| 39 | + case "预约":{ | ||
| 40 | + RouteManager.jumpNewPage("pages/AppointmentListPage") | ||
| 41 | + break; | ||
| 42 | + } | ||
| 43 | + case "关注":{ | ||
| 44 | + RouteManager.jumpNewPage("pages/FollowListPage") | ||
| 45 | + break; | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + }).width('169lpx') | ||
| 49 | + .height('117lpx') | ||
| 50 | + }, item => item) | ||
| 51 | + } | ||
| 52 | + .rowsTemplate('1fr 1fr') | ||
| 53 | + .columnsTemplate('1fr 1fr 1fr 1fr') | ||
| 54 | + .height('234lpx') | ||
| 55 | + .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) | ||
| 56 | + } | ||
| 57 | +} |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/MinePageUserSimpleInfoUI.ets
0 → 100644
| 1 | +import RouteManager from '../../../utils/RouteManager' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export default struct MinePageUserSimpleInfoUI { | ||
| 5 | + @Prop isLogin:boolean | ||
| 6 | + | ||
| 7 | + build(){ | ||
| 8 | + Row(){ | ||
| 9 | + //头像 | ||
| 10 | + Stack(){ | ||
| 11 | + Button({type:ButtonType.Circle}) | ||
| 12 | + .backgroundColor($r('app.color.main_red')) | ||
| 13 | + .width('110lpx') | ||
| 14 | + .height('110lpx') | ||
| 15 | + Image($r('app.media.mine_head_icon')) | ||
| 16 | + .width('108lpx') | ||
| 17 | + .height('108lpx') | ||
| 18 | + .objectFit(ImageFit.Cover) | ||
| 19 | + .borderRadius(50) | ||
| 20 | + }.width('110lpx') | ||
| 21 | + .height('110lpx') | ||
| 22 | + .alignContent(Alignment.Center) | ||
| 23 | + .onClick(()=>{ | ||
| 24 | + RouteManager.jumpNewPage("pages/TestPage") | ||
| 25 | + }) | ||
| 26 | + | ||
| 27 | + if(this.isLogin){ | ||
| 28 | + //昵称信息 | ||
| 29 | + Column(){ | ||
| 30 | + Row(){ | ||
| 31 | + Text("人民日报6G5E3T") | ||
| 32 | + .fontColor($r('app.color.color_222222')) | ||
| 33 | + .maxLines(1) | ||
| 34 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 35 | + .fontSize('33lpx') | ||
| 36 | + | ||
| 37 | + Image($r('app.media.mine_user_edit')) | ||
| 38 | + .width('27lpx') | ||
| 39 | + .height('27lpx') | ||
| 40 | + .margin({left:'15lpx'}) | ||
| 41 | + .objectFit(ImageFit.Cover) | ||
| 42 | + Blank() | ||
| 43 | + }.width('100%') | ||
| 44 | + | ||
| 45 | + Stack(){ | ||
| 46 | + Image($r('app.media.mine_grade_bg')) | ||
| 47 | + .width('84lpx') | ||
| 48 | + .height('29lpx') | ||
| 49 | + .objectFit(ImageFit.Auto) | ||
| 50 | + Text("等级8") | ||
| 51 | + .textAlign(TextAlign.Center) | ||
| 52 | + .fontColor($r('app.color.white')) | ||
| 53 | + .fontSize('19lpx') | ||
| 54 | + .width('50lpx') | ||
| 55 | + .height('29lpx') | ||
| 56 | + }.margin({top:'15lpx'}) | ||
| 57 | + }.alignItems(HorizontalAlign.Start) | ||
| 58 | + .margin({top:'12lpx',left:'17lpx'}) | ||
| 59 | + .width('352lpx') | ||
| 60 | + }else{ | ||
| 61 | + Row(){ | ||
| 62 | + Text("登录注册") | ||
| 63 | + .fontColor($r('app.color.color_222222')) | ||
| 64 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 65 | + .fontSize('33lpx') | ||
| 66 | + | ||
| 67 | + Image($r('app.media.mine_user_edit')) | ||
| 68 | + .width('11lpx') | ||
| 69 | + .height('20lpx') | ||
| 70 | + .margin({left:'15lpx'}) | ||
| 71 | + .objectFit(ImageFit.Cover) | ||
| 72 | + Blank() | ||
| 73 | + } | ||
| 74 | + .margin({top:'11lpx',left:'17lpx'}) | ||
| 75 | + .width('352lpx') | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + Blank() | ||
| 79 | + | ||
| 80 | + Stack({alignContent:Alignment.Start}){ | ||
| 81 | + Text("签到") | ||
| 82 | + .textAlign(TextAlign.Start) | ||
| 83 | + .width('108lpx') | ||
| 84 | + .height('46lpx') | ||
| 85 | + .fontColor($r('app.color.color_AD6000')) | ||
| 86 | + .backgroundColor($r('app.color.color_FFC460')) | ||
| 87 | + .fontWeight(500) | ||
| 88 | + .position({x:'23lpx'}) | ||
| 89 | + .padding({left:'35lpx'}) | ||
| 90 | + Image($r("app.media.mine_sign_icon")) | ||
| 91 | + .width('50lpx') | ||
| 92 | + .height('50lpx') | ||
| 93 | + }.width('131lpx') | ||
| 94 | + }.backgroundColor($r('app.color.white')) | ||
| 95 | + .setFullWidth() | ||
| 96 | + .padding({top:'31lpx',left:'46lpx'}) | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + @Styles setFullWidthAndHeight(){ | ||
| 100 | + .width('100%') | ||
| 101 | + .height('100%') | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + @Styles setFullWidth(){ | ||
| 105 | + .width('100%') | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + @Styles setFullHeight(){ | ||
| 109 | + .height('100%') | ||
| 110 | + } | ||
| 111 | +} |
| 1 | +import { ResourcesUtils } from 'wdKit' | ||
| 2 | +import { ResponseDTO } from 'wdNetwork' | ||
| 3 | +import { FollowListItem } from '../../../../viewmodel/FollowListItem' | ||
| 4 | +import { CustomTitleUI } from '../../../reusable/CustomTitleUI' | ||
| 5 | +import { FollowSecondTabsComponent } from './FollowSecondTabsComponent' | ||
| 6 | + | ||
| 7 | +@Component | ||
| 8 | +export struct FollowFirstTabsComponent{ | ||
| 9 | + @State currentIndex: number = 0 | ||
| 10 | + private controller: TabsController = new TabsController() | ||
| 11 | + @State data:FollowListItem[] = [] | ||
| 12 | + fontColor: string = '#999999' | ||
| 13 | + selectedFontColor: string = '#000000' | ||
| 14 | + | ||
| 15 | + aboutToAppear(){ | ||
| 16 | + this.data.push(new FollowListItem("我的")) | ||
| 17 | + // let res = JSON.parse(`{"code":"0","data":[{"children":[],"directoryName":"阅读","directoryWeight":99,"id":165,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"三二","directoryWeight":2,"id":120,"isShow":1,"level":3,"parentId":118,"rootId":117},{"directoryName":"三级","directoryWeight":1,"id":119,"isShow":1,"level":3,"parentId":118,"rootId":117}],"directoryName":"二级","directoryWeight":1,"id":118,"isShow":1,"level":2,"parentId":117,"rootId":117}],"directoryName":"幽游白书","directoryWeight":33,"id":117,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"推荐","directoryWeight":9,"id":386,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"政务","directoryWeight":9,"id":379,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"推荐","directoryWeight":0,"id":335,"isShow":1,"level":2,"parentId":320,"rootId":320}],"directoryName":"推荐","directoryWeight":9,"id":320,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":390,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":323,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"自媒体","directoryWeight":7,"id":329,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"名人","directoryWeight":6,"id":389,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"测试","directoryWeight":0,"id":338,"isShow":1,"level":2,"parentId":324,"rootId":324}],"directoryName":"名人","directoryWeight":6,"id":324,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"2级目录","directoryWeight":0,"id":340,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"3级测试","directoryWeight":0,"id":368,"isShow":1,"level":3,"parentId":339,"rootId":312}],"directoryName":"二级目录","directoryWeight":0,"id":339,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"企业","directoryWeight":1,"id":348,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"部委","directoryWeight":0,"id":344,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"地方","directoryWeight":0,"id":341,"isShow":1,"level":3,"parentId":336,"rootId":312}],"directoryName":"类型","directoryWeight":0,"id":336,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"贵州省","directoryWeight":0,"id":378,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"西藏自治区","directoryWeight":0,"id":377,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"四川省","directoryWeight":0,"id":376,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"重庆市","directoryWeight":0,"id":375,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖南省","directoryWeight":0,"id":374,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"云南省","directoryWeight":0,"id":373,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广西壮族自治区","directoryWeight":0,"id":372,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"宁夏回族自治区","directoryWeight":0,"id":371,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖北省","directoryWeight":0,"id":370,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"青海省","directoryWeight":0,"id":369,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"陕西省","directoryWeight":0,"id":367,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"甘肃省","directoryWeight":0,"id":366,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"吉林省","directoryWeight":0,"id":365,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广东省","directoryWeight":0,"id":364,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"海南省","directoryWeight":0,"id":363,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"辽宁省","directoryWeight":0,"id":362,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江苏省","directoryWeight":0,"id":361,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"新疆维吾尔族自治区","directoryWeight":0,"id":360,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"福建省","directoryWeight":0,"id":359,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山东省","directoryWeight":0,"id":358,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河南省","directoryWeight":0,"id":357,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"浙江省","directoryWeight":0,"id":356,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"安徽省","directoryWeight":0,"id":355,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"上海市","directoryWeight":0,"id":354,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河北省","directoryWeight":0,"id":353,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"黑龙江省","directoryWeight":0,"id":352,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江西省","directoryWeight":0,"id":351,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"内蒙古自治区","directoryWeight":0,"id":350,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"北京市","directoryWeight":0,"id":349,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山西省","directoryWeight":0,"id":346,"isShow":1,"level":3,"parentId":332,"rootId":312}],"directoryName":"地域","directoryWeight":0,"id":332,"isShow":1,"level":2,"parentId":312,"rootId":312}],"directoryName":"政务","directoryWeight":5,"id":312,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"学校","directoryWeight":4,"id":331,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"机构","directoryWeight":3,"id":330,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"新闻联播","directoryWeight":3,"id":79,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"第三季","directoryWeight":2,"id":78,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"三级","directoryWeight":1,"id":76,"isShow":1,"level":3,"parentId":75,"rootId":74}],"directoryName":"短视频","directoryWeight":1,"id":75,"isShow":1,"level":2,"parentId":74,"rootId":74}],"directoryName":"创作","directoryWeight":3,"id":74,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"教学","directoryWeight":2,"id":72,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"热门","directoryWeight":1,"id":73,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"赛事","directoryWeight":1,"id":71,"isShow":1,"level":2,"parentId":64,"rootId":64}],"directoryName":"游戏","directoryWeight":2,"id":64,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"新闻","directoryWeight":1,"id":315,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"趣闻","directoryWeight":6,"id":70,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"时政","directoryWeight":5,"id":69,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"农业","directoryWeight":3,"id":68,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"娱乐","directoryWeight":3,"id":67,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"科技","directoryWeight":2,"id":66,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"国际","directoryWeight":1,"id":65,"isShow":1,"level":2,"parentId":63,"rootId":63}],"directoryName":"新闻","directoryWeight":1,"id":63,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"公安","directoryWeight":0,"id":388,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":387,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":384,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"综合","directoryWeight":0,"id":328,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"房产","directoryWeight":0,"id":327,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":318,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"历史","directoryWeight":0,"id":310,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":309,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"aaaa","directoryWeight":1,"id":333,"isShow":1,"level":2,"parentId":308,"rootId":308},{"children":[],"directoryName":"qqq","directoryWeight":0,"id":334,"isShow":1,"level":2,"parentId":308,"rootId":308}],"directoryName":"dddd","directoryWeight":0,"id":308,"isShow":1,"level":1,"parentId":0,"rootId":0}],"message":"Success","success":true,"timestamp":1710741803593}`) as ResponseDTO<FollowListItem[]> | ||
| 18 | + // res.data.forEach(element => { | ||
| 19 | + // this.data.push(element) | ||
| 20 | + // }); | ||
| 21 | + | ||
| 22 | + ResourcesUtils.getResourcesJson<ResponseDTO<FollowListItem[]>>('follow_list_data.json', getContext(this)).then((success)=>{ | ||
| 23 | + success.data?.forEach(element => { | ||
| 24 | + this.data.push(element) | ||
| 25 | + }); | ||
| 26 | + console.log("ycg",this.data.length.toString()); | ||
| 27 | + }) | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + @Builder TabBuilder(index: number, item: FollowListItem) { | ||
| 31 | + Stack(){ | ||
| 32 | + Text(item.directoryName) | ||
| 33 | + .height('38lpx') | ||
| 34 | + .fontSize('33lpx') | ||
| 35 | + .fontWeight(this.currentIndex === index ? 600 : 400) | ||
| 36 | + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | ||
| 37 | + .lineHeight('38lpx') | ||
| 38 | + | ||
| 39 | + if(this.currentIndex === index){ | ||
| 40 | + Divider() | ||
| 41 | + .width('31lpx') | ||
| 42 | + .height('4lpx') | ||
| 43 | + .color('#ED2800') | ||
| 44 | + .strokeWidth('4lpx') | ||
| 45 | + .margin({top:'50lpx'}) | ||
| 46 | + .id("divTag") | ||
| 47 | + } | ||
| 48 | + }.onClick(()=>{ | ||
| 49 | + this.currentIndex = index | ||
| 50 | + this.controller.changeIndex(this.currentIndex) | ||
| 51 | + }) | ||
| 52 | + .height('100%') | ||
| 53 | + .margin({right:'9lpx'}) | ||
| 54 | + .padding({left:'31lpx',right:index === this.data.length-1?"31lpx":"0lpx"}) | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + build() { | ||
| 58 | + Column() { | ||
| 59 | + //标题栏目 | ||
| 60 | + CustomTitleUI({titleName:"关注列表"}) | ||
| 61 | + | ||
| 62 | + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | ||
| 63 | + ForEach(this.data, (item: FollowListItem, index: number ) => { | ||
| 64 | + TabContent(){ | ||
| 65 | + FollowSecondTabsComponent({data:$data,firstIndex:index}) | ||
| 66 | + }.tabBar(this.TabBuilder(index,item)) | ||
| 67 | + }, (item: FollowListItem, index: number) => index.toString()) | ||
| 68 | + } | ||
| 69 | + .vertical(false) | ||
| 70 | + .barMode(BarMode.Scrollable) | ||
| 71 | + .barWidth('100%') | ||
| 72 | + .barHeight('84lpx') | ||
| 73 | + .animationDuration(0) | ||
| 74 | + .onChange((index: number) => { | ||
| 75 | + this.currentIndex = index | ||
| 76 | + }) | ||
| 77 | + .width('100%') | ||
| 78 | + .height('100%') | ||
| 79 | + }.width('100%') | ||
| 80 | + } | ||
| 81 | +} |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/follow/FollowListDetailUI.ets
0 → 100644
| 1 | +import { LazyDataSource } from 'wdKit'; | ||
| 2 | +import { FollowListDetailItem } from '../../../../viewmodel/FollowListDetailItem' | ||
| 3 | +import { ListHasNoMoreDataUI } from '../../../reusable/ListHasNoMoreDataUI'; | ||
| 4 | + | ||
| 5 | +const TAG = "FollowListDetailUI" | ||
| 6 | +@Component | ||
| 7 | +export struct FollowListDetailUI{ | ||
| 8 | + @State creatorDirectoryId:number = -1; | ||
| 9 | + @State data: LazyDataSource<FollowListDetailItem> = new LazyDataSource(); | ||
| 10 | + @State isLoading:boolean = false | ||
| 11 | + @State hasMore:boolean = true | ||
| 12 | + curPageNum:number = 1; | ||
| 13 | + headUrl = "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309Th211436299/GLN.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg" | ||
| 14 | + | ||
| 15 | + | ||
| 16 | + aboutToAppear(){ | ||
| 17 | + console.log("YCG","aboutToAppear==="+this.creatorDirectoryId); | ||
| 18 | + this.getNewPageData() | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + build(){ | ||
| 22 | + Column(){ | ||
| 23 | + List({ space: 3 }) { | ||
| 24 | + LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => { | ||
| 25 | + ListItem() { | ||
| 26 | + ChildComponent({data: item}) | ||
| 27 | + } | ||
| 28 | + .onClick(() => { | ||
| 29 | + }) | ||
| 30 | + }, (item: FollowListDetailItem, index: number) => index.toString()) | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + //没有更多数据 显示提示 | ||
| 34 | + if(!this.hasMore){ | ||
| 35 | + ListItem(){ | ||
| 36 | + ListHasNoMoreDataUI() | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + }.cachedCount(7) | ||
| 40 | + .padding({left:'31lpx',right:'31lpx'}) | ||
| 41 | + .layoutWeight(1) | ||
| 42 | + .onReachEnd(()=>{ | ||
| 43 | + console.log(TAG,"触底了"); | ||
| 44 | + if(!this.isLoading){ | ||
| 45 | + this.isLoading = true | ||
| 46 | + //加载分页数据 | ||
| 47 | + this.getNewPageData() | ||
| 48 | + } | ||
| 49 | + }) | ||
| 50 | + }.layoutWeight(1) | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + getNewPageData(){ | ||
| 54 | + if(this.hasMore){ | ||
| 55 | + if(this.curPageNum>=4){ | ||
| 56 | + this.hasMore = false | ||
| 57 | + return | ||
| 58 | + } | ||
| 59 | + if(this.curPageNum == 1){ | ||
| 60 | + this.data.push(new FollowListDetailItem(this.headUrl,"人之初,性本善",10,"人之初,性本善")); | ||
| 61 | + this.data.push(new FollowListDetailItem(this.headUrl,"性相近,习相远",20,"性相近,习相远")); | ||
| 62 | + this.data.push(new FollowListDetailItem(this.headUrl,"苟不教,性乃迁",30,"苟不教,性乃迁")); | ||
| 63 | + this.data.push(new FollowListDetailItem(this.headUrl,"教之道,贵以专",40,"教之道,贵以专")); | ||
| 64 | + this.data.push(new FollowListDetailItem(this.headUrl,"AAAAAAA",50,"教之道,贵以专")); | ||
| 65 | + this.data.push(new FollowListDetailItem(this.headUrl,"BBBBBBB",60,"教之道,贵以专")); | ||
| 66 | + this.data.push(new FollowListDetailItem(this.headUrl,"CCCCCCC",70,"教之道,贵以专")); | ||
| 67 | + }else if(this.curPageNum == 2){ | ||
| 68 | + this.data.push(new FollowListDetailItem(this.headUrl,"昔孟母,择邻处",40,"昔孟母,择邻处")); | ||
| 69 | + }else if(this.curPageNum == 3){ | ||
| 70 | + this.data.push(new FollowListDetailItem(this.headUrl,"子不学,断机杼",40,"子不学,断机杼")); | ||
| 71 | + } | ||
| 72 | + this.isLoading = false | ||
| 73 | + this.curPageNum++ | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | +} | ||
| 77 | + | ||
| 78 | +@Component | ||
| 79 | +struct ChildComponent { | ||
| 80 | + @ObjectLink data: FollowListDetailItem | ||
| 81 | + | ||
| 82 | + build() { | ||
| 83 | + Column(){ | ||
| 84 | + Blank().height('27lpx') | ||
| 85 | + | ||
| 86 | + Row() { | ||
| 87 | + Image(this.data.headPhotoUrl) | ||
| 88 | + .objectFit(ImageFit.Auto) | ||
| 89 | + .width('92lpx') | ||
| 90 | + .height('92lpx') | ||
| 91 | + .margin({right:'15lpx'}) | ||
| 92 | + | ||
| 93 | + Column(){ | ||
| 94 | + Text(this.data.cnUserName) | ||
| 95 | + .fontWeight('400lpx') | ||
| 96 | + .fontSize('31lpx') | ||
| 97 | + .lineHeight('38lpx') | ||
| 98 | + .fontColor($r('app.color.color_222222')) | ||
| 99 | + Text(`粉丝${this.data.cnFansNum}`) | ||
| 100 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 101 | + .fontSize('23lpx') | ||
| 102 | + .maxLines(1) | ||
| 103 | + Text(`${this.data.introduction}`) | ||
| 104 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 105 | + .fontSize('23lpx') | ||
| 106 | + .maxLines(2) | ||
| 107 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 108 | + }.layoutWeight(1) | ||
| 109 | + .alignItems(HorizontalAlign.Start) | ||
| 110 | + | ||
| 111 | + if(this.data.isFollow){ | ||
| 112 | + Row(){ | ||
| 113 | + Text(`已关注`) | ||
| 114 | + .fontColor($r('app.color.color_CCCCCC')) | ||
| 115 | + .fontSize('23lpx') | ||
| 116 | + .fontWeight('500lpx') | ||
| 117 | + .lineHeight('35lpx') | ||
| 118 | + }.backgroundColor($r('app.color.color_F5F5F5')) | ||
| 119 | + .borderRadius('6lpx') | ||
| 120 | + .borderWidth('2lpx') | ||
| 121 | + .justifyContent(FlexAlign.Center) | ||
| 122 | + .width('100lpx') | ||
| 123 | + .height('46lpx') | ||
| 124 | + .margin({left:'4lpx',top:'23lpx'}) | ||
| 125 | + .onClick(()=>{ | ||
| 126 | + this.data.isFollow = false | ||
| 127 | + }) | ||
| 128 | + }else{ | ||
| 129 | + Row(){ | ||
| 130 | + Image($r('app.media.follow_icon')) | ||
| 131 | + .margin({right:'4lpx'}) | ||
| 132 | + .width('23lpx') | ||
| 133 | + .height('23lpx') | ||
| 134 | + Text(`关注`) | ||
| 135 | + .fontColor($r('app.color.color_ED2800')) | ||
| 136 | + .fontSize('23lpx') | ||
| 137 | + .fontWeight('500lpx') | ||
| 138 | + .lineHeight('35lpx') | ||
| 139 | + }.borderColor($r('app.color.color_ED2800')) | ||
| 140 | + .borderRadius('6lpx') | ||
| 141 | + .borderWidth('2lpx') | ||
| 142 | + .justifyContent(FlexAlign.Center) | ||
| 143 | + .width('100lpx') | ||
| 144 | + .height('46lpx') | ||
| 145 | + .margin({left:'4lpx',top:'23lpx'}) | ||
| 146 | + .onClick(()=>{ | ||
| 147 | + this.data.isFollow = true | ||
| 148 | + }) | ||
| 149 | + } | ||
| 150 | + }.alignItems(VerticalAlign.Top) | ||
| 151 | + .width('100%') | ||
| 152 | + .layoutWeight(1) | ||
| 153 | + | ||
| 154 | + Divider().width('100%') | ||
| 155 | + .height('2lpx') | ||
| 156 | + .strokeWidth('1lpx') | ||
| 157 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 158 | + | ||
| 159 | + }.height('146lpx') | ||
| 160 | + .justifyContent(FlexAlign.Center) | ||
| 161 | + } | ||
| 162 | +} |
| 1 | +import { FollowListItem, FollowSecondListItem } from '../../../../viewmodel/FollowListItem' | ||
| 2 | +import { FollowListDetailUI } from './FollowListDetailUI' | ||
| 3 | +import { FollowThirdTabsComponent } from './FollowThirdTabsComponent' | ||
| 4 | + | ||
| 5 | +@Component | ||
| 6 | +export struct FollowSecondTabsComponent{ | ||
| 7 | + @Link data:FollowListItem[] | ||
| 8 | + @State firstIndex:number = 0 | ||
| 9 | + @State currentIndex: number = 0 | ||
| 10 | + private controller: TabsController = new TabsController() | ||
| 11 | + fontColor: string = '#000000' | ||
| 12 | + selectedFontColor: string = '#ED2800' | ||
| 13 | + | ||
| 14 | + aboutToAppear(){ | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + build(){ | ||
| 18 | + Column(){ | ||
| 19 | + Divider().width('100%') | ||
| 20 | + .height('2lpx') | ||
| 21 | + .strokeWidth('1lpx') | ||
| 22 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 23 | + | ||
| 24 | + if(this.data != null){ | ||
| 25 | + if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){ | ||
| 26 | + FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}) | ||
| 27 | + }else{ | ||
| 28 | + this.FollowSecondUI() | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | + .width('100%') | ||
| 33 | + .height('100%') | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + @Builder FollowSecondUI(){ | ||
| 37 | + Row() { | ||
| 38 | + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | ||
| 39 | + ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { | ||
| 40 | + TabContent(){ | ||
| 41 | + FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) | ||
| 42 | + }.tabBar(this.TabBuilder(index,item)) | ||
| 43 | + .backgroundColor($r('app.color.white')) | ||
| 44 | + }, (item: FollowListItem, index: number) => index.toString()) | ||
| 45 | + } | ||
| 46 | + .vertical(true) | ||
| 47 | + .barMode(BarMode.Scrollable) | ||
| 48 | + .barWidth('140lpx') | ||
| 49 | + .animationDuration(0) | ||
| 50 | + .onChange((index: number) => { | ||
| 51 | + this.currentIndex = index | ||
| 52 | + }) | ||
| 53 | + .width('100%') | ||
| 54 | + }.width('100%') | ||
| 55 | + .alignItems(VerticalAlign.Top) | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + @Builder TabBuilder(index: number, item: FollowSecondListItem) { | ||
| 59 | + Column(){ | ||
| 60 | + Text(item.directoryName) | ||
| 61 | + .width('100%') | ||
| 62 | + .height('38lpx') | ||
| 63 | + .fontSize('30lpx') | ||
| 64 | + .textAlign(TextAlign.Center) | ||
| 65 | + .fontWeight(this.currentIndex === index ? 600 : 400) | ||
| 66 | + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | ||
| 67 | + .lineHeight('38lpx') | ||
| 68 | + } | ||
| 69 | + .onClick(()=>{ | ||
| 70 | + this.currentIndex = index | ||
| 71 | + this.controller.changeIndex(this.currentIndex) | ||
| 72 | + }) | ||
| 73 | + .justifyContent(FlexAlign.Center) | ||
| 74 | + .height('84lpx') | ||
| 75 | + .backgroundColor(this.currentIndex === index?$r('app.color.white'):$r('app.color.color_F9F9F9')) | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | +} |
| 1 | +import { FollowListItem, FollowThirdListItem } from '../../../../viewmodel/FollowListItem' | ||
| 2 | +import { FollowListDetailUI } from './FollowListDetailUI' | ||
| 3 | + | ||
| 4 | +@Component | ||
| 5 | +export struct FollowThirdTabsComponent{ | ||
| 6 | + @Link data:FollowListItem[] | ||
| 7 | + @State currentIndex: number = 0 | ||
| 8 | + | ||
| 9 | + @Link firstIndex: number | ||
| 10 | + @State secondIndex:number = -1 | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + private controller: TabsController = new TabsController() | ||
| 14 | + fontColor: string = '#999999' | ||
| 15 | + selectedFontColor: string = '#000000' | ||
| 16 | + | ||
| 17 | + build(){ | ||
| 18 | + if(this.data != null){ | ||
| 19 | + if(this.data[this.firstIndex].children[this.secondIndex].children == null || this.data[this.firstIndex].children[this.secondIndex].children.length == 0){ | ||
| 20 | + FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].id}) | ||
| 21 | + }else{ | ||
| 22 | + this.FollowThirdUI() | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + @Builder TabBuilder(index: number, item: FollowThirdListItem) { | ||
| 28 | + Column(){ | ||
| 29 | + Text(item.directoryName) | ||
| 30 | + .fontSize('30lpx') | ||
| 31 | + .textAlign(TextAlign.Center) | ||
| 32 | + .fontWeight(this.currentIndex === index ? 600 : 400) | ||
| 33 | + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | ||
| 34 | + .lineHeight('38lpx') | ||
| 35 | + .backgroundColor($r('app.color.color_F9F9F9')) | ||
| 36 | + .padding('13lpx') | ||
| 37 | + } | ||
| 38 | + .onClick(()=>{ | ||
| 39 | + this.currentIndex = index | ||
| 40 | + this.controller.changeIndex(this.currentIndex) | ||
| 41 | + }) | ||
| 42 | + .height('100%') | ||
| 43 | + .margin({right:'9lpx'}) | ||
| 44 | + .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"}) | ||
| 45 | + .justifyContent(FlexAlign.Center) | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + @Builder FollowThirdUI(){ | ||
| 49 | + Row() { | ||
| 50 | + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | ||
| 51 | + ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { | ||
| 52 | + TabContent(){ | ||
| 53 | + Column(){ | ||
| 54 | + Divider().width('100%') | ||
| 55 | + .height('2lpx') | ||
| 56 | + .strokeWidth('1lpx') | ||
| 57 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 58 | + .margin({left:'20lpx'}) | ||
| 59 | + FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) | ||
| 60 | + } | ||
| 61 | + }.tabBar(this.TabBuilder(index,item)) | ||
| 62 | + .backgroundColor($r('app.color.white')) | ||
| 63 | + }, (item: FollowListItem, index: number) => index.toString()) | ||
| 64 | + } | ||
| 65 | + .vertical(false) | ||
| 66 | + .barMode(BarMode.Scrollable) | ||
| 67 | + .barWidth('100%') | ||
| 68 | + .barHeight('84lpx') | ||
| 69 | + .animationDuration(0) | ||
| 70 | + .onChange((index: number) => { | ||
| 71 | + this.currentIndex = index | ||
| 72 | + }) | ||
| 73 | + .width('100%') | ||
| 74 | + }.width('100%') | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | +} |
| 1 | +import router from '@ohos.router' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct CustomTitleUI { | ||
| 5 | + imgBack:boolean = true | ||
| 6 | + titleName:string = "默认标题" | ||
| 7 | + | ||
| 8 | + build() { | ||
| 9 | + RelativeContainer() { | ||
| 10 | + //标题栏目 | ||
| 11 | + if(this.imgBack){ | ||
| 12 | + Image($r('app.media.back_icon')) | ||
| 13 | + .width('46lpx') | ||
| 14 | + .height('46lpx') | ||
| 15 | + .objectFit(ImageFit.Auto) | ||
| 16 | + .id("back_icon") | ||
| 17 | + .alignRules({ | ||
| 18 | + center: {anchor: "__container__", align: VerticalAlign.Center}, | ||
| 19 | + left: {anchor: "__container__", align: HorizontalAlign.Start} | ||
| 20 | + }) | ||
| 21 | + .margin({left:'31lpx'}) | ||
| 22 | + .onClick(()=>{ | ||
| 23 | + router.back() | ||
| 24 | + }) | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + Text(this.titleName) | ||
| 28 | + .height('42lpx') | ||
| 29 | + .maxLines(1) | ||
| 30 | + .id("title") | ||
| 31 | + .fontSize('35lpx') | ||
| 32 | + .fontWeight(400) | ||
| 33 | + .fontColor($r('app.color.color_222222')) | ||
| 34 | + .lineHeight('42lpx') | ||
| 35 | + .alignRules({ | ||
| 36 | + center: {anchor: "__container__", align: VerticalAlign.Center}, | ||
| 37 | + middle: {anchor: "__container__", align: HorizontalAlign.Center} | ||
| 38 | + }) | ||
| 39 | + } | ||
| 40 | + .height('84lpx') | ||
| 41 | + .width('100%') | ||
| 42 | + .backgroundColor($r('app.color.white')) | ||
| 43 | + | ||
| 44 | + } | ||
| 45 | +} |
| 1 | +@Component | ||
| 2 | +export struct ListHasNoMoreDataUI{ | ||
| 3 | + build(){ | ||
| 4 | + Row(){ | ||
| 5 | + Text("已显示全部内容") | ||
| 6 | + .fontColor($r('app.color.color_999999')) | ||
| 7 | + .fontWeight('500lpx') | ||
| 8 | + .fontSize('23lpx') | ||
| 9 | + }.justifyContent(FlexAlign.Center) | ||
| 10 | + .width('100%') | ||
| 11 | + .margin({top:'20lpx',bottom:'20lpx'}) | ||
| 12 | + } | ||
| 13 | +} |
| 1 | +@Component | ||
| 2 | +export struct AlbumCard { | ||
| 3 | + // @Link isRefreshData: boolean; // Timer to fresh | ||
| 4 | + // @State title: Resource = $r('app.string.title_default'); | ||
| 5 | + | ||
| 6 | + build() { | ||
| 7 | + Flex({direction:FlexDirection.Column}) { | ||
| 8 | + Text('测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字' + | ||
| 9 | + '测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字' + | ||
| 10 | + '测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字') | ||
| 11 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 12 | + .fontSize(17) | ||
| 13 | + .fontColor(0x222222) | ||
| 14 | + .lineHeight(25) | ||
| 15 | + .maxLines(3) | ||
| 16 | + // .padding({ top: 6, | ||
| 17 | + // left: 16, | ||
| 18 | + // right: 16 }) | ||
| 19 | + .width('100%') | ||
| 20 | + .height(75) | ||
| 21 | + | ||
| 22 | + Grid() { | ||
| 23 | + GridItem() { | ||
| 24 | + Image($r('app.media.icon')) | ||
| 25 | + .width('100%') | ||
| 26 | + .height('100%') | ||
| 27 | + } | ||
| 28 | + .rowStart(1) | ||
| 29 | + .rowEnd(2) | ||
| 30 | + .backgroundColor(0xFF0000) | ||
| 31 | + | ||
| 32 | + GridItem() { | ||
| 33 | + Image($r('app.media.icon')) | ||
| 34 | + .width('100%') | ||
| 35 | + .height('100%') | ||
| 36 | + } | ||
| 37 | + .backgroundColor(0x00FF00) | ||
| 38 | + | ||
| 39 | + GridItem() { | ||
| 40 | + Stack({alignContent:Alignment.BottomEnd}) { | ||
| 41 | + Image($r('app.media.icon')) | ||
| 42 | + .width('100%') | ||
| 43 | + .height('100%') | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + Shape() { | ||
| 47 | + Rect().width(33).height(18) | ||
| 48 | + } | ||
| 49 | + // .viewPort({ x: -2, y: -2, width: 304, height: 130 }) | ||
| 50 | + .fill(0x000000) | ||
| 51 | + .fillOpacity(0.3) | ||
| 52 | + // .strokeDashArray([20]) | ||
| 53 | + // .strokeDashOffset(10) | ||
| 54 | + .strokeLineCap(LineCapStyle.Round) | ||
| 55 | + .strokeLineJoin(LineJoinStyle.Round) | ||
| 56 | + .antiAlias(true) | ||
| 57 | + .align(Alignment.BottomEnd) | ||
| 58 | + .margin({bottom:4,right:4}) | ||
| 59 | + | ||
| 60 | + Image($r('app.media.album_card_shape')) | ||
| 61 | + .width(22) | ||
| 62 | + .height(18) | ||
| 63 | + .align(Alignment.BottomEnd) | ||
| 64 | + .margin({bottom:4,right:15}) | ||
| 65 | + | ||
| 66 | + Text('6') | ||
| 67 | + .fontSize(13) | ||
| 68 | + .fontColor(0xFFFFFF) | ||
| 69 | + // .id('pageIndex') | ||
| 70 | + // .alignRules({ | ||
| 71 | + // right: {anchor: "shape", align: HorizontalAlign.End}, | ||
| 72 | + // top: {anchor: "shape", align: VerticalAlign.Top} | ||
| 73 | + // }) | ||
| 74 | + .textAlign(TextAlign.Center) | ||
| 75 | + .width(17) | ||
| 76 | + .height(17) | ||
| 77 | + .align(Alignment.BottomEnd) | ||
| 78 | + .margin({bottom:4,right:4}) | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + } | ||
| 82 | + .width('100%') | ||
| 83 | + .height('100%') | ||
| 84 | + } | ||
| 85 | + .backgroundColor(0x0000FF) | ||
| 86 | + } | ||
| 87 | + .rowsTemplate('1fr 1fr') | ||
| 88 | + .columnsTemplate('2fr 1fr') | ||
| 89 | + .columnsGap(2) | ||
| 90 | + .rowsGap(2) | ||
| 91 | + .width('100%') | ||
| 92 | + .height(154) | ||
| 93 | + // .aspectRatio(343/154) | ||
| 94 | + .margin({top:8}) | ||
| 95 | + | ||
| 96 | + Row() { | ||
| 97 | + Text('人民日报') | ||
| 98 | + .fontSize(13) | ||
| 99 | + .fontColor(0xB0B0B0) | ||
| 100 | + | ||
| 101 | + Image($r('app.media.album_card_divide')) | ||
| 102 | + .width(16) | ||
| 103 | + .height(16) | ||
| 104 | + | ||
| 105 | + Text('46分钟前') | ||
| 106 | + .fontSize(13) | ||
| 107 | + .fontColor(0xB0B0B0) | ||
| 108 | + | ||
| 109 | + Text('328评') | ||
| 110 | + .fontSize(13) | ||
| 111 | + .fontColor(0xB0B0B0) | ||
| 112 | + .margin({ | ||
| 113 | + left:6 | ||
| 114 | + }) | ||
| 115 | + } | ||
| 116 | + .width('100%') | ||
| 117 | + .height(16) | ||
| 118 | + .margin({top:8}) | ||
| 119 | + | ||
| 120 | + } | ||
| 121 | + .width('100%') | ||
| 122 | + .height(289) | ||
| 123 | + .padding({top: 14,left: 16,right: 16,bottom: 14}) | ||
| 124 | + // .aspectRatio(375 / 289) | ||
| 125 | + .backgroundColor(0x000000) | ||
| 126 | + } | ||
| 127 | +} |
| @@ -55,10 +55,21 @@ export struct BannerComponent { | @@ -55,10 +55,21 @@ export struct BannerComponent { | ||
| 55 | Image(item.coverUrl) | 55 | Image(item.coverUrl) |
| 56 | .objectFit(ImageFit.Fill) | 56 | .objectFit(ImageFit.Fill) |
| 57 | .borderRadius(5) | 57 | .borderRadius(5) |
| 58 | + .onClick(()=>{ | ||
| 59 | + AlertDialog.show({ | ||
| 60 | + title: '🥟id : ' + item.objectId, | ||
| 61 | + message: '标题:' + item.newsTitle, | ||
| 62 | + confirm: { | ||
| 63 | + value: "OK", | ||
| 64 | + action: () => { | ||
| 58 | 65 | ||
| 66 | + }, | ||
| 67 | + } | ||
| 68 | + }) | ||
| 69 | + }) | ||
| 59 | // 底部标题和时间 | 70 | // 底部标题和时间 |
| 60 | Column() { | 71 | Column() { |
| 61 | - Text(item.description) | 72 | + Text(item.newsTitle) |
| 62 | .fontSize(18) | 73 | .fontSize(18) |
| 63 | .margin({ bottom: 4 }) | 74 | .margin({ bottom: 4 }) |
| 64 | .fontColor(Color.White) | 75 | .fontColor(Color.White) |
| @@ -113,7 +124,7 @@ export struct BannerComponent { | @@ -113,7 +124,7 @@ export struct BannerComponent { | ||
| 113 | // 底部标题和时间 | 124 | // 底部标题和时间 |
| 114 | Row() { | 125 | Row() { |
| 115 | // 标题 | 126 | // 标题 |
| 116 | - Text(this.bannerContent.description.toString()) | 127 | + Text(this.bannerContent.newsTitle.toString()) |
| 117 | .fontSize(18) | 128 | .fontSize(18) |
| 118 | .fontColor(Color.White) | 129 | .fontColor(Color.White) |
| 119 | .fontWeight(600) | 130 | .fontWeight(600) |
| @@ -29,7 +29,10 @@ export struct BigPicCardComponent { | @@ -29,7 +29,10 @@ export struct BigPicCardComponent { | ||
| 29 | //大图 | 29 | //大图 |
| 30 | Stack() { | 30 | Stack() { |
| 31 | Image(this.compDTO.operDataList[0].coverUrl) | 31 | Image(this.compDTO.operDataList[0].coverUrl) |
| 32 | + .backgroundColor('#888888') | ||
| 32 | .borderRadius(4) | 33 | .borderRadius(4) |
| 34 | + .width('100%') | ||
| 35 | + .aspectRatio(343 / 192) | ||
| 33 | 36 | ||
| 34 | 37 | ||
| 35 | //播放状态+时长 | 38 | //播放状态+时长 |
| @@ -50,7 +53,6 @@ export struct BigPicCardComponent { | @@ -50,7 +53,6 @@ export struct BigPicCardComponent { | ||
| 50 | 53 | ||
| 51 | } | 54 | } |
| 52 | .width('100%') | 55 | .width('100%') |
| 53 | - .height(192) | ||
| 54 | .alignContent(Alignment.BottomEnd) | 56 | .alignContent(Alignment.BottomEnd) |
| 55 | .margin({top:8}) | 57 | .margin({top:8}) |
| 56 | 58 | ||
| @@ -91,97 +93,6 @@ export struct BigPicCardComponent { | @@ -91,97 +93,6 @@ export struct BigPicCardComponent { | ||
| 91 | 93 | ||
| 92 | } | 94 | } |
| 93 | 95 | ||
| 94 | - | ||
| 95 | - | ||
| 96 | -/** | ||
| 97 | - * 大图卡 中部 | ||
| 98 | - * 包括:视频图、视频时长 | ||
| 99 | - */ | ||
| 100 | -@Component | ||
| 101 | -export struct myBigCard_body { | ||
| 102 | - private newsSrc:string ="https://k.sinaimg.cn/n/default/crawl/190/w550h440/20240118/6772-7c2385bb2741c6f88906af3514d27343.png/w700d1q75cms.jpg"; | ||
| 103 | - private newsTitle:string ="时政微观察丨新征程金融工作怎么干?“新年第一课”这样讲"; | ||
| 104 | - | ||
| 105 | - build() { | ||
| 106 | - Column() { | ||
| 107 | - //新闻标题 | ||
| 108 | - Text(this.newsTitle) | ||
| 109 | - .fontSize(17) | ||
| 110 | - .fontColor('#222222') | ||
| 111 | - .maxLines(3) | ||
| 112 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | ||
| 113 | - //大图 | ||
| 114 | - Stack() { | ||
| 115 | - Image(this.newsSrc) | ||
| 116 | - .borderRadius(4) | ||
| 117 | - | ||
| 118 | - | ||
| 119 | - //播放状态+时长 | ||
| 120 | - Row() { | ||
| 121 | - Image($r('app.media.icon_live')) | ||
| 122 | - .width(22) | ||
| 123 | - .height(18) | ||
| 124 | - | ||
| 125 | - Stack() { | ||
| 126 | - Text('直播中') | ||
| 127 | - .fontColor('#FFFFFF') | ||
| 128 | - .fontSize(11) | ||
| 129 | - } | ||
| 130 | - .width(44) | ||
| 131 | - .height(18) | ||
| 132 | - .backgroundColor('#4d000000') | ||
| 133 | - }.margin({right:8,bottom:8}) | ||
| 134 | - | ||
| 135 | - } | ||
| 136 | - .width('100%') | ||
| 137 | - .height(192) | ||
| 138 | - .alignContent(Alignment.BottomEnd) | ||
| 139 | - .margin({top:8}) | ||
| 140 | - | ||
| 141 | - } | ||
| 142 | - .width('100%') | ||
| 143 | - .justifyContent(FlexAlign.Start) | ||
| 144 | - } | ||
| 145 | - | ||
| 146 | -} | ||
| 147 | - | ||
| 148 | -/** | ||
| 149 | - * 大图卡 底部 | ||
| 150 | - * 包括:分享、评论、点赞 三个按钮 | ||
| 151 | - */ | ||
| 152 | - | ||
| 153 | -@Component | ||
| 154 | -export struct myBigCard_bottom { | ||
| 155 | - private bottom_height:number = 18 | ||
| 156 | - private itemSubtitle1:string = "人民日报" | ||
| 157 | - private itemSubtitle2:string = "25分钟前" | ||
| 158 | - private itemSubtitle3:string = "786条评论" | ||
| 159 | - build() { | ||
| 160 | - //子标题 | ||
| 161 | - Row() { | ||
| 162 | - Text(this.itemSubtitle1) | ||
| 163 | - .bottomTextStyle() | ||
| 164 | - //间隔点 | ||
| 165 | - Image($r('app.media.point')) | ||
| 166 | - .width(12) | ||
| 167 | - .height(12) | ||
| 168 | - | ||
| 169 | - Text(this.itemSubtitle2) | ||
| 170 | - .bottomTextStyle() | ||
| 171 | - Text(' ') | ||
| 172 | - | ||
| 173 | - Text(this.itemSubtitle3) | ||
| 174 | - .bottomTextStyle() | ||
| 175 | - | ||
| 176 | - } | ||
| 177 | - .width('100%') | ||
| 178 | - .height(this.bottom_height) | ||
| 179 | - .justifyContent(FlexAlign.Start) | ||
| 180 | - | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | -} | ||
| 184 | - | ||
| 185 | @Extend(Text) function bottomTextStyle() { | 96 | @Extend(Text) function bottomTextStyle() { |
| 186 | .fontSize(12) | 97 | .fontSize(12) |
| 187 | .fontColor('#B0B0B0') | 98 | .fontColor('#B0B0B0') |
| 1 | import { CommonConstants } from 'wdConstant'; | 1 | import { CommonConstants } from 'wdConstant'; |
| 2 | import thermal from '@ohos.thermal'; | 2 | import thermal from '@ohos.thermal'; |
| 3 | import { CompDTO } from '../../repository/bean/CompDTO'; | 3 | import { CompDTO } from '../../repository/bean/CompDTO'; |
| 4 | +import { ContentDTO } from '../../repository/bean/ContentDTO'; | ||
| 4 | import { CompUtils } from '../../utils/CompUtils'; | 5 | import { CompUtils } from '../../utils/CompUtils'; |
| 5 | 6 | ||
| 6 | @Component | 7 | @Component |
| 7 | export struct HeadPictureCardComponent { | 8 | export struct HeadPictureCardComponent { |
| 8 | @State compDTO: CompDTO = {} as CompDTO | 9 | @State compDTO: CompDTO = {} as CompDTO |
| 10 | + private item: ContentDTO | ||
| 11 | + | ||
| 12 | + aboutToAppear() { | ||
| 13 | + | ||
| 14 | + // Data Initialization. | ||
| 15 | + this.item = this.compDTO.operDataList[0]; | ||
| 16 | + } | ||
| 9 | 17 | ||
| 10 | build() { | 18 | build() { |
| 11 | Stack() { | 19 | Stack() { |
| 12 | - Image(this.compDTO.backgroundImgUrl) | 20 | + Image(this.item.coverUrl) |
| 13 | .width(CommonConstants.FULL_WIDTH) | 21 | .width(CommonConstants.FULL_WIDTH) |
| 14 | .height(CommonConstants.FULL_HEIGHT) | 22 | .height(CommonConstants.FULL_HEIGHT) |
| 15 | - if (this.compDTO.extraData.length > 0) { | 23 | + |
| 24 | + if (this.item.newsTitle != null) { | ||
| 16 | Row() | 25 | Row() |
| 17 | .width(CommonConstants.FULL_WIDTH) | 26 | .width(CommonConstants.FULL_WIDTH) |
| 18 | .height(59) | 27 | .height(59) |
| @@ -22,20 +31,34 @@ export struct HeadPictureCardComponent { | @@ -22,20 +31,34 @@ export struct HeadPictureCardComponent { | ||
| 22 | ] | 31 | ] |
| 23 | }) | 32 | }) |
| 24 | Row() { | 33 | Row() { |
| 25 | - Text(CompUtils.getLabelTitle(this.compDTO.extraData)) | 34 | + Text(this.item.newsTitle) |
| 26 | .width(CommonConstants.FULL_WIDTH) | 35 | .width(CommonConstants.FULL_WIDTH) |
| 27 | .height(CommonConstants.FULL_HEIGHT) | 36 | .height(CommonConstants.FULL_HEIGHT) |
| 28 | .fontColor(Color.White) | 37 | .fontColor(Color.White) |
| 29 | .fontSize($r('app.float.normal_text_size')) | 38 | .fontSize($r('app.float.normal_text_size')) |
| 30 | .fontWeight(FontWeight.Bold) | 39 | .fontWeight(FontWeight.Bold) |
| 31 | .maxLines(2) | 40 | .maxLines(2) |
| 41 | + .align(Alignment.Bottom) | ||
| 32 | } | 42 | } |
| 33 | - .height(25) | 43 | + .height(40) |
| 34 | .margin({left: 12, bottom: 10, right: 12}) | 44 | .margin({left: 12, bottom: 10, right: 12}) |
| 35 | } | 45 | } |
| 36 | } | 46 | } |
| 37 | .alignContent(Alignment.Bottom) | 47 | .alignContent(Alignment.Bottom) |
| 38 | .width(CommonConstants.FULL_WIDTH) | 48 | .width(CommonConstants.FULL_WIDTH) |
| 49 | + .aspectRatio(imageSizeRatio(this.item.coverSize)) | ||
| 39 | .height(200) | 50 | .height(200) |
| 40 | } | 51 | } |
| 41 | } | 52 | } |
| 53 | + | ||
| 54 | +function imageSizeRatio(size: string): number { | ||
| 55 | + if (size != null) { | ||
| 56 | + let parts: string[] = size.split("*"); | ||
| 57 | + let f = Number(parts[0]) | ||
| 58 | + let s = Number(parts[1]) | ||
| 59 | + return f / s; | ||
| 60 | + } else { | ||
| 61 | + return 1.0 | ||
| 62 | + } | ||
| 63 | +} | ||
| 64 | + |
| 1 | -// import { CommonConstants } from 'wdConstant/src/main/ets/constants/CommonConstants' | ||
| 2 | - | ||
| 3 | -@Entry | 1 | +import { CompDTO } from '../../repository/bean/CompDTO'; |
| 2 | +/** | ||
| 3 | + * 小视频卡 | ||
| 4 | + */ | ||
| 4 | @Component | 5 | @Component |
| 5 | export struct SmallVideoCardComponent { | 6 | export struct SmallVideoCardComponent { |
| 7 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 8 | + | ||
| 6 | build() { | 9 | build() { |
| 7 | Row() { | 10 | Row() { |
| 8 | Column() { | 11 | Column() { |
PeopleDaily_Harmony/wdComponent/src/main/ets/components/view/SmallVideoCardHorComponent.ets
0 → 100644
| 1 | +import { CompDTO } from '../../repository/bean/CompDTO' | ||
| 2 | +import { ContentDTO } from '../../repository/bean/ContentDTO' | ||
| 3 | +/** | ||
| 4 | + * 通用 小视频卡3张以下 | ||
| 5 | + */ | ||
| 6 | +@Component | ||
| 7 | +export struct SmallVideoCardHorComponent { | ||
| 8 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Column() { | ||
| 12 | + this.labelTabStyle() | ||
| 13 | + List({ space: 8 }) { | ||
| 14 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 15 | + ListItem() { | ||
| 16 | + this.itemStyle(item) | ||
| 17 | + } | ||
| 18 | + }, (item: string, index: number) => { | ||
| 19 | + return index.toString() | ||
| 20 | + }) | ||
| 21 | + } | ||
| 22 | + .listDirection(Axis.Horizontal) | ||
| 23 | + .margin({ | ||
| 24 | + left: 16 | ||
| 25 | + }) | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + @Builder | ||
| 30 | + itemStyle(item: ContentDTO) { | ||
| 31 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 32 | + Image(item.coverUrl) | ||
| 33 | + .width(156) | ||
| 34 | + .aspectRatio(156 / 208) | ||
| 35 | + Row() { | ||
| 36 | + Text(item.title) | ||
| 37 | + .fontColor('#FFFFFF') | ||
| 38 | + .fontSize('14fp') | ||
| 39 | + .fontWeight(600) | ||
| 40 | + } | ||
| 41 | + .height(80) | ||
| 42 | + .aspectRatio(156 / 80) | ||
| 43 | + .linearGradient({ angle: 0, colors: [['#0000000', 0], ['#4d000000', 0.7], [Color.Transparent, 1]] }) | ||
| 44 | + .alignItems(VerticalAlign.Bottom) | ||
| 45 | + .padding({ left: 8, | ||
| 46 | + right: 8, | ||
| 47 | + bottom: 8 }) | ||
| 48 | + }.border({ radius: 2 }) | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @Builder | ||
| 52 | + labelTabStyle() { | ||
| 53 | + Row() { | ||
| 54 | + Image($r('app.media.iv_line_vertical_label')) | ||
| 55 | + .width(3) | ||
| 56 | + .height(16) | ||
| 57 | + Text(this.compDTO.name) | ||
| 58 | + .fontSize('17sp') | ||
| 59 | + .fontColor('#222222') | ||
| 60 | + .fontWeight(600) | ||
| 61 | + .maxLines(1) | ||
| 62 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 63 | + .layoutWeight(1) | ||
| 64 | + .margin({ | ||
| 65 | + left: 5 | ||
| 66 | + }) | ||
| 67 | + if (this.compDTO.operDataList.length >= 3) { | ||
| 68 | + Text('更多') | ||
| 69 | + .fontSize('14sp') | ||
| 70 | + .fontColor('#999999') | ||
| 71 | + .fontWeight(400) | ||
| 72 | + Image($r('app.media.iv_arrow_right_gray')) | ||
| 73 | + .width(14) | ||
| 74 | + .height(14) | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + .width('100%') | ||
| 78 | + .height('44vp') | ||
| 79 | + .padding({ | ||
| 80 | + left: 16, | ||
| 81 | + right: 16 | ||
| 82 | + }) | ||
| 83 | + } | ||
| 84 | +} |
| 1 | //全标题 "compStyle":"4", | 1 | //全标题 "compStyle":"4", |
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | +import { DateTimeUtils } from 'wdKit'; | ||
| 3 | import { CompDTO } from '../../repository/bean/CompDTO' | 4 | import { CompDTO } from '../../repository/bean/CompDTO' |
| 4 | const TAG: string = 'TriPicCardComponent'; | 5 | const TAG: string = 'TriPicCardComponent'; |
| 5 | 6 | ||
| @@ -10,7 +11,7 @@ const TAG: string = 'TriPicCardComponent'; | @@ -10,7 +11,7 @@ const TAG: string = 'TriPicCardComponent'; | ||
| 10 | * 卡片宽度:充满父窗口 | 11 | * 卡片宽度:充满父窗口 |
| 11 | * 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9: | 12 | * 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9: |
| 12 | */ | 13 | */ |
| 13 | -// @Entry | 14 | +@Entry |
| 14 | @Component | 15 | @Component |
| 15 | export struct TriPicCardComponent { | 16 | export struct TriPicCardComponent { |
| 16 | @State compDTO: CompDTO = {} as CompDTO | 17 | @State compDTO: CompDTO = {} as CompDTO |
| @@ -31,23 +32,21 @@ export struct TriPicCardComponent { | @@ -31,23 +32,21 @@ export struct TriPicCardComponent { | ||
| 31 | Row() { | 32 | Row() { |
| 32 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[0]?.url) | 33 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[0]?.url) |
| 33 | .width('32%') | 34 | .width('32%') |
| 34 | - | ||
| 35 | - .height(75) | 35 | + .aspectRatio(113 / 75) |
| 36 | .borderRadius({ topLeft:4,bottomLeft:4 }) | 36 | .borderRadius({ topLeft:4,bottomLeft:4 }) |
| 37 | 37 | ||
| 38 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[1]?.url) | 38 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[1]?.url) |
| 39 | .width('32%') | 39 | .width('32%') |
| 40 | - .height(75) | 40 | + .aspectRatio(113 / 75) |
| 41 | 41 | ||
| 42 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[2]?.url) | 42 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[2]?.url) |
| 43 | .width('32%') | 43 | .width('32%') |
| 44 | - .height(75) | 44 | + .aspectRatio(113 / 75) |
| 45 | .borderRadius({ topRight:4,bottomRight:4 }) | 45 | .borderRadius({ topRight:4,bottomRight:4 }) |
| 46 | 46 | ||
| 47 | } | 47 | } |
| 48 | .justifyContent(FlexAlign.SpaceBetween) | 48 | .justifyContent(FlexAlign.SpaceBetween) |
| 49 | .width('100%') | 49 | .width('100%') |
| 50 | - .height(75) | ||
| 51 | .margin({top:8}) | 50 | .margin({top:8}) |
| 52 | .borderRadius(8) | 51 | .borderRadius(8) |
| 53 | 52 | ||
| @@ -67,7 +66,7 @@ export struct TriPicCardComponent { | @@ -67,7 +66,7 @@ export struct TriPicCardComponent { | ||
| 67 | .width(12) | 66 | .width(12) |
| 68 | .height(12) | 67 | .height(12) |
| 69 | 68 | ||
| 70 | - Text(this.compDTO.operDataList[0].publishTime) | 69 | + Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) |
| 71 | .bottomTextStyle() | 70 | .bottomTextStyle() |
| 72 | Text(' ') | 71 | Text(' ') |
| 73 | 72 |
| 1 | + | ||
| 2 | +import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunctionsItem' | ||
| 3 | +import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem' | ||
| 4 | +import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; | ||
| 5 | +import { HttpUrlUtils } from '../network/HttpUrlUtils'; | ||
| 6 | +import HashMap from '@ohos.util.HashMap'; | ||
| 7 | +import { ResponseDTO, WDHttp } from 'wdNetwork'; | ||
| 8 | +import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; | ||
| 9 | +import { Logger, ResourcesUtils } from 'wdKit'; | ||
| 10 | +const TAG = "MinePageDatasModel" | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 我的页面 所有数据 获取封装类 | ||
| 14 | + */ | ||
| 15 | +class MinePageDatasModel{ | ||
| 16 | + private static instance: MinePageDatasModel; | ||
| 17 | + personalData:MinePagePersonalFunctionsItem[] = [] | ||
| 18 | + creatorData:MinePageCreatorFunctionsItem[] = [] | ||
| 19 | + moreData:MinePageMoreFunctionModel[] = [] | ||
| 20 | + | ||
| 21 | + private constructor() { } | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 单例模式 | ||
| 25 | + * @returns | ||
| 26 | + */ | ||
| 27 | + public static getInstance(): MinePageDatasModel { | ||
| 28 | + if (!MinePageDatasModel.instance) { | ||
| 29 | + MinePageDatasModel.instance = new MinePageDatasModel(); | ||
| 30 | + } | ||
| 31 | + return MinePageDatasModel.instance; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 评论 关注 收藏 等7个数据 | ||
| 39 | + * 包含名字和图标 | ||
| 40 | + */ | ||
| 41 | + getPersonalFunctionsData():MinePagePersonalFunctionsItem[]{ | ||
| 42 | + if(this.personalData.length === 7){ | ||
| 43 | + return this.personalData | ||
| 44 | + } | ||
| 45 | + this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) | ||
| 46 | + this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_order_icon'))) | ||
| 47 | + this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) | ||
| 48 | + this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) | ||
| 49 | + this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | ||
| 50 | + this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon'))) | ||
| 51 | + this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon'))) | ||
| 52 | + return this.personalData | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 发布文章 发布视频 等4个数据 | ||
| 58 | + * 包含名字和图标 | ||
| 59 | + */ | ||
| 60 | + getCreatorFunctionsData():MinePageCreatorFunctionsItem[]{ | ||
| 61 | + if(this.creatorData.length === 4){ | ||
| 62 | + return this.creatorData | ||
| 63 | + } | ||
| 64 | + this.creatorData.push(new MinePageCreatorFunctionsItem("发布文章",$r('app.media.mine_active_create_article'))) | ||
| 65 | + this.creatorData.push(new MinePageCreatorFunctionsItem("发布视频",$r('app.media.mine_active_create_video'))) | ||
| 66 | + this.creatorData.push(new MinePageCreatorFunctionsItem("发布动态",$r('app.media.mine_active_create_video'))) | ||
| 67 | + this.creatorData.push(new MinePageCreatorFunctionsItem("发布图集",$r('app.media.mine_active_create_pics'))) | ||
| 68 | + return this.creatorData | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 扫一扫 我的奖品 等5个数据 | ||
| 73 | + * 包含名字和图标 | ||
| 74 | + */ | ||
| 75 | + getMoreFunctionsData():MinePageCreatorFunctionsItem[]{ | ||
| 76 | + if(this.moreData.length === 5){ | ||
| 77 | + return this.moreData | ||
| 78 | + } | ||
| 79 | + this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) | ||
| 80 | + this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift'))) | ||
| 81 | + this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest'))) | ||
| 82 | + this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting'))) | ||
| 83 | + this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about'))) | ||
| 84 | + return this.moreData | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 扫一扫 我的奖品 等5个数据 | ||
| 89 | + * 包含名字和图标 | ||
| 90 | + */ | ||
| 91 | + getSettingFunctionsData():MinePageCreatorFunctionsItem[]{ | ||
| 92 | + if(this.moreData.length === 5){ | ||
| 93 | + return this.moreData | ||
| 94 | + } | ||
| 95 | + this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) | ||
| 96 | + this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift'))) | ||
| 97 | + this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest'))) | ||
| 98 | + this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting'))) | ||
| 99 | + this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about'))) | ||
| 100 | + return this.moreData | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + fetchAppointmentListData(pageSize:string,pageNum:string) { | ||
| 104 | + let url = HttpUrlUtils.getAppointmentListDataUrl()+ `?pageSize=${pageSize}&pageNum=${pageNum}` | ||
| 105 | + let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders(); | ||
| 106 | + return WDHttp.get<ResponseDTO<MineAppointmentListItem>>(url, headers) | ||
| 107 | + }; | ||
| 108 | + | ||
| 109 | + getAppointmentListData(pageSize:string,pageNum:string,context?: Context): Promise<MineAppointmentListItem> { | ||
| 110 | + return new Promise<MineAppointmentListItem>((success, error) => { | ||
| 111 | + Logger.info(TAG, `getAppointmentList start`); | ||
| 112 | + this.fetchAppointmentListData(pageSize,pageNum).then((navResDTO: ResponseDTO<MineAppointmentListItem>) => { | ||
| 113 | + if (!navResDTO) { | ||
| 114 | + error("page data invalid"); | ||
| 115 | + success(this.getAppointmentListDataLocal(context)) | ||
| 116 | + return | ||
| 117 | + } | ||
| 118 | + Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 119 | + let navigationBean = navResDTO.data | ||
| 120 | + success(navigationBean); | ||
| 121 | + }).catch((err: Error) => { | ||
| 122 | + Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 123 | + // error(err); | ||
| 124 | + success(this.getAppointmentListDataLocal(context)) | ||
| 125 | + }) | ||
| 126 | + }) | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + async getAppointmentListDataLocal(context?: Context): Promise<MineAppointmentListItem> { | ||
| 130 | + Logger.info(TAG, `getBottomNavDataMock start`); | ||
| 131 | + let compRes: ResponseDTO<MineAppointmentListItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineAppointmentListItem>>('appointment_list_data.json', context); | ||
| 132 | + if (!compRes || !compRes.data) { | ||
| 133 | + Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); | ||
| 134 | + return null | ||
| 135 | + } | ||
| 136 | + Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | ||
| 137 | + return compRes.data | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + | ||
| 141 | +} | ||
| 142 | + | ||
| 143 | +const minePageDatasModel = MinePageDatasModel.getInstance() | ||
| 144 | +export default minePageDatasModel as MinePageDatasModel |
| 1 | + | ||
| 2 | +import MinePagePersonalFunctionsItem from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MinePagePersonalFunctionsItem' | ||
| 3 | +import MinePageCreatorFunctionsItem from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MinePageCreatorFunctionsItem' | ||
| 4 | +import MinePageMoreFunctionModel from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MinePageMoreFunctionModel'; | ||
| 5 | +import { HttpUrlUtils } from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/network/HttpUrlUtils'; | ||
| 6 | +import HashMap from '@ohos.util.HashMap'; | ||
| 7 | +import { ResponseDTO, WDHttp } from 'wdNetwork'; | ||
| 8 | +import { Logger } from 'wdKit'; | ||
| 9 | +import { MineMainSettingFunctionItem } from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MineMainSettingFunctionItem' | ||
| 10 | + | ||
| 11 | +const TAG = "MineSettingDatasModel" | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 我的设置页面 所有数据 获取封装类 | ||
| 15 | + */ | ||
| 16 | +class MineSettingDatasModel{ | ||
| 17 | + private static instance: MineSettingDatasModel; | ||
| 18 | + mainSettingData:MineMainSettingFunctionItem[] = [] | ||
| 19 | + accountAndSecurityData:MineMainSettingFunctionItem[] = [] | ||
| 20 | + | ||
| 21 | + private constructor() { } | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 单例模式 | ||
| 25 | + * @returns | ||
| 26 | + */ | ||
| 27 | + public static getInstance(): MineSettingDatasModel { | ||
| 28 | + if (!MineSettingDatasModel.instance) { | ||
| 29 | + MineSettingDatasModel.instance = new MineSettingDatasModel(); | ||
| 30 | + } | ||
| 31 | + return MineSettingDatasModel.instance; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 评论 关注 收藏 等7个数据 | ||
| 39 | + * 包含名字和图标 | ||
| 40 | + */ | ||
| 41 | + getMineMainSettingFunctionItemData():MineMainSettingFunctionItem[]{ | ||
| 42 | + if(this.mainSettingData.length === 7){ | ||
| 43 | + return this.mainSettingData | ||
| 44 | + } | ||
| 45 | + this.mainSettingData = [] | ||
| 46 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '账户与安全', '18888888888', 0, false)) | ||
| 47 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '接收推送', null, 1, false)) | ||
| 48 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false)) | ||
| 49 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '仅WiFi网络加载图片', null, 1, false)) | ||
| 50 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'WiFi网络情况下自动播放视频', null, 1, false)) | ||
| 51 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开户播放器悬浮窗', null, 1, false)) | ||
| 52 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | ||
| 53 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清除缓存', '32MB', 0, false)) | ||
| 54 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '去评分', null, 0, false)) | ||
| 55 | + | ||
| 56 | + return this.mainSettingData | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 评论 关注 收藏 等7个数据 | ||
| 61 | + * 包含名字和图标 | ||
| 62 | + */ | ||
| 63 | + getAccountAndSecuritySettingData():MineMainSettingFunctionItem[]{ | ||
| 64 | + if(this.accountAndSecurityData.length === 7){ | ||
| 65 | + return this.accountAndSecurityData | ||
| 66 | + } | ||
| 67 | + this.accountAndSecurityData = [] | ||
| 68 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '更换手机号', '18888888888', 0, false)) | ||
| 69 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '设置密码', null, 0, false)) | ||
| 70 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | ||
| 71 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_qqicon'), '绑定QQ', '立即绑定', 0, false)) | ||
| 72 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_wechaticon'), '绑定微信', '立即绑定', 0, false)) | ||
| 73 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_weiboicon'), '绑定新浪微博', '立即绑定', 0, false)) | ||
| 74 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_appleicon'), 'Apple ID', null, 0, false)) | ||
| 75 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | ||
| 76 | + | ||
| 77 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '注销账号', null, 0, false)) | ||
| 78 | + | ||
| 79 | + return this.accountAndSecurityData | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + | ||
| 83 | + | ||
| 84 | + // 网络请求设置数据 | ||
| 85 | + fetchAppointmentListData(pageSize:string,pageNum:string) { | ||
| 86 | + // let url = HttpUrlUtils.getAppointmentListDataUrl()+ `?pageSize=${pageSize}&pageNum=${pageNum}` | ||
| 87 | + // let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders(); | ||
| 88 | + // return WDHttp.get<ResponseDTO<MineAppointmentListItem>>(url, headers) | ||
| 89 | + }; | ||
| 90 | + | ||
| 91 | + // getAppointmentListData(pageSize:string,pageNum:string): Promise<MineAppointmentListItem> { | ||
| 92 | + // return new Promise<MineAppointmentListItem>((success, error) => { | ||
| 93 | + // Logger.info(TAG, `getAppointmentList start`); | ||
| 94 | + // this.fetchAppointmentListData(pageSize,pageNum).then((navResDTO: ResponseDTO<MineAppointmentListItem>) => { | ||
| 95 | + // if (!navResDTO) { | ||
| 96 | + // error("page data invalid"); | ||
| 97 | + // return | ||
| 98 | + // } | ||
| 99 | + // Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 100 | + // let navigationBean = navResDTO.data | ||
| 101 | + // success(navigationBean); | ||
| 102 | + // }).catch((err: Error) => { | ||
| 103 | + // Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 104 | + // error(err); | ||
| 105 | + // }) | ||
| 106 | + // }) | ||
| 107 | + // } | ||
| 108 | + | ||
| 109 | +} | ||
| 110 | + | ||
| 111 | +const mineSettingDatasModel = MineSettingDatasModel.getInstance() | ||
| 112 | +export default mineSettingDatasModel as MineSettingDatasModel |
| @@ -47,6 +47,11 @@ export class HttpUrlUtils { | @@ -47,6 +47,11 @@ export class HttpUrlUtils { | ||
| 47 | * 批查接口,查询互动相关数据,如收藏数、评论数等 | 47 | * 批查接口,查询互动相关数据,如收藏数、评论数等 |
| 48 | */ | 48 | */ |
| 49 | static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData"; | 49 | static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData"; |
| 50 | + /** | ||
| 51 | + * 个人中心 我的预约列表 | ||
| 52 | + */ | ||
| 53 | + static readonly APPOINTMENT_LIST_DATA_PATH: string = "/api/live-center-message/zh/c/live/subscribe"; | ||
| 54 | + | ||
| 50 | private static hostUrl: string = HttpUrlUtils.HOST_UAT; | 55 | private static hostUrl: string = HttpUrlUtils.HOST_UAT; |
| 51 | 56 | ||
| 52 | static getCommonHeaders(): HashMap<string, string> { | 57 | static getCommonHeaders(): HashMap<string, string> { |
| @@ -86,6 +91,44 @@ export class HttpUrlUtils { | @@ -86,6 +91,44 @@ export class HttpUrlUtils { | ||
| 86 | return headers; | 91 | return headers; |
| 87 | } | 92 | } |
| 88 | 93 | ||
| 94 | + static getYcgCommonHeaders(): HashMap<string, string> { | ||
| 95 | + let headers: HashMap<string, string> = new HashMap<string, string>() | ||
| 96 | + | ||
| 97 | + headers.set('mpassid', 'XGt6jfGUx8ADAKruTyAMdhHj') | ||
| 98 | + headers.set('city', "%E5%90%88%E8%82%A5%E5%B8%82") | ||
| 99 | + headers.set('User-Agent', 'Dalvik/2.1.0 (Linux; U; Android 10; PCT-AL10 Build/HUAWEIPCT-AL10)') | ||
| 100 | + headers.set('channel', "rmrb_china_0000") | ||
| 101 | + headers.set('appCode', "0af1f9085e484c97b2a44704bae72c07") | ||
| 102 | + headers.set('Authorization', "APPCODE 0af1f9085e484c97b2a44704bae72c07") | ||
| 103 | + headers.set('X-Ca-Stage', "TEST") | ||
| 104 | + headers.set('plat', "Phone") | ||
| 105 | + headers.set('Content-Type', 'application/json; charset=utf-8') | ||
| 106 | + headers.set('timestamp', "649773304") | ||
| 107 | + headers.set('RMRB-X-TOKEN', "eyJhbGciOiJIUzI1NiIsImtpZCI6IklFazBGclhfV2RYMEx1ZktDU01iYTVYd0VmUHZ6a043T0F5UTRFLWIwWU0ifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcxMDU4Mzk0MywidXNlcklkIjo1NjczODc0NzcwNjM2MjEsInVzZXJWZXJzaW9uIjoiNTY3Mzg3NDc3MDYzNjIxXzAiLCJ1c2VyTmFtZSI6IiVFNCVCQSVCQSVFNiVCMCU5MSVFNiU5NyVBNSVFNiU4QSVBNSVFNyVCRCU5MSVFNSU4RiU4QmFQcnRxNSIsInVzZXJUeXBlIjoxLCJjcmVhdG9ySWQiOm51bGwsInVzZXJJZFpoIjpudWxsfQ._LTKrUxQozpCj1XMhx1TWOIxn5gjDveoPuMFGpI0g_8") | ||
| 108 | + headers.set('device_id', "5156098c-6c44-3514-af70-04a0139a9327") | ||
| 109 | + headers.set('cookie', 'RMRB-X-TOKEN=eyJhbGciOiJIUzI1NiIsImtpZCI6IklFazBGclhfV2RYMEx1ZktDU01iYTVYd0VmUHZ6a043T0F5UTRFLWIwWU0ifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcxMDU4Mzk0MywidXNlcklkIjo1NjczODc0NzcwNjM2MjEsInVzZXJWZXJzaW9uIjoiNTY3Mzg3NDc3MDYzNjIxXzAiLCJ1c2VyTmFtZSI6IiVFNCVCQSVCQSVFNiVCMCU5MSVFNiU5NyVBNSVFNiU4QSVBNSVFNyVCRCU5MSVFNSU4RiU4QmFQcnRxNSIsInVzZXJUeXBlIjoxLCJjcmVhdG9ySWQiOm51bGwsInVzZXJJZFpoIjpudWxsfQ._LTKrUxQozpCj1XMhx1TWOIxn5gjDveoPuMFGpI0g_8') | ||
| 110 | + headers.set('build_version', "202403112023") | ||
| 111 | + headers.set('adcode', "340000") | ||
| 112 | + headers.set('os_version', "10") | ||
| 113 | + headers.set('city_dode', "340100") | ||
| 114 | + headers.set('userId', "567387477063621") | ||
| 115 | + headers.set('versionCode', "7302") | ||
| 116 | + headers.set('system', "Android") | ||
| 117 | + headers.set('version_name', "7.3.0.2") | ||
| 118 | + headers.set('EagleEye-TraceID', '5C3D0800CF2C4440A43E5B131187629B') | ||
| 119 | + headers.set('imei', "5156098c-6c44-3514-af70-04a0139a9327") | ||
| 120 | + headers.set('userType', "1") | ||
| 121 | + headers.set('Accept-Language', 'zh') | ||
| 122 | + | ||
| 123 | + // HttpUrlUtils.addSpecialHeaders(headers); | ||
| 124 | + // Logger.debug("TAG", '******************* commonHeaders headers start ******************************** '); | ||
| 125 | + // headers.forEach((v,k)=>{ | ||
| 126 | + // Logger.debug("TAG", 'getCommonHeaders header: ' + k + ': ' + v); | ||
| 127 | + // }) | ||
| 128 | + // Logger.debug("TAG", '******************* commonHeaders headers end ******************************** '); | ||
| 129 | + return headers; | ||
| 130 | + } | ||
| 131 | + | ||
| 89 | static getHost() { | 132 | static getHost() { |
| 90 | return this.hostUrl; | 133 | return this.hostUrl; |
| 91 | } | 134 | } |
| @@ -149,6 +192,11 @@ export class HttpUrlUtils { | @@ -149,6 +192,11 @@ export class HttpUrlUtils { | ||
| 149 | return url; | 192 | return url; |
| 150 | } | 193 | } |
| 151 | 194 | ||
| 195 | + static getAppointmentListDataUrl() { | ||
| 196 | + let url = this.HOST_SIT + this.APPOINTMENT_LIST_DATA_PATH; | ||
| 197 | + return url; | ||
| 198 | + } | ||
| 199 | + | ||
| 152 | static addSpecialHeaders(headers: HashMap<string, string>) { | 200 | static addSpecialHeaders(headers: HashMap<string, string>) { |
| 153 | switch (this.hostUrl) { | 201 | switch (this.hostUrl) { |
| 154 | case this.HOST_UAT: | 202 | case this.HOST_UAT: |
| @@ -44,4 +44,5 @@ export class PageRepository { | @@ -44,4 +44,5 @@ export class PageRepository { | ||
| 44 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 44 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 45 | return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param, headers) | 45 | return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param, headers) |
| 46 | }; | 46 | }; |
| 47 | + | ||
| 47 | } | 48 | } |
| 1 | + | ||
| 2 | +import router from '@ohos.router'; | ||
| 3 | +const TAG = 'RouteManager'; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * 跳转页面封装类 | ||
| 7 | + */ | ||
| 8 | +class RouteManager{ | ||
| 9 | + | ||
| 10 | + jumpNewPage(target_url: string,params?: Object){ | ||
| 11 | + router.pushUrl({ | ||
| 12 | + url: target_url, | ||
| 13 | + params: { | ||
| 14 | + params | ||
| 15 | + } | ||
| 16 | + }).catch((error: Error) => { | ||
| 17 | + console.log(TAG,JSON.stringify(error)); | ||
| 18 | + }); | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +const routeManager = new RouteManager() | ||
| 24 | +export default routeManager as RouteManager |
| 1 | + | ||
| 2 | +/** | ||
| 3 | + * | ||
| 4 | + "attentionNum": 0, | ||
| 5 | + "authIcon": "", | ||
| 6 | + "authId": 0, | ||
| 7 | + "authPersonal": "", | ||
| 8 | + "authTitle": "", | ||
| 9 | + "categoryAuth": "", | ||
| 10 | + "city": "110100", | ||
| 11 | + "cnAttentionNum": 0, | ||
| 12 | + "cnCollectNum": 0, | ||
| 13 | + "cnCommentNum": 0, | ||
| 14 | + "cnFansNum": 4, | ||
| 15 | + "cnIsAttention": 1, | ||
| 16 | + "cnIsComment": 1, | ||
| 17 | + "cnIsLike": 1, | ||
| 18 | + "cnLikeNum": 0, | ||
| 19 | + "cnLiveCommentControl": 1, | ||
| 20 | + "cnLiveGiftControl": 1, | ||
| 21 | + "cnLiveLikeControl": 1, | ||
| 22 | + "cnLiveShareControl": 1, | ||
| 23 | + "cnMainControl": 1, | ||
| 24 | + "cnRegistTime": 1695280071000, | ||
| 25 | + "cnShareControl": 1, | ||
| 26 | + "cnShareNum": 0, | ||
| 27 | + "cnUserId": "444937588589253", | ||
| 28 | + "cnUserName": "QACrawler2115", | ||
| 29 | + "cnUserType": "2", | ||
| 30 | + "collectNum": 0, | ||
| 31 | + "creatorId": "3004862", | ||
| 32 | + "district": "110101", | ||
| 33 | + "fansNum": 0, | ||
| 34 | + "headPhotoUrl": "https://sitcontentjdcdn.aikan.pdnews.cn/vod/content/202309/202309Th211436299/GLN.png?x-oss-process=image/resize,l_400/auto-orient,1/quality,q_90/format,jpg", | ||
| 35 | + "honoraryIcon": "", | ||
| 36 | + "honoraryTitle": "", | ||
| 37 | + "introduction": "知识博主", | ||
| 38 | + "isAttention": 1, | ||
| 39 | + "isComment": 1, | ||
| 40 | + "isLike": 1, | ||
| 41 | + "isVisiable": 1, | ||
| 42 | + "likeNum": 0, | ||
| 43 | + "liveCommentControl": 1, | ||
| 44 | + "liveGiftControl": 1, | ||
| 45 | + "liveLikeControl": 1, | ||
| 46 | + "liveShareControl": 1, | ||
| 47 | + "posterShareControl": 1, | ||
| 48 | + "province": "110000", | ||
| 49 | + "publishNum": 0, | ||
| 50 | + "region": "", | ||
| 51 | + "shareControl": 1, | ||
| 52 | + "shareNum": 0, | ||
| 53 | + "shopOpen": 0, | ||
| 54 | + "storeUrl": "", | ||
| 55 | + "subjectType": 0, | ||
| 56 | + "userId": "", | ||
| 57 | + "userName": "QACrawler2115", | ||
| 58 | + "userType": "2", | ||
| 59 | + "waresSwitch": 1 | ||
| 60 | + */ | ||
| 61 | + | ||
| 62 | +@Observed | ||
| 63 | +export class FollowListDetailItem{ | ||
| 64 | + headPhotoUrl:string //头像 | ||
| 65 | + cnUserName:string //昵称 | ||
| 66 | + cnFansNum:number //粉丝数 | ||
| 67 | + introduction:string //介绍 | ||
| 68 | + isFollow:boolean = false //是否已经关注 | ||
| 69 | + | ||
| 70 | + constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:number,introduction:string) { | ||
| 71 | + this.headPhotoUrl = headPhotoUrl | ||
| 72 | + this.cnUserName = cnUserName | ||
| 73 | + this.cnFansNum = cnFansNum | ||
| 74 | + this.introduction = introduction | ||
| 75 | + } | ||
| 76 | +} |
| 1 | + | ||
| 2 | +/** | ||
| 3 | + * { | ||
| 4 | + "directoryName": "创作", | ||
| 5 | + "directoryWeight": 3, | ||
| 6 | + "id": 74, | ||
| 7 | + "isShow": 1, | ||
| 8 | + "level": 1, | ||
| 9 | + "parentId": 0, | ||
| 10 | + "rootId": 0, | ||
| 11 | + "children": [ | ||
| 12 | + { | ||
| 13 | + "children": [ | ||
| 14 | + { | ||
| 15 | + "directoryName": "新闻联播", | ||
| 16 | + "directoryWeight": 3, | ||
| 17 | + "id": 79, | ||
| 18 | + "isShow": 1, | ||
| 19 | + "level": 3, | ||
| 20 | + "parentId": 75, | ||
| 21 | + "rootId": 74 | ||
| 22 | + } | ||
| 23 | + ], | ||
| 24 | + "directoryName": "短视频", | ||
| 25 | + "directoryWeight": 1, | ||
| 26 | + "id": 75, | ||
| 27 | + "isShow": 1, | ||
| 28 | + "level": 2, | ||
| 29 | + "parentId": 74, | ||
| 30 | + "rootId": 74 | ||
| 31 | + } | ||
| 32 | + ] | ||
| 33 | + } | ||
| 34 | + */ | ||
| 35 | + | ||
| 36 | +@Observed | ||
| 37 | +export class FollowListItem{ | ||
| 38 | + constructor(directoryName:string) { | ||
| 39 | + this.directoryName = directoryName | ||
| 40 | + } | ||
| 41 | + directoryName:string | ||
| 42 | + directoryWeight:number | ||
| 43 | + id:number | ||
| 44 | + isShow:number | ||
| 45 | + level:number | ||
| 46 | + parentId:number | ||
| 47 | + rootId:number | ||
| 48 | + children:FollowSecondListItem[] | ||
| 49 | +} | ||
| 50 | +@Observed | ||
| 51 | +export class FollowSecondListItem{ | ||
| 52 | + directoryName:string | ||
| 53 | + directoryWeight:number | ||
| 54 | + id:number | ||
| 55 | + isShow:number | ||
| 56 | + level:number | ||
| 57 | + parentId:number | ||
| 58 | + rootId:number | ||
| 59 | + children:FollowThirdListItem[] | ||
| 60 | +} | ||
| 61 | +@Observed | ||
| 62 | +export class FollowThirdListItem{ | ||
| 63 | + directoryName:string | ||
| 64 | + directoryWeight:number | ||
| 65 | + id:number | ||
| 66 | + isShow:number | ||
| 67 | + level:number | ||
| 68 | + parentId:number | ||
| 69 | + rootId:number | ||
| 70 | +} |
| 1 | +@Observed | ||
| 2 | +export class MineAppointmentItem{ | ||
| 3 | + appStyle:string //"15" | ||
| 4 | + /*[ | ||
| 5 | + "https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20231204/image/live/563cc8ce1ecc43b288f6cf60da66579c.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg" | ||
| 6 | + ]*/ | ||
| 7 | + imageUrl:string[] | ||
| 8 | + | ||
| 9 | + liveId:number //20000007348 | ||
| 10 | + planStartTime:string //2023-12-05 15:26:10 | ||
| 11 | + timePre:string //12月05日 | ||
| 12 | + timeBack:string //15:26 | ||
| 13 | + relId:string //"500000017021" | ||
| 14 | + relType:number //1 | ||
| 15 | + startTime:string //"" | ||
| 16 | + status:string //"wait" | ||
| 17 | + title:string //"视界运营位加权-加权中删除" | ||
| 18 | + isAppointment:boolean | ||
| 19 | + | ||
| 20 | + | ||
| 21 | + constructor(imageUrl:string[],status:string,title:string,isAppointment:boolean,timePre:string,timeBack:string,relType:number ) { | ||
| 22 | + this.imageUrl=imageUrl | ||
| 23 | + this.status=status | ||
| 24 | + this.title=title | ||
| 25 | + this.isAppointment=isAppointment | ||
| 26 | + this.timePre = timePre | ||
| 27 | + this.timeBack = timeBack | ||
| 28 | + this.relType = relType | ||
| 29 | + } | ||
| 30 | +} |
-
Please register or login to post a comment