Browse Source

Merge branch '3.0' of http://git.ycjcjy.com/shigongli/miniapp-v2 into 3.0

李志伟 3 years ago
parent
commit
f9f1db489b

+ 1
- 1
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    // HOST: '"http://127.0.0.1:8080"',
6
+    // HOST: '"http://192.168.89.147:8080"',
7
     HOST: '"http://sgl-v2-test.njyunzhi.com"',
7
     HOST: '"http://sgl-v2-test.njyunzhi.com"',
8
     OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
8
     OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
9
     VERSION: '"2.0.33"',
9
     VERSION: '"2.0.33"',

src/pages/details/foodDetails/laba.png → src/assets/icons/UserCenter/laba.png View File


BIN
src/assets/icons/housemantj/NoteasICO.png View File


BIN
src/assets/icons/housemantj/TextMentioned.png View File


+ 1
- 1
src/components/SearchBar/index.jsx View File

10
 
10
 
11
 
11
 
12
   return (
12
   return (
13
-    <View className='searchBar'>
13
+    <View className='searchBar' >
14
       <mp-searchbar
14
       <mp-searchbar
15
         placeholder={placeholder}
15
         placeholder={placeholder}
16
         onBlur={onBlur}
16
         onBlur={onBlur}

+ 1
- 1
src/pages/MineUserAll/AllOrder/index.jsx View File

1
 import { useState, useEffect, useMemo, } from 'react'
1
 import { useState, useEffect, useMemo, } from 'react'
2
-import {Taro, useRouter } from '@tarojs/taro'
2
+import { Taro, useRouter } from '@tarojs/taro'
3
 import { View } from '@tarojs/components'
3
 import { View } from '@tarojs/components'
4
 import withLayout from '@/layouts'
4
 import withLayout from '@/layouts'
5
 import CustomNav from '@/components/CustomNav'
5
 import CustomNav from '@/components/CustomNav'

+ 5
- 1
src/pages/RoomOrder/index.jsx View File

17
   const [taRoomContent, setTaRoomContent] = useState([])
17
   const [taRoomContent, setTaRoomContent] = useState([])
18
   const [orderContent, setOrderContent] = useState([])
18
   const [orderContent, setOrderContent] = useState([])
19
   const [titleLogo, settitleLogo] = useState('none')
19
   const [titleLogo, settitleLogo] = useState('none')
20
+  const [loading, setLoading] = useState(false)
20
 
21
 
21
   const { hotelId } = orderContent
22
   const { hotelId } = orderContent
22
   const CarNumber = orderContent?.personNum
23
   const CarNumber = orderContent?.personNum
28
   }
29
   }
29
 
30
 
30
   const handleSubmit = (e) => {
31
   const handleSubmit = (e) => {
32
+    setLoading(true)
31
 
33
 
32
     // 订阅消息
34
     // 订阅消息
33
     withSubscribeMessage([TPL_MESSAGE_HOTEL_CHECK_OUT], () => {
35
     withSubscribeMessage([TPL_MESSAGE_HOTEL_CHECK_OUT], () => {
45
         // Taro.navigateBack({
47
         // Taro.navigateBack({
46
         //   delta: 1
48
         //   delta: 1
47
         // })
49
         // })
50
+        setLoading(false)
51
+
48
         Taro.reLaunch({
52
         Taro.reLaunch({
49
           url: `/pages/index/index?tab=1&roomId=${roomId}`
53
           url: `/pages/index/index?tab=1&roomId=${roomId}`
50
         })
54
         })
80
               )
84
               )
81
             })
85
             })
82
           }
86
           }
83
-          <button className='button-OK' onClick={handleSubmit} >确定</button>
87
+          <button className='button-OK' onClick={handleSubmit} loading={loading} disabled={loading} >确定</button>
84
         </scroll-view>
88
         </scroll-view>
85
       </View>
89
       </View>
86
     </view>
90
     </view>

+ 9
- 0
src/pages/details/NoteDetails/index.config.js View File

