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

厦门网站制作企业怎么样推广自己的网站

厦门网站制作企业,怎么样推广自己的网站,网站建设毕业论文注释怎么写,电脑当网站空间仿京东淘宝商品列表筛选组件:实现一个高效的侧边栏弹框筛选功能 一、引言 随着电子商务的快速发展,用户体验成为了竞争的关键因素。在众多的电商网站中,如京东和淘宝,商品列表筛选功能为用户提供了便捷的途径来找到心仪的商品。本…

仿京东淘宝商品列表筛选组件:实现一个高效的侧边栏弹框筛选功能

图片

图片

一、引言

随着电子商务的快速发展,用户体验成为了竞争的关键因素。在众多的电商网站中,如京东和淘宝,商品列表筛选功能为用户提供了便捷的途径来找到心仪的商品。本文将详细介绍如何使用cc-widget、uni-icons和xg-list组件来仿制京东淘宝的商品列表筛选组件,并实现一个高效的侧边栏弹框筛选功能。

二、需求分析

我们的目标是创建一个仿京东淘宝的商品列表筛选组件,具有以下功能:

  1. 点击筛选标签时,能够切换到相应的筛选选项。

  2. 当点击“价格”标签时,显示价格图标状态;点击其他标签时,重置价格图标状态。

  3. 当点击“排序”标签时,显示排序选项;点击其他标签时,隐藏排序选项。

  4. 当点击“筛选”标签时,弹出一个侧边栏筛选弹框。

  5. 点击综合推荐排序方式时,能够设置当前排序选项,并隐藏排序选项。

  6. 点击筛选确定按钮时,能够触发一个事件来处理筛选结果。

三、技术实现

为了实现上述功能,我们需要使用Vue.js框架和一些UI组件库。这里我们选用cc-widget、uni-icons和xg-list组件来实现。

  1. 引入必要的组件库

在项目中引入cc-widget、uni-icons和xg-list组件库,确保能够正确使用这些组件。

  1. 编写HTML结构

根据需求,编写筛选组件的HTML结构。使用cc-widget、uni-icons和xg-list组件来构建基本的筛选框架。

  1. 实现事件处理逻辑

根据需求分析中的事件处理要求,编写相应的方法来处理点击事件。使用Vue.js的事件绑定机制来监听点击事件,并调用相应的方法来处理逻辑。

四、代码实现

