当前位置: 首页 > wzjs >正文

网站如何不让百度抓取视频8首页制作代码

网站如何不让百度抓取,视频8首页制作代码,网站建设属于哪类税率,自己建私人网站做外贸不好做场景描述 List组件作为整个首页长列表的容器,通过ListItem对不同模块进行视图界面定制,常用于门户首页、商城首页等多类型视图展示的列表信息流场景。 本场景以应用首页为例,将除页面顶部搜索框区域的其它内容,放在List组件内部…

场景描述

List组件作为整个首页长列表的容器,通过ListItem对不同模块进行视图界面定制,常用于门户首页、商城首页等多类型视图展示的列表信息流场景。

本场景以应用首页为例,将除页面顶部搜索框区域的其它内容,放在List组件内部,进行整体页面的构建。进入页面后,下滑刷新模拟网络请求;滑动页面列表内容,景区标题吸顶;滑动到页面底部,上滑模拟请求添加数据。

1.png

实现原理

根据列表内部各部分视图对应数据类型的区别,渲染不同的ListItem子组件。

Refresh组件可以进行页面下拉操作并显示刷新动效,List组件配合使用Swiper、Grid等基础组件用于页面的整体构建,再通过List组件的sticky属性、onReachEnd()事件和Refresh组件的onRefreshing()事件,实现下滑模拟刷新、上滑模拟添加数据及列表标题吸顶的效果。

开发步骤

顶部搜索框区域

.Row() {
.  Text('Beijing')
.    // ...
.  TextInput({ placeholder: 'guess you want to search...'})
.    // ...
.  Text('more')
.    // ...
.}

HomePage.ets

实现效果:

图片5.png

  1. 在List的第一个ListItem分组中,使用Swiper组件构建页面轮播图内容。
.List({ space: 12 }) {
.  // Swiper
.  ListItem() {
.    Swiper() {
.      ForEach(this.swiperContent, (item: SwiperType) => {
.        Stack({ alignContent: Alignment.BottomStart }) {
.          Image($r(item.pic))
.        }
.      }, (item: SwiperType) => JSON.stringify(item))
.    }
.    // ...
.    .autoPlay(true) // Set the sub-component to play automatically
.    .duration(1000) // Set the animation duration of the sub-component switchover
.    .curve(Curve.Linear) // Set the animation curve to uniform speed
.    .indicator( // Set the navigation point indicator
.      new DotIndicator()
.        .selectedColor(Color.White)
.    )
.    .itemSpace(10) // Set the space between sub-components
.    // ...
.  }
.  // ...
.}

HomePage.ets

实现效果:

图片6.png

  1. 在List的第二个ListItem分组中,使用Grid组件构建页面网格区域。
.List({ space: 12 }) {
.  // Swiper
.  ListItem() {
.    // ...
.  }
.  // Grid
.  ListItem() {
.    Grid() {
.      ForEach(this.gridTitle, (item: Resource) => {
.        GridItem() {
.          Column() {
.            Image($r('app.media.pic1'))
.              // ...
.            Text(item)
.              // ...
.          }
.        }
.      }, (item: Resource) => JSON.stringify(item))
.    }
.    .rowsGap(16) // Set the line spacing
.    .columnsGap(19) // Set the column spacing
.    .columnsTemplate('1fr 1fr 1fr 1fr 1fr') // Set the proportion of each column
.    // ...
.  }
.  // ...
.}

HomePage.ets

实现效果:

图片7.png

  1. 推荐内容及列表内容的构建。
.// Scenic spot list content details
.@Builder
.scenicSpotDetailBuilder(title: Resource) {
.  Column() {
.    Image($r('app.media.pic1'))
.      // ...
.    Column() {
.      Text(title)
.        // ...
.      Text() {
.        Span('Multi person group discount:')
.          // ...
.        Span('999¥')
.          // ...
.      }
.      .margin({ top: 4, bottom: 4 })
.
.      Text() {
.        Span('Multi person group discount:')
.        Span('1999¥')
.      }
.      // ...
.    }
.    // ...
.  }
.}
HomePage.ets
.List({ space: 12 }) {
.  // Swiper
.  ListItem() {
.    // ...
.  }
.  // Grid
.  ListItem() {
.    // ...
.  }
.  // Customize display area.
.  ListItem() {
.    Row() {
.      Image($r('app.media.pic1'))
.        // ...
.      Image($r('app.media.pic1'))
.        // ...
.    }
.    // ...
.  }
.
.  // Scenic spot classification list.
.  ForEach(this.scenicSpotTitle, (item: Resource) => {
.    ListItemGroup({ header: this.scenicSpotHeader(item) }) {
.      ForEach(this.scenicSpotArray, (scenicSpotItem: Resource) => {
.        ListItem() {
.          this.scenicSpotDetailBuilder(scenicSpotItem);
.        }
.      }, (scenicSpotItem: Resource) => JSON.stringify(scenicSpotItem))
.    }
.    .borderRadius(this.borderRadiusVal)
.  }, (item: Resource) => JSON.stringify(item))
.
.  // ...
.}

