吃个甘蔗嚼一年 3 anos atrás
pai
commit
ba2c53118e

+ 0
- 1
package.json Ver arquivo

@@ -42,7 +42,6 @@
42 42
     "@tarojs/runtime": "3.3.2",
43 43
     "@tarojs/taro": "3.3.2",
44 44
     "@zjxpcyc/react-tiny-store": "^1.0.0",
45
-    "moment": "^2.29.1",
46 45
     "react": "^17.0.0",
47 46
     "react-dom": "^17.0.0"
48 47
   },

+ 70
- 0
src/components/BossCard/index.jsx Ver arquivo

@@ -0,0 +1,70 @@
1
+import withLayout from '@/layouts'
2
+import useSave from "@/utils/hooks/useSave"
3
+import image from '@/assets/icons/ProCard/8kb.jpg'
4
+import AuthPage from '@/components/AuthPage'
5
+import moment from 'moment'
6
+import { useState, useEffect } from 'react'
7
+import { Button, Radio, Input } from '@tarojs/components'
8
+import food from '@/assets/icons/ProCard/food.png'
9
+import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
10
+import OrderMolded from '@/components/OrderMolded'
11
+import Popup from '@/components/Popup'
12
+
13
+
14
+
15
+import './style.less'
16
+
17
+export default (props) => {
18
+  const { } = props
19
+
20
+  return (
21
+
22
+    <view class='container'>
23
+      <view class='wrapper'>
24
+        <view class='left-complete-one'>
25
+          <image className='left-image-1' src={ProCard_hot}></image>
26
+          <view className='left-viewText'>
27
+            返现¥16.00
28
+          </view>
29
+          {/* 评分 */}
30
+          <view className='card-box-star'>
31
+            {
32
+              scoreList.map((_, index) => {
33
+                const src = (index + '0.1') < score ? starOn : starOff
34
+                return (
35
+                  <image className='card-star-image' key={index} src={src} />
36
+                )
37
+              })
38
+            }
39
+            <text className='card-star-text' >{score}</text>
40
+          </view>
41
+          <view className='title-image'>
42
+            <image className='image-1' mode='scaleToFill' src={image}></image>
43
+            <image className='image-2' src={food}></image>
44
+          </view>
45
+          <view className='title-content'>
46
+            <view className='Pro-title'>
47
+              <view className='title-text'>【橘里橘啊换行啊啊啊气咖啡店】新鲜出炉啦!</view>
48
+            </view>
49
+            <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
50
+            <view className='title-position-on'>
51
+              <image className='title-position' src={position} />
52
+              <text className='title-position-image'>南京市/秦淮区</text>
53
+              <image className='title-on' src={imageSrc} />
54
+              <text onClick={() => AddCollect()} className='title-on-text'>{value}</text>
55
+            </view>
56
+          </view>
57
+        </view>
58
+        <view class='right-complete-two'>
59
+          <view className='right-content'>
60
+            {/* <view className='right-number'>×1</view> */}
61
+            <image className='right-image' src={Pay} />
62
+            <view className='right-title'>支付</view>
63
+          </view>
64
+        </view>
65
+      </view>
66
+    </view>
67
+
68
+
69
+  )
70
+}

+ 299
- 0
src/components/BossCard/style.less Ver arquivo

