李志伟 3 years ago
parent
commit
e9b3e964ba

+ 57
- 50
src/pages/details/foodDetails/foodDetails.jsx View File

@@ -10,6 +10,7 @@ import { getVerifyTargetList } from "@/services/payOrder";
10 10
 import { useState, useEffect, useRef } from "react";
11 11
 import { Button, Swiper, SwiperItem } from "@tarojs/components";
12 12
 import Star from "@/components/Star/Star.jsx";
13
+import NoData from '@/components/NoData'
13 14
 import Cards from "@/components/foodCards/foodCards.jsx";
14 15
 import ax from "@/assets/icons/housemantj/onlove.png";
15 16
 import yysj from "@/assets/icons/housemantj/营业时间.png";
@@ -219,56 +220,62 @@ export default withLayout((props) => {
219 220
               </view>
220 221
             </view>
221 222
           </view>
222
-          <view
223
-            style={{
224
-              position: "relative",
225
-              display: spackage == "" ? "none" : "",
226
-            }}
227
-          >
228
-            <view className="title">
229
-              <image src={titlezs} />
230
-              <text>返现套餐</text>
231
-            </view>
232
-            {(spackage || []).map((item) => (
233
-              <Cards key={item.packageId} st={star} item={item} det={detail} />
234
-            ))}
235
-            <view
236
-              className="showMore"
237
-              style={{ display: newpgNum == AllpgNum ? "none" : "" }}
238
-              onClick={pgMore}
239
-            >
240
-              <view>查看更多</view>
241
-              <image src={showMore} className="moreTip" />
242
-            </view>
243
-          </view>
244
-          <view
245
-            style={{
246
-              position: "relative",
247
-              display: extend == "" ? "none" : "",
248
-            }}
249
-          >
250
-            <view className="title">
251
-              <image src={titlezs} />
252
-              <text>本店指南</text>
253
-            </view>
254
-            {(extend || []).map((item) => (
255
-              <Extend key={item.extId} item={item} />
256
-            ))}
257
-            <view
258
-              className="showMore"
259
-              style={{ display: newextNum == AllextNum ? "none" : "" }}
260
-              onClick={extendMore}
261
-            >
262
-              <view>查看更多</view>
263
-              <image src={showMore} className="moreTip" />
264
-            </view>
265
-          </view>
266
-          <view
267
-            className="botton"
268
-            style={{ display: newextNum == AllextNum ? "" : "none" }}
269
-          >
270
-            已经到底了~
271
-          </view>
223
+          {
224
+            spackage == '' && extend == "" ?
225
+              <NoData /> :
226
+              <>
227
+                <view
228
+                  style={{
229
+                    position: "relative",
230
+                    display: spackage == "" ? "none" : "",
231
+                  }}
232
+                >
233
+                  <view className="title">
234
+                    <image src={titlezs} />
235
+                    <text>返现套餐</text>
236
+                  </view>
237
+                  {(spackage || []).map((item) => (
238
+                    <Cards key={item.packageId} st={star} item={item} det={detail} />
239
+                  ))}
240
+                  <view
241
+                    className="showMore"
242
+                    style={{ display: newpgNum == AllpgNum ? "none" : "" }}
243
+                    onClick={pgMore}
244
+                  >
245
+                    <view>查看更多</view>
246
+                    <image src={showMore} className="moreTip" />
247
+                  </view>
248
+                </view>
249
+                <view
250
+                  style={{
251
+                    position: "relative",
252
+                    display: extend == "" ? "none" : "",
253
+                  }}
254
+                >
255
+                  <view className="title">
256
+                    <image src={titlezs} />
257
+                    <text>本店指南</text>
258
+                  </view>
259
+                  {(extend || []).map((item) => (
260
+                    <Extend key={item.extId} item={item} />
261
+                  ))}
262
+                  <view
263
+                    className="showMore"
264
+                    style={{ display: newextNum == AllextNum ? "none" : "" }}
265
+                    onClick={extendMore}
266
+                  >
267
+                    <view>查看更多</view>
268
+                    <image src={showMore} className="moreTip" />
269
+                  </view>
270
+                </view>
271
+                <view
272
+                  className="botton"
273
+                  style={{ display: newextNum == AllextNum ? "" : "none" }}
274
+                >
275
+                  已经到底了~
276
+                </view>
277
+              </>
278
+          }
272 279
         </scroll-view>
273 280
       </view>
274 281
       <view className="bottomTab">

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

@@ -10,7 +10,7 @@ import baozan from '@/assets/icons/housemantj/爆赞.png'
10 10
 import weibaozan from '@/assets/icons/housemantj/未赞.png'
11 11
 import zhuandao from "@/assets/icons/housemantj/backTop.png";
12 12
 import withLayout from '@/layouts'
13
-import { useState, useEffect, useRef } from 'react'
13
+import { useState, useEffect} from 'react'
14 14
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
15 15
 import { Swiper, SwiperItem, Button } from '@tarojs/components';
16 16
 import useSave from "@/utils/hooks/useSave"

+ 0
- 1
src/pages/index/tabs/Recommend.jsx View File

@@ -24,7 +24,6 @@ export default (props) => {
24 24
   const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
25 25
   //切换上面的标签
26 26
   const handleTabChange = (e) => {
27
-    // Taro.pageScrollTo({ scrollTop: 0 })为什么不能置顶
28 27
     const { index } = e.detail
29 28
     setActiveTab(index)
30 29
     const tab = tabs[index].typeId