1bea4f105Sopenharmony_ci/*
2bea4f105Sopenharmony_ci * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
3bea4f105Sopenharmony_ci */
4bea4f105Sopenharmony_ciimport UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'
5bea4f105Sopenharmony_ciimport Want from '@ohos.app.ability.Want';
6bea4f105Sopenharmony_ciimport ability from '@ohos.ability.ability';
7bea4f105Sopenharmony_ci
8bea4f105Sopenharmony_ciimport { Logger } from '../../common/util/HiLogger'
9bea4f105Sopenharmony_ciimport { createOrGet, globalKeys } from '../../common/global/GlobalThisHelper'
10bea4f105Sopenharmony_ciimport { DeviceInfo, DeviceTypes } from '../../common/global/globalmodel/GlobalModel'
11bea4f105Sopenharmony_ciimport { LocalAudioFile } from '../../localresource/localaudio/LocalAudioFile'
12bea4f105Sopenharmony_ciimport { LocalResourceManager } from '../../localresource/LocalResourceManager';
13bea4f105Sopenharmony_ciimport { AudioPickerViewData } from '../model/AudioPickerViewData';
14bea4f105Sopenharmony_ciimport { AudioPickerViewModel } from '../viewmodel/AudioPickerViewModel';
15bea4f105Sopenharmony_ciimport { AudioPickerPreference } from '../../audiopreference/AudioPickerPreference';
16bea4f105Sopenharmony_ciimport { Constants } from '../../constant/Constants';
17bea4f105Sopenharmony_ciimport { SafetyTipDialog } from '../dialog/SafetyTipDialog';
18bea4f105Sopenharmony_ci
19bea4f105Sopenharmony_ciconst logger: Logger = new Logger('AudioPickerView')
20bea4f105Sopenharmony_ci
21bea4f105Sopenharmony_ci@Component
22bea4f105Sopenharmony_ciexport struct AudioPickerView {
23bea4f105Sopenharmony_ci  @StorageLink('navigatorBarHeight') navigatorBarHeight: number = 200
24bea4f105Sopenharmony_ci  @Link isShow: boolean;
25bea4f105Sopenharmony_ci  @State audioPickerData: AudioPickerViewData = new AudioPickerViewData()
26bea4f105Sopenharmony_ci  @State audioPickerViewModel: AudioPickerViewModel = new AudioPickerViewModel()
27bea4f105Sopenharmony_ci  // 选中列表信息
28bea4f105Sopenharmony_ci  @State isSelectedAudioPickerList: Array<LocalAudioFile> = []
29bea4f105Sopenharmony_ci  @State isSafetyTip: boolean = false
30bea4f105Sopenharmony_ci  @State requestCounts: number = 0
31bea4f105Sopenharmony_ci  @State isSelect: boolean = true
32bea4f105Sopenharmony_ci  @State indexArr: Array<number> = []
33bea4f105Sopenharmony_ci  // load more 提前的条目数量
34bea4f105Sopenharmony_ci  private loadMoreAdvance: number = 3
35bea4f105Sopenharmony_ci  private pageNo: number = 0;
36bea4f105Sopenharmony_ci  // 设备信息
37bea4f105Sopenharmony_ci  private globalDeviceInfo: DeviceInfo = createOrGet(DeviceInfo, globalKeys.deviceInfo)
38bea4f105Sopenharmony_ci  private audioPickerPreference: AudioPickerPreference =
39bea4f105Sopenharmony_ci    createOrGet(AudioPickerPreference, globalKeys.audioPickerPreference)
40bea4f105Sopenharmony_ci  private localResourceManager: LocalResourceManager = new LocalResourceManager()
41bea4f105Sopenharmony_ci  session: UIExtensionContentSession | undefined
42bea4f105Sopenharmony_ci  want: Want | undefined
43bea4f105Sopenharmony_ci  scroller: Scroller = new Scroller()
44bea4f105Sopenharmony_ci  context: Context = getContext(this)
45bea4f105Sopenharmony_ci  // 弹窗知道了按钮回调
46bea4f105Sopenharmony_ci  dialogKnow: () => void = () => {
47bea4f105Sopenharmony_ci    // 保存安全提示状态
48bea4f105Sopenharmony_ci    this.audioPickerPreference.saveSafetyTipStatus(true)
49bea4f105Sopenharmony_ci    logger.info('isSafetyTip ' + this.isSafetyTip)
50bea4f105Sopenharmony_ci    this.dialogController.close()
51bea4f105Sopenharmony_ci  }
52bea4f105Sopenharmony_ci  dialogController: CustomDialogController = new CustomDialogController({
53bea4f105Sopenharmony_ci    builder: SafetyTipDialog({
54bea4f105Sopenharmony_ci      know: this.dialogKnow
55bea4f105Sopenharmony_ci    }),
56bea4f105Sopenharmony_ci    alignment: DialogAlignment.Center
57bea4f105Sopenharmony_ci  })
58bea4f105Sopenharmony_ci
59bea4f105Sopenharmony_ci  async aboutToAppear() {
60bea4f105Sopenharmony_ci    this.audioPickerData = this.audioPickerViewModel.getDataSource()
61bea4f105Sopenharmony_ci    logger.info('this.audioPickerData.getDataList(): ' + this.audioPickerData.getDataList())
62bea4f105Sopenharmony_ci    this.isSafetyTip = await this.audioPickerPreference.getSafetyTipStatus()
63bea4f105Sopenharmony_ci    this.audioPickerViewModel.queryAudioPickerList(this.pageNo, this.context)
64bea4f105Sopenharmony_ci    if (!this.isSafetyTip) {
65bea4f105Sopenharmony_ci      this.dialogController.open()
66bea4f105Sopenharmony_ci    }
67bea4f105Sopenharmony_ci  }
68bea4f105Sopenharmony_ci
69bea4f105Sopenharmony_ci  routerBack: () => void = () => {
70bea4f105Sopenharmony_ci    if (this.session !== undefined) {
71bea4f105Sopenharmony_ci      this.session?.sendData({ 'isShowUIExtension': false })
72bea4f105Sopenharmony_ci      this.session?.terminateSelf()
73bea4f105Sopenharmony_ci    }
74bea4f105Sopenharmony_ci  }
75bea4f105Sopenharmony_ci
76bea4f105Sopenharmony_ci  onBackPress() {
77bea4f105Sopenharmony_ci    this.routerBack()
78bea4f105Sopenharmony_ci  }
79bea4f105Sopenharmony_ci
80bea4f105Sopenharmony_ci  /**
81bea4f105Sopenharmony_ci   * 是否是列表最后一个音频
82bea4f105Sopenharmony_ci   */
83bea4f105Sopenharmony_ci  isLast(index: number): boolean {
84bea4f105Sopenharmony_ci    this.requestCounts = Constants.PICKER_PAGE_SIZE * (this.pageNo + 1)
85bea4f105Sopenharmony_ci    let musicTotal: number = 0
86bea4f105Sopenharmony_ci    if (this.audioPickerData.totalCount() < this.requestCounts) {
87bea4f105Sopenharmony_ci      musicTotal = this.audioPickerViewModel.getAudioTotal()
88bea4f105Sopenharmony_ci    }
89bea4f105Sopenharmony_ci    if (musicTotal) {
90bea4f105Sopenharmony_ci      return index >= musicTotal - 1
91bea4f105Sopenharmony_ci    } else {
92bea4f105Sopenharmony_ci      return false
93bea4f105Sopenharmony_ci    }
94bea4f105Sopenharmony_ci  }
95bea4f105Sopenharmony_ci
96bea4f105Sopenharmony_ci  /**
97bea4f105Sopenharmony_ci   * 返回赋予临时权限的uri列表回调
98bea4f105Sopenharmony_ci   */
99bea4f105Sopenharmony_ci  async settingTerminateSelfWithResult() {
100bea4f105Sopenharmony_ci    if (this.session) {
101bea4f105Sopenharmony_ci      let uriArr = await this.localResourceManager.terminateSelfWithResult(this.isSelectedAudioPickerList)
102bea4f105Sopenharmony_ci      logger.info('uriArr length: ' + uriArr.length)
103bea4f105Sopenharmony_ci      let abilityResult: ability.AbilityResult = {
104bea4f105Sopenharmony_ci        resultCode: (uriArr === undefined) ? -1 : 0,
105bea4f105Sopenharmony_ci        want: {
106bea4f105Sopenharmony_ci          parameters: {
107bea4f105Sopenharmony_ci            'ability.params.stream': uriArr,
108bea4f105Sopenharmony_ci            'uriArr': uriArr
109bea4f105Sopenharmony_ci          }
110bea4f105Sopenharmony_ci        }
111bea4f105Sopenharmony_ci      }
112bea4f105Sopenharmony_ci      this.session.terminateSelfWithResult(abilityResult, (err) => {
113bea4f105Sopenharmony_ci        logger.error('terminateSelfWithResult is called: ' + err)
114bea4f105Sopenharmony_ci      })
115bea4f105Sopenharmony_ci    } else {
116bea4f105Sopenharmony_ci      logger.error(`oncancel session: ${this.session}`)
117bea4f105Sopenharmony_ci    }
118bea4f105Sopenharmony_ci    this.routerBack()
119bea4f105Sopenharmony_ci  }
120bea4f105Sopenharmony_ci
121bea4f105Sopenharmony_ci  build() {
122bea4f105Sopenharmony_ci    if (this.audioPickerViewModel.audioTotal > 0) {
123bea4f105Sopenharmony_ci      Stack({ alignContent: Alignment.TopStart }) {
124bea4f105Sopenharmony_ci        Scroll(this.scroller) {
125bea4f105Sopenharmony_ci          Grid() {
126bea4f105Sopenharmony_ci            LazyForEach(this.audioPickerData, (item: LocalAudioFile, index: number) => {
127bea4f105Sopenharmony_ci              GridItem() {
128bea4f105Sopenharmony_ci                Column() {
129bea4f105Sopenharmony_ci                  Row() {
130bea4f105Sopenharmony_ci                    Image(item.getThumbnail)
131bea4f105Sopenharmony_ci                      .width(48)
132bea4f105Sopenharmony_ci                      .height(48)
133bea4f105Sopenharmony_ci                      .margin({ right: 16 })
134bea4f105Sopenharmony_ci                      .borderRadius(8)
135bea4f105Sopenharmony_ci                      .draggable(false)
136bea4f105Sopenharmony_ci                      .id('audiopicker_thumbnail')
137bea4f105Sopenharmony_ci
138bea4f105Sopenharmony_ci                    Column() {
139bea4f105Sopenharmony_ci                      Text(item.name)
140bea4f105Sopenharmony_ci                        .fontSize(16)
141bea4f105Sopenharmony_ci                        .fontColor($r('sys.color.ohos_id_color_text_primary'))
142bea4f105Sopenharmony_ci                        .fontWeight(FontWeight.Medium)
143bea4f105Sopenharmony_ci                        .lineHeight(21)
144bea4f105Sopenharmony_ci                        .width('100%')
145bea4f105Sopenharmony_ci                        .height(21)
146bea4f105Sopenharmony_ci                        .maxLines(1)
147bea4f105Sopenharmony_ci                        .textOverflow({ overflow: TextOverflow.Ellipsis })
148bea4f105Sopenharmony_ci                        .margin({ bottom: 2 })
149bea4f105Sopenharmony_ci                        .id('audiopicker_name')
150bea4f105Sopenharmony_ci
151bea4f105Sopenharmony_ci                      Text() {
152bea4f105Sopenharmony_ci                        if (item.artist && item.album) {
153bea4f105Sopenharmony_ci                          Span(item.artist)
154bea4f105Sopenharmony_ci                          Span('-')
155bea4f105Sopenharmony_ci                          Span(item.album)
156bea4f105Sopenharmony_ci                        } else if (item.artist || item.album) {
157bea4f105Sopenharmony_ci                          Span(item.artist || item.album)
158bea4f105Sopenharmony_ci                        } else {
159bea4f105Sopenharmony_ci                          Span('')
160bea4f105Sopenharmony_ci                        }
161bea4f105Sopenharmony_ci                      }
162bea4f105Sopenharmony_ci                      .fontSize(12)
163bea4f105Sopenharmony_ci                      .fontWeight(FontWeight.Regular)
164bea4f105Sopenharmony_ci                      .fontColor($r('sys.color.ohos_id_color_text_tertiary'))
165bea4f105Sopenharmony_ci                      .lineHeight(16)
166bea4f105Sopenharmony_ci                      .maxLines(1)
167bea4f105Sopenharmony_ci                      .width('100%')
168bea4f105Sopenharmony_ci                      .height(16)
169bea4f105Sopenharmony_ci                      .textOverflow({ overflow: TextOverflow.Ellipsis })
170bea4f105Sopenharmony_ci                      .textAlign(TextAlign.Start)
171bea4f105Sopenharmony_ci                      .id('audiopicker_artist_album')
172bea4f105Sopenharmony_ci                    }
173bea4f105Sopenharmony_ci                    .width('calc(100% - 128vp)')
174bea4f105Sopenharmony_ci                    .alignItems(HorizontalAlign.Start)
175bea4f105Sopenharmony_ci                    .justifyContent(FlexAlign.Start)
176bea4f105Sopenharmony_ci                    .margin({ right: 40 })
177bea4f105Sopenharmony_ci
178bea4f105Sopenharmony_ci                    Column() {
179bea4f105Sopenharmony_ci                      Checkbox()
180bea4f105Sopenharmony_ci                        .selectedColor($r('sys.color.ohos_id_color_component_activated'))
181bea4f105Sopenharmony_ci                        .shape(CheckBoxShape.CIRCLE)
182bea4f105Sopenharmony_ci                        .onChange((value) => {
183bea4f105Sopenharmony_ci                          if (value) {
184bea4f105Sopenharmony_ci                            this.isSelectedAudioPickerList.push(item)
185bea4f105Sopenharmony_ci                            this.indexArr.push(index)
186bea4f105Sopenharmony_ci                          } else {
187bea4f105Sopenharmony_ci                            this.isSelectedAudioPickerList = this.isSelectedAudioPickerList.filter(val => val != item)
188bea4f105Sopenharmony_ci                            let selectIndex = this.indexArr.indexOf(index)
189bea4f105Sopenharmony_ci                            if(selectIndex != -1){
190bea4f105Sopenharmony_ci                              this.indexArr.splice(selectIndex, 1)
191bea4f105Sopenharmony_ci                            }
192bea4f105Sopenharmony_ci                          }
193bea4f105Sopenharmony_ci                          let keyPickNum = this.want?.parameters?.key_pick_num
194bea4f105Sopenharmony_ci                          logger.info('key_pick_num: ' + JSON.stringify(keyPickNum))
195bea4f105Sopenharmony_ci                          if (keyPickNum) {
196bea4f105Sopenharmony_ci                            if (this.isSelectedAudioPickerList.length < keyPickNum) {
197bea4f105Sopenharmony_ci                              this.isSelect = true
198bea4f105Sopenharmony_ci                            } else {
199bea4f105Sopenharmony_ci                              this.isSelect = false
200bea4f105Sopenharmony_ci                            }
201bea4f105Sopenharmony_ci                          }
202bea4f105Sopenharmony_ci                          logger.info('indexArr: ' + JSON.stringify(this.indexArr))
203bea4f105Sopenharmony_ci                          logger.info('isSelect: ' + this.isSelect)
204bea4f105Sopenharmony_ci                        })
205bea4f105Sopenharmony_ci                        .enabled(this.indexArr.indexOf(index) != -1 ? true : this.isSelect)
206bea4f105Sopenharmony_ci                        .unselectedColor($r('sys.color.ohos_id_color_switch_outline_off'))
207bea4f105Sopenharmony_ci                        .width(20)
208bea4f105Sopenharmony_ci                        .height(20)
209bea4f105Sopenharmony_ci                    }
210bea4f105Sopenharmony_ci                    .width(24)
211bea4f105Sopenharmony_ci                    .height(24)
212bea4f105Sopenharmony_ci                  }
213bea4f105Sopenharmony_ci                  .width('100%')
214bea4f105Sopenharmony_ci                  .height(72)
215bea4f105Sopenharmony_ci                  .alignItems(VerticalAlign.Center)
216bea4f105Sopenharmony_ci                  .justifyContent(FlexAlign.SpaceBetween)
217bea4f105Sopenharmony_ci
218bea4f105Sopenharmony_ci                  if (!this.isLast(index)) {
219bea4f105Sopenharmony_ci                    Divider()
220bea4f105Sopenharmony_ci                      .strokeWidth('1px')
221bea4f105Sopenharmony_ci                      .margin({ left: 64 })
222bea4f105Sopenharmony_ci                      .backgroundColor($r('sys.color.ohos_id_color_list_separator'))
223bea4f105Sopenharmony_ci                  }
224bea4f105Sopenharmony_ci                }
225bea4f105Sopenharmony_ci                .padding({ left: 16, right: 16 })
226bea4f105Sopenharmony_ci              }
227bea4f105Sopenharmony_ci            }, (item: LocalAudioFile) => {
228bea4f105Sopenharmony_ci              return item.uri
229bea4f105Sopenharmony_ci            })
230bea4f105Sopenharmony_ci          }
231bea4f105Sopenharmony_ci          .onScrollIndex((start, end) => {
232bea4f105Sopenharmony_ci            // 判断是否还有更多数据
233bea4f105Sopenharmony_ci            if (this.audioPickerData.totalCount() < this.requestCounts) {
234bea4f105Sopenharmony_ci              logger.warn(`audioPickerData less than ,size: ${this.audioPickerData.totalCount()}`)
235bea4f105Sopenharmony_ci              this.audioPickerData.hasMoreData = false
236bea4f105Sopenharmony_ci              return
237bea4f105Sopenharmony_ci            } else {
238bea4f105Sopenharmony_ci              this.audioPickerData.hasMoreData = true
239bea4f105Sopenharmony_ci            }
240bea4f105Sopenharmony_ci            // 判断首页数据是否满足一页
241bea4f105Sopenharmony_ci            if (this.audioPickerData) {
242bea4f105Sopenharmony_ci              if (this.audioPickerData.totalCount() < Constants.PICKER_PAGE_SIZE &&
243bea4f105Sopenharmony_ci                this.pageNo === Constants.PAGE_COUNT) {
244bea4f105Sopenharmony_ci                logger.warn('audioPickerData less than 100,size: ' + this.audioPickerData.totalCount())
245bea4f105Sopenharmony_ci                return
246bea4f105Sopenharmony_ci              }
247bea4f105Sopenharmony_ci            }
248bea4f105Sopenharmony_ci            // 判断是否是在加载中
249bea4f105Sopenharmony_ci            if (this.audioPickerData.isLoadMore || !this.audioPickerData.hasMoreData) {
250bea4f105Sopenharmony_ci              logger.warn('audioPickerData is showing more view : ' + this.audioPickerData.isLoadMore +
251bea4f105Sopenharmony_ci                ' no more data: ' + this.audioPickerData.hasMoreData)
252bea4f105Sopenharmony_ci              return
253bea4f105Sopenharmony_ci            }
254bea4f105Sopenharmony_ci            // 查询下一页数据
255bea4f105Sopenharmony_ci            let lastIndex: number = this.audioPickerData.totalCount() - 1
256bea4f105Sopenharmony_ci            if (end >= lastIndex - this.loadMoreAdvance) {
257bea4f105Sopenharmony_ci              this.audioPickerData.hasMoreData = true
258bea4f105Sopenharmony_ci              this.audioPickerViewModel.loadMore(this.pageNo, this.context).then((res) => {
259bea4f105Sopenharmony_ci                if (res) {
260bea4f105Sopenharmony_ci                  // 加载成功后,页面+1
261bea4f105Sopenharmony_ci                  this.pageNo++
262bea4f105Sopenharmony_ci                  logger.info(`get success pageNo:${this.pageNo}`)
263bea4f105Sopenharmony_ci                }
264bea4f105Sopenharmony_ci              })
265bea4f105Sopenharmony_ci            }
266bea4f105Sopenharmony_ci          })
267bea4f105Sopenharmony_ci        }
268bea4f105Sopenharmony_ci        .scrollBar(BarState.Off)
269bea4f105Sopenharmony_ci        // 手机端列表高度要 - 标题 - 已选完成栏 - 提示语栏目 - 底部避让,其他设备不涉及底部避让
270bea4f105Sopenharmony_ci        .margin({ bottom: this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? 108 : 96 })
271bea4f105Sopenharmony_ci
272bea4f105Sopenharmony_ci        Column() {
273bea4f105Sopenharmony_ci          Row() {
274bea4f105Sopenharmony_ci            Text() {
275bea4f105Sopenharmony_ci              Span($r('app.string.is_elected'))
276bea4f105Sopenharmony_ci              Span(`(${this.isSelectedAudioPickerList.length})`)
277bea4f105Sopenharmony_ci            }
278bea4f105Sopenharmony_ci            .fontSize(16)
279bea4f105Sopenharmony_ci            .fontColor($r('sys.color.ohos_id_color_text_primary'))
280bea4f105Sopenharmony_ci            .fontWeight(FontWeight.Medium)
281bea4f105Sopenharmony_ci            .height(22)
282bea4f105Sopenharmony_ci            .id('audiopicker_selected')
283bea4f105Sopenharmony_ci
284bea4f105Sopenharmony_ci            Button($r('app.string.complete'), { type: ButtonType.Capsule, stateEffect: false })
285bea4f105Sopenharmony_ci              .fontColor($r('sys.color.ohos_id_color_text_primary_contrary'))
286bea4f105Sopenharmony_ci              .backgroundColor($r('sys.color.ohos_id_color_component_activated'))
287bea4f105Sopenharmony_ci              .opacity(this.isSelectedAudioPickerList.length ? 1 : 0.4)
288bea4f105Sopenharmony_ci              .width(72)
289bea4f105Sopenharmony_ci              .height(28)
290bea4f105Sopenharmony_ci              .onClick(() => {
291bea4f105Sopenharmony_ci                if (this.isSelectedAudioPickerList.length > 0) {
292bea4f105Sopenharmony_ci                  this.settingTerminateSelfWithResult()
293bea4f105Sopenharmony_ci                  this.isShow = false
294bea4f105Sopenharmony_ci                } else {
295bea4f105Sopenharmony_ci                  this.isShow = true
296bea4f105Sopenharmony_ci                }
297bea4f105Sopenharmony_ci              })
298bea4f105Sopenharmony_ci              .id('audiopicker_button')
299bea4f105Sopenharmony_ci          }
300bea4f105Sopenharmony_ci          .width('100%')
301bea4f105Sopenharmony_ci          .height(52)
302bea4f105Sopenharmony_ci          .padding({ left: 16, right: 16 })
303bea4f105Sopenharmony_ci          .alignItems(VerticalAlign.Center)
304bea4f105Sopenharmony_ci          .justifyContent(FlexAlign.SpaceBetween)
305bea4f105Sopenharmony_ci
306bea4f105Sopenharmony_ci          Row() {
307bea4f105Sopenharmony_ci            Image($r('app.media.ic_public_privacy'))
308bea4f105Sopenharmony_ci              .width(14)
309bea4f105Sopenharmony_ci              .height(14)
310bea4f105Sopenharmony_ci            Text($r('app.string.only_selected_items_can_be_accessed'))
311bea4f105Sopenharmony_ci              .fontSize(12)
312bea4f105Sopenharmony_ci              .fontColor($r('sys.color.ohos_id_color_tertiary'))
313bea4f105Sopenharmony_ci              .width(96)
314bea4f105Sopenharmony_ci              .height(16)
315bea4f105Sopenharmony_ci          }
316bea4f105Sopenharmony_ci          .width(114)
317bea4f105Sopenharmony_ci          .height(28)
318bea4f105Sopenharmony_ci          .justifyContent(FlexAlign.SpaceBetween)
319bea4f105Sopenharmony_ci        }
320bea4f105Sopenharmony_ci        .position({ x: 0, y: 576 })
321bea4f105Sopenharmony_ci        .height(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? 108 : 96)
322bea4f105Sopenharmony_ci        .padding(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ?
323bea4f105Sopenharmony_ci          { bottom: `${this.navigatorBarHeight}px` } : { bottom: 0 })
324bea4f105Sopenharmony_ci      }
325bea4f105Sopenharmony_ci      .width(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? '100%' : 480)
326bea4f105Sopenharmony_ci      .height(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? 684 : 560)
327bea4f105Sopenharmony_ci    } else {
328bea4f105Sopenharmony_ci      Column() {
329bea4f105Sopenharmony_ci        Image($r('app.media.emptypage'))
330bea4f105Sopenharmony_ci          .width(96)
331bea4f105Sopenharmony_ci          .height(96)
332bea4f105Sopenharmony_ci          .margin({ bottom: 8 })
333bea4f105Sopenharmony_ci
334bea4f105Sopenharmony_ci        Text($r('app.string.no_matching_content'))
335bea4f105Sopenharmony_ci          .fontSize(14)
336bea4f105Sopenharmony_ci          .fontColor($r('sys.color.ohos_id_color_text_tertiary'))
337bea4f105Sopenharmony_ci          .fontFamily('HarmonyHeiTi')
338bea4f105Sopenharmony_ci          .fontWeight(FontWeight.Regular)
339bea4f105Sopenharmony_ci          .lineHeight(19)
340bea4f105Sopenharmony_ci      }
341bea4f105Sopenharmony_ci      .width(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? '100%' : 480)
342bea4f105Sopenharmony_ci      .height(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? 411 : 560)
343bea4f105Sopenharmony_ci      .justifyContent(FlexAlign.Center)
344bea4f105Sopenharmony_ci      .alignItems(HorizontalAlign.Center)
345bea4f105Sopenharmony_ci    }
346bea4f105Sopenharmony_ci  }
347bea4f105Sopenharmony_ci}