HomePage.ets

实现效果:

图片8.png

将构建好的页面内容,放在Refresh组件内部,并给List和Refresh组件添加对应的onReachEnd()和onRefreshing()回调,实现下拉模拟刷新和上滑添加列表数据的效果。

.// Top search box.
.Row() {
.  // ...
.}
.// ...
.
.// Pull down refresh component.
.Refresh({ refreshing: $$this.isRefreshing }) {
.  // List as a long list layout.
.  List({ space: 12 }) {
.    // Swiper
.    ListItem() {
.      // ...
.    }
.    // Grid
.    ListItem() {
.      // ...
.    }
.    // Customize display area.
.    ListItem() {
.      // ...
.    }
.
.    // Scenic spot classification list.
.    ForEach(this.scenicSpotTitle, (item: Resource) => {
.      // ...
.    }, (item: Resource) => JSON.stringify(item))
.
.    // Customize bottom loading for more.
.    ListItem() {
.      Row() {
.        if (!this.noMoreData) {
.          LoadingProgress()
.            // ...
.        }
.        Text(this.noMoreData ? $r('app.string.no_more_data') : $r('app.string.loading_more'))
.      }
.      // ...
.    }
.    // ...
.  }
.  // ...
.  .onReachEnd(() => { // Callback triggered when the list is added to the end position
.    if (this.scenicSpotArray.length >= 20) {
.      // When the list data is greater than or equal to 20, noMoreData is set to true
.      this.noMoreData = true;
.      return;
.    }
.    setTimeout(() => {
.      this.scenicSpotArray.push('scenic area' + (this.scenicSpotArray.length + 1));
.    }, 500)
.  })
.}
.// Pull down refresh, simulate network request.
..onRefreshing(() => {
.  this.isRefreshing = true; // Enter the refresh state
.  setTimeout(() => {
.    // Set the landscapeSpotArray to the initial value
.    this.scenicSpotArray =
.      this.scenicSpotArray = ['scenic area 1', 'scenic area 2', 'scenic area 3', 'scenic area 4', 'scenic area 5'];
.    this.noMoreData = false;
.    this.isRefreshing = false;
.  }, 2000)
.})```

HomePage.ets

实现效果

2.png

本文主要引用整理于鸿蒙官方文档

http://www.dtcms.com/wzjs/590541.html

相关文章:

  • 制作网站网页域名的公司做网站的外包公司
  • 建站网站苏州天美传媒传媒官网免费下载
  • 网站开发公司的职责wordpress 网银支付宝
  • 网站开发struts泰安房产网新楼盘房价
  • 专业营销型网站建设游戏门户网站建设
  • 微信网站方案阳高网站建设
  • 徐州手机网站开发公司电话nana wordpress
  • php怎么建立站点泰安最好的房产中介
  • 建筑公司网站页面图片学校网站建设联系电话
  • 网站建设 佛山移动网站 用户体验
  • 长春网络传媒做网站骗钱先做网站还是app
  • 吴中区建设局招标网站公司响应式网站
  • 开个免费的网站多少钱中国建筑劳务分包平台
  • xyz溢价域名最好的网站烟台网站建设的公司
  • 深圳住房和建设管理局官方网站深圳网站制作价格
  • 网站设计师 要求中国企业500强榜单发布
  • 个人优秀网站网站建设:上海珍岛
  • 旅游网站建设模块威胁网站检测平台建设
  • 铜仁公司做网站南联网站建设推广
  • 能够做数据地图的网站怎么做淘宝客网站赚钱吗
  • 品牌宣传网站制作如何给异地网站做镜像
  • 自己做网站难网站开发与软件开发区别
  • 企业网站必须实名认证现在网站的外部链接怎么做
  • 建设外贸类网站西宁城西区建设局网站
  • 用jsp做一网站的流程图朝阳公共资源交易中心
  • 专业网站建设是哪家便宜wordpress文章字体大小
  • 网站建设对企业的好处wordpress 模板引入文件
  • 阿里云网站 模板建设wordpress网站分享到朋友圈
  • 如何在linux服务器上架设网站专业郑州网站建设
  • 网站描文本链接怎么做网站进度条做多大