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

商业网站设计惠州中小企业网站制作

商业网站设计,惠州中小企业网站制作,福州营销型网站建设价格,搭建网站备案鸿蒙开发城市联动选择弹框 城市联动选择弹框不容易#xff0c;在Android那边也是不容易。选择某个省份时#xff0c;城市要对得上#xff0c;切换得及时 一、思路#xff1a; 关键用Provide和Consume互相监听对方的变化 二、效果图#xff1a; 三、视频效果#xff1…鸿蒙开发城市联动选择弹框 城市联动选择弹框不容易在Android那边也是不容易。选择某个省份时城市要对得上切换得及时 一、思路 关键用Provide和Consume互相监听对方的变化 二、效果图 三、视频效果 鸿蒙Next开发教程实战案例源码分享-城市联动选择弹框 四、关键代码如下 // 联系893151960 Component export struct ProvinceLevelComponent {State labelList: string[] [];Consume selectProvinceIndex: number ;Consume currentFirst: string;Consume dataSource: ArrayProvinceListBean;aboutToAppear() {for (let i 0; i this.dataSource.length; i) {this.labelList.push(this.dataSource[i].province)if (this.dataSource[i].province this.currentFirst) {this.selectProvinceIndex i;}}this.currentFirst this.dataSource[this.selectProvinceIndex].province}build() {Column() {Column() {if (this.labelList.length 0) {Text(暂无数据).fontSize(20)} else {TextPicker({ range: this.labelList, selected: this.selectProvinceIndex }).onChange((value: string|string[], index: number|number[]) {if (typeof index number) {this.selectProvinceIndex indexthis.currentFirst this.dataSource[index].province}}).selectedTextStyle({color:$r(app.color.color_main)}).canLoop(false)}}.backgroundColor(Color.White).border({ color: #e2e2e2, width: { right: 0.5 }}).width(100%).layoutWeight(1).justifyContent(FlexAlign.Center)}.height(100%)} }Component export struct CityLevelComponent {State mTip: string 暂无数据Consume Watch(onFirstChange) currentFirst: string;Consume currentSecond: string;Consume selectProvinceIndex: number;State labelList: string[] [];State select: number 0;Consume dataSource: ArrayProvinceListBean;isIncludeUnlimited:boolean trueaboutToAppear(){this.onFirstChange()}build() {Column() {Column() {if (this.labelList.length 0) {Text(this.mTip).fontSize(20)} else {TextPicker({ range: this.labelList, selected: this.select }).onChange((value: string | string[], index: number | number[]) {if (typeof index number) {this.select indexthis.currentSecond this.labelList[index]}}).selectedTextStyle({color:$r(app.color.color_main)}).canLoop(false)}}.backgroundColor(Color.White).border({color: #e2e2e2,width: { right: 0.5 }}).width(100%).layoutWeight(1).justifyContent(FlexAlign.Center)}.height(100%)}// export interface ProvinceCityAreaDataBean{ // version?:number // list?:ArrayProvinceListBean // } // // export interface ProvinceListBean{ // province?:string // cityList?:ArrayCityListBean // } // // export interface CityListBean{ // city?:string // }onFirstChange() {this.labelList []let tempList : string[] []let cityList : ArrayCityListBean []let json: ProvinceListBean JSON.parse(JSON.stringify(this.dataSource[this.selectProvinceIndex]));cityList json.cityList!if (this.isIncludeUnlimited){if (cityList.length 1) {tempList.push(全省)}}for (let i 0; i cityList.length; i) {tempList.push(cityList[i].city)}this.labelList tempListif (this.isIncludeUnlimited || !this.currentSecond) {this.select 0;this.currentSecond this.labelList[this.select]} else {for (let i 0; i this.labelList.length; i) {if (this.labelList[i] this.currentSecond) {this.select i;this.currentSecond this.labelList[this.select]break}}// 切换了省但是没滑动市if (this.select 0) {this.currentSecond this.labelList[this.select]}}}}五、完整项目demo源码结构图 有需要完整源码的可私信我
http://www.ho-use.cn/article/10815629.html

相关文章:

  • 网站内链怎么删除wordpress标题带竖
  • 网站自然排名成都百度快照优化排名
  • 网站建设 国外wordpress 微信发布文章
  • 上海文明城市建设网站北京工程建设公共资源交易平台
  • 如何查看网站服务器网络公司加盟代理
  • 多就能自己做网站巴中汽车网站建设
  • 张家港外贸网站建设建设电商网站报价
  • 注册微商店铺如何注册青岛百度排名优化
  • discuz做电影网站软件开发项目预算
  • 南昌建设企业网站网站asp文件只读
  • 东莞正规网站建设如何编写一份网站开发需求文档
  • 西工网站建设设计东莞房价2023年最新房价走势
  • 国有企业投资建设项目厦门seo收费
  • 巧家县住房和城乡建设局网站接网站建设的单子
  • 深圳华强北商业圈广州seo成功案例
  • 网站开发项目报告主机网站建设制作
  • 网站备案要多长时间网站内容更新用什么
  • 美发店网站源码热门关键词
  • 手机网站怎样做解析红河州做网站
  • 杭州鼎易做的网站广州必去的十大景点
  • 用win2008做网站淘宝seo优化
  • 搬瓦工做网站稳定吗无为县建设局网站
  • 用网站做淘宝客怎么样开发银行助学贷款系统登录官网
  • 网站后台访问权限设置新媒体运营方案
  • 山西孝义网站开发工程建设信息都在哪个网站发布
  • 网站建设主要哪些内容wordpress 添加二级
  • 网站层次好的seo公司营销网
  • 备案的网站是公司吗wordpress导航菜单加图片
  • 音乐网站建设方案上海二手房
  • 适合权重小的网站做的专题福州网站建设市场