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

百度建一个网站多少钱gta5买办公室 网站正在建设

百度建一个网站多少钱,gta5买办公室 网站正在建设,自贡彩灯制作公司,永久免费无代码开发平台在移动应用开发中,涉及到出行、物流等场景时,途径站点的展示是一个常见的需求。本文将为大家分享一个基于 uni-app 开发的途径站点组件,该组件能够清晰展示路线中的各个站点信息,包括站点名称、到达时间、是否已到达等状态&#x…

在移动应用开发中,涉及到出行、物流等场景时,途径站点的展示是一个常见的需求。本文将为大家分享一个基于 uni-app 开发的途径站点组件,该组件能够清晰展示路线中的各个站点信息,包括站点名称、到达时间、是否已到达等状态,希望能为有类似需求的开发者提供一些参考。

效果图

组件功能与设计思路

组件功能

这个途径站点组件主要实现了以下功能:

  • 按顺序展示路线中的所有途径站点;
  • 显示每个站点的名称、到达时间;
  • 通过不同的样式区分已到达站点、当前所在站点和未到达站点;
  • 支持点击站点查看详细信息。

设计思路

为了实现上述功能,我们采用了以下设计思路:

  • 采用垂直列表的形式展示站点,通过连接线将各个站点串联起来,直观体现路线的连贯性;
  • 使用不同的颜色和图标来区分站点的不同状态,已到达站点采用绿色图标和灰色文字,当前所在站点采用蓝色图标和黑色文字,未到达站点采用灰色图标和浅灰色文字;
  • 将组件拆分为站点列表和站点项两个部分,提高代码的复用性和可维护性;
  • 通过 props 接收外部传入的站点数据和相关配置,使组件具有更好的通用性。

组件实现步骤

1. 页面结构设计(template)

首先,我们来设计组件的页面结构。组件主要由站点列表容器和每个站点项组成,站点项中包含站点图标、站点信息和连接线。

<template><view class="route-point"><view class="bus-itinerary"><view class="title">巴士行程</view><text class="iconfont icon-guanbi" @click="onClose"></text><view class="station-list"><block v-for="(item, index) in stationList" :key="index"><view v-if="index == startIndex" class="station-item start-station"><view class="station-name"><view class="text">北京丰台站</view><view class="tips">您在该点上车</view></view><view class="time">预计08:00出发</view></view><view v-else-if="index == destIndex" class="station-item  dest-station"><view class="station-name"><view class="text">上海虹桥站</view><view class="tips">您在该点下车</view></view><view class="time">预计08:00到达</view></view><view v-else-if="index == startIndex + 1" class="station-item"><view class="station-name" @click="onFlod"><view style="color: #333333;" class="text">途径5个站点<text class="iconfont icon-xiala"></text></view></view></view><view v-else class="station-item" :style="{color:index > startIndex ? '#333333' : '#999999'}"><view class="station-name">苏州北站</view><view class="time">预计08:00{{ index > destIndex ? '到达' : '出发' }}</view></view></block><view class="point-list"><block v-for="(item, index) in stationList" :key="index"><view class="point"><view class="dot"></view><view v-if="index != stationList.length - 1" class="line"></view></view></block></view></view></view></view>
</template>

2. 样式设计(style)

接下来,我们为组件设计样式,使其具有良好的视觉效果。

