Baozhangchao 3 年前
父节点
当前提交
0110cdb36f

+ 9
- 2
src/components/MoreGuide/index.jsx 查看文件

1
 import { Video } from '@tarojs/components';
1
 import { Video } from '@tarojs/components';
2
+import { useState } from 'react';
2
 import { compressImage } from '@/utils'
3
 import { compressImage } from '@/utils'
3
 import './style.less'
4
 import './style.less'
4
 
5
 
5
 export default (props) => {
6
 export default (props) => {
6
-  const { item } = props
7
+  const { item, } = props
8
+
9
+
7
   return (
10
   return (
8
     <>
11
     <>
9
       {
12
       {
17
             <Video
20
             <Video
18
               controls
21
               controls
19
               autoplay={false}
22
               autoplay={false}
23
+              VideoType={false}
20
               loop={false}
24
               loop={false}
21
-              muted={false} style={{ width: "100%", height: '200px' }} src={item.content}></Video>
25
+              muted={false} style={{ width: "100%", height: '200px' }} src={item.content}
26
+            >
27
+
28
+            </Video>
22
       }
29
       }
23
     </>
30
     </>
24
   )
31
   )

+ 113
- 14
src/components/foodCards/NoteCard/index.jsx 查看文件

1
-import { useState } from 'react'
1
+import { useState, useEffect, useRef } from 'react'
2
 
2
 
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
-import { View, Text, Image, Button, ScrollView } from '@tarojs/components'
4
+import { View, Picker, Image, ScrollView } from '@tarojs/components'
5
 import CouponCard from '@/components/CouponCard'
5
 import CouponCard from '@/components/CouponCard'
6
 import { compressImage } from '@/utils'
6
 import { compressImage } from '@/utils'
7
 import SaveIcon from '@/components/SaveIcon'
7
 import SaveIcon from '@/components/SaveIcon'
8
 import grassOFF from '@/assets/icons/housemantj/grassOFF.png'
8
 import grassOFF from '@/assets/icons/housemantj/grassOFF.png'
9
 import grassNO from '@/assets/icons/housemantj/grassNO.png'
9
 import grassNO from '@/assets/icons/housemantj/grassNO.png'
10
 import Popup from '@/components/Popup'
10
 import Popup from '@/components/Popup'
11
+import { saveTravel, newTravelMine, getTravelMine } from '@/services/travel'
12
+
11
 import './style.less'
13
 import './style.less'
12
 
14
 
13
 
15
 
16
 
18
 
17
 //套餐卡片
19
 //套餐卡片
18
 export default (props) => {
20
 export default (props) => {
19
-  const { item, st, det, editable, setScroll, goshop, scene, subOrderId, id } = props
20
-  const { shopId } = props.item
21
+  const { item, st, editable, setScroll, goshop, travelMine, travelMineContent } = props
22
+  // const travelId = travelMineContent?.records[0]?.travelId
23
+  const { targetId } = props.item
21
   const goFood = () => {
24
   const goFood = () => {
22
-    Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
25
+    Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${targetId}` })
26
+
23
   }
27
   }
24
   const [showCutover, setShowCutover] = useState(false)
28
   const [showCutover, setShowCutover] = useState(false)
25
-  const goDetail = () => {
26
-    //打开当前套餐详情弹窗
27
-    setShowCutover(true)
28
-    //使父组件禁止滚动
29
-    setScroll(false)
30
-  }
29
+  const [valueList, setValueList] = useState([])
30
+
31
+
32
+  useEffect(() => {
33
+    setValueList(travelMine?.records)
34
+
35
+
36
+  }, [travelMine?.records])
37
+
31
   const onClose = () => {
38
   const onClose = () => {
32
     //关闭当前套餐详情弹窗
39
     //关闭当前套餐详情弹窗
33
     setShowCutover(false)
40
     setShowCutover(false)
35
     setScroll(true)
42
     setScroll(true)
36
   }
43
   }
37
 
44
 
45
+  //列改变
46
+  const [traveCoumun, setTraveCoumun] = useState()
47
+
48
+
49
+  const numberTrave = (new Array(traveCoumun).fill()).map((_, index) => ({ id: index + 1, title: `第 ${index + 1} 天` }))
50
+
51
+  const array = [valueList, numberTrave]
52
+
53
+
54
+  const handleColumn = e => {
55
+    // console.log(e.detail.column);
56
+
57
+    const { column, value } = e.detail
58
+
59
+
60
+    const firstValue = valueList[value]
61
+    console.log("🚀 ~ file: index.jsx ~ line 61 ~ firstValue", firstValue)
62
+    setTraveCoumun(firstValue.dayNum)
63
+
64
+  }
65
+
66
+
67
+
68
+  const day = new Date();
69
+  const y = day.getFullYear();
70
+  const m = day.getMonth();
71
+  const d = day.getDate();
72
+  let number = 0
73
+
74
+  const onChange = (e) => {
75
+    const [firstInx, secondInx] = e.detail.value
76
+
77
+    const firstValue = valueList[firstInx]
78
+    const secondValue = numberTrave[secondInx]
79
+
80
+    const { travelId } = firstValue//行程内容
81
+    const { i } = secondValue//天数
82
+
83
+
84
+    console.log(firstValue, secondValue);
85
+
86
+
87
+    if (travelMine.records.total < 0) {
88
+      newTravelMine({ title: `我的行程 ${y}-${m == 0 ? 1 : m}-${d}` }).then(e => {
89
+        console.log("🚀 ~ file: index.jsx ~ line 61 ~ newTravelMine ~ e", e)
90
+        // saveTravel({})
91
+        saveTravel(travelId, { dayOrder: i, targetId: targetId, targetType: 'note' }).then((res) => {
92
+          Taro.
93
+            Taro.showToast({
94
+              title: '添加成功',
95
+              icon: 'none',
96
+              duration: 1000
97
+            })
98
+          console.log(res);
99
+        })
100
+      })
101
+    } else {
102
+      saveTravel(travelId, { dayOrder: i, targetId: targetId, targetType: 'note' }).then((res) => {
103
+        console.log(res);
104
+        Taro.showToast({
105
+          title: '添加成功',
106
+          icon: 'none',
107
+
108
+          duration: 1000
109
+        })
110
+      })
111
+      // console.log('else');
112
+
113
+    }
114
+  }
38
 
115
 
39
 
116
 
40
   const handlePayClick = () => {
117
   const handlePayClick = () => {
41
-    Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
118
+    // Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
119
+
42
   }
120
   }
43
-  const PayAction = <Action.Icon icon={grassOFF} text='种草' onClick={handlePayClick} />
121
+  const PayAction =
122
+    <View className='view-picker'>
123
+      <Picker
124
+        className='picker-box'
125
+        mode='multiSelector'
126
+        range={array}
127
+        range-key='title'
128
+        onColumnChange={handleColumn}
129
+        onChange={onChange}
130
+        scrollType='link'
131
+      // value={}
132
+
133
+      >
134
+
135
+        <Action.Icon icon={item.isVisited > 1 ? grassOFF : grassNO} text={item.isVisited > 1 ? '种草' : '已种草'} onClick={handlePayClick} />
136
+
137
+      </Picker>
138
+
139
+    </View>
140
+
141
+
142
+
44
   return (
143
   return (
45
     <View style={{ margin: '15px 5px' }} >
144
     <View style={{ margin: '15px 5px' }} >
46
       <View className='packageDetail' style={{ display: goshop ? '' : 'none' }}>
145
       <View className='packageDetail' style={{ display: goshop ? '' : 'none' }}>
54
         </Popup >
153
         </Popup >
55
       </View>
154
       </View>
56
       <CouponCard action={PayAction}>
155
       <CouponCard action={PayAction}>
57
-        <CouponMedia onClick={goshop ? goDetail : goFood}>
156
+        <CouponMedia onClick={goFood}>
58
           <CouponMedia.Header
157
           <CouponMedia.Header
59
             cashback={item.cashback}
158
             cashback={item.cashback}
60
             image={compressImage(item.poster)}
159
             image={compressImage(item.poster)}

+ 10
- 5
src/components/foodCards/NoteCard/style.less 查看文件

1
-.foodCard{
1
+.view-picker {
2
+  position: relative;
3
+  top: 30%;
4
+}
5
+
6
+.foodCard {
2
   .cpn-card-text {
7
   .cpn-card-text {
3
     font-size: 24px;
8
     font-size: 24px;
4
     font-weight: 400;
9
     font-weight: 400;
36
     }
41
     }
37
   }
42
   }
38
 }
43
 }
39
-.packageDetail{
40
-  Image{
44
+.packageDetail {
45
+  Image {
41
     width: 100%;
46
     width: 100%;
42
   }
47
   }
43
-  .weui-dialog__bd{
48
+  .weui-dialog__bd {
44
     padding: 0;
49
     padding: 0;
45
     margin: 0;
50
     margin: 0;
46
   }
51
   }
47
-}
52
+}

+ 11
- 10
src/hotel/components/HouseManage/houseManage.jsx 查看文件

1
 import Taro, { useDidShow } from '@tarojs/taro'
1
 import Taro, { useDidShow } from '@tarojs/taro'
2
 import { View, Image } from '@tarojs/components';
2
 import { View, Image } from '@tarojs/components';
3
+import ToggleRole from '@/components/ToggleRole'
4
+
3
 import see from '@/assets/icons/landlord/lookPerson.png'
5
 import see from '@/assets/icons/landlord/lookPerson.png'
4
 import share from '@/assets/icons/landlord/shareLink.png'
6
 import share from '@/assets/icons/landlord/shareLink.png'
5
 import del from '@/assets/icons/landlord/delete.png'
7
 import del from '@/assets/icons/landlord/delete.png'
6
 import addImg from '@/assets/icons/landlord/add.png'
8
 import addImg from '@/assets/icons/landlord/add.png'
7
 import copyRoomImg from '@/assets/icons/landlord/copyroom.png'
9
 import copyRoomImg from '@/assets/icons/landlord/copyroom.png'
8
 import React, { useState, useEffect, useRef, useImperativeHandle, useMemo } from 'react'
10
 import React, { useState, useEffect, useRef, useImperativeHandle, useMemo } from 'react'
9
-import { getRoomList,deleteRoom,copyRoom } from '@/services/landlord'
11
+import { getRoomList, deleteRoom, copyRoom } from '@/services/landlord'
10
 import Spin3 from '@/components/Spin/Spin3';
12
 import Spin3 from '@/components/Spin/Spin3';
11
 import List from '@/components/List';
13
 import List from '@/components/List';
12
 import Picker from '@/components/Picker'
14
 import Picker from '@/components/Picker'
13
 import SearchBar from '@/components/SearchBar'
15
 import SearchBar from '@/components/SearchBar'
14
 import ShareRoom from '../shareRoom/ShareRoom.jsx'
16
 import ShareRoom from '../shareRoom/ShareRoom.jsx'
15
 import ShareCard from '../shareCard/shareCard'
17
 import ShareCard from '../shareCard/shareCard'
16
-import ToggleRole from '@/components/ToggleRole'
17
 import './houseManage.less'
18
 import './houseManage.less'
18
 
19
 
19
 
20
 
20
 export default React.forwardRef((props, ref) => {
21
 export default React.forwardRef((props, ref) => {
21
-  const { hotel, hotelList, onHotelChange,isBind } = props
22
+  const { hotel, hotelList, onHotelChange, isBind } = props
22
   const [detail, setDetail] = useState([])
23
   const [detail, setDetail] = useState([])
23
   const [search, setSearch] = useState()
24
   const [search, setSearch] = useState()
24
 
25
 
46
               title: '删除房源成功',
47
               title: '删除房源成功',
47
               icon: 'none',
48
               icon: 'none',
48
             })
49
             })
49
-            getRoomList({ hotelId: hotel.hotelId }).then((res) => {
50
-              setDetail(res.records || [])
50
+            getRoomList({ hotelId: hotel.hotelId }).then((vals) => {
51
+              setDetail(vals.records || [])
51
             })
52
             })
52
           })
53
           })
53
         }
54
         }
61
   const [showCutover, setShowCutover] = useState(false)
62
   const [showCutover, setShowCutover] = useState(false)
62
   const [showCard, setShowCard] = useState(false)
63
   const [showCard, setShowCard] = useState(false)
63
   const [room, setRoom] = useState({})
64
   const [room, setRoom] = useState({})
64
-  const ShowMoldeOn = (room) => {
65
-    setRoom(room)
65
+  const ShowMoldeOn = (rooms) => {
66
+    setRoom(rooms)
66
     setShowCutover(true)
67
     setShowCutover(true)
67
   }
68
   }
68
   const onClose = () => {
69
   const onClose = () => {
160
         <Spin3 show={loading} />
161
         <Spin3 show={loading} />
161
       </View>
162
       </View>
162
       <View style={{ flex: 'none' }}>
163
       <View style={{ flex: 'none' }}>
163
-        <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
164
+        <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder='请选择民宿' value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
164
         <view className='User-info-cutover-normal'>
165
         <view className='User-info-cutover-normal'>
165
-            <ToggleRole role='hotel' isBind={isBind}/>
166
+          <ToggleRole role='hotel' isBind={isBind} />
166
         </view>
167
         </view>
167
       </View>
168
       </View>
168
       <View style={{ flex: 'none' }}>
169
       <View style={{ flex: 'none' }}>
179
           params={queryParams}
180
           params={queryParams}
180
           onDataChange={setDetail}
181
           onDataChange={setDetail}
181
           refresherEnabled={false}
182
           refresherEnabled={false}
182
-          noData="暂无房源信息"
183
+          noData='暂无房源信息'
183
         >
184
         >
184
           <view className='waterfall'>
185
           <view className='waterfall'>
185
             {
186
             {

+ 25
- 25
src/pages/details/NoteDetails/index.jsx 查看文件

14
 import withLayout from '@/layouts'
14
 import withLayout from '@/layouts'
15
 import SpinBox from "@/components/Spin/SpinBox";
15
 import SpinBox from "@/components/Spin/SpinBox";
16
 import { getNoteList, getNoteID } from '@/services/note'
16
 import { getNoteList, getNoteID } from '@/services/note'
17
+import { getTravelMine } from '@/services/travel'
17
 
18
 
18
 import TabIcon from '@/components/HorTabbar/TabIcon'
19
 import TabIcon from '@/components/HorTabbar/TabIcon'
19
 import { useState, useEffect } from 'react'
20
 import { useState, useEffect } from 'react'
20
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
21
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
21
 import logo from "@/assets/icons/UserCenter/laba.png"
22
 import logo from "@/assets/icons/UserCenter/laba.png"
22
-import { Swiper, SwiperItem, Button, View, Ad } from '@tarojs/components';
23
+import { Swiper, SwiperItem, Button, View, Ad, Video } from '@tarojs/components';
23
 import useSave from "@/utils/hooks/useSave"
24
 import useSave from "@/utils/hooks/useSave"
24
 import useLike from "@/utils/hooks/useLike"
25
 import useLike from "@/utils/hooks/useLike"
25
 import NoteCards from '@/components/foodCards/NoteCard/index'
26
 import NoteCards from '@/components/foodCards/NoteCard/index'
26
 import Taro, { useShareAppMessage } from '@tarojs/taro'
27
 import Taro, { useShareAppMessage } from '@tarojs/taro'
27
 import Extend from '../components/Extend/extend'
28
 import Extend from '../components/Extend/extend'
29
+import ImageList from "../components/ImageList";
30
+
28
 import './index.less'
31
 import './index.less'
29
 
32
 
30
 
33
 
36
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
39
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
37
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
40
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
38
   const [loading, setLoading] = useState(false)
41
   const [loading, setLoading] = useState(false)
39
-
42
+  const [travelMine, setTravelMine] = useState()
43
+  const [travelMineContent, setTravelMineContent] = useState()
40
   //banner图集数组
44
   //banner图集数组
41
   const [imglist, setimglist] = useState([])
45
   const [imglist, setimglist] = useState([])
42
   const [index, setIndex] = useState(0)
46
   const [index, setIndex] = useState(0)
61
 
65
 
62
 
66
 
63
   useEffect(() => {
67
   useEffect(() => {
68
+    //获取我的行程。
69
+    getTravelMine({ pageNum: 1, pageSize: 99, simple: true }).then(e => {
70
+      setTravelMine(e)
71
+
72
+    })
73
+
74
+
75
+
64
     if (id) {
76
     if (id) {
65
       setLoading(true)
77
       setLoading(true)
66
       getNoteID(id).then((res) => {
78
       getNoteID(id).then((res) => {
67
         setDetail(res)
79
         setDetail(res)
68
-        console.log("🚀 ~ file: index.jsx ~ line 68 ~ getNoteID ~ res", res)
69
         setimglist(res.imageList || [])
80
         setimglist(res.imageList || [])
70
         setRecommend(res.wxResourceList || [])
81
         setRecommend(res.wxResourceList || [])
71
 
82
 
91
       imageUrl: detail.poster,
102
       imageUrl: detail.poster,
92
     }
103
     }
93
   })
104
   })
105
+
106
+
94
   return (
107
   return (
95
     <view className='page-index'>
108
     <view className='page-index'>
96
       {
109
       {
110
             <View className='huadong'>
123
             <View className='huadong'>
111
               {
124
               {
112
                 detail.noteType === 'image' ?
125
                 detail.noteType === 'image' ?
113
-                  <Swiper className='swiper' circular onChange={handchange}>
114
-                    {
115
-                      imglist.map((item, key) => (
116
-                        <SwiperItem key={key}>
117
-                          <image src={compressImage(item.url)} mode='aspectFit' className='storeImage' />
118
-                        </SwiperItem>
119
-                      ))}
120
-                  </Swiper>
126
+                  <ImageList imglist={imglist} />
121
                   :
127
                   :
122
-                  <Swiper className='swiper' circular onChange={handchange}>
123
-                    {
124
-                      imglist.map((item, key) => (
125
-                        <MoreGuide key={key} item={item} />
126
-
127
-                      ))}
128
-                  </Swiper>
128
+                  <Video
129
+                    controls
130
+                    autoplay={false}
131
+                    loop={false}
132
+                    muted={false} style={{ width: "100%", height: '200px' }} src={detail.videoUrl}
133
+                  >
134
+                  </Video>
129
               }
135
               }
130
-
131
-              <view className='tpPage'>
132
-                <text>
133
-                  {index + 1}/{imglist.length}
134
-                </text>
135
-              </view>
136
             </View>
136
             </View>
137
 
137
 
138
 
138
 
159
             <view className='title'>
159
             <view className='title'>
160
               <image src={TextMentioned} />文中提及
160
               <image src={TextMentioned} />文中提及
161
             </view>
161
             </view>
162
-            {(recommend || []).map((item) => <NoteCards key={item} item={item} det={item} />)}
162
+            {(recommend || []).map((item) => <NoteCards travelMine={travelMine} travelMineContent={travelMineContent} key={item} item={item} det={item} />)}
163
           </view>
163
           </view>
164
           <view className='botton'>这是我的底线</view>
164
           <view className='botton'>这是我的底线</view>
165
         </scroll-view>
165
         </scroll-view>

+ 2
- 2
src/pages/index/tabs/Guide.jsx 查看文件

169
               </view>
169
               </view>
170
               {/* --------停车场-------- */}
170
               {/* --------停车场-------- */}
171
               {
171
               {
172
-                !taRoomContent.parkingLocation ?null:
172
+                !taRoomContent.parkingLocation ? null :
173
                   <view className='room-box-info-Parking'>
173
                   <view className='room-box-info-Parking'>
174
                     <view className='room-bi-name-Parking' >
174
                     <view className='room-bi-name-Parking' >
175
                       <view className='room-bin-title-Parking'>停车位置</view>
175
                       <view className='room-bin-title-Parking'>停车位置</view>
185
               }
185
               }
186
               {/* --------无线网-------- */}
186
               {/* --------无线网-------- */}
187
               {
187
               {
188
-                !taRoomContent.wifiName && !taRoomContent.wifiPassword ?null:
188
+                !taRoomContent.wifiName && !taRoomContent.wifiPassword ? null :
189
                   <view className='room-box-info-WIFIContent'>
189
                   <view className='room-box-info-WIFIContent'>
190
                     <view className='room-bi-name-WIFIContent' >
190
                     <view className='room-bi-name-WIFIContent' >
191
                       <view className='room-bin-title-WIFIContent'>WiFi信息</view>
191
                       <view className='room-bin-title-WIFIContent'>WiFi信息</view>

+ 2
- 2
src/pages/index/tabs/RecommendNote/index.jsx 查看文件

14
 const listStyle = { height: '100%' }
14
 const listStyle = { height: '100%' }
15
 
15
 
16
 export default (props) => {
16
 export default (props) => {
17
-  const { router, person, location } = props
17
+  const { router, person, location, queryParamsSearch } = props
18
   const listClass = useMemo(() => random('f'), [])
18
   const listClass = useMemo(() => random('f'), [])
19
   const [activeTab, setActiveTab] = useState(0)
19
   const [activeTab, setActiveTab] = useState(0)
20
   const listRef = useRef()
20
   const listRef = useRef()
76
         ref={listRef}
76
         ref={listRef}
77
         style={listStyle}
77
         style={listStyle}
78
         request={getNoteList}
78
         request={getNoteList}
79
-        params={queryParams}
79
+        params={queryParamsSearch || queryParams}
80
         refresherEnabled={false}
80
         refresherEnabled={false}
81
         onDataChange={handleDataChange}
81
         onDataChange={handleDataChange}
82
       >
82
       >

+ 4
- 1
src/pages/search/search.jsx 查看文件

14
   const hotSearch = (val) => {
14
   const hotSearch = (val) => {
15
     Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${val}` });
15
     Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${val}` });
16
   }
16
   }
17
+
17
   const onSearch = (e) => {
18
   const onSearch = (e) => {
18
     if (e.detail.value !== '') {
19
     if (e.detail.value !== '') {
19
-      Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${e.detail.value}` });
20
+      Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${e.detail.value}&targetTypeValue=${selectValue}` });
20
     }
21
     }
21
   }
22
   }
23
+
22
   const [selectValue, setselectValue] = useState('地点')
24
   const [selectValue, setselectValue] = useState('地点')
23
   const state = {
25
   const state = {
24
     selector: ['地点', '笔记'],
26
     selector: ['地点', '笔记'],
25
     selectorChecked: selectValue,
27
     selectorChecked: selectValue,
28
+
26
     // timeSel: '12:01',
29
     // timeSel: '12:01',
27
     // dateSel: '2018-04-22'
30
     // dateSel: '2018-04-22'
28
   }
31
   }

+ 29
- 19
src/pages/searchResult/searchResult.jsx 查看文件

4
 import Taro from '@tarojs/taro'
4
 import Taro from '@tarojs/taro'
5
 import { View } from '@tarojs/components';
5
 import { View } from '@tarojs/components';
6
 import { getResourceList } from '@/services/home'
6
 import { getResourceList } from '@/services/home'
7
+import { getNoteList } from '@/services/note'
8
+
7
 import MasonryLayout from '@/components/MasonryLayout';
9
 import MasonryLayout from '@/components/MasonryLayout';
8
 import NoData from '@/components/NoData'
10
 import NoData from '@/components/NoData'
9
 import List from '@/components/List';
11
 import List from '@/components/List';
11
 import './searchResult.less'
13
 import './searchResult.less'
12
 import Card from '../index/components/Card'
14
 import Card from '../index/components/Card'
13
 import iconsearch from '../../assets/icons/housemantj/search.png'
15
 import iconsearch from '../../assets/icons/housemantj/search.png'
16
+import RecommendNote from '../index/tabs/RecommendNote/index'
14
 
17
 
15
 
18
 
16
 const listStyle = { height: '100%' }
19
 const listStyle = { height: '100%' }
17
 
20
 
18
 export default withLayout((props) => {
21
 export default withLayout((props) => {
19
   const { router, person, location } = props
22
   const { router, person, location } = props
20
-  const { q } = props.router.params
23
+  console.log("🚀 ~ file: searchResult.jsx ~ line 22 ~ withLayout ~ props", props)
24
+  const { q, targetTypeValue } = props.router.params
21
 
25
 
22
   const [listData, setListData] = useState({ list: [], rfTimes: 0 })
26
   const [listData, setListData] = useState({ list: [], rfTimes: 0 })
23
 
27
 
24
   // 横向tab
28
   // 横向tab
25
-  const [queryParams, setQueryParams] = useState({ q: q, location, pageNum: 1, pageSize: 10, typeId: '' })
29
+  // targetType: targetTypeValue 
30
+  const [queryParams, setQueryParams] = useState({ q: q, location, pageNum: 1, pageSize: 10, })
26
   const rfTimes = useRef(0)
31
   const rfTimes = useRef(0)
27
 
32
 
28
 
33
 
59
         </view>
64
         </view>
60
 
65
 
61
         <View style={{ flex: 1, overflow: 'hidden' }}>
66
         <View style={{ flex: 1, overflow: 'hidden' }}>
62
-          <List
63
-            ref={listRef}
64
-            style={listStyle}
65
-            request={getResourceList}
66
-            params={queryParams}
67
-            refresherEnabled={false}
68
-            onDataChange={handleDataChange}
69
-            noData={<NoData />}
70
-          >
71
-            <view style={{ padding: '30rpx 15rpx' }}>
72
-              <MasonryLayout
73
-                itemKey='resourceNo'
74
-                listData={listData}
75
-                render={(item) => <Card key={item.resourceNo} item={item} />}
76
-              />
77
-            </view>
78
-          </List>
67
+          {
68
+            targetTypeValue == '地点' ?
69
+              <List
70
+                ref={listRef}
71
+                style={listStyle}
72
+                request={getResourceList}
73
+                params={queryParams}
74
+                refresherEnabled={false}
75
+                onDataChange={handleDataChange}
76
+                noData={<NoData />}
77
+              >
78
+                <view style={{ padding: '30rpx 15rpx' }}>
79
+                  <MasonryLayout
80
+                    itemKey='resourceNo'
81
+                    listData={listData}
82
+                    render={(item) => <Card key={item.resourceNo} item={item} />}
83
+                  />
84
+                </view>
85
+              </List>
86
+              : <RecommendNote queryParamsSearch={queryParams} />
87
+          }
88
+
79
         </View>
89
         </View>
80
       </view>
90
       </view>
81
     </view>
91
     </view>

+ 3
- 0
src/services/note.js 查看文件

24
 
24
 
25
 
25
 
26
 
26
 
27
+
28
+
29
+

+ 32
- 0
src/services/travel.js 查看文件

1
+
2
+import request from '@/utils/request'
3
+
4
+
5
+
6
+/**
7
+ * Picker获取行程
8
+ * @param {*} 
9
+ * @returns 
10
+ */
11
+
12
+export const getTravelMine = (params) => request(`/travel/mine`, { params })
13
+
14
+
15
+
16
+/**
17
+ * 新建保存行程
18
+ * @param {*} 
19
+ * @returns 
20
+ */
21
+
22
+export const newTravelMine = (data) => request(`/travel`, { method: 'post', data })
23
+
24
+
25
+
26
+/**
27
+ * 保存行程地点
28
+ * @param {*} 
29
+ * @returns 
30
+ */
31
+
32
+export const saveTravel = (id, data) => request(`/travel/${id}/travel-item`, { method: 'post', data })

+ 29
- 29
src/shop/components/ShopKeeper/shopKeeper.jsx 查看文件

88
     },
88
     },
89
   ]
89
   ]
90
   return (
90
   return (
91
-    <view style={{height:'100%'}}>
92
-      <view style={{ padding: '0 15px 0 15px', height: '100%',display:'flex' ,flexDirection:'column' }}>
93
-        <view className='storexx' style={{flex:'none'}}>
94
-          <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder='请选择商铺' value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>          
91
+    <view style={{ height: '100%' }}>
92
+      <view style={{ padding: '0 15px 0 15px', height: '100%', display: 'flex', flexDirection: 'column' }}>
93
+        <view className='storexx' style={{ flex: 'none' }}>
94
+          <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder='请选择商铺' value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>
95
           <view className='User-info-cutover-normal'>
95
           <view className='User-info-cutover-normal'>
96
-            <ToggleRole role='shop' isBind={isBind}/>
96
+            <ToggleRole role='shop' isBind={isBind} />
97
           </view>
97
           </view>
98
           <view className='tip'>(计算收入以核销为准)</view>
98
           <view className='tip'>(计算收入以核销为准)</view>
99
           <view className='money'>
99
           <view className='money'>
114
               </view></view>
114
               </view></view>
115
           </view>
115
           </view>
116
         </view>
116
         </view>
117
-        <view className='search' style={{flex:'none'}}>
117
+        <view className='search' style={{ flex: 'none' }}>
118
           <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={handelSearch} />
118
           <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={handelSearch} />
119
         </view>
119
         </view>
120
-        <view className='index-tabs' style={{flex:'none'}}>
120
+        <view className='index-tabs' style={{ flex: 'none' }}>
121
           <mp-tabs
121
           <mp-tabs
122
             tabClass='tabs-Unselected'
122
             tabClass='tabs-Unselected'
123
             swiperClass='tabs-swiper'
123
             swiperClass='tabs-swiper'
129
           >
129
           >
130
           </mp-tabs>
130
           </mp-tabs>
131
         </view>
131
         </view>
132
-        <view style={{flex:1,overflow:'hidden'}}>
132
+        <view style={{ flex: 1, overflow: 'hidden' }}>
133
           {/* 未核销 */}
133
           {/* 未核销 */}
134
           {activeTab === 0 &&
134
           {activeTab === 0 &&
135
-              <List
136
-                style={{ height: '100%' }}
137
-                request={getVerifiedOrder}
138
-                params={queryParams}
139
-                refresherEnabled={refres}
140
-                refresOff={refresOff}
141
-                noData={<NoData />}
142
-                render={({ item, index }) =>
143
-                  <ShopUnused key={(index)} item={item} />}
144
-              >
145
-              </List>
135
+            <List
136
+              style={{ height: '100%' }}
137
+              request={getVerifiedOrder}
138
+              params={queryParams}
139
+              refresherEnabled={refres}
140
+              refresOff={refresOff}
141
+              noData={<NoData />}
142
+              render={({ item, index }) =>
143
+                <ShopUnused key={(index)} item={item} />}
144
+            >
145
+            </List>
146
           }
146
           }
147
           {/* 已核销 */}
147
           {/* 已核销 */}
148
           {activeTab === 1 &&
148
           {activeTab === 1 &&
149
-              <List
150
-                style={{ height: '100%' }}
151
-                noData={<NoData />}
152
-                request={getVerifiedOrder}
153
-                params={queryParams}
154
-                refresherEnabled={refres}
155
-                refresOff={refresOff}
156
-                render={({ item, index }) => <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />}
157
-              >
158
-              </List>
149
+            <List
150
+              style={{ height: '100%' }}
151
+              noData={<NoData />}
152
+              request={getVerifiedOrder}
153
+              params={queryParams}
154
+              refresherEnabled={refres}
155
+              refresOff={refresOff}
156
+              render={({ item, index }) => <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />}
157
+            >
158
+            </List>
159
           }
159
           }
160
         </view>
160
         </view>
161
       </view>
161
       </view>