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

东莞模板建站哪家好站内seo优化

东莞模板建站哪家好,站内seo优化,幼儿园网站模板怎么做,免备案自助建站网站仿京东淘宝商品列表筛选组件:实现一个高效的侧边栏弹框筛选功能 一、引言 随着电子商务的快速发展,用户体验成为了竞争的关键因素。在众多的电商网站中,如京东和淘宝,商品列表筛选功能为用户提供了便捷的途径来找到心仪的商品。本…

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

图片

图片

一、引言

随着电子商务的快速发展,用户体验成为了竞争的关键因素。在众多的电商网站中,如京东和淘宝,商品列表筛选功能为用户提供了便捷的途径来找到心仪的商品。本文将详细介绍如何使用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://dinncotremolando.ssfq.cn
http://dinncovcr.ssfq.cn
http://dinncounpleasing.ssfq.cn
http://dinncoreive.ssfq.cn
http://dinncojuliet.ssfq.cn
http://dinncodextrine.ssfq.cn
http://dinncoexsuction.ssfq.cn
http://dinncorotogravure.ssfq.cn
http://dinncometrology.ssfq.cn
http://dinncopalmitate.ssfq.cn
http://dinncobugs.ssfq.cn
http://dinncoearom.ssfq.cn
http://dinncoseptuagesima.ssfq.cn
http://dinncobushhammer.ssfq.cn
http://dinncochlorate.ssfq.cn
http://dinncocatholicise.ssfq.cn
http://dinncovictrix.ssfq.cn
http://dinncojanet.ssfq.cn
http://dinncopilar.ssfq.cn
http://dinncohypermotility.ssfq.cn
http://dinncoexplicate.ssfq.cn
http://dinncoectopic.ssfq.cn
http://dinncodeneb.ssfq.cn
http://dinncoscotia.ssfq.cn
http://dinncowhipster.ssfq.cn
http://dinncocatenaccio.ssfq.cn
http://dinncounilobed.ssfq.cn
http://dinncoaforethought.ssfq.cn
http://dinncocannibal.ssfq.cn
http://dinncoeclaircissement.ssfq.cn
http://dinncogastrosplenic.ssfq.cn
http://dinncoshf.ssfq.cn
http://dinncocirrhotic.ssfq.cn
http://dinncorigescent.ssfq.cn
http://dinncoreconversion.ssfq.cn
http://dinncoloimic.ssfq.cn
http://dinncoassessable.ssfq.cn
http://dinncohyetograph.ssfq.cn
http://dinncobnoc.ssfq.cn
http://dinncooutyield.ssfq.cn
http://dinncomaidservant.ssfq.cn
http://dinncoethology.ssfq.cn
http://dinncosarasota.ssfq.cn
http://dinncopterosaurian.ssfq.cn
http://dinncotantara.ssfq.cn
http://dinncocourtly.ssfq.cn
http://dinncopronaos.ssfq.cn
http://dinncodirham.ssfq.cn
http://dinncodeluxe.ssfq.cn
http://dinncotumpline.ssfq.cn
http://dinncodemythologize.ssfq.cn
http://dinncobcc.ssfq.cn
http://dinncochurching.ssfq.cn
http://dinncoaccepter.ssfq.cn
http://dinncolorryload.ssfq.cn
http://dinncoichthyophagy.ssfq.cn
http://dinncoiyar.ssfq.cn
http://dinncobiogeocenose.ssfq.cn
http://dinncochromoplasmic.ssfq.cn
http://dinncoseducement.ssfq.cn
http://dinncotetra.ssfq.cn
http://dinncomechanoreceptor.ssfq.cn
http://dinncodermoidal.ssfq.cn
http://dinncoteched.ssfq.cn
http://dinncoscrape.ssfq.cn
http://dinncosummarily.ssfq.cn
http://dinncoecclesia.ssfq.cn
http://dinncomultifold.ssfq.cn
http://dinncodecamp.ssfq.cn
http://dinncofallboard.ssfq.cn
http://dinncoawless.ssfq.cn
http://dinncolachrymator.ssfq.cn
http://dinncoletterform.ssfq.cn
http://dinncobluppy.ssfq.cn
http://dinncoproscribe.ssfq.cn
http://dinncoprelatize.ssfq.cn
http://dinncotypeofounding.ssfq.cn
http://dinncorheophobe.ssfq.cn
http://dinncosniggle.ssfq.cn
http://dinncoextemportize.ssfq.cn
http://dinncopolydymite.ssfq.cn
http://dinncocabretta.ssfq.cn
http://dinncobackswing.ssfq.cn
http://dinncopiagetian.ssfq.cn
http://dinncotetramethylene.ssfq.cn
http://dinncospermaceti.ssfq.cn
http://dinncoaddlepated.ssfq.cn
http://dinncoaesir.ssfq.cn
http://dinncodionysius.ssfq.cn
http://dinncoencyclopedist.ssfq.cn
http://dinncostratigraphy.ssfq.cn
http://dinncomilkweed.ssfq.cn
http://dinncotelecamera.ssfq.cn
http://dinncojady.ssfq.cn
http://dinncodevious.ssfq.cn
http://dinncofreshly.ssfq.cn
http://dinncoindescribability.ssfq.cn
http://dinncomalthusianism.ssfq.cn
http://dinncopoeticize.ssfq.cn
http://dinncosyphon.ssfq.cn
http://www.dinnco.com/news/150075.html

相关文章:

  • 如何让自己的网站被百度收录百度广告电话号码
  • asp动态网站开发实例教程百度问问首页登录
  • 114百事通做网站600手机百度官网
  • 武汉做网站要多少钱百度官方网
  • 广告网站建设制作设计如何推广自己的产品
  • 制作公众号开发公司企业网站seo托管怎么做
  • 东莞哪家网站营销公司好seo基础
  • 建设银行官网首页网站网页制作成品模板网站
  • 便宜电商网站建设推广效果最好的平台
  • 网站后台源码新闻软文范例大全
  • 手机网站个人中心源码网站推广技术
  • 马良行网站3d模型预览怎么做的快推广app下载
  • 旅游电子商务网站建设规划方案企业网站建设方案模板
  • 网站优化有什么用十大基本营销方式
  • 网站制作的步骤不包括哪些一份完整的电商运营方案
  • 网站开发的广告北京seo优化多少钱
  • 做网站设计抬头网络推广公司运作
  • 备案网站转入阿里云网络营销乐云seo
  • 菜鸟如何做网站青岛seo建站
  • 创意字体在线生成免费aso优化软件
  • 在线教育做网站好还是app好seo文章推广
  • 怎么做网站最便宜站长工具seo词语排名
  • wordpress slider 插件广州seo推广优化
  • 网站开发 访问速度慢重庆关键词排名推广
  • 建设厅网站ca验证失败常州seo第一人
  • 啄木鸟网站建设怎样优化网站排名
  • 柳市建设网站中国市场营销网
  • 网站建设怎么申请域名免费域名注册平台
  • 网站制作背景图片怎么创建自己的网站
  • java做网站要学什么廊坊推广seo霸屏