@@ -0,0 +1,299 @@
1
+@whiteColor: #fff;
2
+@Image-ProCard_hot: "../../assets/icons/ProCard/ProCard_hot.png";
3
+.container {
4
+  width: 100%;
5
+  .item-center-Number {
6
+    width: 100%;
7
+    margin-top: 30px;
8
+    .buy-num-minus {
9
+      display: inline-block;
10
+      width: 60px;
11
+      height: 60px;
12
+      background: #ffffff;
13
+      border: 1px solid #999999;
14
+      border-radius: 8px 0px 0px 8px;
15
+    }
16
+    .buy-num-input {
17
+      display: inline-block;
18
+      width: 90px;
19
+      height: 60px;
20
+      font-size: 28px;
21
+      font-weight: 400;
22
+      color: #202020;
23
+      background: #ffffff;
24
+      border: 1px solid #999999;
25
+      position: relative;
26
+      top: 26px;
27
+    }
28
+    .buy-num-add {
29
+      display: inline-block;
30
+
31
+      width: 60px;
32
+      height: 60px;
33
+      background: #ffffff;
34
+      border: 1px solid #999999;
35
+      border-radius: 0px 8px 8px 0px;
36
+    }
37
+  }
38
+  .buy-button-box {
39
+    width: 100%;
40
+    margin: 40px 0 0 0;
41
+
42
+    .button-Cancel {
43
+      display: inline-block;
44
+      width: 236px;
45
+      height: 78px;
46
+      border: 2px solid #274291;
47
+      font-size: 30px;
48
+      font-weight: bold;
49
+      color: #274291;
50
+      border-radius: 12px;
51
+      margin-right: 80px;
52
+    }
53
+    .button-OK {
54
+      display: inline-block;
55
+
56
+      width: 236px;
57
+      height: 78px;
58
+      background: #274291;
59
+      border-radius: 12px;
60
+      font-size: 30px;
61
+      font-weight: bold;
62
+      color: #ffffff;
63
+    }
64
+  }
65
+  .wrapper {
66
+    display: flex;
67
+    position: relative;
68
+    // margin-top: 600px;
69
+    margin: 30px auto;
70
+    width: 700px;
71
+
72
+    // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
73
+    // filter: drop-shadow(5px 8px 6px rgb(202, 202, 202));
74
+    filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
75
+
76
+    .left-complete-one {
77
+      padding-top: 87px;
78
+      padding-bottom: 43px;
79
+      position: relative;
80
+      display: flex;
81
+      background: @whiteColor;
82
+      background: radial-gradient(
83
+            circle at top right,
84
+            transparent 15px,
85
+            @whiteColor 0
86
+          )
87
+          top right,
88
+        radial-gradient(circle at bottom right, transparent 15px, @whiteColor 0)
89
+          bottom right;
90
+      background-size: 100% 60%;
91
+      background-repeat: no-repeat;
92
+
93
+      width: 573px;
94
+      border-radius: 15px 0px 0px 15px;
95
+      // border-radius: 12px;
96
+
97
+      align-items: center;
98
+      .left-image-1 {
99
+        width: 145px;
100
+        height: 44px;
101
+        position: absolute;
102
+        top: 22px;
103
+      }
104
+      .left-viewText {
105
+        // background-image: url(@Image-ProCard_hot);
106
+        // width: 287px;
107
+        width: auto;
108
+        height: 44.3px;
109
+        position: absolute;
110
+        left: 1px;
111
+        top: 28px;
112
+        font-size: 24px;
113
+        color: @whiteColor;
114
+        font-weight: 600;
115
+      }
116
+      //图片
117
+      .title-image {
118
+        width: 145px;
119
+        margin-left: 20px;
120
+        border-radius: 24px;
121
+        overflow: hidden;
122
+        position: relative;
123
+        .image-1 {
124
+          width: 100%;
125
+          height: 145px;
126
+        }
127
+        .image-2 {
128
+          width: 89px;
129
+          height: 34px;
130
+          position: absolute;
131
+          left: 0;
132
+          top: 0;
133
+        }
134
+      }
135
+      // 商品标题
136
+      .title-content {
137
+        // padding: 84px 0 56px 20px;
138
+        padding-left: 18px;
139
+
140
+        .Pro-title {
141
+          .title-text {
142
+            width: 375px;
143
+            overflow: hidden;
144
+            text-overflow: ellipsis;
145
+            display: -webkit-box; //必须要
146
+            -webkit-line-clamp: 1;
147
+            -webkit-box-orient: vertical;
148
+            word-break: break-all; /* 多出文本省略号代替 */
149
+            text-align: left;
150
+            font-size: 24px;
151
+            padding-bottom: 10px;
152
+          }
153
+        }
154
+        .title-money {
155
+          padding-top: 34px;
156
+          font-size: 24px;
157
+          // color: red;
158
+          font-weight: 800;
159
+        }
160
+        .title-money-2 {
161
+          font-size: 18px;
162
+          color: #666;
163
+          padding-left: 10px;
164
+          text-decoration: line-through;
165
+        }
166
+
167
+        .title-time {
168
+          font-size: 24px;
169
+          padding-top: 20px;
170
+          color: #c0c8d3;
171
+        }
172
+      }
173
+    }
174
+  }
175
+
176
+  .right-complete-two {
177
+    background: @whiteColor;
178
+    background: radial-gradient(
179
+          circle at top left,
180
+          transparent 15px,
181
+          @whiteColor 0
182
+        )
183
+        top left,
184
+      radial-gradient(circle at bottom left, transparent 15px, @whiteColor 0)
185
+        bottom left;
186
+    background-size: 100% 60%;
187
+    background-repeat: no-repeat;
188
+    width: 129px;
189
+    border-radius: 0 15px 15px 0;
190
+    position: relative;
191
+    //右面部分
192
+    .right-content {
193
+      // width: 100px;
194
+      // height: 80px;
195
+      position: absolute;
196
+      top: 50%;
197
+      left: 50%;
198
+      transform: translate(-50%, -50%);
199
+      // border: 1px solid red;
200
+
201
+      .right-number {
202
+        width: 40px;
203
+        font-size: 20px;
204
+        border-radius: 4px;
205
+        border: 2px solid #999;
206
+        margin: auto;
207
+        text-align: center;
208
+      }
209
+
210
+      .right-title {
211
+        font-weight: 700;
212
+        font-size: 24px;
213
+        padding-top: 20px;
214
+        text-align: center;
215
+      }
216
+    }
217
+  }
218
+  //线条
219
+  .right-complete-two::after {
220
+    content: "";
221
+    position: absolute;
222
+    top: 15px;
223
+    margin: 26px auto;
224
+    height: 70%;
225
+    border-left: 1px dashed #595959;
226
+  }
227
+
228
+  .view-button {
229
+
230
+    position: fixed;
231
+    bottom: 0px;
232
+
233
+    .Card-number-box {
234
+      .Card-number {
235
+        width: 100%;
236
+        height: 96px;
237
+        background-color: @whiteColor;
238
+      }
239
+      .Card-user {
240
+        width: 100%;
241
+        height: 96px;
242
+        background-color: @whiteColor;
243
+      }
244
+    }
245
+    .button-box-button-box {
246
+      position: relative;
247
+      .button-text-image {
248
+        width: 144;
249
+        height: 45px;
250
+        position: absolute;
251
+        top: -35px;
252
+        left: 267px;
253
+        right: 305px;
254
+        z-index: 1;
255
+        .button-text-money-hot {
256
+          position: absolute;
257
+          width: 144px;
258
+          height: 43px;
259
+          line-height: 43px;
260
+          font-size: 24px;
261
+          font-weight: bold;
262
+          color: @whiteColor;
263
+        }
264
+        .button-image {
265
+          width: 143px;
266
+          height: 43px;
267
+        }
268
+        .button-text-money {
269
+          position: absolute;
270
+          margin-top: -8;
271
+          width: 157px;
272
+          font-size: 18px;
273
+          font-weight: 400;
274
+          text-decoration: line-through;
275
+          color: @whiteColor;
276
+        }
277
+      }
278
+      .button-box-one {
279
+        font-size: 30px;
280
+        line-height: 92px;
281
+        margin-top: 3em;
282
+        background-color: #274190;
283
+        border-radius: 12px;
284
+        width: 690px;
285
+        height: 92px;
286
+        color: @whiteColor;
287
+        // position: absolute;
288
+        bottom: 40px;
289
+        right: 0;
290
+        left: 0;
291
+        .button-text-one {
292
+          right: 133px;
293
+          font-size: 30px;
294
+          padding-left: 220px;
295
+        }
296
+      }
297
+    }
298
+  }
299
+}

+ 0
- 8
src/components/Card/index.jsx Ver arquivo

@@ -1,8 +0,0 @@
1
-
2
-import './style.less'
3
-
4
-export default (props) => {
5
-
6
-    return <view className='card'>{props.children}</view>
7
-
8
-}

+ 0
- 6
src/components/Card/style.less Ver arquivo