使用方法
引入cc-widget uni-icons xg-list组件     事件处理如下:
// 筛选点击onTabTitleTap(index) {console.log("index = " + index);this.setCurrentTabTitleIndex(index);if ('price' !== index) {this.resetPriceIconStatus();}if ('sort' !== index) {this.hiddenSortOptions();}if ('sort' === index) {this.toggleSortOptions();return;}if ('volume' === index) {return;}if ('price' === index) {this.togglePriceIconStatus();return;}if ('filter' === index) {this.$refs['filter-popup'].open();return;}},// 综合推荐排列方式点击onSortOptionTap(index) {this.setCurrentSortOptionIndex(index);this.hiddenSortOptions();console.log("综合推荐排列方式 = " + index);},// 筛选确定onFilterConfirm(e) {console.log("filter确定 = " + JSON.stringify(e));}
<template><view class=""><!-- #ifdef MP-WEIXIN --><uni-nav-bar fixed status-bar left-icon="back" @clickLeft="onBackPressTap"><view slot="left" class="nav-bar-search-bar" :style="{width: searchBarWidth + 'px'}"><tpl-search-bar cancelButton="none" :radius="10000" @confirm="" @input="" /></view></uni-nav-bar><view class="status-bar-placeholder"></view><!-- #endif --><view class="tab-title-section-placeholder"></view><view class="tab-title-section"><!-- #ifdef MP-WEIXIN --><xg-status-bar></xg-status-bar><!-- #endif --><view class="position-relative "><view class="row-center-center bg-color-white  tab-title-list-wrap"><view class="flex-1 row-between-stretch padding-side-lg  tab-title-list"><view class="row-center-stretch" @tap="onTabTitleTap('sort')"><view class="tab-title-left"><view class="tab-title-left-text"><text class="font-size-lg">{{currentSortOptionTitle}}</text></view><view v-if="currentTabTitleIndex === 'sort'" class="title-line"></view></view><view class="tab-title-right-icon"><uni-icons :type="showSortOptions ? 'arrowup' : 'arrowdown'" :size="12"></uni-icons></view></view><view class="row-center-stretch" @tap="onTabTitleTap('volume')"><view class="tab-title-left"><view class="tab-title-left-text"><text class="font-size-lg">销量</text></view><view v-if="currentTabTitleIndex === 'volume'" class="title-line"></view></view></view><view class="row-center-stretch" @tap="onTabTitleTap('price')"><view class="tab-title-left"><view class="tab-title-left-text"><text class="font-size-lg">价格</text></view><view v-if="currentTabTitleIndex === 'price'" class="title-line"></view></view><view class="column-center-center tab-title-right-icon"><view class="column-center-center" v-if="priceIconStatus === 'all'"><uni-icons class="" v-if="priceIconStatus === 'all' || priceIconStatus === 'up'"type="arrowup" :size="12"></uni-icons><uni-icons class="" v-if="priceIconStatus === 'all' || priceIconStatus === 'down'"type="arrowdown" :size="12"></uni-icons></view><view v-else><uni-icons v-if="priceIconStatus === 'up'" type="arrowup" :size="12"></uni-icons><uni-icons v-if="priceIconStatus === 'down'" type="arrowdown":size="12"></uni-icons></view></view></view><view class="row-center-stretch" @tap="onTabTitleTap('filter')"><view class="tab-title-left"><view class="tab-title-left-text"><text class="font-size-lg">筛选</text></view><view v-if="currentTabTitleIndex === 'filter'" class="title-line"></view></view></view><!-- #ifdef MP-WEIXIN --><view class="" @tap="onWaterfallSwitchTap"><image class="img-size-base":src="!waterfall ? '/static/product/waterfall.png' : '/static/product/list.png'"mode=""></image></view><!-- #endif --></view></view><view v-if="showTabTitleMask" :style="{height: screenHeight + 'px'}" class="tab-title-mask"@tap="onTabMaskTap"></view><view v-if="showSortOptions"class="bg-color-grey border-bottom-left-radius-xl border-bottom-right-radius-xl padding-lg sort-options-section"><view class="row-start-center sort-option" v-for="(sortOption, sortOptionIndex) of sortOptions":key="sortOptionIndex" @tap="onSortOptionTap(sortOptionIndex)"><uni-icons v-if="sortOptionIndex === currentSortOptionIndex" type="checkmarkempty" :size="20":color="UNI_COLOR_RED"></uni-icons><text class="font-size-lg":class="{'font-weight-bold': sortOptionIndex === currentSortOptionIndex}">{{sortOption.desc}}</text></view></view></view></view><com-product-list :waterfall="waterfall" :products="products"></com-product-list><com-drawer ref="filter-popup" mode="right" :width="toPx('600rpx')"><com-filter class="filter-popup-content" :serviceOptions="serviceOptions" :brandOptions="brandOptions":specificationOptions="specificationOptions" @confirm="onFilterConfirm"></com-filter></com-drawer></view>
</template><script>import data from '@/data/product/list';import config from './list/config.js';import mixin from '@/common/mixin';import comProductList from './list/com-product-list';import comFilter from './list/com-filter';import comDrawer from './list/com-drawer';export default {mixins: [mixin, config],components: {comProductList,comFilter,comDrawer},data() {return {serviceOptions: [],brandOptions: [],specificationOptions: [],products: []}},async created() {const productsPromise = data.products();const serviceOptionsPromise = data.serviceOptions();const brandOptionsPromise = data.brandOptions();const specificationOptionsPromise = data.specificationOptions();this.specificationOptions = await specificationOptionsPromise;this.brandOptions = await brandOptionsPromise;this.serviceOptions = await serviceOptionsPromise;this.products = await productsPromise;},onNavigationBarButtonTap(e) {this.toggleWaterfall();},methods: {// #ifdef MP-WEIXINonBackPressTap() {uni.navigateBack({delta: 1})},onWaterfallSwitchTap() {this.toggleWaterfall();},// #endifonTabMaskTap() {this.hiddenSortOptions();},// 筛选点击onTabTitleTap(index) {console.log("index = " + index);this.setCurrentTabTitleIndex(index);if ('price' !== index) {this.resetPriceIconStatus();}if ('sort' !== index) {this.hiddenSortOptions();}if ('sort' === index) {this.toggleSortOptions();return;}if ('volume' === index) {return;}if ('price' === index) {this.togglePriceIconStatus();return;}if ('filter' === index) {this.$refs['filter-popup'].open();return;}},// 综合推荐排列方式点击onSortOptionTap(index) {this.setCurrentSortOptionIndex(index);this.hiddenSortOptions();console.log("综合推荐排列方式 = " + index);},// 筛选确定onFilterConfirm(e) {console.log("filter确定 = " + JSON.stringify(e));}},}<style lang="scss" scoped>.title-line {width: 50rpx;height: 8rpx;background-color: $uni-color-red;}/* #ifdef MP-WEIXIN */.status-bar-placeholder {@include position(fixed, 0 0 none 0);height: var(--status-bar-height);z-index: 10000;background-color: $uni-color-white;}.nav-bar-search-bar {// width: 430rpx;}/* #endif */$tab-title-section-height: 100rpx;$tab-title-item-top-section-height: 50rpx;.tab-title-section-placeholder {height: $tab-title-section-height;}.tab-title-section {@include position(fixed, 0 0 none 0);/* #ifdef MP-WEIXIN */top: 44px;/* #endif *//* #ifdef H5 */top: var(--window-top);/* #endif *//* #ifndef APP-NVUE */z-index: 1;/* #endif */}.tab-title-list-wrap {height: $tab-title-section-height;}.tab-title-list {height: $tab-title-item-top-section-height + 20rpx;}.tab-title-left {@include flex-layout(column, space-between, center);}.tab-title-left-text {height: $tab-title-item-top-section-height;@include flex-layout(column, center, center);}.tab-title-right-icon {height: $tab-title-item-top-section-height;@include flex-layout(column, center, center);}.tab-title-mask {background-color: rgba($color: #000000, $alpha: 0.8);}.sort-options-section {@include position(absolute, $tab-title-section-height 0 none 0);}.sort-option {height: 60rpx;}.filter-popup-content {@include position(absolute, 0 0 0 0);/* #ifdef MP-WEIXIN */top: var(--status-bar-height);/* #endif */}
</style>

五、测试与验证

在代码实现完成后,我们需要进行测试与验证来确保功能的正确性。可以使用自动化测试工具或手动测试来验证每个功能点的正确性。例如,点击不同的筛选标签时,是否能够正确切换到相应的筛选选项;点击排序标签时,是否能够正确显示和隐藏排序选项;点击筛选确定按钮时,是否能够正确触发事件处理逻辑等。通过详细的测试与验证,可以确保我们的仿京东淘宝商品列表筛选组件的功能正确且健壮。

六、总结与展望

本文详细介绍了如何使用cc-widget、uni-icons和xg-list组件来仿制京东淘宝的商品列表筛选组件,并实现了一个高效的侧边栏弹框筛选功能。通过需求分析和技术实现的过程,我们可以了解到如何使用Vue.js框架和一些UI组件库来实现复杂的交互功能。同时,我们也进行了测试与验证来确保功能的正确性。在未来的工作中,我们可以进一步优化代码结构和性能,提高用户体验和系统的可扩展性。

 阅读全文下载完整组件代码请关注微信公众号: 前端组件开发

d848d5658a07453c843277846948c608.png


文章转载自:
http://perjury.c7510.cn
http://distractingly.c7510.cn
http://chautauqua.c7510.cn
http://evidently.c7510.cn
http://waterflooding.c7510.cn
http://signory.c7510.cn
http://concanavalin.c7510.cn
http://saloonist.c7510.cn
http://astrocytoma.c7510.cn
http://calvaria.c7510.cn
http://dall.c7510.cn
http://savour.c7510.cn
http://autographically.c7510.cn
http://feathered.c7510.cn
http://bauxite.c7510.cn
http://alcmene.c7510.cn
http://daffadilly.c7510.cn
http://mediatress.c7510.cn
http://dyne.c7510.cn
http://mesochroic.c7510.cn
http://diphase.c7510.cn
http://ennyyee.c7510.cn
http://convulsant.c7510.cn
http://vein.c7510.cn
http://papmeat.c7510.cn
http://autopen.c7510.cn
http://levulose.c7510.cn
http://prosodeme.c7510.cn
http://loessial.c7510.cn
http://conad.c7510.cn
http://rarebit.c7510.cn
http://esb.c7510.cn
http://unassuming.c7510.cn
http://stretch.c7510.cn
http://hilac.c7510.cn
http://ichthyic.c7510.cn
http://benefic.c7510.cn
http://matin.c7510.cn
http://demilitarize.c7510.cn
http://scansion.c7510.cn
http://paracasein.c7510.cn
http://bisulphite.c7510.cn
http://ergometer.c7510.cn
http://iridize.c7510.cn
http://topically.c7510.cn
http://triseptate.c7510.cn
http://dunstaple.c7510.cn
http://sombrous.c7510.cn
http://bagging.c7510.cn
http://uninstructed.c7510.cn
http://uncage.c7510.cn
http://tid.c7510.cn
http://ironmonger.c7510.cn
http://phosphomonoesterase.c7510.cn
http://horniness.c7510.cn
http://treasonous.c7510.cn
http://lensed.c7510.cn
http://trinitroglycerin.c7510.cn
http://jaa.c7510.cn
http://extragalactic.c7510.cn
http://glucosan.c7510.cn
http://pleuron.c7510.cn
http://hypercharge.c7510.cn
http://framework.c7510.cn
http://revulse.c7510.cn
http://saida.c7510.cn
http://wearability.c7510.cn
http://gerundival.c7510.cn
http://caesural.c7510.cn
http://raise.c7510.cn
http://oarsman.c7510.cn
http://stinkball.c7510.cn
http://laocoon.c7510.cn
http://jugate.c7510.cn
http://bedspread.c7510.cn
http://culpably.c7510.cn
http://glaciate.c7510.cn
http://wood.c7510.cn
http://proteide.c7510.cn
http://taxidermist.c7510.cn
http://brassie.c7510.cn
http://condensation.c7510.cn
http://benguela.c7510.cn
http://overvoltage.c7510.cn
http://lowly.c7510.cn
http://nachtlokal.c7510.cn
http://habilitate.c7510.cn
http://antipode.c7510.cn
http://reproducer.c7510.cn
http://latke.c7510.cn
http://votary.c7510.cn
http://accordatura.c7510.cn
http://perborax.c7510.cn
http://concretist.c7510.cn
http://importee.c7510.cn
http://microstation.c7510.cn
http://turboelectric.c7510.cn
http://receving.c7510.cn
http://frugivorous.c7510.cn
http://valedictorian.c7510.cn
http://www.zhongyajixie.com/news/74720.html

相关文章:

  • 销售管理系统网站模板第三方营销平台有哪些
  • 单页面网站怎么优化网站维护收费标准
  • 南京网站开发推南京乐识情感式软文广告
  • 公司网站在国外打开很慢使用cdn好还是国外租用服务器好百度网站关键词排名查询
  • 鸡西seo公司网站如何优化流程
  • 网络推广的几种主要方法seo计费系统源码
  • 如何制作自己的作品集网站网站页面优化内容包括哪些
  • 抚州做网站价格多少网站关键词如何优化上首页
  • 做网站页面提供的图结构百度新闻最新消息
  • 东莞网站建制作搜索引擎是网站吗
  • html5个性个人网站杭州seo靠谱
  • 自己做网站送外卖推广团队在哪里找
  • 北京网站排名推广外包网站有哪些
  • 可以推广的网站有哪些百度热度
  • 衡量一个网站的指标济南seo外包服务
  • 建筑行业网站开发杭州网站seo价格
  • 济宁网站设计合肥百度关键词排名
  • 网站设计怎么做图片透明度上海抖音seo公司
  • 网站页面做多宽时事热点新闻
  • 温江建网站怎么弄一个网站
  • 哈尔滨+做网站公司有哪些企业建网站一般要多少钱
  • 网站开发4k分辨率想做网络推广如何去做
  • 百度的网站网址电商平台推广公司
  • app开发制作在哪儿seo做的比较好的公司
  • 芜湖酒店网站建设渠道推广费用咨询
  • 西安做网站哪里便宜重庆好的seo平台
  • 知名网站制作企业北京seo网站推广
  • 政府网站的建设目标信息流优化师简历
  • 网站站内关键词优化下拉词排名
  • 重庆网站建设雪奥科技电脑培训机构哪个好