order.vue 1.89 KB
<template>
  <Layout>
      <Slide ref="slide"
             :data="list"
             :loop="false"
             :autoPlay="false"
             direction="vertical"
             class="slide-container"
             :showDots="false"
             @scroll-end="onChange"
             :speed="1000"
             :threshold="0.05"
             :options="scrollOpts"
      >
        <SlideItem v-for="i in list">
          <OrderSlideItem></OrderSlideItem>
        </SlideItem>
      </Slide>
  </Layout>
</template>

<script>

import {Slide} from 'cube-ui';
import OrderSlideItem from './components/order-slide-item';

export default {
  name: 'ShowOrderPage',
  components: {
    Slide,
    SlideItem: Slide.Item,
    OrderSlideItem,
  },
  data() {
    return {
      list: [
        {
          url: 'http://www.didichuxing.com/',
          image: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3978382133,2176310874&fm=27&gp=0.jpg'
        },
        {
          url: 'http://www.didichuxing.com/',
          image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide02.png'
        },
        {
          url: 'http://www.didichuxing.com/',
          image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide02.png'
        },
      ],
      scrollOpts: {
        deceleration: 0.0001,
        listenScroll: true,
        probeType: 3,
        click: true,
        directionLockThreshold: 0,
      }
    };
  },
  mounted() {
  },
  methods: {
    onChange(i) {
      this.$nextTick(() => {
        this.list.shift();
        this.list.push({
          url: 'http://www.didichuxing.com/',
          image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide03.png'
        });
      });
    },
    clickHandler(e) {
      console.log(e);
    }
  }
};
</script>

<style lang="scss" scoped>

.slide-container {
  /deep/ .cube-slide-item {
    width: 100%;
  }
}

</style>