1
+export default {
2
+  navigationBarTitleText: '笔记详情',
3
+  disableScroll: true,
4
+  navigationStyle: 'custom',
5
+  usingComponents: {
6
+    // "add-tipsFood": "../../../components/add-tipsFood/index"
7
+
8
+  }
9
+}

+ 199
- 0
src/pages/details/NoteDetails/index.jsx View File

1
+import CustomNav from '@/components/CustomNav'
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'
5
+import NoteasICO from '@/assets/icons/housemantj/NoteasICO.png'
6
+import { compressImage } from '@/utils'
7
+import MoreGuide from "@/components/MoreGuide";//视频
8
+
9
+import share from '@/assets/icons/housemantj/touristShare.png'
10
+import good from '@/assets/icons/housemantj/touristGood.png'
11
+import baozan from '@/assets/icons/housemantj/bgood.png'
12
+import weibaozan from '@/assets/icons/housemantj/unLike.png'
13
+import zhuandao from "@/assets/icons/housemantj/backTop.png";
14
+import withLayout from '@/layouts'
15
+import SpinBox from "@/components/Spin/SpinBox";
16
+import TabIcon from '@/components/HorTabbar/TabIcon'
17
+import { useState, useEffect } from 'react'
18
+import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
19
+import logo from "@/assets/icons/UserCenter/laba.png"
20
+import { Swiper, SwiperItem, Button, View, Ad } from '@tarojs/components';
21
+import useSave from "@/utils/hooks/useSave"
22
+import useLike from "@/utils/hooks/useLike"
23
+import Cards from '@/components/foodCards/foodCards.jsx'
24
+import Taro, { useShareAppMessage } from '@tarojs/taro'
25
+import Extend from '../components/Extend/extend'
26
+import './index.less'
27
+
28
+
29
+
30
+export default withLayout((props) => {
31
+  const { router, person, location } = props
32
+  const { id } = props.router.params
33
+  const [detail, setDetail] = useState({})
34
+  const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
35
+  const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
36
+  const [loading, setLoading] = useState(false)
37
+
38
+  //banner图集数组
39
+  const [imglist, setimglist] = useState([])
40
+  const [index, setIndex] = useState(0)
41
+  const handchange = (e) => {
42
+    setIndex(e.detail.current)
43
+  }
44
+
45
+  //本店指南
46
+  const [extend, setExtend] = useState([])
47
+
48
+  // 推荐套餐列表
49
+  const [recommend, setRecommend] = useState([])
50
+
51
+  const openMap = () => {
52
+    const [lng, lat] = detail.locaton.split(',')
53
+
54
+    Taro.openLocation({
55
+      longitude: lng - 0,
56
+      latitude: lat - 0,
57
+      name: detail.touristName,
58
+      address: detail.address,
59
+      scale: 12,
60
+    })
61
+  }
62
+  //引导显隐
63
+  const [guidance, setGuidance] = useState('shareOff')
64
+  useEffect(() => {
65
+    if (router.params.enterType === "share") {
66
+      setGuidance('shareOn')
67
+    }
68
+  }, [router.params.enterType])
69
+
70
+
71
+  useEffect(() => {
72
+    if (id) {
73
+      setLoading(true)
74
+      getTouristDetail(id, { location }).then((res) => {
75
+        setDetail(res)
76
+        setimglist(res.imageList || [])
77
+        getRecommendList({ location: res.locaton }).then((res2) => {
78
+          setRecommend(res2 || [])
79
+        })
80
+      })
81
+      getExtendContent('tourist', id, { pageSize: 500 }).then((res) => {
82
+        setExtend(res.records || [])
83
+        setLoading(false)
84
+
85
+      })
86
+    } else {
87
+      getRecommendList({ location }).then((res2) => {
88
+        setRecommend(res2 || [])
89
+        setLoading(false)
90
+      }).catch(e => {
91
+        setLoading(false)
92
+      })
93
+    }
94
+  }, [id, location])
95
+  // 分享
96
+  useShareAppMessage(() => {
97
+    return {
98
+      title: detail.touristName,
99
+      path: `/pages/details/mjDetails/sceneryDetails?id=${id}&enterType=share`,
100
+      imageUrl: detail.poster,
101
+    }
102
+
103
+  })
104
+  return (
105
+    <view className='page-index'>
106
+      {
107
+        guidance === 'shareOn' ? <view className='index-navbar'>
108
+          <add-tipsFood logo={logo} custom duration={-1} />
109
+          <CustomNav title='十公里' noback />
110
+        </view> :
111
+          <view className='index-navbar'>
112
+            <CustomNav title='十公里' />
113
+          </view>
114
+      }
115
+
116
+
117
+      <SpinBox loading={loading} className='index-container' style={{ padding: '0 30rpx', background: '#F8F8F8' }}>
118
+        <scroll-view scrollY style={{ height: '100%' }}>
119
+          <view className='storeDetails'>
120
+            <View className='huadong'>
121
+              <Swiper
122
+                className='swiper'
123
+                circular
124
+                onChange={handchange}
125
+              >
126
+                {
127
+                  imglist.map((item, key) => (
128
+                    item.noteType == 'image' ?
129
+                      <SwiperItem key={key}>
130
+                        <image src={compressImage(item.url)} mode='aspectFit' className='storeImage' />
131
+                      </SwiperItem> : <MoreGuide key={key} item={item} />
132
+                  ))}
133
+              </Swiper>
134
+              <view className='tpPage'>
135
+                <text>
136
+                  {index + 1}/{imglist.length}
137
+                </text>
138
+              </view>
139
+            </View>
140
+
141
+            <view className='storeJs'>
142
+              <view className='introduce'>
143
+                <text className='storeName'>{detail.touristName}</text>
144
+              </view>
145
+              <view className='bz'>
146
+                <image src={baozan} style={{ width: '15px', height: '15px', marginRight: '10px', marginBottom: '-2px' }} />
147
+                <text className='bzRight'>爆赞{detail.likeNum}</text>
148
+              </view>
149
+              <view className='wz'>{detail.address}</view>
150
+              <view className='dpPosition' onClick={openMap}>
151
+                <image src={dw} className='dwTip' />
152
+                <view className='distance'>{(detail.distance / 1000).toFixed(2)}公里<image src={zhuandao} className='zhuandao' /></view>
153
+              </view>
154
+            </view>
155
+          </view>
156
+          <view className='jdjs'>
157
+            <view>{detail.description}</view>
158
+            <view className='line'></view>
159
+            <view className='sc' onClick={toggleSave}>
160
+              <image className='scTip' src={isSaved > 0 ? ax : good} /><text>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
161
+            </view>
162
+          </view>
163
+          <view class='adContainer'>
164
+            <Ad unit-id='adunit-a0f97bb7ec8ec7bb' ad-intervals='30' />
165
+          </view>
166
+          <view style={{ position: 'relative', display: extend == '' ? 'none' : '' }}>
167
+            <view className='title'>
168
+              <image src={NoteasICO} />笔记详情
169
+            </view>
170
+            <View style={{ background: '#FFF' }}>
171
+              {(extend || []).map((item) => <Extend item={item} />)}
172
+            </View>
173
+          </view>
174
+          <view style={{ display: recommend == '' ? 'none' : '' }}>
175
+            <view className='title'>
176
+              <image src={TextMentioned} />文中提及
177
+            </view>
178
+            {(recommend || []).map((item) => <Cards item={item} det={item} st={parseFloat(item.score.toFixed(1))} />)}
179
+          </view>
180
+          <view className='botton'>这是我的底线</view>
181
+        </scroll-view>
182
+      </SpinBox>
183
+
184
+      <view className='index-tabber weui-tabbar' style={{ background: '#fff' }}>
185
+        <view className='weui-tabbar__item'>
186
+          <Button openType='share' className='purebtn'><TabIcon icon={share} text='分享' /></Button>
187
+        </view>
188
+        <view className='weui-tabbar__item' onClick={toggleLike}>
189
+          <TabIcon icon={isLike > 0 ? baozan : weibaozan} text={isLike > 0 ? "已爆赞" : "爆赞"} />
190
+        </view>
191
+        <view className='weui-tabbar__item' onClick={toggleSave}>
192
+          <TabIcon icon={isSaved > 0 ? ax : good} text={isSaved > 0 ? "已收藏" : "加入收藏"} />
193
+        </view>
194
+      </view>
195
+    </view>
196
+  )
197
+})
198
+
199
+