@@ -1,6 +0,0 @@
1
-.card {
2
-    width: 100%;
3
-    background: #FFFFFF;
4
-    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
5
-    border-radius: 24px;
6
-}

+ 26
- 0
src/components/MoreGuide/index.jsx Ver arquivo

@@ -0,0 +1,26 @@
1
+import { Video } from '@tarojs/components';
2
+import './style.less'
3
+
4
+export default (props) => {
5
+  const { item } = props
6
+  return (
7
+    <>{
8
+      item.contentType == 'image' ?
9
+        <image src={item.content} mode='widthFix' style={{ width: '100%' }} className='image-content' /> :
10
+        item.contentType == 'text' ?
11
+          <view style={{ marginBottom: '5px' }}>
12
+            <view className='storezn'>{item.content}</view>
13
+          </view> :
14
+          <Video
15
+            controls
16
+            autoplay={false}
17
+            loop={false}
18
+            muted={false} style={{ width: "100%", height: '200px' }} src={item.content}></Video>
19
+
20
+    }
21
+
22
+    </>
23
+  )
24
+}
25
+
26
+

+ 11
- 0
src/components/MoreGuide/style.less Ver arquivo

@@ -0,0 +1,11 @@
1
+
2
+.image-content{
3
+  border-radius: 10px
4
+}
5
+  .storezn{
6
+    font-size: 28px;
7
+    font-weight: 400;
8
+    color: #202020;
9
+    line-height: 54px;
10
+    padding-bottom: 10px;
11
+  }

+ 2
- 2
src/components/Popup/index.jsx Ver arquivo

@@ -2,10 +2,10 @@
2 2
 import './style.less'
3 3
 
4 4
 export default (props) => {
5
-  const { show, mask = true,  onClose } = props
5
+  const { show, mask = true, onClose, maskClosable } = props
6 6
 
7 7
   return (
8
-    <mp-dialog extClass='x-popup'  buttons={[]} show={show} mask={mask} maskClosable={true} onClose={onClose}>
8
+    <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose}>
9 9
       {props.children}
10 10
     </mp-dialog>
11 11
   )

+ 42
- 0
src/pages/RoomOrder/components/RoomForm/index.jsx Ver arquivo

@@ -0,0 +1,42 @@
1
+import { useState, useEffect } from 'react'
2
+import Taro from '@tarojs/taro'
3
+import { Text, Input } from '@tarojs/components'
4
+import './style.less'
5
+
6
+
7
+
8
+export default (props) => {
9
+  const { onChange } = props
10
+
11
+  const [customerName, setCustomerName] = useState()
12
+  const [customerPhone, setCustomerPhone] = useState()
13
+
14
+  const handeInput = (e, key) => {
15
+    const value = e.detail.value
16
+
17
+    if (key === 'customerName') {
18
+      setCustomerName(value)
19
+    } else {
20
+      setCustomerPhone(value)
21
+    }
22
+  }
23
+
24
+  useEffect(() => {
25
+    onChange({ customerName, customerPhone })
26
+  }, [customerName, customerPhone])
27
+
28
+  return (
29
+    <view className='from-room'  >
30
+      <mp-form >
31
+        <mp-cells title='请填写姓名手机号' footer='  '>
32
+          <mp-cell prop='customerName' title='姓名:' extClass=''>
33
+            <input onInput={(e) => handeInput(e, 'customerName')} focus dataField='name' className='weui-input' placeholder='请输入姓名' />
34
+          </mp-cell>
35
+          <mp-cell prop='customerPhone' title='手机号:' extClass=''>
36
+            <input type='number' onInput={(e) => handeInput(e, 'customerPhone')} dataField='mobile' className='weui-input' placeholder='请输入手机号' />
37
+          </mp-cell>
38
+        </mp-cells>
39
+      </mp-form>
40
+    </view>
41
+  )
42
+}

+ 9
- 0
src/pages/RoomOrder/components/RoomForm/style.less Ver arquivo

@@ -0,0 +1,9 @@
1
+.from-room{
2
+  width: 100%;
3
+  background: #FFFFFF;
4
+  box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
5
+  border-radius: 24px;
6
+}
7
+.weui-agree .weui-agree__text {
8
+  display: inline;
9
+}

+ 16
- 0
src/pages/RoomOrder/index.config.js Ver arquivo

@@ -0,0 +1,16 @@
1
+export default {
2
+  navigationBarTitleText: '',
3
+  navigationStyle: 'custom',
4
+
5
+  usingComponents: {
6
+    "mp-checkbox-group": "weui-miniprogram/checkbox-group/checkbox-group",
7
+    "mp-checkbox": "weui-miniprogram/checkbox/checkbox",
8
+    "mp-cells": "weui-miniprogram/cells/cells",
9
+    "mp-dialog": "weui-miniprogram/dialog/dialog",
10
+    "mp-cells": "weui-miniprogram/cells/cells",
11
+    "mp-cell": "weui-miniprogram/cell/cell",
12
+    "mp-form": "weui-miniprogram/form/form"
13
+  }
14
+
15
+
16
+}

+ 91
- 0
src/pages/RoomOrder/index.jsx Ver arquivo

