Browse Source

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

张延森 3 years ago
parent
commit
fd75d780a7

+ 1
- 1
project.config.json View File

2
   "miniprogramRoot": "./dist",
2
   "miniprogramRoot": "./dist",
3
   "projectname": "miniapp",
3
   "projectname": "miniapp",
4
   "description": "十公里",
4
   "description": "十公里",
5
-  "appid": "wx06a7372d48d56843",
5
+  "appid": "wx835627a9b9b3932a",
6
   "setting": {
6
   "setting": {
7
     "urlCheck": true,
7
     "urlCheck": true,
8
     "es6": false,
8
     "es6": false,

+ 32
- 10
src/components/CompoentsOrder/OrderCard/index.jsx View File

60
       url: `/pages/MineUserAll/RefundMoney/CheckRefund/index?id=${item.orderId}`,
60
       url: `/pages/MineUserAll/RefundMoney/CheckRefund/index?id=${item.orderId}`,
61
     });
61
     });
62
   };
62
   };
63
-  const PayAction =
64
-    kkp == '1' ? null ://空卡片用于售后详情页面
65
-      sh == '1' ? <Action.Icon icon={Refund} text='售后/退款' onClick={() => handleRefund(item)} /> ://售后页面卡片
66
-        item.status === 0 ? <Action.Icon icon={Pay} text='支付' onClick={handleDetail} /> ://待支付
67
-          item.status === 1 && item.isVerified == false ? <Action.Icon icon={QRcode} text='扫码核销' onClick={() => onWriteOff(item)} /> ://待核销
68
-            item.status === 2 && item.isVerified == false ? <Action.Image image={refund} /> ://已退费
69
-              item.status === 7 && item.isVerified == false ? <Action.Image image={Cancel} /> ://已取消
70
-                item.status === 9 ? <Action.Image image={Null} /> ://已过期
71
-                  item.isVerified == true && item.isEvaluated > 0 ? <Action.Image image={Evaluated} /> ://已评价
72
-                    item.isVerified == true ? <Action.Icon icon={Evaluation} text='评价' onClick={() => evaluation(item)} /> : null//待评价
63
+  // const PayAction =
64
+  //   kkp == '1' ? null ://空卡片用于售后详情页面
65
+  //     sh == '1' ? <Action.Icon icon={Refund} text='售后/退款' onClick={() => handleRefund(item)} /> ://售后页面卡片
66
+  //       item.status === 0 ? <Action.Icon icon={Pay} text='支付' onClick={handleDetail} /> ://待支付
67
+  //         item.status === 1 && item.isVerified == false ? <Action.Icon icon={QRcode} text='扫码核销' onClick={() => onWriteOff(item)} /> ://待核销
68
+  //           item.status === 2 && item.isVerified == false ? <Action.Image image={refund} /> ://已退费
69
+  //             item.status === 7 && item.isVerified == false ? <Action.Image image={Cancel} /> ://已取消
70
+  //               item.status === 9 ? <Action.Image image={Null} /> ://已过期
71
+  //                 item.isVerified == true && item.isEvaluated > 0 ? <Action.Image image={Evaluated} /> ://已评价
72
+  //                   item.isVerified == true ? <Action.Icon icon={Evaluation} text='评价' onClick={() => evaluation(item)} /> : null//待评价
73
 
73
 
74
+  let PayAction=null
75
+  if (kkp=='1') {//空卡片用于售后详情页面
76
+    PayAction=null
77
+  }else if (sh=='1') {//售后页面卡片
78
+     PayAction=<Action.Icon icon={Refund} text='售后/退款' onClick={() => handleRefund(item)} />
79
+  }else if (item.status===0) {//待支付
80
+     PayAction=<Action.Icon icon={Pay} text='支付' onClick={handleDetail} />
81
+  }else if (item.status === 1 && item.isVerified == false) {//待核销
82
+     PayAction=<Action.Icon icon={QRcode} text='扫码核销' onClick={() => onWriteOff(item)} />
83
+  }else if (item.status === 2 && item.isVerified == false) {//已退费
84
+     PayAction=<Action.Image image={refund} />
85
+  }else if (item.status === 7 && item.isVerified == false) {//已取消
86
+     PayAction=<Action.Image image={Cancel} />
87
+  }else if(item.status === 9){//已过期
88
+     PayAction=<Action.Image image={Null} />
89
+  }else if (item.isVerified == true && item.isEvaluated > 0) {//已评价
90
+     PayAction=<Action.Image image={Evaluated} />
91
+  }else if (item.isVerified == true) {//待评价
92
+     PayAction=<Action.Icon icon={Evaluation} text='评价' onClick={() => evaluation(item)} />
93
+  }else{
94
+    PayAction=null
95
+  }
74
 