+ 134
- 0
src/pages/details/NoteDetails/index.less View File

1
+.storeDetails {
2
+  background-color: #fff;
3
+  border-radius: 12px;
4
+  margin-bottom: 20px;
5
+  .huadong {
6
+    position: relative;
7
+    .swiper {
8
+      height: calc((100vw - 60px) * 0.6);
9
+      .storeImage {
10
+        border-radius: 22px;
11
+        width: 100%;
12
+        height: 100%;
13
+      }
14
+    }
15
+    .tpPage {
16
+      position: absolute;
17
+      right: 20px;
18
+      bottom: 20px;
19
+      background: #000000;
20
+      border-radius: 16px;
21
+      font-size: 24px;
22
+      color: #ffffff;
23
+      padding: 0 7px;
24
+      opacity: 0.4;
25
+      line-height: 32px;
26
+      padding: 7px 8px 8px 7px;
27
+      text {
28
+        opacity: 0.64;
29
+      }
30
+    }
31
+  }
32
+  .storeJs {
33
+    padding: 22px;
34
+    .introduce {
35
+      display: inline-block;
36
+      .storeName {
37
+        font-size: 32px;
38
+        font-weight: bold;
39
+        color: #020200;
40
+      }
41
+    }
42
+    .bz {
43
+      float: right;
44
+      .bzRight {
45
+        font-size: 24px;
46
+        color: #202020;
47
+        line-height: 34px;
48
+        height: 23px;
49
+      }
50
+    }
51
+    .wz {
52
+      font-size: 24px;
53
+      padding: 30rpx 0 32rpx 0;
54
+      font-weight: bold;
55
+      color: #404040;
56
+    }
57
+    .dpPosition {
58
+      position: relative;
59
+      .dwTip {
60
+        width: 48px;
61
+        height: 48px;
62
+        top: -8px;
63
+        left: -8px;
64
+        position: absolute;
65
+      }
66
+      .distance {
67
+        padding-left: 38px;
68
+        font-size: 24px;
69
+        color: #c0c8d3;
70
+        .zhuandao {
71
+          width: 14px;
72
+          height: 24px;
73
+          transform: rotate(180deg);
74
+          position: relative;
75
+          left: 8px;
76
+          top: 5px;
77
+        }
78
+      }
79
+    }
80
+  }
81
+}
82
+.jdjs {
83
+  background: #fff;
84
+  border-radius: 12px 12px 0px 0px;
85
+  padding: 30px 20px 43px 20px;
86
+  text-align: justify;
87
+  font-size: 24px;
88
+  font-weight: bold;
89
+  color: #202020;
90
+  line-height: 54px;
91
+  overflow: hidden;
92
+  margin-bottom: 20px;
93
+  .line {
94
+    height: 1px;
95
+    background: #000;
96
+    opacity: 0.1;
97
+    margin: 57px 0 42px 0;
98
+  }
99
+  .sc {
100
+    font-size: 20px;
101
+    font-weight: bold;
102
+    color: #333;
103
+    float: right;
104
+    line-height: 0;
105
+    margin-right: 4px;
106
+    .scTip {
107
+      width: 20px;
108
+      height: 20px;
109
+      margin-right: 8px;
110
+    }
111
+  }
112
+}
113
+.title {
114
+  margin: 40px 0 40px 0;
115
+  font-size: 34px;
116
+  font-weight: bold;
117
+  color: #202020;
118
+  display: flex;
119
+  align-items: center;
120
+  image {
121
+    width: 35px;
122
+    height: 35px;
123
+    margin-right: 10px;
124
+  }
125
+}
126
+
127
+.botton {
128
+  font-size: 28px;
129
+  color: #c0c8d3;
130
+  line-height: 34px;
131
+  text-align: center;
132
+  padding: 40px 0;
133
+  background-color: #f8f8f8;
134
+}

