吃个甘蔗嚼一年 3 年之前
父節點
當前提交
72146c9a73
共有 2 個文件被更改,包括 18 次插入3 次删除
  1. 1
    1
      src/hotel/components/shareCard/shareCard.jsx
  2. 17
    2
      src/pages/details/mjDetails/sceneryDetails.jsx

+ 1
- 1
src/hotel/components/shareCard/shareCard.jsx 查看文件

12
 
12
 
13
   return (
13
   return (
14
     <View className='c1'>
14
     <View className='c1'>
15
-      <Popup show={showCutover} onClose={onClose}>
15
+      <Popup show={showCutover} onClose={onClose} maskClosable={showCutover}>
16
         <View className='card2'>
16
         <View className='card2'>
17
           <View className='text'>分享到微信</View>
17
           <View className='text'>分享到微信</View>
18
           <View className='share'>去分享<Button openType='share' className='btn'>去分享</Button></View>
18
           <View className='share'>去分享<Button openType='share' className='btn'>去分享</Button></View>

+ 17
- 2
src/pages/details/mjDetails/sceneryDetails.jsx 查看文件

10
 import weibaozan from '@/assets/icons/housemantj/unLike.png'
10
 import weibaozan from '@/assets/icons/housemantj/unLike.png'
11
 import zhuandao from "@/assets/icons/housemantj/backTop.png";
11
 import zhuandao from "@/assets/icons/housemantj/backTop.png";
12
 import withLayout from '@/layouts'
12
 import withLayout from '@/layouts'
13
+import SpinBox from "@/components/Spin/SpinBox";
13
 import { useState, useEffect } from 'react'
14
 import { useState, useEffect } from 'react'
14
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
15
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
15
 import { Swiper, SwiperItem, Button } from '@tarojs/components';
16
 import { Swiper, SwiperItem, Button } from '@tarojs/components';
26
   const [detail, setDetail] = useState({})
27
   const [detail, setDetail] = useState({})
27
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
28
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
28
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
29
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
30
+  const [loading, setLoading] = useState(false)
31
+
29
   //banner图集数组
32
   //banner图集数组
30
   const [imglist, setimglist] = useState([])
33
   const [imglist, setimglist] = useState([])
31
   const [index, setIndex] = useState(0)
34
   const [index, setIndex] = useState(0)
42
   //指南当前页数
45
   //指南当前页数
43
   const [epage, setepage] = useState(2)
46
   const [epage, setepage] = useState(2)
44
   const extendMore = () => {
47
   const extendMore = () => {
48
+    setLoading(true)
45
     setepage(epage + 1)
49
     setepage(epage + 1)
46
     getExtendContent('tourist', id, { pageNum: epage }).then((res) => {
50
     getExtendContent('tourist', id, { pageNum: epage }).then((res) => {
47
       setExtend([...extend, ...res.records])
51
       setExtend([...extend, ...res.records])
48
       setNewextNum(newextNum + res.records.length)
52
       setNewextNum(newextNum + res.records.length)
53
+      setLoading(false)
54
+    }).catch(e => {
55
+      setLoading(false)
56
+
49
     })
57
     })
50
   }
58
   }
51
 
59
 
66
 
74
 
67
   useEffect(() => {
75
   useEffect(() => {
68
     if (id) {
76
     if (id) {
77
+      setLoading(true)
69
       getTouristDetail(id, { location }).then((res) => {
78
       getTouristDetail(id, { location }).then((res) => {
70
         setDetail(res)
79
         setDetail(res)
71
         setimglist(res.imageList || [])
80
         setimglist(res.imageList || [])
77
         setExtend(res.records || [])
86
         setExtend(res.records || [])
78
         setAllextNum(res.total)
87
         setAllextNum(res.total)
79
         setNewextNum(res.records.length)
88
         setNewextNum(res.records.length)
89
+        setLoading(false)
90
+
80
       })
91
       })
81
     } else {
92
     } else {
82
       getRecommendList({ location }).then((res2) => {
93
       getRecommendList({ location }).then((res2) => {
83
         setRecommend(res2 || [])
94
         setRecommend(res2 || [])
95
+        setLoading(false)
96
+      }).catch(e => {
97
+        setLoading(false)
84
       })
98
       })
85
     }
99
     }
86
   }, [id, location])
100
   }, [id, location])
98
       <view className='index-navbar'>
112
       <view className='index-navbar'>
99
         <CustomNav title='十公里' />
113
         <CustomNav title='十公里' />
100
       </view>
114
       </view>
101
-      <view style={{ overflow: 'hidden', padding: '0 30rpx', height: '100%', background: '#F8F8F8' }}>
115
+
116
+      <SpinBox loading={loading} style={{ overflow: 'hidden', padding: '0 30rpx', height: '100%', background: '#F8F8F8' }}>
102
         <scroll-view scrollY style={{ height: '100%' }}>
117
         <scroll-view scrollY style={{ height: '100%' }}>
103
           <view className='storeDetails'>
118
           <view className='storeDetails'>
104
             <Swiper
119
             <Swiper
160
           </view>
175
           </view>
161
           <view className='bottom'>这是我的底线</view>
176
           <view className='bottom'>这是我的底线</view>
162
         </scroll-view>
177
         </scroll-view>
163
-      </view>
178
+      </SpinBox>
164
       <view className='bottomTab'>
179
       <view className='bottomTab'>
165
         <Button openType='share' className='sharebtn'>分享</Button>
180
         <Button openType='share' className='sharebtn'>分享</Button>
166
         <view className='tab'>
181
         <view className='tab'>