@@ -0,0 +1,91 @@
1
+import Taro from "@tarojs/taro"
2
+import { useEffect, useState } from "react"
3
+import CustomNav from '@/components/CustomNav'
4
+import withLayout from '@/layouts'
5
+import { getTaRoom, goToRoomForm, personSubmit } from '@/services/taRoom​'
6
+import RoomForm from './components/RoomForm'
7
+import './style.less'
8
+
9
+
10
+
11
+
12
+
13
+export default withLayout((props) => {
14
+  const { router, person } = props
15
+  const { roomId, roomOrderId, status } = router.params
16
+  const [taRoomContent, setTaRoomContent] = useState([])
17
+  const [orderContent, setOrderContent] = useState([])
18
+
19
+  const CarNumber = orderContent?.personNum
20
+  const [formData, setFormData] = useState([])
21
+
22
+  const handleChange = (e, inx) => {
23
+    formData[inx] = e;
24
+    setFormData([...formData])
25
+  }
26
+
27
+  const handleSubmit = (e) => {
28
+    console.log('原数组', formData)
29
+
30
+    var arrr = [...formData]
31
+    let Phone = /^[1][3,4,5,7,8,9][0-9]{9}$/;
32
+
33
+    for (let i = 0, len = arrr.length; i < len; i++) {
34
+      console.log('For后数组', arrr[i])
35
+      let numPhone = 0
36
+      let userName = 0
37
+
38
+      formData.map((item, index) => {
39
+        userName = item.customerName
40
+        numPhone = item.customerPhone
41
+      })
42
+      if (userName === undefined) {
43
+        console.log('没有名字');
44
+      } else {
45
+        if (!Phone.test(numPhone)) {
46
+          console.log('手机号格式不正确')
47
+          return false;
48
+        } else {
49
+          console.log('成功----------')
50
+          return true;
51
+        }
52
+      }
53
+
54
+
55
+
56
+
57
+
58
+      //   personSubmit(roomId, { ...formData }).then((res) => {
59
+      //     console.log('----------------------', res);
60
+      //   })
61
+
62
+    }
63
+  }
64
+
65
+
66
+
67
+  useEffect(() => {
68
+    getTaRoom(roomId).then((res) => {
69
+      setTaRoomContent(res)
70
+    })
71
+    goToRoomForm(roomOrderId).then((res) => {
72
+      setOrderContent(res)
73
+    })
74
+  }, [roomId, roomOrderId])
75
+
76
+  const FormCard = new Array(CarNumber).fill(0)
77
+  return (
78
+    <view>
79
+      <CustomNav title={taRoomContent?.roomName} />
80
+      {
81
+        FormCard.map((_, index) => {
82
+          return (
83
+            <RoomForm key={(index)} onChange={(e) => handleChange(e, index)} />
84
+          )
85
+        })
86
+      }
87
+      <button className='button-OK' onClick={handleSubmit} >确定</button>
88
+
89
+    </view>
90
+  )
91
+})

+ 10
- 0
src/pages/RoomOrder/style.less Ver arquivo

@@ -0,0 +1,10 @@
1
+button {
2
+  width: 690px;
3
+  height: 92px;
4
+  background: #1A3B83;
5
+  margin: 0 auto;
6
+  line-height: 92px;
7
+  border-radius: 12px;
8
+  font-size: 40px;
9
+  color: #ffffff;
10
+}

+ 0
- 1
src/pages/TobeShop/style.less Ver arquivo

@@ -329,7 +329,6 @@
329 329
     }