+ 5
- 4
src/pages/details/foodDetails/foodDetails.jsx View File

8
 } from "@/services/home";
8
 } from "@/services/home";
9
 import { getVerifyTargetList } from "@/services/payOrder";
9
 import { getVerifyTargetList } from "@/services/payOrder";
10
 import { useState, useEffect, useRef } from "react";
10
 import { useState, useEffect, useRef } from "react";
11
-import { Button,View, Ad } from "@tarojs/components";
11
+import { Button, View, Ad } from "@tarojs/components";
12
 import Star from "@/components/Star/Star.jsx";
12
 import Star from "@/components/Star/Star.jsx";
13
 import NoData from '@/components/NoData'
13
 import NoData from '@/components/NoData'
14
 import Cards from "@/components/foodCards/foodCards.jsx";
14
 import Cards from "@/components/foodCards/foodCards.jsx";
24
 import good from "@/assets/icons/housemantj/touristGood.png";
24
 import good from "@/assets/icons/housemantj/touristGood.png";
25
 import baozan from "@/assets/icons/housemantj/bgood.png";
25
 import baozan from "@/assets/icons/housemantj/bgood.png";
26
 import weibaozan from "@/assets/icons/housemantj/unLike.png";
26
 import weibaozan from "@/assets/icons/housemantj/unLike.png";
