瀏覽代碼

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

吃个甘蔗嚼一年 3 年之前
父節點
當前提交
5ce3359845

+ 2
- 1
config/dev.js 查看文件

@@ -4,7 +4,8 @@ module.exports = {
4 4
   },
5 5
   defineConstants: {
6 6
     // HOST: '"http://192.168.89.147:8080"',
7
-    HOST: '"https://sgl-v2-test.njyunzhi.com"',
7
+    HOST: '"https://sgl-v2.njyunzhi.com"',
8
+    OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
8 9
   },
9 10
   mini: {},
10 11
   h5: {}

+ 1
- 0
config/prod.js 查看文件

@@ -4,6 +4,7 @@ module.exports = {
4 4
   },
5 5
   defineConstants: {
6 6
     HOST: '"https://sgl-v2.njyunzhi.com"',
7
+    OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
7 8
   },
8 9
   mini: {},
9 10
   h5: {

+ 19
- 56
src/pages/details/foodDetails/foodDetails.jsx 查看文件

@@ -8,7 +8,7 @@ import {
8 8
 } from "@/services/home";
9 9
 import { getVerifyTargetList } from "@/services/payOrder";
10 10
 import { useState, useEffect, useRef } from "react";
11
-import { Button, Swiper, SwiperItem } from "@tarojs/components";
11
+import { Button, Swiper, SwiperItem, View } from "@tarojs/components";
12 12
 import Star from "@/components/Star/Star.jsx";
13 13
 import NoData from '@/components/NoData'
14 14
 import Cards from "@/components/foodCards/foodCards.jsx";
@@ -20,7 +20,6 @@ import dw from "@/assets/icons/housemantj/loc-o.png";
20 20
 import phoneImg from "@/assets/icons/housemantj/phone-o.png";
21 21
 import zhuandao from "@/assets/icons/housemantj/backTop.png";
22 22
 import titlezs from "@/assets/icons/housemantj/titleTip.png";
23
-import showMore from "@/assets/icons/housemantj/setMore.png";
24 23
 import share from "@/assets/icons/housemantj/touristShare.png";
25 24
 import good from "@/assets/icons/housemantj/touristGood.png";
26 25
 import baozan from "@/assets/icons/housemantj/bgood.png";
@@ -65,29 +64,9 @@ export default withLayout((props) => {
65 64
   const [isSaved, toggleSave] = useSave(detail.isSaved, "shop", id);
66 65
   const [isLike, toggleLike] = useLike(detail.isLike, "shop", id);
67 66
 
68
-  //当前套餐总数
69
-  const [newpgNum, setNewpgNum] = useState(0);
70
-  //全部套餐个数
71
-  const [AllpgNum, setAllpgNum] = useState(0);
72
-  //套餐当前页数
73
-  const [page, setpage] = useState(2);
74
-  const pgMore = () => {
75
-    setpage(page + 1);
76
-    getShopPackage(id, { pageNum: page }).then((res) => {
77
-      setPackage([...spackage, ...res.records]);
78
-      setNewpgNum(newpgNum + res.records.length);
79
-    });
80
-  };
81 67
   //本店指南
82 68
   const [extend, setExtend] = useState([]);
83 69
 
84
-  //当前指南总数
85
-  const [newextNum, setNewextNum] = useState(0);
86
-  //全部指南个数
87
-  const [AllextNum, setAllextNum] = useState(0);
88
-  //指南当前页数
89
-  const [epage, setepage] = useState(2);
90
-
91 70
   const openMap = () => {
92 71
     Taro.openLocation({
93 72
       longitude: log.current - 0,
@@ -107,10 +86,8 @@ export default withLayout((props) => {
107 86
         title: '暂无商家联系方式',
108 87
         icon: 'none',
109 88
       })
110
-
111 89
       return;
112 90
     }
113
-
114 91
     Taro.makePhoneCall({
115 92
       phoneNumber: detail.phone
116 93
     })
@@ -128,13 +105,9 @@ export default withLayout((props) => {
128 105
       }).catch(() => setLoading(false));
129 106
       getShopPackage(id, { pageSize: 500 }).then((res) => {
130 107
         setPackage(res.records || []);
131
-        setNewpgNum(res.records.length);
132 108
       });
133
-      setAllpgNum(res.total);
134 109
       getExtendContent("shop", id, { pageSize: 500 }).then((res) => {
135 110
         setExtend(res.records || []);
136
-        setAllextNum(res.total);
137
-        setNewextNum(res.records.length);
138 111
       });
139 112
     }
140 113
   }, [id]);
@@ -164,24 +137,24 @@ export default withLayout((props) => {
164 137
           style={{ height: '100%' }}
165 138
         >
166 139
           <view className='storeDetails'>
167
-            <Swiper
168
-              className='swiper'
169
-              circular
170
-              current={index}
171
-              onChange={handchange}
172
-            >
173
-              {imglist.map((item, inx) => (
174
-                <SwiperItem key={inx}>
175
-                  <image src={item.url} mode='aspectFit' className='storeImage'>
176
-                    <view className='tpPage'>
177
-                      <text>
178
-                        {index + 1}/{imglist.length}
179
-                      </text>
180
-                    </view>
181
-                  </image>
182
-                </SwiperItem>
183
-              ))}
184
-            </Swiper>
140
+            <View className='huadong'>
141
+              <Swiper
142
+                circular
143
+                className='swiper'
144
+                onChange={handchange}
145
+              >
146
+                {imglist.map((item, inx) => (
147
+                  <SwiperItem key={inx}>
148
+                    <image src={item.url} mode='aspectFit' className='storeImage' />
149
+                  </SwiperItem>
150
+                ))}
151
+              </Swiper>
152
+              <view className='tpPage'>
153
+                <text>
154
+                  {index + 1}/{imglist.length}
155
+                </text>
156
+              </view>
157
+            </View>
185 158
             <view className='storeJs'>
186 159
               <view style={{ overflow: "hidden" }}>
187 160
                 <view className='storeName'>{detail.shopName}</view>
@@ -245,14 +218,6 @@ export default withLayout((props) => {
245 218
                   {(spackage || []).map((item) => (
246 219
                     <Cards key={item.packageId} editable='1' st={star} goshop='1' item={item} det={detail} />
247 220
                   ))}
248
-                  {/* <view
249
-                    className='showMore'
250
-                    style={{ display: newpgNum == AllpgNum ? "none" : "" }}
251
-                    onClick={pgMore}
252
-                  >
253
-                    <view>查看更多</view>
254
-                    <image src={showMore} className='moreTip' />
255
-                  </view> */}
256 221
                 </view>
257 222
                 <view
258 223
                   style={{
@@ -268,11 +233,9 @@ export default withLayout((props) => {
268 233
                   {(extend || []).map((item) => (
269 234
                     <Extend key={item.extId} item={item} />
270 235
                   ))}
271
-
272 236
                 </view>
273 237
                 <view
274 238
                   className='botton'
275
-                  style={{ display: newextNum == AllextNum ? "" : "none" }}
276 239
                 >
277 240
                   这是我的底线
278 241
                 </view>

+ 10
- 49
src/pages/details/foodDetails/foodDetails.less 查看文件

@@ -2,15 +2,16 @@
2 2
   background-color: #fff;
3 3
   border-radius: 12px;
4 4
   margin-bottom: 20px;
5
-
6
-  .swiper {
7
-    height: calc((100vw - 60px) * 0.6);
8
-  }
9
-  .storeImage {
5
+  .huadong{    
10 6
     position: relative;
11
-    border-radius: 22px;
12
-    width: 100%;
13
-    height: 100%;
7
+    .swiper {
8
+      height: calc((100vw - 60px) * 0.6);
9
+      .storeImage {
10
+        border-radius: 22px;
11
+        width: 100%;
12
+        height: 100%;
13
+      }
14
+    }
14 15
     .tpPage {
15 16
       position: absolute;
16 17
       right: 20px;
@@ -26,7 +27,7 @@
26 27
       text {
27 28
         opacity: 0.64;
28 29
       }
29
-    }
30
+    }  
30 31
   }
31 32
   .storeJs {
32 33
     padding: 20px;
@@ -117,12 +118,6 @@
117 118
 }
118 119
 .cs {
119 120
   height: 500px;
120
-  // background: rgb(240, 142, 142);
121
-  // background: radial-gradient(circle at top left, transparent 15px, rgb(240, 142, 142) 0) top left,
122
-  //           radial-gradient(circle at top right, transparent 15px, #58a 0) top right,
123
-  //           radial-gradient(circle at bottom left, transparent 15px, #58a 0) bottom left,
124
-  //           radial-gradient(circle at bottom right, transparent 15px, #58a 0) bottom right;
125
-
126 121
   background: radial-gradient(
127 122
         circle at 82% top,
128 123
         transparent 15px,
@@ -135,43 +130,9 @@
135 130
         rgb(230, 120, 120) 0
136 131
       )
137 132
       bottom;
138
-
139 133
   background-repeat: no-repeat;
140 134
   background-size: auto 50%;
141 135
 }
142
-
143
-.showMore {
144
-  width: 100%;
145
-  background: linear-gradient(
146
-    0deg,
147
-    rgba(248, 248, 248, 0.58) 42%,
148
-    rgba(248, 248, 248, 0) 100%
149
-  );
150
-  font-size: 28px;
151
-  font-weight: bold;
152
-  color: #202020;
153
-  text-align: center;
154
-  position: absolute;
155
-  bottom: -140px;
156
-  padding-top: 77px;
157
-  padding-bottom: 20px;
158
-  .moreTip {
159
-    width: 38px;
160
-    height: 19px;
161
-    margin-top: 14px;
162
-  }
163
-}
164
-.storezn {
165
-  font-size: 28px;
166
-  color: #202020;
167
-  line-height: 64px;
168
-  margin-bottom: 44px;
169
-}
170
-.storezn + image {
171
-  width: 100%;
172
-  margin-bottom: 40px;
173
-}
174
-
175 136
 .botton {
176 137
   font-size: 28px;
177 138
   color: #c0c8d3;

+ 14
- 29
src/pages/details/mjDetails/sceneryDetails.jsx 查看文件

@@ -14,7 +14,7 @@ import SpinBox from "@/components/Spin/SpinBox";
14 14
 import TabIcon from '@/components/HorTabbar/TabIcon'
15 15
 import { useState, useEffect } from 'react'
16 16
 import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
17
-import { Swiper, SwiperItem, Button } from '@tarojs/components';
17
+import { Swiper, SwiperItem, Button,View } from '@tarojs/components';
18 18
 import useSave from "@/utils/hooks/useSave"
19 19
 import useLike from "@/utils/hooks/useLike"
20 20
 import Cards from '@/components/foodCards/foodCards.jsx'
@@ -39,20 +39,6 @@ export default withLayout((props) => {
39 39
 
40 40
   //本店指南
41 41
   const [extend, setExtend] = useState([])
42
-  //当前指南总数
43
-  const [newextNum, setNewextNum] = useState(0)
44
-  //全部指南个数
45
-  const [AllextNum, setAllextNum] = useState(0)
46
-  //指南当前页数
47
-  const [epage, setepage] = useState(2)
48
-  const extendMore = () => {
49
-    setepage(epage + 1)
50
-    getExtendContent('tourist', id, { pageNum: epage }).then((res) => {
51
-      setExtend([...extend, ...res.records])
52
-      setNewextNum(newextNum + res.records.length)
53
-      setLoading(false)
54
-    })
55
-  }
56 42
 
57 43
   // 推荐套餐列表
58 44
   const [recommend, setRecommend] = useState([])
@@ -81,8 +67,6 @@ export default withLayout((props) => {
81 67
       })
82 68
       getExtendContent('tourist', id, { pageSize: 500 }).then((res) => {
83 69
         setExtend(res.records || [])
84
-        setAllextNum(res.total)
85
-        setNewextNum(res.records.length)
86 70
         setLoading(false)
87 71
 
88 72
       })
@@ -113,24 +97,25 @@ export default withLayout((props) => {
113 97
       <SpinBox loading={loading} style={{ overflow: 'hidden', padding: '0 30rpx', height: '100%', background: '#F8F8F8' }}>
114 98
         <scroll-view scrollY style={{ height: '100%' }}>
115 99
           <view className='storeDetails'>
100
+          <View className='huadong'>
116 101
             <Swiper
117 102
               className='swiper'
118 103
               circular
119
-              current={index}
120 104
               onChange={handchange}
121 105
             >
122 106
               {
123
-                imglist.map((item) =>
107
+                imglist.map((item) =>(
124 108
                   <SwiperItem>
125
-                    <image src={item.url} mode='aspectFit' className='storeImage' >
126
-                      <view className='tpPage'>
127
-                        <text>{index + 1}/{imglist.length}</text>
128
-                      </view>
129
-                    </image>
130
-                  </SwiperItem>
131
-                )
132
-              }
133
-            </Swiper>
109
+                    <image src={item.url} mode='aspectFit' className='storeImage' />
110
+                    </SwiperItem>
111
+                ))}
112
+              </Swiper>
113
+              <view className='tpPage'>
114
+                <text>
115
+                  {index + 1}/{imglist.length}
116
+                </text>
117
+              </view>
118
+            </View>
134 119
 
135 120
             <view className='storeJs'>
136 121
               <view className='introduce'>
@@ -167,7 +152,7 @@ export default withLayout((props) => {
167 152
             </view>
168 153
             {(recommend || []).map((item) => <Cards item={item} det={item} st={parseFloat(item.score.toFixed(1))} />)}
169 154
           </view>
170
-          <view className='bottom'>这是我的底线</view>
155
+          <view className='botton'>这是我的底线</view>
171 156
         </scroll-view>
172 157
       </SpinBox>
173 158
 

+ 11
- 30
src/pages/details/mjDetails/sceneryDetails.less 查看文件

@@ -2,14 +2,16 @@
2 2
   background-color: #fff;
3 3
   border-radius: 12px;
4 4
   margin-bottom: 20px;
5
-  .swiper {
6
-    height: calc((100vw - 60px) * 0.6);
7
-  }
8
-  .storeImage {
5
+  .huadong{    
9 6
     position: relative;
10
-    border-radius: 22px;
11
-    width: 100%;
12
-    height: 100%;
7
+    .swiper {
8
+      height: calc((100vw - 60px) * 0.6);
9
+      .storeImage {
10
+        border-radius: 22px;
11
+        width: 100%;
12
+        height: 100%;
13
+      }
14
+    }
13 15
     .tpPage {
14 16
       position: absolute;
15 17
       right: 20px;
@@ -25,7 +27,7 @@
25 27
       text {
26 28
         opacity: 0.64;
27 29
       }
28
-    }
30
+    }  
29 31
   }
30 32
   .storeJs {
31 33
     padding: 22px;
@@ -118,29 +120,8 @@
118 120
     margin-right: 10px;
119 121
   }
120 122
 }
121
-.showMore {
122
-  width: 100%;
123
-  background: linear-gradient(
124
-    0deg,
125
-    rgba(248, 248, 248, 0.58) 42%,
126
-    rgba(248, 248, 248, 0) 100%
127
-  );
128
-  font-size: 28px;
129
-  font-weight: bold;
130
-  color: #202020;
131
-  text-align: center;
132
-  position: absolute;
133
-  bottom: -130px;
134
-  padding-top: 77px;
135
-  padding-bottom: 20px;
136
-  .moreTip {
137
-    width: 38px;
138
-    height: 19px;
139
-    margin-top: 14px;
140
-  }
141
-}
142 123
 
143
-.bottom {
124
+.botton {
144 125
   font-size: 28px;
145 126
   color: #c0c8d3;
146 127
   line-height: 34px;

+ 2
- 1
src/pages/index/components/Card/index.jsx 查看文件

@@ -2,6 +2,7 @@
2 2
 import { useMemo } from 'react'
3 3
 import Taro from '@tarojs/taro'
4 4
 import useSave from "@/utils/hooks/useSave"
5
+import { compressImage } from '@/utils'
5 6
 import msTip from '@/assets/icons/housemantj/foodtip.png'
6 7
 import mjTip from '@/assets/icons/housemantj/mjtip.png'
7 8
 import location from '@/assets/icons/housemantj/location.png'
@@ -39,7 +40,7 @@ export default (props) => {
39 40
     <view className={uqClass} style={{ overflow: 'hidden' }}>
40 41
       <view className='contentCard' style={style}>
41 42
         <view className='cardTop'>
42
-          <image mode='widthFix' onClick={Detail} src={item.poster} className='cCardimg' onLoad={handleLoad} />
43
+          <image mode='widthFix' onClick={Detail} src={compressImage(item.poster)} className='cCardimg' onLoad={handleLoad} />
43 44
           <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} />
44 45
           <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
45 46
         </view>

+ 0
- 1
src/pages/index/tabs/Guide.jsx 查看文件

@@ -12,7 +12,6 @@ import { getRecommendList, getExtendContent } from '@/services/home'
12 12
 import sleep from '@/assets/icons/GuideCheck/sleep_logo.png'
13 13
 import { getTaRoom, goToRoomForm } from '@/services/taRoom​'
14 14
 import useTrackClick from '@/utils/hooks/useTrackClick'
15
-import showMore from '@/assets/icons/housemantj/setMore.png'
16 15
 import { useModel } from "@/store";
17 16
 import './GuideCss/style.less'
18 17
 

+ 3
- 0
src/pages/index/tabs/Recommend.jsx 查看文件

@@ -70,6 +70,9 @@ export default (props) => {
70 70
     Taro.navigateTo({ url: '/pages/search/search' });
71 71
   }
72 72
 
73
+  useDidShow(() => {
74
+    setQueryParams({ ...queryParams })
75
+  })
73 76
 
74 77
   return (
75 78
     // <view style={{ height: '100%', overflow: 'hidden',display:'flex',flexDirection:'column' }}>

+ 19
- 0
src/utils/index.js 查看文件

@@ -44,3 +44,22 @@ export function getQueryString(params) {
44 44
 
45 45
   return arr.filter(Boolean).join('&')
46 46
 }
47
+
48
+/**
49
+ * 压缩图片
50
+ * @param {*} url 
51
+ * @returns 
52
+ */
53
+export function compressImage(url) {
54
+  if (!url) return url;
55
+
56
+  // GIF 不压缩
57
+  if (url.indexOf('.gif') > -1) return url;
58
+
59
+  // eslint-disable-next-line no-undef
60
+  if (url.indexOf(OSS) > -1) {
61
+    return `${url}?x-oss-process=style/cmp80`
62
+  }
63
+
64
+  return url;
65
+}