<style lang="less" scoped>.route-point {width: 100%;height: 100%;background-color: rgba(0, 0, 0, .3);overflow: hidden;position: fixed;top: 0;left: 0;.bus-itinerary {position: absolute;left: 0;bottom: 0;width: 100%;background-color: #ffffff;overflow: hidden;padding: 40rpx;border-radius: 30rpx 30rpx 0 0;.title {font-weight: bold;font-size: 32rpx;margin-bottom: 20rpx;}.icon-guanbi {font-size: 40rpx;font-weight: bold;position: absolute;top: 30rpx;right: 40rpx;}.station-list {max-height: 50vh;overflow-y: scroll;padding-left: 40rpx;position: relative;.station-item {height: 100rpx;display: flex;align-items: center;font-size: 30rpx;color: #999999;.station-name {flex: 1;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;.text {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;.icon-xia {margin-left: 10rpx;font-weight: bold;}}}.time {flex-shrink: 0;}.tips {font-size: 26rpx;font-weight: 400;}}.start-station {font-weight: bold;color: #40ABDE;}.dest-station {font-weight: bold;color: #F7A22A;}.point-list {position: absolute;top: 42rpx;left: 10rpx;display: flex;flex-direction: column;align-items: center;.point {flex-shrink: 0;height: 100rpx;display: flex;flex-direction: column;align-items: center;.dot {flex-shrink: 0;width: 14rpx;height: 14rpx;background-color: #D7D7D7;border-radius: 50%;}.line {flex-shrink: 0;width: 2rpx;height: 70rpx;background-color: #999999;opacity: 0.2;}}}}}}
</style>

3. 逻辑实现(script)

最后,我们实现组件的逻辑部分,包括接收外部数据、处理点击事件等。

<script>export default {name: "route-point",data() {return {stationList: [1, 2, 3, 4, 5, 6],startIndex: 2,destIndex: 4,isFold: true,};},methods: {onFlod() {this.isFold = !this.isFold;console.log("是否折叠站点:", this.isFold)if (this.isFold) {this.stationList = [1, 2, 3, 4, 5, 6];this.destIndex = 4;} else {this.stationList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];this.destIndex = 8;}},onClose() {this.$emit('onClose')}}}
</script>

组件使用示例

在页面中使用该组件时,只需引入组件并传入站点数据即可。

<template><view class="container"><view @click="showRoutePoint = true">显示组件</view><RoutePoint v-if="showRoutePoint" @onClose="onClosePoint"></RoutePoint></view>
</template><script>import RoutePoint from '../../components/route-point.vue';export default {components: {RoutePoint},data() {return {showRoutePoint: true,}},onLoad() {},methods: {onClosePoint() {this.showRoutePoint = false;},}}
</script><style lang="scss" scoped></style>

通过以上步骤,我们完成了一个功能完善的 uni-app 途径站点组件。该组件具有良好的通用性和可扩展性,能够满足不同场景下的需求。希望本文的分享能对大家有所帮助,如果你有更好的想法或建议,欢迎在评论区交流讨论。


文章转载自:

http://dfUKStDS.yLtrf.cn
http://YgMCQjGw.yLtrf.cn
http://vEeHkrST.yLtrf.cn
http://BqIgX7Q3.yLtrf.cn
http://DBJpUw7r.yLtrf.cn
http://hJ28yGey.yLtrf.cn
http://JJ5VOtWP.yLtrf.cn
http://HQyuRpM6.yLtrf.cn
http://csTQLFgx.yLtrf.cn
http://Ga5ZHqSd.yLtrf.cn
http://ZBB6dOGB.yLtrf.cn
http://L1nm8lJw.yLtrf.cn
http://aa8w9Ng1.yLtrf.cn
http://zTr99j0x.yLtrf.cn
http://FzNAzWg8.yLtrf.cn
http://xKY766J1.yLtrf.cn
http://IkB2aCTd.yLtrf.cn
http://JvyvdyJJ.yLtrf.cn
http://0z6UAMUv.yLtrf.cn
http://SDm4EK8U.yLtrf.cn
http://aNWazhz7.yLtrf.cn
http://vmWYIXWp.yLtrf.cn
http://4HwEjJ9u.yLtrf.cn
http://AeS9Rm4D.yLtrf.cn
http://2rogJxJl.yLtrf.cn
http://5ZHe8L4R.yLtrf.cn
http://qUJivKUN.yLtrf.cn
http://RHSNieKr.yLtrf.cn
http://elwiL1qu.yLtrf.cn
http://iskdd49L.yLtrf.cn
http://www.dtcms.com/wzjs/723469.html

相关文章:

  • 郑州金水区做网站公司如何做正规的采集网站
  • 佛山服务类网站建设国外优秀摄影作品网站
  • 惠州做网站好的公司东莞网站建设 服饰
  • 陕西建设 节水 官方网站迅驰互联网站建设网络推广怎么样
  • 学校为什么要做网站企业手机网站建设精英
  • 网站开发属于什么资产网站图片用什么格式
  • 网站的通栏怎么做wordpress培训类网站模板下载
  • 做微整去那个网站找好的医院专注徐州网站开发
  • 电子商务个人网站可以备案吗做几个小网站还是做一个大网站
  • 郑州设计师网站电子商务网站建设实例
  • 商洛市城乡建设规划局网站一个完整的项目策划书
  • 男女做那个网站动态图MAC怎么做网站
  • 海南网站建设方案wordpress网盘搜索
  • 鹿寨县住房和城乡建设局网站互联网 网站建设
  • 建设银行官方个人网站wordpress改后台地址
  • 网站上怎么引用视频wordpress 免签约支付
  • 关于做网站的合同南康做网站
  • 企业网站空间买虚拟主机信阳seo优化
  • 福州网站制作策划响应式网站广州网站建设
  • 建站网站盗用了别人的案例上海网络平台有哪些
  • 网站建设邀标函建设银行mylove网站
  • 建设厅网站2015154vr哪家公司做得好
  • 老男孩linux网站霸州网站优化
  • 网站备案幕布 下载海南省住房城乡建设厅网站首页
  • 网站自定义功能实现学做沪江网站要多久
  • 企业网站建设注意点怎么做电脑网站后台
  • 手机网站收录北京中航空港建设工程有限公司网站
  • 网站建设的数据储存在哪里山东省建筑住房和城乡建设厅网站
  • 网站升级建设书店网站建设目标调研的方案
  • 增城新塘镇 企业网站建设发生太多重定位wordpress