소스 검색

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

张延森 3 년 전
부모
커밋
fd75d780a7
4개의 변경된 파일136개의 추가작업 그리고 128개의 파일을 삭제
  1. 1
    1
      project.config.json
  2. 32
    10
      src/components/CompoentsOrder/OrderCard/index.jsx
  3. 82
    91
      src/pages/index/tabs/Guide.jsx
  4. 21
    26
      src/pages/index/tabs/Recommend.jsx

+ 1
- 1
project.config.json 파일 보기

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

+ 32
- 10
src/components/CompoentsOrder/OrderCard/index.jsx 파일 보기

@@ -60,17 +60,39 @@ export default (props) => {
60 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 97
   return (
76 98
     <>

+ 82
- 91
src/pages/index/tabs/Guide.jsx 파일 보기

@@ -33,13 +33,12 @@ export default (props) => {
33 33
   const trackClick = useTrackClick(router)
34 34
 
35 35
   const [taRoomContent, setTaRoomContent] = useState([])
36
-  const RoomLocation = taRoomContent?.location
37 36
   //没有停车 wifi的就不显示按钮
38 37
   const [wifiButtonStyle, setWifiButtonStyle] = useState('')
39 38
   const [parkingButtonStyle, setParkingButtonStyle] = useState('')
40 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,26 +80,17 @@ export default (props) => {
81 80
       setLoading(true)
82 81
       // 点击’去这里‘跳转导航
83 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 83
         setTaRoomContent(res || [])
89 84
         setLoading(false)
90 85
       })
91 86
       //更多指引
92 87
       geiZy()
93
-
94
-      getRecommendList({ location: location }).then((res) => {
88
+      getRecommendList({ location: roomGps }).then((res) => {
95 89
         setPackage(res || [])
96 90
         setLoading(false)
97
-
98 91
       })
99
-      // setLoading(false)
100
-
101 92
     } else {
102 93
       setLoading(true)
103
-
104 94
       getRecommendList({ location: location }).then((res) => {
105 95
         setPackage(res || [])
106 96
         setLoading(false)
@@ -114,7 +104,7 @@ export default (props) => {
114 104
     if (taRoomContent?.parkingAddress === "") {
115 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 110
   const goRoomMap = () => {
@@ -160,102 +150,103 @@ export default (props) => {
160 150
 
161 151
   return (
162 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 170
                   </view>
182 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 185
                         </view>
197 186
                       </view>
198 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 205
                         </view>
215 206
                       </view>
216 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 223
                     </view>
233 224
                   </view>
234 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 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 244
           </view>
257
-
258 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 250
     </scroll-view>
260 251
   )
261 252
 }

+ 21
- 26
src/pages/index/tabs/Recommend.jsx 파일 보기

@@ -1,6 +1,5 @@
1 1
 import Taro, { useDidShow } from '@tarojs/taro'
2 2
 import { React, useState, useEffect, useRef } from 'react'
3
-import { View } from '@tarojs/components';
4 3
 import iconsearch from '@/assets/icons/housemantj/search.png'
5 4
 import locationimg from '@/assets/icons/housemantj/location.png'
6 5
 import Tip from '@/components/tip'
@@ -27,6 +26,8 @@ export default (props) => {
27 26
   // 获取资源表信息
28 27
   // const [alllist, setAllList] = useState([])
29 28
   const [listData, setListData] = useState({ list: [], rfTimes: 0 })
29
+  const { isSaved } = listData
30
+
30 31
 
31 32
   //分类标签
32 33
   const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
@@ -55,6 +56,7 @@ export default (props) => {
55 56
     setListData({ list: value, rfTimes: rfTimes.current })
56 57
   }
57 58
 
59
+
58 60
   useEffect(() => {
59 61
     //查询分类标签表
60 62
     getIndexType({ pageSize: 20 }).then((res) => {
@@ -66,16 +68,9 @@ export default (props) => {
66 68
     // 用绝对路径
67 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 72
   useDidShow(() => {
78
-    setQueryParams({ ... queryParams})
73
+    setQueryParams({ ...queryParams })
79 74
   })
80 75
 
81 76
   return (
@@ -107,22 +102,22 @@ export default (props) => {
107 102
         </scroll-view>
108 103
       </view>
109 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 121
             alllist.length == 0 ?
127 122
               <NoData /> :
128 123
               <view className='waterfall'>
@@ -131,7 +126,7 @@ export default (props) => {
131 126
                 }
132 127
               </view>
133 128
           } */}
134
-        </List>
129
+      </List>
135 130
       {/* </View> */}
136 131
     </view>
137 132
   )