96
 
75
   return (
97
   return (
76
     <>
98
     <>

+ 82
- 91
src/pages/index/tabs/Guide.jsx View File

33
   const trackClick = useTrackClick(router)
33
   const trackClick = useTrackClick(router)
34
 
34
 
35
   const [taRoomContent, setTaRoomContent] = useState([])
35
   const [taRoomContent, setTaRoomContent] = useState([])
36
-  const RoomLocation = taRoomContent?.location
37
   //没有停车 wifi的就不显示按钮
36
   //没有停车 wifi的就不显示按钮
38
   const [wifiButtonStyle, setWifiButtonStyle] = useState('')
37
   const [wifiButtonStyle, setWifiButtonStyle] = useState('')
39
   const [parkingButtonStyle, setParkingButtonStyle] = useState('')
38
   const [parkingButtonStyle, setParkingButtonStyle] = useState('')
40
   const [guideStyle, setGuideStyle] = useState('')
39
   const [guideStyle, setGuideStyle] = useState('')
41
-  const parkingGps = taRoomContent?.parkingLocation
42
-  const roomGps = taRoomContent?.location
40
+  const parkingGps = taRoomContent.parkingLocation || []
41
+  const roomGps = taRoomContent.location || []
43
 
42
 
44
 
43
 
45
 
44
 
81
       setLoading(true)
80
       setLoading(true)
82
       // 点击’去这里‘跳转导航
81
       // 点击’去这里‘跳转导航
83
       getTaRoom(roomId).then((res) => {
82
       getTaRoom(roomId).then((res) => {
84
-        // Roomlog.current = (!res.location).toString().split(',')[0]
85
-        // Roomlat.current = (!res.location).toString().split(',')[1]
86
-        // Parklog.current = (!res.parkingLocation).toString().split(',')[0]
87
-        // Parklat.current = (!res.parkingLocation).toString().split(',')[1]
88
         setTaRoomContent(res || [])
83
         setTaRoomContent(res || [])
89
         setLoading(false)
84
         setLoading(false)
90
       })
85
       })
91
       //更多指引
86
       //更多指引
92
       geiZy()
87
       geiZy()
93
-
94
-      getRecommendList({ location: location }).then((res) => {
88
+      getRecommendList({ location: roomGps }).then((res) => {
95
         setPackage(res || [])
89
         setPackage(res || [])
96
         setLoading(false)
90
         setLoading(false)
97
-
98
       })
91
       })
99
-      // setLoading(false)
100
-
101
     } else {
92
     } else {
102
       setLoading(true)
93
       setLoading(true)
103
-
104
       getRecommendList({ location: location }).then((res) => {
94
       getRecommendList({ location: location }).then((res) => {
105
         setPackage(res || [])
95
         setPackage(res || [])
106
         setLoading(false)
96
         setLoading(false)
114
     if (taRoomContent?.parkingAddress === "") {
104
     if (taRoomContent?.parkingAddress === "") {
115
       setParkingButtonStyle('none')
105
       setParkingButtonStyle('none')
116
     }
106
     }
117
-  }, [roomId, RoomLocation, taRoomContent?.wifiPassword, taRoomContent?.parkingAddress, location])
107
+  }, [roomId, roomGps, taRoomContent?.wifiPassword, taRoomContent?.parkingAddress, location])
118
 
108
 
119
 
109
 
120
   const goRoomMap = () => {
110
   const goRoomMap = () => {
160
 
150
 
161
   return (
151
   return (
162
     <scroll-view scrollY style={{ height: '100%' }}  >
152
     <scroll-view scrollY style={{ height: '100%' }}  >
163
-        <view className='Guide-Home-box'>
164
-          {
165
-            ifroomId === 'havenot' && (
166
-              <view className='Guide-image-text-box'>
167
-                <image className='Guide-images' src={sleep} />
168
-                <view className='Guide-text'>您还没有入住订单哟~</view>
169
-              </view>
170
-            )
171
-          }
172
-          {/* 有民宿的情况下 */}
173
-          {
174
-            ifroomId === 'reality' && (
175
-              <SpinBox loading={loading}>
176
-                <view className='room-box-info-ROOM'>
177
-                  <view className='room-bi-name-ROOM' >
178
-                    <view className='room-bin-title-ROOM'>房屋名称</view>
179
-                    <view className='room-bint-nameInfo-ROOM'>{taRoomContent?.roomName}
180
-                    </view>
153
+      <view className='Guide-Home-box'>
154
+        {
155
+          ifroomId === 'havenot' && (
156
+            <view className='Guide-image-text-box'>
157
+              <image className='Guide-images' src={sleep} />
158
+              <view className='Guide-text'>您还没有入住订单哟~</view>
159
+            </view>
160
+          )
161
+        }
162
+        {/* 有民宿的情况下 */}
163
+        {
164
+          ifroomId === 'reality' && (
165
+            <SpinBox loading={loading}>
166
+              <view className='room-box-info-ROOM'>
167
+                <view className='room-bi-name-ROOM' >
168
+                  <view className='room-bin-title-ROOM'>房屋名称</view>
169
+                  <view className='room-bint-nameInfo-ROOM'>{taRoomContent?.roomName}
181
                   </view>
170
                   </view>
182
                 </view>
171
                 </view>
183
-                {/* --------房屋位置-------- */}
184
-                {
185
-                  !roomGps ? <view></view>
186
-                    :
187
-                    <view className='room-box-info-HouLocation'>
188
-                      <view className='room-bi-name-HouLocation' >
189
-                        <view className='room-bin-title-HouLocation'>房屋位置</view>
190
-                        <view className='room-bint-nameInfo-HouLocation'>
191
-                          <view className='room-bint-nameInfo-bool-HouLocation' >{taRoomContent?.address}</view>
192
-                          <view className='room-bintn-button-HouLocation' onClick={() => { goRoomMap() }} style={{ display: wifiButtonStyle }}>
193
-                            <image className='room-bintn-image-HouLocation' src={GPS} />
194
-                            <text className='room-bintn-text-HouLocation'>去这里</text>
195
-                          </view>
172
+              </view>
173
+              {/* --------房屋位置-------- */}
174
+              {
175
+                !roomGps ? <view></view>
176
+                  :
177
+                  <view className='room-box-info-HouLocation'>
178
+                    <view className='room-bi-name-HouLocation' >
179
+                      <view className='room-bin-title-HouLocation'>房屋位置</view>
180
+                      <view className='room-bint-nameInfo-HouLocation'>
181
+                        <view className='room-bint-nameInfo-bool-HouLocation' >{taRoomContent?.address}</view>
182
+                        <view className='room-bintn-button-HouLocation' onClick={() => { goRoomMap() }} style={{ display: wifiButtonStyle }}>
183
+                          <image className='room-bintn-image-HouLocation' src={GPS} />
184
+                          <text className='room-bintn-text-HouLocation'>去这里</text>
196
                         </view>
185
                         </view>
197
                       </view>
186
                       </view>
198
                     </view>
187
                     </view>
199
-                }
188
+                  </view>
200
 
189
 
201
-                {/* --------停车场-------- */}
202
-                {
203
-                  !parkingGps ? <view></view>
204
-                    :
205
-                    <view className='room-box-info-Parking'>
206
-                      <view className='room-bi-name-Parking' >
207
-                        <view className='room-bin-title-Parking'>停车位置</view>
208
-                        <view className='room-bint-nameInfo-Parking'>
209
-                          <view className='room-bint-nameInfo-bool-Parking' >{taRoomContent?.parkingAddress}</view>
210
-                          <view className='room-bintn-button-Parking' onClick={() => { goParkMap() }} style={{ display: wifiButtonStyle }}>
211
-                            <image className='room-bintn-image-Parking' src={GPS} />
212
-                            <text className='room-bintn-text-Parking'>去这里</text>
213
-                          </view>
190
+              }
191
+
192
+
193
+              {/* --------停车场-------- */}
194
+              {
195
+                !parkingGps ? <view></view>
196
+                  :
197
+                  <view className='room-box-info-Parking'>
198
+                    <view className='room-bi-name-Parking' >
199
+                      <view className='room-bin-title-Parking'>停车位置</view>
200
+                      <view className='room-bint-nameInfo-Parking'>
201
+                        <view className='room-bint-nameInfo-bool-Parking' >{taRoomContent?.parkingAddress}</view>
202
+                        <view className='room-bintn-button-Parking' onClick={() => { goParkMap() }} style={{ display: wifiButtonStyle }}>
203
+                          <image className='room-bintn-image-Parking' src={GPS} />
204
+                          <text className='room-bintn-text-Parking'>去这里</text>
214
                         </view>
205
                         </view>
215
                       </view>
206
                       </view>
216
                     </view>
207
                     </view>
208
+                  </view>
217
 
209
 
218
-                }
210
+              }
219
 
211
 
220
 
212
 
221
-                {/* --------无线网-------- */}
222
-                <view className='room-box-info-WIFIContent'>
223
-                  <view className='room-bi-name-WIFIContent' >
224
-                    <view className='room-bin-title-WIFIContent'>WiFi信息</view>
225
-                    <view className='room-bint-nameInfo-WIFIContent'>
226
-                      <view className='room-bint-nameInfo-bool-WIFIContent-wifi' >名称:{taRoomContent?.wifiName}</view>
227
-                      <view className='room-bint-nameInfo-bool-WIFIContent-password' >密码:{taRoomContent?.wifiPassword}</view>
228
-                      <view className='room-bintn-button-WIFIContent' onClick={() => { wifiCopy() }} style={{ display: wifiButtonStyle }}>
229
-                        <image className='room-bintn-image-WIFIContent' src={copy_logo} />
230
-                        <text className='room-bintn-text-WIFIContent'>复制</text>
231
-                      </view>
213
+              {/* --------无线网-------- */}
214
+              <view className='room-box-info-WIFIContent'>
215
+                <view className='room-bi-name-WIFIContent' >
216
+                  <view className='room-bin-title-WIFIContent'>WiFi信息</view>
217
+                  <view className='room-bint-nameInfo-WIFIContent'>
218
+                    <view className='room-bint-nameInfo-bool-WIFIContent-wifi' >名称:{taRoomContent?.wifiName}</view>
219
+                    <view className='room-bint-nameInfo-bool-WIFIContent-password' >密码:{taRoomContent?.wifiPassword}</view>
220
+                    <view className='room-bintn-button-WIFIContent' onClick={() => { wifiCopy() }} style={{ display: wifiButtonStyle }}>
221
+                      <image className='room-bintn-image-WIFIContent' src={copy_logo} />
222
+                      <text className='room-bintn-text-WIFIContent'>复制</text>
232
                     </view>
223
                     </view>
233
                   </view>
224
                   </view>
234
                 </view>
225
                 </view>
226
+              </view>
235
 
227
 
236
-                <view className='Guide-Content-box'  >
237
-                  <view className='title-image' style={{ display: guideStyle }} >
238
-                    <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
239
-                    <text className='title-title-boss' >更多指引</text>
240
-                  </view>
241
-                  <view style={{ padding: '0 30rpx', boxSizing: 'border-box' }}>
242
-                    {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
243
-                  </view>
228
+              <view className='Guide-Content-box'  >
229
+                <view className='title-image' style={{ display: guideStyle }} >
230
+                  <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
231
+                  <text className='title-title-boss' >更多指引</text>
244
                 </view>
232
                 </view>
245
-              </SpinBox>
246
-            )
247
-          }
248
-          <view className='Guide-Content-box'>
249
-            <view className='title-image'>
250
-              <image mode='scaleToFill' className='title-image-cup' src={Cup} />
251
-              <text className='title-title-boss' >老板推荐好吃的</text>
252
-            </view>
253
-          </view>
254
-          <view style={{ marginTop: '10rpx', marginBottom: '60rpx' }}>
255
-            {(spackage || []).map((item, index) => <BossCard det={item} st={parseFloat(item.score.toFixed(1))} key={(index)} trackClick={trackClick} taRoomContent={taRoomContent} item={item} />)}
233
+                <view style={{ padding: '0 30rpx', boxSizing: 'border-box' }}>
234
+                  {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
235
+                </view>
236
+              </view>
237
+            </SpinBox>
238
+          )
239
+        }
240
+        <view className='Guide-Content-box'>
241
+          <view className='title-image'>
242
+            <image mode='scaleToFill' className='title-image-cup' src={Cup} />
243
+            <text className='title-title-boss' >老板推荐好吃的</text>
256
           </view>
244
           </view>
257
-
258
         </view>
245
         </view>
246
+        <view style={{ marginTop: '10rpx', marginBottom: '60rpx' }}>
247
+          {(spackage || []).map((item, index) => <BossCard det={item} st={parseFloat(item.score.toFixed(1))} key={(index)} trackClick={trackClick} taRoomContent={taRoomContent} item={item} />)}
248
+        </view>
249
+      </view>
259
     </scroll-view>
250
     </scroll-view>
260
   )
251
   )
261
 }
252
 }

+ 21
- 26
src/pages/index/tabs/Recommend.jsx View File

1
 import Taro, { useDidShow } from '@tarojs/taro'
1
 import Taro, { useDidShow } from '@tarojs/taro'
2
 import { React, useState, useEffect, useRef } from 'react'
2
 import { React, useState, useEffect, useRef } from 'react'
3
-import { View } from '@tarojs/components';
4
 import iconsearch from '@/assets/icons/housemantj/search.png'
3
 import iconsearch from '@/assets/icons/housemantj/search.png'
5
 import locationimg from '@/assets/icons/housemantj/location.png'
4
 import locationimg from '@/assets/icons/housemantj/location.png'
6
 import Tip from '@/components/tip'
5
 import Tip from '@/components/tip'
27
   // 获取资源表信息
26
   // 获取资源表信息
28
   // const [alllist, setAllList] = useState([])
27
   // const [alllist, setAllList] = useState([])
29
   const [listData, setListData] = useState({ list: [], rfTimes: 0 })
28
   const [listData, setListData] = useState({ list: [], rfTimes: 0 })
29
+  const { isSaved } = listData
30
+
30
 
31
 
31
   //分类标签
32
   //分类标签
32
   const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
33
   const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
55
     setListData({ list: value, rfTimes: rfTimes.current })
56
     setListData({ list: value, rfTimes: rfTimes.current })
56
   }
57
   }
57
 
58
 
59
+
58
   useEffect(() => {
60
   useEffect(() => {
59
     //查询分类标签表
61
     //查询分类标签表
60
     getIndexType({ pageSize: 20 }).then((res) => {
62
     getIndexType({ pageSize: 20 }).then((res) => {
66
     // 用绝对路径
68
     // 用绝对路径
67
     Taro.navigateTo({ url: '/pages/search/search' });
69
     Taro.navigateTo({ url: '/pages/search/search' });
68
   }
70
   }
69
-  // // 联动收藏
70
-  // const likeLook = () => {
71
-  //   getResourceList().then(e => {
72
-  //     setAllList(e.records)
73
-  //   })
74
-
75
-  // }
76
 
71
 
77
   useDidShow(() => {
72
   useDidShow(() => {
78
-    setQueryParams({ ... queryParams})
73
+    setQueryParams({ ...queryParams })
79
   })
74
   })
80
 
75
 
81
   return (
76
   return (
107
         </scroll-view>
102
         </scroll-view>
108
       </view>
103
       </view>
109
       {/* <View style={{ flex:'auto' }}> */}
104
       {/* <View style={{ flex:'auto' }}> */}
110
-        <List
111
-          ref={listRef}
112
-          style={listStyle}
113
-          request={getResourceList}
114
-          params={queryParams}
115
-          onDataChange={handleDataChange}
116
-        >
117
-          <view style={{ padding: '30rpx 15rpx' }}>
118
-            <MasonryLayout
119
-              itemKey='resourceNo'
120
-              listData={listData}
121
-              render={(item, callback) => <Card item={item} onImageLoad={callback} />}
122
-            />
123
-          </view>
124
-
125
-          {/* {
105
+      <List
106
+        ref={listRef}
107
+        style={listStyle}
108
+        request={getResourceList}
109
+        params={queryParams}
110
+        onDataChange={handleDataChange}
111
+      >
112
+        <view style={{ padding: '30rpx 15rpx' }}>
113
+          <MasonryLayout
114
+            itemKey='resourceNo'
115
+            listData={listData}
116
+            render={(item, callback) => <Card item={item} onImageLoad={callback} />}
117
+          />
118
+        </view>
119
+
120
+        {/* {
126
             alllist.length == 0 ?
121
             alllist.length == 0 ?
127
               <NoData /> :
122
               <NoData /> :
128
               <view className='waterfall'>
123
               <view className='waterfall'>
131
                 }
126
                 }
132
               </view>
127
               </view>
133
           } */}
128
           } */}
134
-        </List>
129
+      </List>
135
       {/* </View> */}
130
       {/* </View> */}
136
     </view>
131
     </view>
137
   )
132
   )