123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <div
- class="com-main"
- element-loading-text="Loading"
- v-loading="listLoading">
- <div class="com-width-1400 com-margin-auto">
- <div class="metal-hardPlastic">
- <div class="metal-title">
- <p>Search Results</p>
- <div>
- <div class="sort">
- <el-dropdown
- trigger="click"
- @command="handleCommand">
- <span class="el-dropdown-link">
- Sort by {{ command }}
- <i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- v-for="command in commandList"
- :command="command.value"
- :key="command.label"
- >{{ command.label }}
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- </div>
- <div class="metal-content">
- <div class="metal-content-left">
- <category-filter
- :leadTimeList="leadTimeList"
- :colourList="colourList"
- :collectionsList="collectionsList"
- :complianceList="complianceList"
- :featureList="featureList"
- :decorationList="decorationList"
- :priceRange1="priceRange1"
- :priceRange2="priceRange2"
- @reset="reset"
- @getList="getList"
- @handleChangeColor="handleChangeColor"
- @handleChangeFeature="handleChangeFeature"
- @handleChangePrice="handleChangePrice"
- @handleChangeCollection="handleChangeCollection"
- @handleChangeCompliance="handleChangeCompliance"
- @handleChangeDecoration="handleChangeDecoration"
- @handleChangeLeadtime="handleChangeLeadtime"
- @handleChangeQuantity="handleChangeQuantity"></category-filter>
- </div>
- <div
- v-if="listLoading"
- class="metal-content-right"></div>
- <div
- class="metal-content-right"
- v-show="cardList.length > 0 && !listLoading">
- <div class="metal-content-right-item">
- <card
- class="card"
- v-for="(item, index) in cardList"
- :key="parseInt(index)"
- :cardData="item"></card>
- <transition
- @before-enter="beforeEnter"
- @enter="enter"
- @after-enter="afterEnter">
- <div
- class="ball"
- v-show="shopCarBall"
- ref="ball">
- <div class="linner_ball"></div>
- </div>
- </transition>
- </div>
- <!-- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="listQuery.page"
- :limit.sync="listQuery.limit"
- @pagination="getList"
- /> -->
- <infinite-loading
- spinner="spiral"
- @infinite="infiniteHandler"
- :identifier="computedProductList"
- :distance="200"
- class="infinite-loading-wrap">
- <div
- v-loading="true"
- slot="spinner"
- element-loading-text="Loading"
- element-loading-spinner="el-icon-loading"></div>
- <div
- class="loading-text"
- slot="no-more"></div>
- <div
- slot="error"
- slot-scope="{ trigger }">
- Error Data, click
- <a
- href="javascript:;"
- @click="trigger"
- >here</a
- >
- toretry
- </div>
- </infinite-loading>
- </div>
- <div
- class="metal-content-right-item empty"
- v-show="cardList.length === 0 && !listLoading">
- <category-no-data></category-no-data>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import InfiniteLoading from 'vue-infinite-loading'
- import categoryMixin from '@/mixins/category'
- export default {
- components: {
- InfiniteLoading,
- },
- mixins: [categoryMixin],
- data() {
- return {
- listLoading: true,
- activeNames: ['1'],
- cardList: [],
- priceList: [],
- shopCarBall: false,
- shopCarBallEl: null,
- ss: null,
- }
- },
- watch: {},
- async created() {},
- methods: {
- addCompareList(target) {
- this.shopCarBallEl = target
- this.shopCarBall = true
- },
- // 动画开始
- beforeEnter(el) {
- // 获取元素的大小及其相对于视口的位置
- if (process.client) {
- const dom = this.shopCarBallEl.getBoundingClientRect()
- const comparePosition = document
- .querySelector('.compare-list')
- .getBoundingClientRect()
- const offsetX = comparePosition.left - dom.left
- const offsetY = dom.top - comparePosition.top - 20
- el.style.display = ''
- // y轴是曲直向上的,x轴是蜿蜒的向右的
- el.style.transform = `translate3D( -${offsetX}px,${offsetY}px,0)`
- }
- },
- enter(el, done) {
- // 触发重绘,来实现动画的移动过程
- if (process.client) {
- this.ss = document.body.offsetHeight
- el.style.transform = `translate3D( 0,0,0)`
- el.addEventListener('transitionend', done)
- }
- },
- afterEnter(el) {
- this.shopCarBall = false
- el.style.display = 'none'
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .com-main a img {
- width: 100%;
- height: 450px;
- }
- @import './category.scss';
- </style>
|