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

跨境电商网站怎么做网络营销推广实战宝典

跨境电商网站怎么做,网络营销推广实战宝典,全网网络营销,佛山网站建设的品牌鸿蒙里面,实现一个音乐播放的列表,模拟数组的数据展示 实现效果代码实现 准备数据 songs:SongItemTypes[] [{img:https://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.jpg,name:直到世界的尽头,author:WANDS},{img:https://yjy-teach-oss.oss-cn…

鸿蒙里面,实现一个音乐播放的列表,模拟数组的数据展示

实现效果

在这里插入图片描述

代码实现

  • 准备数据
songs:SongItemTypes[] = [{img:'https://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.jpg',name:'直到世界的尽头',author:'WANDS'},{img:'https://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/1.jpg',name:'画',author:'赵磊'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/2.jpg',name:'Sweet Dreams',author:'TPaul sax / Eurythmics'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/3.jpg',name:'奢香夫人',author:'凤凰传奇'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/4.jpg',name:'空心',author:'光泽'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/5.jpg',name:'反转地球',author:'潘玮柏'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/6.jpg',name:'No.9',author:'T-ara'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/7.jpg',name:'孤独',author:'G.E.M.邓紫棋'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/8.jpg',name:'Lose Control',author:'Hedley'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/9.jpg',name:'倩女幽魂',author:'张国荣'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/10.jpg',name:'反转地球',author:'潘玮柏'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/11.jpg',name:'苦笑',author:'汪苏泷'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/12.jpg',name:'一生所爱',author:'卢冠廷 / 莫文蔚'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/13.jpg',name:'月半小夜曲',author:'李克勤'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/14.jpg',name:'Rolling in the peep',author:'Adele'},{img:'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/1.jpg',name:'Beyond',author:'海阔天空'}]
  • 标题的实现
Text("猜你喜欢").fontColor('#fff').width('100%').margin({bottom:10})
  • 列表的实现
List(){ForEach(this.songs,(item:SongItemTypes,index:number) => {ListItem(){Row(){Stack(){Image(item.img).width(80).border({radius:8}).margin({right:10})if(this.currentIndex == index){Image($r('app.media.wave')).width(40)}}.alignContent(Alignment.Bottom)Column(){Text(item.name).fontColor(Color.White).width('100%')Row(){Text("Vip").fontColor(Color.White).padding({top:2,right:5,bottom:2,left:5}).fontColor(Color.Grey).margin({right:10}).border({width:1,radius:8,color:Color.Grey})Text(item.author).fontColor(Color.White).fontColor(Color.Grey)}.width('100%').margin({top:20})}.layoutWeight(1)Image($r('app.media.more')).width(24).fillColor('#fff')}.width('100%').height(80).onClick(() => {this.currentIndex = index})}.margin({bottom:10})
})
}.scrollBar(BarState.Off)
  • 点击当前项的时候,出现音量闪烁的图片
if(this.currentIndex == index){Image($r('app.media.wave')).width(40)
}

完整代码

import {SongItemTypes} from '../types'@Entry
@Component
struct  FourthPage {@State currentIndex:number = -1build() {Column(){Text("猜你喜欢").fontColor('#fff').width('100%').margin({bottom:10})List(){ForEach(this.songs,(item:SongItemTypes,index:number) => {ListItem(){Row(){Stack(){Image(item.img).width(80).border({radius:8}).margin({right:10})if(this.currentIndex == index){Image($r('app.media.wave')).width(40)}}.alignContent(Alignment.Bottom)Column(){Text(item.name).fontColor(Color.White).width('100%')Row(){Text("Vip").fontColor(Color.White).padding({top:2,right:5,bottom:2,left:5}).fontColor(Color.Grey).margin({right:10}).border({width:1,radius:8,color:Color.Grey})Text(item.author).fontColor(Color.White).fontColor(Color.Grey)}.width('100%').margin({top:20})}.layoutWeight(1)Image($r('app.media.more')).width(24).fillColor('#fff')}.width('100%').height(80).onClick(() => {this.currentIndex = index})}.margin({bottom:10})})}.scrollBar(BarState.Off)}.backgroundColor("#000").width('100%').height('100%').padding({left:10,right:10}).expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.TOP,SafeAreaEdge.BOTTOM])}
}

在这里插入图片描述
这样就实现了一个模拟的音乐列表页面

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

相关文章:

  • 唐山房产网站建设bt最佳磁力搜索引擎
  • 免费做房产网站丽水百度seo
  • 鄂州市 网站建设2022新闻热点10条
  • 贵阳市住房和城乡建设厅网站天天自学网网址
  • 成都彭州网站建设优化最狠的手机优化软件
  • 服务器可以做几个网站百度公司电话
  • 十里河网站建设公司百度客服中心电话
  • 外贸网站开发哪家好网络营销师资格证
  • 母婴用品网站建设杭州网站推广与优化
  • 鑫牛元网站建设网站seo的主要优化内容
  • 网站充值记账凭证怎么做天津关键词排名推广
  • 百度网站回档怎么能恢复如何百度收录自己的网站
  • 秦皇岛的网站建设公司幽默软文经典案例300
  • 国外有做塑料粒子的网站吗新网站怎么推广
  • 做网站行业的动态上海关键词排名优化怎样
  • 中山精品网站建设新闻昆山优化外包
  • 北京市住房城乡建设行业从业人员考务网站中国联通腾讯
  • 网站从哪里找的快速优化网站排名的方法
  • 龙岩做网站公司服务之家网站推广
  • 中文域名注册费用标准seo研究中心学员案例
  • 学校网站作用免费seo视频教学
  • 英文独立站建设公司上热门最火标题
  • 辽宁市场网站建设销售百度开车关键词
  • wordpress move衡阳seo优化报价
  • wordpress 父类 id舟山seo
  • 产品创意设计案例沈阳网站优化
  • 苏州网站建设姜超全媒体广告加盟
  • 阿里云WordPress主题seo主要优化
  • 如何让订阅号菜单做微网站软文是什么意思
  • 海外推广品牌优化工具箱