|
@@ -29,6 +29,7 @@ import "./foodDetails.less";
|
29
|
29
|
export default withLayout((props) => {
|
30
|
30
|
const { router, person } = props;
|
31
|
31
|
const { id, subOrderId, scene } = props.router.params;
|
|
32
|
+
|
32
|
33
|
useEffect(() => {
|
33
|
34
|
if (id && subOrderId) {
|
34
|
35
|
Taro.navigateTo({
|
|
@@ -109,24 +110,27 @@ export default withLayout((props) => {
|
109
|
110
|
const lat = useRef("");
|
110
|
111
|
|
111
|
112
|
useEffect(() => {
|
112
|
|
- getShopDetail(id).then((res) => {
|
113
|
|
- console.log(res)
|
114
|
|
- setDetail(res);
|
115
|
|
- log.current = res.locaton.toString().split(",")[0];
|
116
|
|
- lat.current = res.locaton.toString().split(",")[1];
|
117
|
|
- setimglist(res.imageList || []);
|
118
|
|
- });
|
119
|
|
- getShopPackage(id).then((res) => {
|
120
|
|
- setPackage(res.records || []);
|
121
|
|
- setNewpgNum(res.records.length);
|
122
|
|
- setAllpgNum(res.total);
|
123
|
|
- });
|
124
|
|
- getExtendContent("shop", id).then((res) => {
|
125
|
|
- setExtend(res.records || []);
|
126
|
|
- setAllextNum(res.total);
|
127
|
|
- setNewextNum(res.records.length);
|
128
|
|
- });
|
129
|
|
- }, []);
|
|
113
|
+ if (id) {
|
|
114
|
+ getShopDetail(id).then((res) => {
|
|
115
|
+ console.log(res)
|
|
116
|
+ setDetail(res);
|
|
117
|
+ log.current = res.locaton.toString().split(",")[0];
|
|
118
|
+ lat.current = res.locaton.toString().split(",")[1];
|
|
119
|
+ setimglist(res.imageList || []);
|
|
120
|
+ });
|
|
121
|
+ getShopPackage(id).then((res) => {
|
|
122
|
+ setPackage(res.records || []);
|
|
123
|
+ setNewpgNum(res.records.length);
|
|
124
|
+ setAllpgNum(res.total);
|
|
125
|
+ });
|
|
126
|
+ getExtendContent("shop", id).then((res) => {
|
|
127
|
+ setExtend(res.records || []);
|
|
128
|
+ setAllextNum(res.total);
|
|
129
|
+ setNewextNum(res.records.length);
|
|
130
|
+ });
|
|
131
|
+ }
|
|
132
|
+ }, [id]);
|
|
133
|
+
|
130
|
134
|
const star = parseFloat(
|
131
|
135
|
(
|
132
|
136
|
(detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1)
|