27
+import logo from "@/assets/icons/UserCenter/laba.png"
28
+
27
 import useSave from "@/utils/hooks/useSave";
29
 import useSave from "@/utils/hooks/useSave";
28
 import useLike from "@/utils/hooks/useLike";
30
 import useLike from "@/utils/hooks/useLike";
29
 import Extend from "../components/Extend/extend";
31
 import Extend from "../components/Extend/extend";
30
 import ImageList from "../components/ImageList";
32
 import ImageList from "../components/ImageList";
31
-import logo from "./laba.png";
32
 import "./foodDetails.less";
33
 import "./foodDetails.less";
33
 
34
 
34
 export default withLayout((props) => {
35
 export default withLayout((props) => {
217
                     <Cards scene={scene} id={id} setScroll={setScroll} subOrderId={subOrderId} key={item.packageId} editable='1' st={star} goshop='1' item={item} det={detail} />
218
                     <Cards scene={scene} id={id} setScroll={setScroll} subOrderId={subOrderId} key={item.packageId} editable='1' st={star} goshop='1' item={item} det={detail} />
218
                   ))}
219
                   ))}
219
                 </view>
220
                 </view>
220
-                <view class="adContainer">
221
-                  <Ad unit-id="adunit-a0f97bb7ec8ec7bb" ad-intervals="30" />
221
+                <view class='adContainer'>
222
+                  <Ad unit-id='adunit-a0f97bb7ec8ec7bb' ad-intervals='30' />
222
                 </view>
223
                 </view>
223
                 <view
224
                 <view