330 330
     .button-OK {
331 331
       display: inline-block;
332
-
333 332
       width: 236px;
334 333
       height: 78px;
335 334
       background: #274291;

+ 19
- 0
src/pages/details/components/Extend/extend.jsx Ver arquivo

@@ -0,0 +1,19 @@
1
+import { Video } from '@tarojs/components';
2
+
3
+export default (props) => {
4
+  const { item } = props
5
+  return (
6
+    <>{
7
+      item.contentType == 'image' ?
8
+        <image src={item.content} mode='widthFix' style={{ width: '100%' }} /> :
9
+        item.contentType == 'text' ?
10
+          <view className='storezn'>{item.content}</view> :
11
+          <Video
12
+            controls
13
+            autoplay={false}
14
+            loop={false}
15
+            muted={false} style={{ width: "100%", height: '200px' }} src={item.content}></Video>
16
+    }
17
+    </>
18
+  )
19
+}

+ 0
- 18
src/pages/details/components/extend.jsx Ver arquivo

@@ -1,18 +0,0 @@
1
-import { Video} from '@tarojs/components';
2
-
3
-export default (props) => {
4
-  const { item } = props
5
-  return (
6
-    <>{
7
-      item.contentType == 'image' ?
8
-        <image src={item.content} mode="widthFix" style={{width:'100%'}}/> :
9
-        item.contentType == 'text' ?
10
-          <view className='storezn'>{item.content}</view> :
11
-          <Video controls={true}
12
-          autoplay={false}
13
-          loop={false}
14
-          muted={false} style={{width:"100%",height:'200px'} } src={item.content} ></Video>
15
-    }
16
-    </>
17
-  )
18
-}

+ 2
- 1
src/pages/details/foodDetails/foodDetails.jsx Ver arquivo

@@ -17,7 +17,7 @@ import collection from '../../../assets/icons/housemantj/景点收藏.png'
17 17
 import hongxin from '../../../assets/icons/housemantj/已收藏.png'
18 18
 import './foodDetails.less'
19 19
 import Taro from '@tarojs/taro'
20
-import Extend from '../components/extend'
20
+import Extend from '../components/Extend/extend'
21 21
 import useSave from "@/utils/hooks/useSave"
22 22
 import useLike from "@/utils/hooks/useLike"
23 23
 import { useRef } from 'react';
@@ -97,6 +97,7 @@ export default withLayout((props) => {
97 97
       setAllpgNum(res.total)
98 98
     })
99 99
     getExtendContent('shop', id).then((res) => {
100
+      console.log('targetId targetId targetId targetId targetId targetId targetId targetId targetId ', res);
100 101
       setExtend(res.records || [])
101 102
       setAllextNum(res.total)
102 103
       setNewextNum(res.records.length)

+ 1
- 1
src/pages/details/mjDetails/sceneryDetails.jsx Ver arquivo

@@ -15,7 +15,7 @@ import { getTouristDetail, getExtendContent, getRecommendList } from '@/services
15 15
 import { Swiper, SwiperItem } from '@tarojs/components';
16 16
 import useSave from "@/utils/hooks/useSave"
17 17
 import useLike from "@/utils/hooks/useLike"
18
-import Extend from '../components/extend'
18
+import Extend from '../components/Extend/extend'
19 19
 import Cards from '@/components/foodCards/foodCards.jsx'
20 20
 import Taro from '@tarojs/taro'
21 21
 import './sceneryDetails.less'

+ 1
- 1
src/pages/index/index.jsx Ver arquivo

@@ -35,7 +35,7 @@ export default withLayout((props) => {
35 35
       </view>
36 36
       <view className='index-container'>
37 37
         {currentTab === 0 && <Recommend />}
38
-        {currentTab === 1 && <Guide />}
38
+        {currentTab === 1 && <Guide person={person} router={router} />}
39 39
         {/* {currentTab === 2 && <Strategy />} */}
40 40
         {currentTab === 2 && <Mine person={person} />}
41 41
       </view>

+ 169
- 93
src/pages/index/tabs/Guide.jsx Ver arquivo

@@ -1,4 +1,4 @@
1
-import { useState } from "react";
1
+import { useState, useEffect, useRef } from "react";
2 2
 import withLayout from '@/layouts'
3 3
 import Taro from '@tarojs/taro'
4 4
 import image from '@/assets/icons/ProCard/8kb.jpg'
@@ -13,10 +13,11 @@ import Cup from '@/assets/icons/GuideCheck/Cup.png'
13 13
 import BlackSpot from '@/assets/icons/GuideCheck/BlackSpot.png'
14 14
 import starOn from '@/assets/icons/GuideCheck/starOn.png'
15 15
 import starOff from '@/assets/icons/GuideCheck/starOff.png'
16
-import loveOn from '@/assets/icons/GuideCheck/loveOn.png'
17
-import Raiders from '@/assets/icons/GuideCheck/Raiders.png'
18
-import RaidersImage from '@/assets/icons/GuideCheck/RaidersImage.jpg'
19
-import articleCardImage from '@/assets/icons/GuideCheck/articleCardImage.png'
16
+import { getTouristDetail, getExtendContent, getRecommendList } from '@/services/home'
17
+import sleep from '@/assets/icons/GuideCheck/sleep_logo.png'
18
+import { getTaRoom, goToRoomForm } from '@/services/taRoom​'
19
+
20
+import MoreGuide from "@/components/MoreGuide";
20 21
 import './GuideCss/style.less'
21 22
 
22 23
 
@@ -27,8 +28,97 @@ const score = '3.9'
27 28
 
28 29
 export default (props) => {
29 30
   const { router, person } = props
31
+  const { roomId, location, roomOrderId } = router.params
30 32
   const [value, setVaule] = useState('已收藏')
31 33
   const [imageSrc, setImageSrc] = useState(starOn)
34
+  const [extend, setExtend] = useState([])
35
+  const [ifroomId, setIfroomId] = useState('havenot')
36
+  // 住宿经纬度
37
+  const Roomlog = useRef('')
38
+  const Roomlat = useRef('')
39
+  // 停车场经纬度
40
+  const Parklog = useRef('')
41
+  const Parklat = useRef('')
42
+
43
+  const [taRoomContent, setTaRoomContent] = useState([])
44
+
45
+  useEffect(() => {
46
+    if (roomOrderId) {
47
+      goToRoomForm(roomOrderId).then((res) => {
48
+        console.log("🚀 ~ file: Guide.jsx ~ line 48 ~ goToRoomForm ~ res", res)
49
+        if (res.status !== 1) {
50
+          Taro.navigateTo({
51
+            url: `/pages/RoomOrder/index?roomOrderId=${roomOrderId}&status=${res.status}&roomId=${roomId}`,
52
+          })
53
+        }
54
+      })
55
+    }
56
+  }, [roomOrderId])
57
+
58
+  useEffect(() => {
59
+
60
+    if (roomId) {
61
+      getTaRoom(roomId).then((res) => {
62
+        Roomlog.current = (res.location).toString().split(',')[0]
63
+        Roomlat.current = (res.location).toString().split(',')[1]
64
+        Parklog.current = (res.parkingLocation).toString().split(',')[0]
65
+        Parklat.current = (res.parkingLocation).toString().split(',')[1]
66
+        setTaRoomContent(res || [])
67
+        console.log(res);
68
+      })
69
+      getExtendContent('room', roomId).then((res) => {
70
+        setExtend(res.records || [])
71
+        setIfroomId('reality')
72
+      })
73
+
74
+
75
+    } else {
76
+      console.log('房源没有ID');
77
+    }
78
+    // getRecommendList({ location: location }).then((res) => {
79
+    //   setRecommend(res || [])
80
+    // })
81
+  }, [roomId])
82
+
83
+
84
+  const goRoomMap = () => {
85
+    Taro.openLocation({
86
+      longitude: Roomlog.current - 0,
87
+      latitude: Roomlat.current - 0,
88
+      name: taRoomContent.roomName,
89
+      address: taRoomContent.address,
90
+      scale: 12,
91
+    })
92
+  }
93
+
94
+  const goParkMap = () => {
95
+    Taro.openLocation({
96
+      longitude: Parklog.current - 0,
97
+      latitude: Parklat.current - 0,
98
+      name: taRoomContent.parkingAddress,
99
+      address: taRoomContent.parkingAddress,
100
+      scale: 12,
101
+    })
102
+  }
103
+
104
+
105
+
106
+
107
+  const wifiCopy = () => {
108
+    Taro.setClipboardData({
109
+      data: taRoomContent?.wifiPassword,
110
+      success: e => {
111
+        Taro.showToast({
112
+          title: '密码已复制',
113
+          icon: 'success',
114
+          duration: 2000,
115
+        })
116
+      }
117
+    })
118
+  }
119
+
120
+
121
+
32 122
 
33 123
 
34 124
   const AddCollect = () => {
@@ -44,70 +134,78 @@ export default (props) => {
44 134
     <scroll-view scroll-y style='height: 77vh;' >
45 135
 
46 136
       <view className='Guide-Home-box'>
47
-        {/* <view className='Guide-image-text-box'>
48
-          <image className='Guide-images' src={sleep} />
49
-          <view className='Guide-text'>休息一下,休息一下~</view>
50
-        </view> */}
51
-        {/* 图片结束 */}
52
-        {/* 有民宿的情况下 */}
53
-        <view className='MessageCard'>
54
-          <view className='MessageCard-title1'>
55
-            <text className='MessageCard-left'>----------</text>
56
-            名称
57
-            <text className='MessageCard-right'>----------</text>
58
-          </view>
59
-          <view className='MessageCard-content'>
60
-            <view className='MessageCard-name' >皇冠假日酒店-2507</view>
61
-          </view>
62
-        </view>
63
-        {/* 有民宿的情况下 */}
64
-        <view className='MessageCard'>
65
-          <view className='MessageCard-title1'>
66
-            <text className='MessageCard-left'>----------</text>
67
-            民宿位置
68
-            <text className='MessageCard-right'>----------</text>
69
-          </view>
70
-          <view className='MessageCard-content'>
71
-            <view className='MessageCard-name' >精悦SHOS-北门</view>
72
-            <view className='MessageCard-info' >江苏省南京市秦淮区XXXXXX路</view>
73
-          </view>
74
-          <view className='MessageCard-button'>
75
-            <image className='MessageCard-image' src={GoHere} />
76
-            <text className='MessageCard-text'>去这里</text>
77
-          </view>
78
-        </view>
79
-        {/* 有民宿的情况下 */}
80
-        <view className='MessageCard'>
81
-          <view className='MessageCard-title1'>
82
-            <text className='MessageCard-left'>----------</text>
83
-            停车位置
84
-            <text className='MessageCard-right'>----------</text>
85
-          </view>
86
-          <view className='MessageCard-content'>
87
-            <view className='MessageCard-name' >江苏通讯大厦停车厂</view>
88
-            <view className='MessageCard-info' >江苏省南京市秦淮区集庆路</view>
89
-          </view>
90
-          <view className='MessageCard-button'>
91
-            <image className='MessageCard-image' src={Taxi} />
92
-            <text className='MessageCard-text'>去这里</text>
93
-          </view>
94
-        </view>
137
+        {
138
+          ifroomId === 'havenot' && (
139
+            <view className='Guide-image-text-box'>
140
+              <image className='Guide-images' src={sleep} />
141
+              <view className='Guide-text'>休息一下,休息一下~</view>
142
+            </view>
143
+          )
144
+        }
95 145
         {/* 有民宿的情况下 */}
96
-        <view className='MessageCard'>
97
-          <view className='MessageCard-title1'>
98
-            <text className='MessageCard-left'>----------</text>
99
-            WiFi信息
100
-            <text className='MessageCard-right'>----------</text>
101
-          </view>
102
-          <view className='MessageCard-content'>
103
-            <view className='MessageCard-name' >名称:2507</view>
104
-            <view className='MessageCard-info' >密码:15s1x5s5</view>
105
-          </view>
106
-          <view className='MessageCard-button'>
107
-            <image className='MessageCard-image' src={WiFi} />
108
-            <text className='MessageCard-text'>复制</text>
109
-          </view>
110
-        </view>
146
+        {
147
+          ifroomId === 'reality' && (
148
+            <view>
149
+
150
+              <view className='MessageCard'>
151
+                <view className='MessageCard-title1'>
152
+                  <text className='MessageCard-left'>----------</text>
153
+                  名称
154
+                  <text className='MessageCard-right'>----------</text>
155
+                </view>
156
+                <view className='MessageCard-content'>
157
+                  <view className='MessageCard-name' >{taRoomContent?.roomName}</view>
158
+                </view>
159
+              </view>
160
+              <view className='MessageCard'>
161
+                <view className='MessageCard-title1'>
162
+                  <text className='MessageCard-left'>----------</text>
163
+                  民宿位置
164
+                  <text className='MessageCard-right'>----------</text>
165
+                </view>
166
+                <view className='MessageCard-content'>
167
+                  <view className='MessageCard-name' >{taRoomContent?.address}</view>
168
+                </view>
169
+                <view className='MessageCard-button-RoomName'>
170
+                  <image className='MessageCard-image' src={GoHere} />
171
+                  <text className='MessageCard-text' onClick={() => { goRoomMap() }} >去这里</text>
172
+                </view>
173
+              </view>
174
+              <view className='MessageCard'>
175
+                <view className='MessageCard-title1'>
176
+                  <text className='MessageCard-left'>----------</text>
177
+                  停车位置
178
+                  <text className='MessageCard-right'>----------</text>
179
+                </view>
180
+                <view className='MessageCard-content'>
181
+                  <view className='MessageCard-name' >{taRoomContent?.parkingAddress}</view>
182
+                </view>
183
+                <view className='MessageCard-button-Park'>
184
+                  <image className='MessageCard-image' src={Taxi} />
185
+                  <text className='MessageCard-text' onClick={() => { goParkMap() }} >去这里</text>
186
+                </view>
187
+              </view>
188
+              <view className='MessageCard'>
189
+                <view className='MessageCard-title1'>
190
+                  <text className='MessageCard-left'>----------</text>
191
+                  WiFi信息
192
+                  <text className='MessageCard-right'>----------</text>
193
+                </view>
194
+                <view className='MessageCard-content'>
195
+                  <view className='MessageCard-name' >名称:{taRoomContent?.wifiName}</view>
196
+                  <view className='MessageCard-info' ><text className='MessageCard-name'>密码:</text>{taRoomContent?.wifiPassword}</view>
197
+                </view>
198
+                <view className='MessageCard-button'>
199
+                  <image className='MessageCard-image' src={WiFi} />
200
+                  <text className='MessageCard-text' onClick={() => { wifiCopy() }}>复制</text>
201
+                </view>
202
+              </view>
203
+            </view>
204
+
205
+          )
206
+        }
207
+
208
+
111 209
         {/* 更多指引开始 */}
112 210
         <view className='Guide-Content-box'>
113 211
           <view className='title-image'>
@@ -115,25 +213,7 @@ export default (props) => {
115 213
             <text className='title-title-boss' >更多指引</text>
116 214
           </view>
117 215
         </view>
118
-        <view className='articleCard'>
119
-          <view className='articleCard-title'>
120
-            <text className='articleCard-left'>--------</text>
121
-            南京市·普通公寓里的独立房间
122
-            <text className='articleCard-right'>--------</text>
123
-          </view>
124
-          <view className='articleCard-content'>
125
-            <image className='articleCard-image' src={articleCardImage} />
126
-          </view>
127
-          <view className='articleCard-textarea'>
128
-            <view className='articleCard-textarea-title' >位置:<text className='articleCard-textarea-content'>地处繁华街区,餐饮、娱乐选择丰富
129
-              毗邻虹桥CBD,世贸商城展馆,百盛城市购物中心金虹桥购物中心,虹桥艺术中心,领馆聚集区,商务活动频繁,购物、聚会、聚餐、观看演出、表演电影,各项活动一应俱全。
130
-            </text></view>
131
-            <view className='articleCard-textarea-title' >出行信息:<text className='articleCard-textarea-content'>地处繁华街区,餐饮、娱乐选择丰富
132
-              地铁2号线娄山关路站下车3号口出步行5分钟可以到达。周边公交车众多,四通八达,叫车也非常便捷快速。2号线去虹桥机场、虹桥高铁站勻为直达,无需换乘,非常便捷快速,耗时在20分钟左右(4-5站即可抵达).
133
-
134
-            </text></view>
135
-          </view>
136
-        </view>
216
+        {extend?.map((item, index) => <MoreGuide key={(index)} item={item} />)}
137 217
         {/* 更多指引结束 */}
138 218
         <view className='Guide-Content-box'>
139 219
           <view className='title-image'>
@@ -212,7 +292,6 @@ export default (props) => {
212 292
                 <view className='title-text'>【橘里橘啊换行啊啊啊气咖啡店】新鲜出炉啦!</view>
213 293
               </view>
214 294
               <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
215
-              {/* ProCard区域定位 */}
216 295
               <view className='title-position-on'>
217 296
                 <image className='title-position' src={position} />
218 297
                 <text className='title-position-image'>南京市/秦淮区</text>
@@ -230,14 +309,12 @@ export default (props) => {
230 309
           </view>
231 310
         </view>
232 311
         {/* 卡片------------- */}
233
-        <view className='Guide-Content-box-two'>
312
+        {/* <view className='Guide-Content-box-two'>
234 313
           <view className='title-image-two'>
235 314
             <image mode='scaleToFill' className='title-image-cup-two' src={Cup} />
236 315
             <text className='title-title-boss-two' >老板推荐的攻略</text>
237 316
           </view>
238 317
         </view>
239
-        {/* 小标题结束 */}
240
-        {/* 攻略卡片 */}
241 318
         <view className='Raiders-box-one'>
242 319
           <view className='Raiders-imageLove'>
243 320
             <image className='Raiders-image-Raiders' src={Raiders} />
@@ -265,8 +342,7 @@ export default (props) => {
265 342
               <text className='Raiders-on-text'>¥8888/人</text>
266 343
             </view>
267 344
           </view>
268
-          {/* <view className='Raiders-box'></view> */}
269
-        </view>
345
+        </view> */}
270 346
       </view>
271 347
     </scroll-view>
272 348
 

+ 51
- 1
src/pages/index/tabs/GuideCss/style.less Ver arquivo

@@ -55,6 +55,54 @@
55 55
         padding-top: 19px;
56 56
       }
57 57
     }
58
+    .MessageCard-button-RoomName{
59
+      width: 168px;
60
+      height: 60px;
61
+      border: 2px solid #000000;
62
+      border-radius: 12px;
63
+      position: relative;
64
+      text-align: center;
65
+      display: inline-block;
66
+      left: 1.5em;
67
+      .MessageCard-image {
68
+        width: 30px;
69
+        height: 30px;
70
+        padding-top: 12px;
71
+        padding-right: 5px;
72
+      }
73
+      .MessageCard-text {
74
+        line-height: 30px;
75
+        width: 87px;
76
+        height: 28px;
77
+        font-size: 30px;
78
+        font-weight: bold;
79
+        color: #202020;
80
+      }
81
+    }
82
+    .MessageCard-button-Park{
83
+      width: 168px;
84
+      height: 60px;
85
+      border: 2px solid #000000;
86
+      border-radius: 12px;
87
+      position: relative;
88
+      text-align: center;
89
+      display: inline-block;
90
+      left: 1.5em;
91
+      .MessageCard-image {
92
+        width: 30px;
93
+        height: 30px;
94
+        padding-top: 12px;
95
+        padding-right: 5px;
96
+      }
97
+      .MessageCard-text {
98
+        line-height: 30px;
99
+        width: 87px;
100
+        height: 28px;
101
+        font-size: 30px;
102
+        font-weight: bold;
103
+        color: #202020;
104
+      }
105
+    }
58 106
     .MessageCard-button {
59 107
       width: 168px;
60 108
       height: 60px;
@@ -155,9 +203,10 @@
155 203
     }
156 204
   }
157 205
   .Guide-Content-box {
206
+    margin: 2em 0;
158 207
     .title-image {
159 208
       display: flex;
160
-      width: 270px;
209
+      // width: 270px;
161 210
       height: 40px;
162 211
       .title-image-cup {
163 212
         width: 32px;
@@ -514,4 +563,5 @@
514 563
       }
515 564
     }
516 565
   }
566
+
517 567
 }

+ 6
- 2
src/routes.js Ver arquivo

@@ -54,6 +54,10 @@ const mainPages = [
54 54
     title: '套餐核销',
55 55
     page: 'pages/TobeShop/index',
56 56
   },
57
+  {
58
+    title: '入住指引跳转表单',
59
+    page: 'pages/RoomOrder/index'
60
+  }
57 61
 ];
58 62
 
59 63
 // 商户管理页面shop/pages/spread/spreadIndex
@@ -75,8 +79,8 @@ const hotelPages = [
75 79
 ];
76 80
 
77 81
 // 所有的页面
78
-const routes = mainPages.concat(shopPages.map(x => ({...x, root: 'shop'})))
79
-                        .concat(hotelPages.map(x => ({...x, root: 'hotel'})))
82
+const routes = mainPages.concat(shopPages.map(x => ({ ...x, root: 'shop' })))
83
+  .concat(hotelPages.map(x => ({ ...x, root: 'hotel' })))
80 84
 
81 85
 // 主包
82 86
 const pages = mainPages.map(x => x.page);

+ 39
- 39
src/services/home.js Ver arquivo

@@ -12,99 +12,99 @@ export const getIndexType = (params) => request('/tdType', { params })
12 12
  * 获取新闻公告列表
13 13
  * @returns 
14 14
  */
15
- export const getTipList = (params) => request('/notification', { params })
15
+export const getTipList = (params) => request('/notification', { params })
16 16
 /**
17 17
  * 获取资源列表
18 18
  * @returns 
19 19
  * params 搜索条件放这里
20 20
  */
21
- export const getResourceList = (params) => request('/resource', { params })
21
+export const getResourceList = (params) => request('/resource', { params })
22 22
 
23 23
 /**
24 24
  * 加入收藏
25 25
  * @param {*} data 
26 26
  * @returns 
27 27
  */
28
- export const saveCollection = (targetType,targetId) => request(`/${targetType}/save/${targetId}`, { method: 'post' })
28
+export const saveCollection = (targetType, targetId) => request(`/${targetType}/save/${targetId}`, { method: 'post' })
29 29
 
30 30
 /**
31 31
  * 取消收藏
32 32
  * @param {*} data 
33 33
  * @returns 
34 34
  */
35
- export const removeCollection = (targetType,targetId) => request(`/${targetType}/save/${targetId}`, { method: 'delete'})
36
- 
35
+export const removeCollection = (targetType, targetId) => request(`/${targetType}/save/${targetId}`, { method: 'delete' })
36
+
37 37
 /**
38 38
  * 获取收藏
39 39
  * @param {*} data 
40 40
  * @returns 
41 41
  */
42
- export const getCollection = (targetType,targetId) => request(`/${targetType}/save/${targetId}`)
42
+export const getCollection = (targetType, targetId) => request(`/${targetType}/save/${targetId}`)
43 43
 
44 44
 /**
45 45
  * 商铺详情
46 46
  * @param {*} id 
47 47
  * @returns 
48 48
  */
49
- export const getShopDetail = (id) => request(`/shop/${id}`)
50
- /**
51
- * 获取商铺套餐列表
52
- * @returns 
53
- */
54
-  export const getShopPackage = (id,params) => request(`/shop/${id}/package`,{params})
49
+export const getShopDetail = (id) => request(`/shop/${id}`)
50
+/**
51
+* 获取商铺套餐列表
52
+* @returns 
53
+*/
54
+export const getShopPackage = (id, params) => request(`/shop/${id}/package`, { params })
55 55
 
56
-  /**
57
- * 套餐详情
58
- * @param {*} id 
59
- * @returns 
60
- */
61
- export const getShopPackageDetail = (id) => request(`/taShopPackage/${id}`)
62
- 
63
- /**
64
- * 获取套餐定位
65
- * @param {*} id 
66
- * @returns 
67
- */
68
-   export const getShopcity = (id) => request(`/city/${id}`)
56
+/**
57
+* 套餐详情
58
+* @param {*} id 
59
+* @returns 
60
+*/
61
+export const getShopPackageDetail = (id) => request(`/taShopPackage/${id}`)
62
+
63
+/**
64
+* 获取套餐定位
65
+* @param {*} id 
66
+* @returns 
67
+*/
68
+export const getShopcity = (id) => request(`/city/${id}`)
69
+
70
+/**
71
+* 本店指南
72
+* @param {*} id 
73
+* @returns 
74
+*/
75
+export const getExtendContent = (type, id, params) => request(`/${type}/${id}/content`, { params })
69 76
 
70
- /**
71
- * 本店指南
72
- * @param {*} id 
73
- * @returns 
74
- */
75
-  export const getExtendContent = (type,id,params) => request(`/${type}/${id}/content`,{params})
76
- 
77 77
 /**
78 78
  * 景点详情
79 79
  * @param {*} id 
80 80
  * @returns 
81 81
  */
82
- export const getTouristDetail = (id) => request(`/tourist/${id}`)
82
+export const getTouristDetail = (id) => request(`/tourist/${id}`)
83 83
 
84 84
 /**
85 85
  * 获取推荐套餐列表
86 86
  * @returns 
87 87
  * params 搜索条件放这里
88 88
  */
89
- export const getRecommendList = (params) => request('/package/recommend', { params })
89
+export const getRecommendList = (params) => request('/package/recommend', { params })
90
+
90 91
 
91 92
 
92 93
 
93
- 
94 94
 /**
95 95
  * 爆赞
96 96
  * @param {*} data 
97 97
  * @returns 
98 98
  */
99
- export const saveLike = (targetType,targetId) => request(`/${targetType}/like/${targetId}`, { method: 'post' })
99
+export const saveLike = (targetType, targetId) => request(`/${targetType}/like/${targetId}`, { method: 'post' })
100 100
 
101 101
 /**
102 102
  * 取消爆赞
103 103
  * @param {*} data 
104 104
  * @returns 
105 105
  */
106
- export const removeLike = (targetType,targetId) => request(`/${targetType}/like/${targetId}`, { method: 'delete'})
107
- 
106
+export const removeLike = (targetType, targetId) => request(`/${targetType}/like/${targetId}`, { method: 'delete' })
107
+
108 108
 //缺少套餐订单生成
109 109
 
110 110
 
@@ -113,4 +113,4 @@ export const getIndexType = (params) => request('/tdType', { params })
113 113
  * 获取搜索列表
114 114
  * @returns 
115 115
  */
116
- export const getIndexSearch  = (params) => request('/taSearch', { params })
116
+export const getIndexSearch = (params) => request('/taSearch', { params })

+ 33
- 0
src/services/taRoom​.js Ver arquivo

@@ -0,0 +1,33 @@
1
+
2
+import request from '@/utils/request'
3
+
4
+
5
+
6
+
7
+/**
8
+ * 房源
9
+ * @param {*} id 
10
+ * @returns 
11
+ */
12
+
13
+export const getTaRoom = (id) => request(`/taRoom/${id}`)
14
+
15
+
16
+
17
+
18
+/**
19
+ * 跳转表单页面
20
+ * @param {*} id 
21
+ * @returns 
22
+ */
23
+
24
+export const goToRoomForm = (id) => request(`/roomOrder/${id}`)
25
+
26
+
27
+/**
28
+ * 人员表单保存
29
+ * @param {*} id 
30
+ * @returns 
31
+ */
32
+
33
+export const personSubmit = (id, data) => request(`/room-order/${id}/person`, { method: 'post', data })