李志伟 3 gadus atpakaļ
vecāks
revīzija
ffe0113130

+ 27
- 2
src/pages/machineryDetail/index.jsx Parādīt failu

@@ -1,4 +1,4 @@
1
-import { View, Image, ScrollView } from "@tarojs/components"
1
+import { View, Image, ScrollView,Swiper,SwiperItem } from "@tarojs/components"
2 2
 import CustomNav from "@/components/CustomNav"
3 3
 import Jianbian from "@/components/Jianbian"
4 4
 import withLayout from '@/layouts'
@@ -9,6 +9,20 @@ import micon from '@/assets/machinery/micon2.png'
9 9
 import './style.less'
10 10
 
11 11
 export default withLayout((props) => {
12
+  const imgList=[
13
+    {
14
+      thumb:banner1
15
+    },
16
+    {
17
+      thumb:banner1
18
+    },
19
+    {
20
+      thumb:banner1
21
+    },
22
+    {
23
+      thumb:banner1
24
+    }
25
+  ]
12 26
   return (
13 27
     <View className='page-index'>
14 28
       <View className='index-navbar'>
@@ -16,7 +30,18 @@ export default withLayout((props) => {
16 30
       </View>
17 31
       <View className='index-container'>
18 32
         <ScrollView scrollY style={{ height: '100%' }}>
19
-          <Image src={banner1} mode='aspectFill' className='detailHead' />
33
+        <Swiper
34
+          circular
35
+          autoplay
36
+          className='swiper'
37
+        >
38
+            {imgList.map((item, inx) => (
39
+              <SwiperItem key={inx}>
40
+                <Image src={item.thumb} mode='widthFix' className='storeImage' />
41
+              </SwiperItem>
42
+            ))}
43
+          </Swiper>
44
+          {/* <Image src={banner1} mode='aspectFill' className='detailHead' /> */}
20 45
           <View className='detailContent'>
21 46
             <Jianbian status='1' />
22 47
             <View className='detialName'>收割机001--S001</View>

+ 7
- 0
src/pages/machineryDetail/style.less Parādīt failu

@@ -47,4 +47,11 @@
47 47
     margin: 30px 0;
48 48
   }
49 49
 
50
+}
51
+.swiper {
52
+  height: calc( calc(100vw - 60px) * 0.6);
53
+  text-align: center;
54
+  .storeImage {
55
+    width: 100%;
56
+  }
50 57
 }