224
                   style={{
225
                   style={{

+ 7
- 6
src/pages/details/mjDetails/sceneryDetails.jsx View File

13
 import TabIcon from '@/components/HorTabbar/TabIcon'
13
 import TabIcon from '@/components/HorTabbar/TabIcon'
14
 import { useState, useEffect } from 'react'
14
 import { useState, useEffect } from 'react'
15
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
15
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
16
-import { Button, View, Ad } from '@tarojs/components';
16
+import logo from "@/assets/icons/UserCenter/laba.png"
17
+import { Swiper, SwiperItem, Button, View, Ad } from '@tarojs/components';
17
 import useSave from "@/utils/hooks/useSave"
18
 import useSave from "@/utils/hooks/useSave"
18
 import useLike from "@/utils/hooks/useLike"
19
 import useLike from "@/utils/hooks/useLike"
19
 import Cards from '@/components/foodCards/foodCards.jsx'
20
 import Cards from '@/components/foodCards/foodCards.jsx'
20
 import Taro, { useShareAppMessage } from '@tarojs/taro'
21
 import Taro, { useShareAppMessage } from '@tarojs/taro'
21
 import Extend from '../components/Extend/extend'
22
 import Extend from '../components/Extend/extend'
23
+import './sceneryDetails.less'
22
 import ImageList from "../components/ImageList";
24
 import ImageList from "../components/ImageList";
23
-import logo from "../foodDetails/laba.png";
24
 
25
 
25
-import './sceneryDetails.less'
26
+
26
 
27
 
27
 export default withLayout((props) => {
28
 export default withLayout((props) => {
28
   const { router, person, location } = props
29
   const { router, person, location } = props
123
               <view className='wz'>{detail.address}</view>
124
               <view className='wz'>{detail.address}</view>
124
               <view className='dpPosition' onClick={openMap}>
125
               <view className='dpPosition' onClick={openMap}>
125
                 <image src={dw} className='dwTip' />
126
                 <image src={dw} className='dwTip' />
126
-                <view className='distance'>{(detail.distance / 1000).toFixed(2)}公里<image src={zhuandao} className="zhuandao" /></view>
127
+                <view className='distance'>{(detail.distance / 1000).toFixed(2)}公里<image src={zhuandao} className='zhuandao' /></view>
127
               </view>
128
               </view>
128
             </view>
129
             </view>
129
           </view>
130
           </view>
134
               <image className='scTip' src={isSaved > 0 ? ax : good} /><text>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
135
               <image className='scTip' src={isSaved > 0 ? ax : good} /><text>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
135
             </view>
136
             </view>
136
           </view>
137
           </view>
137
-          <view class="adContainer">
138
-            <Ad unit-id="adunit-a0f97bb7ec8ec7bb" ad-intervals="30" />
138
+          <view class='adContainer'>
139
+            <Ad unit-id='adunit-a0f97bb7ec8ec7bb' ad-intervals='30' />
139
           </view>
140
           </view>
140
           <view style={{ position: 'relative', display: extend == '' ? 'none' : '' }}>
141
           <view style={{ position: 'relative', display: extend == '' ? 'none' : '' }}>
141
             <view className='title'>
142
             <view className='title'>

+ 1
- 1
src/pages/index/components/Card/index.jsx View File

32
       <view className='contentCard' style={style}>
32
       <view className='contentCard' style={style}>
33
         <view className='cardTop'>
33
         <view className='cardTop'>
34
           <image mode='widthFix' onClick={Detail} src={compressImage(item.poster)} className='cCardimg' />
34
           <image mode='widthFix' onClick={Detail} src={compressImage(item.poster)} className='cCardimg' />
35
-          <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} />
35
+          {/* <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} /> */}
36
           <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
36
           <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
37
         </view>
37
         </view>
38
         <view className='bContent' onClick={Detail}>
38
         <view className='bContent' onClick={Detail}>

+ 23
- 6
src/pages/index/tabs/Recommend.jsx View File

9
 import { random } from '@/utils'
9
 import { random } from '@/utils'
10
 import Card from '../components/Card'
10
 import Card from '../components/Card'
11
 import './less/Recommend.less'
11
 import './less/Recommend.less'
12
-import { OfficialAccount } from '@tarojs/components'
12
+
13
+
13
 const listStyle = { height: '100%' }
14
 const listStyle = { height: '100%' }
14
 
15
 
15
 export default (props) => {
16
 export default (props) => {
19
   const [typeList, setTypeList] = useState([])
20
   const [typeList, setTypeList] = useState([])
20
   const listRef = useRef()
21
   const listRef = useRef()
21
 
22
 
22
-  const [queryParams, setQueryParams] = useState({ location, pageNum: 1, pageSize: 10, typeId: '' })
23
+  const [queryParams, setQueryParams] = useState({ location, pageNum: 1, pageSize: 10, typeId: '' })//地点
24
+
25
+  // const [queryParams, setQueryParams] = useState({ location, pageNum: 1, pageSize: 10, typeId: '' })//笔记
23
   const rfTimes = useRef(0)
26
   const rfTimes = useRef(0)
24
 
27
 
25
   // 获取资源表信息
28
   // 获取资源表信息
27
 
30
 
28
 
31
 
29
   //分类标签
32
   //分类标签
30
-  const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
31
-  const details = (index, tab) => {
33
+  const tabs = [{ title: '地点' }, { title: '笔记' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
34
+
35
+  //笔记
36
+  const penDetails = (index, tab) => {
37
+    // setActiveTab(index)
38
+    // setQueryParams({
39
+    //   ...queryParams,
40
+    //   typeId: tab
41
+    // })
42
+  }
43
+
44
+
45
+  const placeDetails = (index, tab) => {
32
     setActiveTab(index)
46
     setActiveTab(index)
33
     setQueryParams({
47
     setQueryParams({
34
       ...queryParams,
48
       ...queryParams,
38
   //切换上面的标签
52
   //切换上面的标签
39
   const handleTabChange = (e) => {
53
   const handleTabChange = (e) => {
40
     const { index } = e.detail
54
     const { index } = e.detail
41
-    details(index, tabs[index].typeId || '')
55
+    // if (index = 0) {
56
+
57
+    // }
58
+    placeDetails(index, tabs[index].typeId || '')
42
   }
59
   }
43
 
60
 
44
   const handleDataChange = (value, e) => {
61
   const handleDataChange = (value, e) => {
56
     //查询分类标签表
73
     //查询分类标签表
57
     getIndexType({ pageSize: 20 }).then((res) => {
74
     getIndexType({ pageSize: 20 }).then((res) => {
58
       setTypeList(res.records || [])
75
       setTypeList(res.records || [])
59
-      details(1, res.records[0].typeId)
76
+      placeDetails(1, res.records[0]?.typeId)
60
     })
77
     })
61
   }, [])
78
   }, [])
62
 
79
 

+ 34
- 11
src/pages/search/search.jsx View File

1
 import CustomNav from '@/components/CustomNav'
1
 import CustomNav from '@/components/CustomNav'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
+import { View, Picker } from '@tarojs/components'
3
 import withLayout from '@/layouts'
4
 import withLayout from '@/layouts'
4
 import { getIndexSearch } from '@/services/home'
5
 import { getIndexSearch } from '@/services/home'
5
 import { useEffect, useState } from 'react'
6
 import { useEffect, useState } from 'react'
18
       Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${e.detail.value}` });
19
       Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${e.detail.value}` });
19
     }
20
     }
20
   }
21
   }
22
+  const [selectValue, setselectValue] = useState('地点')
23
+  const state = {
24
+    selector: ['地点', '笔记'],
25
+    selectorChecked: selectValue,
26
+    // timeSel: '12:01',
27
+    // dateSel: '2018-04-22'
28
+  }
29
+
30
+  const onChange = e => {
31
+    setselectValue(state.selector[e.detail.value])
32
+  }
21
   useEffect(() => {
33
   useEffect(() => {
22
     getIndexSearch().then((res) => {
34
     getIndexSearch().then((res) => {
23
       setHotList(res || [])
35
       setHotList(res || [])
24
     })
36
     })
25
   }, [])
37
   }, [])
26
   return (
38
   return (
27
-    <view className='page-index'>
28
-      <view className='index-navbar'>
39
+    <View className='page-index'>
40
+      <View className='index-navbar'>
29
         <CustomNav title='搜索' />
41
         <CustomNav title='搜索' />
30
-      </view>
31
-      <SearchBar placeholder='搜索景点/店铺' onBlur={onSearch} />
32
-      <view className='content'>
33
-        <view className='hotSearch'>热门搜索</view>
34
-        <view className='hotSearchtip'>
42
+      </View>
43
+      <View className='page-index-box' >
44
+
45
+        <Picker className='picker-box' mode='selector' range={state.selector} onChange={onChange}>
46
+          <View className='picker-text'>
47
+            {state.selectorChecked} |
48
+          </View>
49
+        </Picker>
50
+        <View className='selector-box'>
51
+          <SearchBar placeholder='搜索景点/店铺' onBlur={onSearch} />
52
+        </View>
53
+
54
+      </View>
55
+      <View className='content'>
56
+        <View className='hotSearch'>热门搜索</View>
57
+        <View className='hotSearchtip'>
35
           {
58
           {
36
-            (hotList || []).map((item) => <view onClick={() => hotSearch(item.word)}>{item.word}</view>)
59
+            (hotList || []).map((item) => <View onClick={() => hotSearch(item.word)}>{item.word}</View>)
37
           }
60
           }
38
-        </view>
39
-      </view>
40
-    </view>
61
+        </View>
62
+      </View>
63
+    </View>
41
   )
64
   )
42
 })
65
 })

+ 48
- 18
src/pages/search/search.less View File

1
-.content{
2
-  padding: 60px 30px;
3
-  .hotSearch{
4
-    font-size: 34px;     
5
-    font-weight: bold;
6
-    color: #202020;
7
-    margin-bottom:58.4px;
1
+.page-index {
2
+  .page-index-box {
3
+    margin-top: -10vw;
4
+    .picker-box {
5
+      width: 20%;
6
+      display: inline-block;
7
+      position: relative;
8
+      top: 10vw;
9
+
10
+      .picker-text {
11
+        line-height: 73px;
12
+        text-align: center;
13
+        border-radius: 42px;
14
+        font-size: 30px;
15
+        font-weight: 700;
16
+        background-color: #f8f8f8;
17
+        position: relative;
18
+        top: 34px;
19
+        height: 9.9vw;
20
+        left: 12px;
21
+      }
22
+    }
23
+    .selector-box {
24
+      width: 83%;
25
+      position: relative;
26
+      right: -15vw;
27
+    }
8
   }
28
   }
9
-  .hotSearchtip view{
10
-    border-radius: 30px;
11
-    font-size: 24px;     
12
-    font-weight: bold;
13
-    margin:0 40px 40px 0;
14
-    padding:18px 23px;
15
-    float: left;
16
-    color: #666666;
17
-    border: 1px solid #999999;
18
-  }  
19
-}
29
+
30
+  .content {
31
+    padding: 60px 30px;
32
+    .hotSearch {
33
+      font-size: 34px;
34
+      font-weight: bold;
35
+      color: #202020;
36
+      margin-bottom: 58.4px;
37
+    }
38
+    .hotSearchtip view {
39
+      border-radius: 30px;
40
+      font-size: 24px;
41
+      font-weight: bold;
42
+      margin: 0 40px 40px 0;
43
+      padding: 18px 23px;
44
+      float: left;
45
+      color: #666666;
46
+      border: 1px solid #999999;
47
+    }
48
+  }
49
+}

+ 6
- 1
src/routes.js View File

22
     title: '景点详情',
22
     title: '景点详情',
23
     page: 'pages/details/mjDetails/sceneryDetails',
23
     page: 'pages/details/mjDetails/sceneryDetails',
24
   },
24
   },
25
+  {
26
+    title: '笔记详情',
27
+    page: 'pages/details/NoteDetails/index',
28
+
29
+  },
25
   {
30
   {
26
     title: '订单',
31
     title: '订单',
27
     page: 'pages/PayOrder/index',
32
     page: 'pages/PayOrder/index',
67
 // 商户管理页面shop/pages/spread/spreadIndex
72
 // 商户管理页面shop/pages/spread/spreadIndex
68
 const shopPages = [
73
 const shopPages = [
69
   {
74
   {
70
-    title: '商铺管理',  
75
+    title: '商铺管理',
71
     page: 'pages/spread/spreadIndex',
76
     page: 'pages/spread/spreadIndex',
72
     isIndex: true,
77
     isIndex: true,
73
   },
78
   },