فهرست منبع

分类:静态

panyong 2 سال پیش
والد
کامیت
7de186955c

+ 1 - 0
htmldev/cps/public/index.html

@@ -10,6 +10,7 @@
   <meta http-equiv="Pragma" content="no-cache"/>
   <meta http-equiv="Expires" content="0"/>
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+  <link rel="stylesheet" href="//unpkg.com/swiper@4.3.5/dist/css/swiper.min.css">
   <title>返不停</title>
 </head>
 <body>

+ 76 - 0
htmldev/cps/src/views/category/detail/child/banner/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <swiper class="fbt-swiper-container"
+          :class="{'swiper-no-swiping': arrBanner.length === 1}"
+          :options="fbtSWOptions"
+          v-if="arrBanner.length">
+    <swiper-slide v-for="(item, index) in arrBanner"
+                  :key="index">
+      <img class="banner"
+           :src="item"
+           alt="">
+    </swiper-slide>
+    <div class="sw-pagination"
+         slot="pagination"
+         :style="{visibility: arrBanner.length <= 1 ? 'hidden' : 'visible'}"></div>
+  </swiper>
+</template>
+
+<script>
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
+
+export default {
+  name: 'banner',
+  components: {
+    swiper,
+    swiperSlide
+  },
+  computed: {
+    fbtSWOptions () {
+      return {
+        // loop: true,
+        // autoplay: this.arrBanner.length > 1,
+        autoplay: false,
+        pagination: {
+          el: '.sw-pagination',
+          clickable: true
+        }
+      }
+    },
+    arrBanner () {
+      return ['http://p1.music.126.net/uuO0NVbTBmvumV6Qa-ExJw==/109951166598780468.jpg?imageView&quality=89', 'http://p1.music.126.net/2gK-S1egQdDTMgs8zTzmFg==/109951166598932300.jpg?imageView&quality=89']
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.fbt-swiper-container {
+  .banner {
+    display: block;
+    width: 100%;
+    // height: 357px;
+  }
+
+  ::v-deep .sw-pagination {
+    position: absolute;
+    bottom: 20px;
+    z-index: 1;
+    text-align: center;
+
+    .swiper-pagination-bullet {
+      margin: 0 6px !important;
+    }
+
+    .swiper-pagination-bullet {
+      width: 12px;
+      height: 12px;
+      opacity: 1;
+      background: #fff;
+    }
+
+    .swiper-pagination-bullet-active {
+      background: #D8D8D8;
+    }
+  }
+}
+</style>

+ 10 - 2
htmldev/cps/src/views/category/detail/index.vue

@@ -1,10 +1,18 @@
 <template>
-  <div>分类</div>
+  <div>
+    <!--轮播图-->
+    <Banner/>
+  </div>
 </template>
 
 <script>
+import Banner from './child/banner'
+
 export default {
-  name: 'index'
+  name: 'index',
+  components: {
+    Banner
+  }
 }
 </script>
 

+ 2 - 10
htmldev/cps/src/views/category/index/child/main.vue

@@ -80,7 +80,7 @@
 <script>
 import BScroll from 'better-scroll'
 import { Toast, Loading } from 'vant'
-import { apiOrderList, apiOrderDetail } from '../../../order/api/api'
+import { apiOrderList } from '../../../order/api/api'
 
 export default {
   components: {
@@ -123,7 +123,6 @@ export default {
     this.$route.meta.isUseCache = false
   },
   methods: {
-    goDetail (id) {},
     onRefresh () {
       this.pagenum = 0
       this.pagesize = 20
@@ -207,14 +206,7 @@ export default {
       }
     },
     async getOrderDetail (id) {
-      try {
-        const { status, data, msg } = await apiOrderDetail(id)
-        if (status) {
-          this.$emit('setOrderDetail', data)
-        } else {
-          Toast(msg)
-        }
-      } catch (err) {}
+      this.$router.push({ name: 'CategoryDetail' })
     }
   },
   beforeDestroy () {