吃个甘蔗嚼一年 3 lat temu
rodzic
commit
27e8124e1d

+ 17
- 5
src/pages/TobeShop/index.jsx Wyświetl plik

@@ -1,8 +1,9 @@
1
+import Taro from "@tarojs/taro";
2
+import { useState, useEffect } from "react";
1 3
 import withLayout from "@/layouts";
2
-
3 4
 import CustomNav from "@/components/CustomNav";
5
+import { getShopDetail, getShopPackage, getExtendContent } from '@/services/home'
4 6
 import Popup from "@/components/Popup";
5
-import { useState, useEffect } from "react";
6 7
 import LocationBig from "@/assets/icons/UserCenter/LocationBig.png";
7 8
 import Perfection from "@/assets/icons/UserCenter/Perfection.png";
8 9
 import Check_OK from "@/assets/icons/UserCenter/Check_OK.png";
@@ -14,21 +15,31 @@ import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
14 15
 import { Button, Icon, Text, Textarea } from "@tarojs/components";
15 16
 import { getVerifyTargetList, putVerifyTarget } from "@/services/payOrder";
16 17
 import formatTime from '@/utils/formatTime'
18
+
17 19
 import "./style.less";
18
-import Taro from "@tarojs/taro";
19 20
 
20 21
 export default withLayout((props) => {
21 22
   const { router, person } = props;
23
+  console.log("🚀 ~ file: index.jsx ~ line 22 ~ withLayout ~ props", props)
22 24
   const { id, subOrderId } = props.router.params;
23 25
   const [showDialog, setShowDialog] = useState(false);
24 26
   //核销
25 27
   const [Consumption, setConsumption] = useState(false);
26 28
 
27 29
   const [checked, setChecked] = useState();
30
+  const [shopContent, setShopContent] = useState([])
28 31
 
32
+  const [list, setList] = useState([]);
33
+
34
+
35
+  const getShop = () => {
36
+    getShopDetail(id).then(e => {
37
+      setShopContent(e)
38
+
39
+    })
40
+  }
29 41
 
30 42
 
31
-  const [list, setList] = useState([]);
32 43
 
33 44
   const getList = (params) => {
34 45
     getVerifyTargetList({
@@ -51,6 +62,7 @@ export default withLayout((props) => {
51 62
 
52 63
   useEffect(() => {
53 64
     getList();
65
+    getShop();
54 66
   }, []);
55 67
 
56 68
   const ShowMoldeOn = () => {
@@ -123,7 +135,7 @@ export default withLayout((props) => {
123 135
         <view className="position-header">
124 136
           <image className="position-LocationBig" src={LocationBig} />
125 137
           <text cla="position-LocationBig-text">
126
-            当前所在店铺:SEOUL·创意韩国料理
138
+            当前所在店铺:{shopContent?.shopName || []}
127 139
           </text>
128 140
         </view>
129 141
         <view className="shop-image">

+ 4
- 3
src/pages/TobeShop/style.less Wyświetl plik

@@ -89,7 +89,6 @@
89 89
       position: absolute;
90 90
       width: auto;
91 91
       height: 44.3px;
92
-      position: absolute;
93 92
       left: 200px;
94 93
       top: 28px;
95 94
       font-size: 20px;
@@ -109,6 +108,7 @@
109 108
 
110 109
     .left-complete-one {
111 110
       // padding-left: 64px;
111
+      width: 560px;
112 112
       padding-top: 87px;
113 113
       padding-bottom: 43px;
114 114
       position: relative;
@@ -141,7 +141,7 @@
141 141
         width: 145px;
142 142
         height: 44px;
143 143
         position: absolute;
144
-        margin-left: 75px;
144
+        margin-left: 88px;
145 145
         top: 22px;
146 146
       }
147 147
       .left-viewText {
@@ -162,6 +162,7 @@
162 162
         border-radius: 24px;
163 163
         overflow: hidden;
164 164
         position: relative;
165
+        flex: none;
165 166
         .image-1 {
166 167
           width: 100%;
167 168
           height: 145px;
@@ -260,7 +261,7 @@
260 261
     background-repeat: no-repeat;
261 262
     width: 129px;
262 263
     border-radius: 0 15px 15px 0;
263
-    position: relative;
264
+    // position: relative;
264 265
     //右面部分
265 266
     .right-content {
266 267
       // width: 100px;

+ 11
- 10
src/pages/details/foodDetails/foodDetails.jsx Wyświetl plik

@@ -15,7 +15,7 @@ import share from '@/assets/icons/housemantj/景点分享.png'
15 15
 import good from '@/assets/icons/housemantj/景点爆赞.png'
16 16
 import baozan from '@/assets/icons/housemantj/爆赞.png'
17 17
 import weibaozan from '@/assets/icons/housemantj/未赞.png'
18
-import Taro,{ useShareAppMessage } from '@tarojs/taro'
18
+import Taro, { useShareAppMessage } from '@tarojs/taro'
19 19
 import useSave from "@/utils/hooks/useSave"
20 20
 import useLike from "@/utils/hooks/useLike"
21 21
 import Extend from '../components/Extend/extend'
@@ -35,7 +35,6 @@ export default withLayout((props) => {
35 35
   }, [id, subOrderId])
36 36
   //商铺基础信息
37 37
   const [detail, setDetail] = useState({})
38
-  console.log("🚀 ~ file: foodDetails.jsx ~ line 38 ~ withLayout ~ setDetail", setDetail)
39 38
   //商铺套餐
40 39
   const [spackage, setPackage] = useState([])
41 40
   //banner图集数组
@@ -45,6 +44,8 @@ export default withLayout((props) => {
45 44
     setIndex(e.detail.current)
46 45
   }
47 46
 
47
+
48
+
48 49
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'shop', id)
49 50
   const [isLike, toggleLike] = useLike(detail.isLike, 'shop', id)
50 51
 
@@ -108,15 +109,15 @@ export default withLayout((props) => {
108 109
     })
109 110
   }, [])
110 111
   const star = parseFloat(((detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1));
111
-  
112
+
112 113
   // 分享
113
-  useShareAppMessage(()=>{
114
-      return {
115
-        title: detail.shopName,
116
-        path: `/pages/details/foodDetails/foodDetails?id=${id}`,
117
-        imageUrl: detail.poster,
118
-      }
119
-    
114
+  useShareAppMessage(() => {
115
+    return {
116
+      title: detail.shopName,
117
+      path: `/pages/details/foodDetails/foodDetails?id=${id}`,
118
+      imageUrl: detail.poster,
119
+    }
120
+
120 121
   })
121 122
 
122 123
   return (