sys il y a 2 ans
Parent
commit
59c4b150b7

+ 1 - 1
components/dgex-tantan/dgex-tantan.vue

@@ -222,7 +222,7 @@
 	.tantan-slide-box {
 		position: relative;
 		width: 95%;
-		height: 90%;
+		height: 100%;
 		perspective: 2100rpx;
 		perspective-origin: 50% -30%;
 		transform-style: preserve-3d;

+ 1 - 2
pages/index/index.vue

@@ -3,8 +3,7 @@
     <index-nav @setTabNum="setTabNum"></index-nav>
     <view class="list-box">
       <view class="box-one" v-if="tabNum===0">
-<!--        <slide-item></slide-item>-->
-        <attachment-list></attachment-list>
+        <slide-item></slide-item>
       </view>
       <view class="box-two" v-else-if="tabNum===1">
         <attachment-list></attachment-list>

+ 55 - 5
pages/index/model/slide-item.vue

@@ -1,22 +1,72 @@
 <template>
   <view class="slide-box">
-
+    <tantan :list="list" @onChange="change" @onClickImage="clickImage"></tantan>
   </view>
 </template>
 
 <script>
+import tantan from '@/components/dgex-tantan/dgex-tantan.vue'
 export default {
   name: "slide-item",
-  components: {},
+  components: {
+    tantan
+  },
   props: {},
   data() {
-    return {}
+    return {
+      list: []
+    }
   },
   watch: {},
   mounted() {
-
+    const arr = []
+    /* 测试数据*/
+    const tu = [
+      'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2Fc7a27a1ej00qvpu700019c000hs00vlc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
+      'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F9f81e6aaj00qvpu70001xc000hs00vmc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
+      'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F55bf2cb3j00qvpu70002cc000hs012jc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
+      'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F2017725bj00qvpu70001jc000hs00zxc.jpg&thumbnail=660x2147483647&quality=80&type=jpg'
+    ]
+    for (let index = 0; index < 10; index++) {
+      const n = Math.floor(Math.random() * (tu.length - 1))
+      let data = {
+        image: tu[n],
+        title: '你好',
+        desc: n + 500 + 'm ' + '30分钟前活跃',
+        tags: ['射手座']
+      }
+      arr.push(data)
+    }
+    this.list = arr
   },
-  methods: {}
+  methods: {
+    change(data) {
+      // 判断倒数
+      if (data.currentIndex > this.list.length - 5) {
+        // 模拟一下最加数据
+        const tu = [
+          'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2Fc7a27a1ej00qvpu700019c000hs00vlc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
+          'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F9f81e6aaj00qvpu70001xc000hs00vmc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
+          'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F55bf2cb3j00qvpu70002cc000hs012jc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
+          'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F2017725bj00qvpu70001jc000hs00zxc.jpg&thumbnail=660x2147483647&quality=80&type=jpg'
+        ]
+        for (let index = 0; index < 10; index++) {
+          const n = Math.floor(Math.random() * (tu.length - 1))
+          let newdata = {
+            image: tu[n],
+            title: '你好',
+            desc: n + 500 + 'm ' + '30分钟前活跃',
+            tags: ['射手座']
+          }
+          this.list.push(newdata)
+        }
+      }
+      // console.log(data);
+    },
+    clickImage(data) {
+      console.log(data);
+    }
+  }
 }
 </script>