Baozhangchao 3 years ago
parent
commit
f7ed3021ea

+ 13
- 9
src/components/foodCards/ShopNoteCard/index.jsx View File

34
   const [showCutover, setShowCutover] = useState(false)
34
   const [showCutover, setShowCutover] = useState(false)
35
   const [valueList, setValueList] = useState([])
35
   const [valueList, setValueList] = useState([])
36
 
36
 
37
+  const [traveCoumun, setTraveCoumun] = useState()
37
 
38
 
38
   useEffect(() => {
39
   useEffect(() => {
39
-    if (item == []) {
40
-    }
41
-    setValueList(travelMine?.records)
42
 
40
 
41
+    setValueList(travelMine?.records)
42
+    setTraveCoumun(travelMine?.records[0].dayNum)
43
 
43
 
44
   }, [travelMine?.records, item])
44
   }, [travelMine?.records, item])
45
 
45
 
51
   }
51
   }
52
 
52
 
53
   //列改变
53
   //列改变
54
-  const [traveCoumun, setTraveCoumun] = useState()
55
 
54
 
56
 
55
 
57
   const numberTrave = (new Array(traveCoumun).fill()).map((_, index) => ({ id: index + 1, title: `第 ${index + 1} 天` }))
56
   const numberTrave = (new Array(traveCoumun).fill()).map((_, index) => ({ id: index + 1, title: `第 ${index + 1} 天` }))
62
   const handleColumn = e => {
61
   const handleColumn = e => {
63
     console.log("🚀 ~ file: index.jsx ~ line 63 ~ e", e)
62
     console.log("🚀 ~ file: index.jsx ~ line 63 ~ e", e)
64
     // console.log(e.detail.column);
63
     // console.log(e.detail.column);
65
-
66
     const { column, value } = e.detail
64
     const { column, value } = e.detail
67
 
65
 
66
+    if (column == 0) {
67
+
68
+      const firstValue = valueList[value] || ''
69
+      setTraveCoumun(firstValue.dayNum)
70
+
71
+    }
72
+
68
 
73
 
69
-    const firstValue = valueList[value]
70
-    setTraveCoumun(firstValue.dayNum)
71
 
74
 
72
   }
75
   }
73
 
76
 
77
   const m = day.getMonth() + 1;
80
   const m = day.getMonth() + 1;
78
   const d = day.getDate();
81
   const d = day.getDate();
79
   let number = 0
82
   let number = 0
80
-  const onChange = (e) => {
83
+
84
+  const hanleChange = (e) => {
81
     console.log("🚀 ~ file: index.jsx ~ line 63 ~ e", e)
85
     console.log("🚀 ~ file: index.jsx ~ line 63 ~ e", e)
82
 
86
 
83
     if (travelMine?.records == '') {
87
     if (travelMine?.records == '') {
168
         range={array}
172
         range={array}
169
         range-key='title'
173
         range-key='title'
170
         onColumnChange={handleColumn}
174
         onColumnChange={handleColumn}
171
-        onChange={onChange}
175
+        onChange={hanleChange}
172
         scrollType='link'
176
         scrollType='link'
173
       // value={}
177
       // value={}
174
       >
178
       >

+ 3
- 5
src/pages/details/NoteDetails/index.jsx View File

1
 import CustomNav from '@/components/CustomNav'
1
 import CustomNav from '@/components/CustomNav'
2
 import ax from '@/assets/icons/housemantj/onlove.png'
2
 import ax from '@/assets/icons/housemantj/onlove.png'
3
-import dw from '@/assets/icons/housemantj/loc-o.png'
4
 import TextMentioned from '@/assets/icons/housemantj/TextMentioned.png'
3
 import TextMentioned from '@/assets/icons/housemantj/TextMentioned.png'
5
 import NoteasICO from '@/assets/icons/housemantj/NoteasICO.png'
4
 import NoteasICO from '@/assets/icons/housemantj/NoteasICO.png'
6
 
5
 
8
 import good from '@/assets/icons/housemantj/touristGood.png'
7
 import good from '@/assets/icons/housemantj/touristGood.png'
9
 import baozan from '@/assets/icons/housemantj/bgood.png'
8
 import baozan from '@/assets/icons/housemantj/bgood.png'
10
 import weibaozan from '@/assets/icons/housemantj/unLike.png'
9
 import weibaozan from '@/assets/icons/housemantj/unLike.png'
11
-import zhuandao from "@/assets/icons/housemantj/backTop.png";
12
 import withLayout from '@/layouts'
10
 import withLayout from '@/layouts'
13
 import SpinBox from "@/components/Spin/SpinBox";
11
 import SpinBox from "@/components/Spin/SpinBox";
14
-import { getNoteList, getNoteID } from '@/services/note'
12
+import { getNoteID } from '@/services/note'
15
 import { getTravelMine } from '@/services/travel'
13
 import { getTravelMine } from '@/services/travel'
16
 
14
 
17
 import TabIcon from '@/components/HorTabbar/TabIcon'
15
 import TabIcon from '@/components/HorTabbar/TabIcon'
18
 import { useState, useEffect } from 'react'
16
 import { useState, useEffect } from 'react'
19
-import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
17
+import { getExtendContent } from '@/services/home'
20
 import logo from "@/assets/icons/UserCenter/laba.png"
18
 import logo from "@/assets/icons/UserCenter/laba.png"
21
-import { Swiper, SwiperItem, Button, View, Ad, Video } from '@tarojs/components';
19
+import { Button, View, Video } from '@tarojs/components';
22
 import useSave from "@/utils/hooks/useSave"
20
 import useSave from "@/utils/hooks/useSave"
23
 import useLike from "@/utils/hooks/useLike"
21
 import useLike from "@/utils/hooks/useLike"
24
 import ShopNoteCard from '@/components/foodCards/ShopNoteCard/index'
22
 import ShopNoteCard from '@/components/foodCards/ShopNoteCard/index'