Selaa lähdekoodia

定制行程 创建行程

Baozhangchao 3 vuotta sitten
vanhempi
commit
4cae83b36c
28 muutettua tiedostoa jossa 1480 lisäystä ja 182 poistoa
  1. 0
    0
      src/assets/icons/Travel/ChangeNext.png
  2. 111
    0
      src/components/BottomMoadl/index.jsx
  3. 117
    0
      src/components/BottomMoadl/style.css
  4. 112
    0
      src/components/foodCards/CustomCard/index.jsx
  5. 52
    0
      src/components/foodCards/CustomCard/style.less
  6. 67
    35
      src/components/foodCards/NoteCard/index.jsx
  7. 109
    0
      src/components/foodCards/RecommendedCard/index.jsx
  8. 54
    0
      src/components/foodCards/RecommendedCard/style.less
  9. 4
    4
      src/components/foodCards/foodCards.jsx
  10. 66
    17
      src/pages/MineUserAll/MyTravel/index.jsx
  11. BIN
      src/pages/Travel/Edit/NewCustom/ico/openUp.png
  12. BIN
      src/pages/Travel/Edit/NewCustom/ico/packUp.png
  13. 86
    0
      src/pages/Travel/Edit/NewCustom/index.jsx
  14. 9
    0
      src/pages/Travel/Edit/NewCustom/style.less
  15. 4
    1
      src/pages/Travel/Edit/index.config.js
  16. 198
    85
      src/pages/Travel/Edit/index.jsx
  17. 54
    12
      src/pages/Travel/Edit/style.less
  18. 33
    8
      src/pages/Travel/customizedTravel/components/CustomDay/index.jsx
  19. 56
    0
      src/pages/Travel/customizedTravel/components/ThreeModel/index.jsx
  20. 73
    0
      src/pages/Travel/customizedTravel/components/ThreeModel/style.less
  21. 18
    2
      src/pages/Travel/customizedTravel/components/TipModel/index.jsx
  22. 56
    0
      src/pages/Travel/customizedTravel/components/TwoModel/index.jsx
  23. 73
    0
      src/pages/Travel/customizedTravel/components/TwoModel/style.less
  24. 38
    10
      src/pages/Travel/customizedTravel/index.jsx
  25. 22
    6
      src/pages/details/NoteDetails/index.jsx
  26. 1
    1
      src/pages/details/foodDetails/foodDetails.less
  27. 9
    0
      src/pages/index/tabs/Recommend.jsx
  28. 58
    1
      src/services/travel.js

src/assets/icons/Travel/change.png → src/assets/icons/Travel/ChangeNext.png Näytä tiedosto


+ 111
- 0
src/components/BottomMoadl/index.jsx Näytä tiedosto

@@ -0,0 +1,111 @@
1
+import Taro from '@tarojs/taro'
2
+import { View, Text } from '@tarojs/components'
3
+import DeleteTravel from '@/assets/icons/Travel/delete.png'
4
+import RecommendedCard from '@/components/foodCards/RecommendedCard'
5
+import SpinBox from "@/components/Spin/SpinBox";
6
+
7
+import { useState, useEffect } from 'react'
8
+import { deleteTravel, getRecommendList } from '@/services/travel'
9
+
10
+import './style.css'
11
+
12
+
13
+export default (props) => {
14
+  const { frameTitle, onRecommend, flag, ico, textNext, location, dayNumber, travelId, handelAddTravel } = props
15
+
16
+  // const [flag, setFlag] = useState(false)
17
+  // const [wrapAnimate, setWrapAnimate] = useState('wrap wrapAnimate')
18
+  // const [frameAnimate, setFrameAnimate] = useState('frame-wrapper frameAnimate')
19
+  let wrapAnimate = 'wrap wrapAnimate'
20
+  let frameAnimate = 'frame-wrapper frameAnimate'
21
+  const [textNextSum, setTextNext] = useState(1)
22
+  const [recommendContent, setRecommendContent] = useState([])
23
+  const [loading, setLoading] = useState(false)
24
+
25
+  const hideFrame = () => {
26
+    wrapAnimate = 'wrap wrapAnimateOut'
27
+    frameAnimate = 'frame-wrapper frameAnimateOut'
28
+    onRecommend()
29
+
30
+  }
31
+
32
+  const catchNone = () => {
33
+    //阻止冒泡
34
+
35
+  }
36
+  const handelText = () => {
37
+    handleTextNext()
38
+
39
+  }
40
+
41
+
42
+  useEffect(() => {
43
+
44
+    getRecommendList({ location: location, pageNum: textNextSum, pageSize: 3 }).then(e => {
45
+      setRecommendContent(e.records)
46
+
47
+    })
48
+  }, [])
49
+
50
+
51
+  //换一批
52
+  const handleTextNext = (e) => {
53
+    setLoading(true)
54
+    console.log("🚀 ~ file: index.jsx ~ line 61 ~ handleTextNext ~ e", e)
55
+
56
+    e.stopPropagation()
57
+
58
+    setTextNext(textNextSum + 1)
59
+    getRecommendList({ location: location, pageNum: textNextSum, pageSize: 3 }).then(e => {
60
+      setRecommendContent(e.records)
61
+      setLoading(false)
62
+
63
+    }).catch(s => {
64
+      setLoading(false)
65
+
66
+    })
67
+
68
+  }
69
+
70
+  return (
71
+    flag && <view  >
72
+      <view className={wrapAnimate} style='background:rgba(0,0,0,0);'></view>
73
+      <view onClick={hideFrame} className={frameAnimate}>
74
+        <view onClick={catchNone} className='frame'>
75
+          {/* 标题  */}
76
+          <view className='title-wrapper '>
77
+            <view>{frameTitle}</view>
78
+            {/* <image onClick={hideFrame} src={DeleteTravel} mode='widthFix'></image> */}
79
+          </view>
80
+          {/* 内容 */}
81
+
82
+          <View style='overflow-x: hidden;'>
83
+            <SpinBox loading={loading}>
84
+
85
+              {
86
+                recommendContent.map((item, index) =>
87
+
88
+
89
+
90
+                  <RecommendedCard key={index} item={item} det={item} location={location} travelId={travelId} dayNumber={dayNumber} handelAddTravel={handelAddTravel} />
91
+                )
92
+              }
93
+              {props.children}
94
+            </SpinBox>
95
+
96
+            <view className='bottom-text' onClick={handleTextNext}>
97
+              <image src={ico} />
98
+              <text>{textNext}</text>
99
+            </view>
100
+          </View>
101
+
102
+        </view>
103
+
104
+      </view>
105
+
106
+    </view>
107
+  )
108
+
109
+
110
+
111
+}

+ 117
- 0
src/components/BottomMoadl/style.css Näytä tiedosto

@@ -0,0 +1,117 @@
1
+.wrapAnimate {
2
+  animation: wrapAnimate 0.5s ease-in-out forwards;
3
+}
4
+@keyframes wrapAnimate {
5
+  0% {
6
+  }
7
+  100% {
8
+    background: rgba(0, 0, 0, 0.35);
9
+  }
10
+}
11
+.wrapAnimateOut {
12
+  animation: wrapAnimateOut 0.4s ease-in-out forwards;
13
+}
14
+@keyframes wrapAnimateOut {
15
+  0% {
16
+    background: rgba(0, 0, 0, 0.35);
17
+  }
18
+
19
+  100% {
20
+    background: rgba(0, 0, 0, 0);
21
+  }
22
+}
23
+.frameAnimate {
24
+  animation: frameAnimate 0.5s ease forwards;
25
+}
26
+@keyframes frameAnimate {
27
+  0% {
28
+  }
29
+  100% {
30
+    opacity: 1;
31
+    top: 0vh;
32
+  }
33
+}
34
+.frameAnimateOut {
35
+  animation: frameAnimateOut 0.5s ease forwards;
36
+}
37
+@keyframes frameAnimateOut {
38
+  0% {
39
+    opacity: 2;
40
+    top: 0vh;
41
+  }
42
+  50% {
43
+    opacity: 1;
44
+    top: 50vh;
45
+  }
46
+  100% {
47
+    opacity: 0;
48
+    top: 100vh;
49
+  }
50
+}
51
+.frame-wrapper {
52
+  position: fixed;
53
+  height: 100vh;
54
+  width: 100vw;
55
+  z-index: 2;
56
+  top: 50vh;
57
+}
58
+.frame {
59
+  background: #fff;
60
+  position: absolute;
61
+  bottom: 0;
62
+  width: 100%;
63
+  padding: 2.9vw 2.9vw 0;
64
+  border-top-left-radius: 20px;
65
+  border-top-right-radius: 20px;
66
+  z-index: 3;
67
+  box-sizing: border-box;
68
+  align-items: center;
69
+  text-align: center;
70
+}
71
+.title-wrapper {
72
+  justify-content: space-between;
73
+
74
+  text-align: center;
75
+  height: 28px;
76
+  font-size: 35px;
77
+  font-weight: 700;
78
+  color: #202020;
79
+  margin-bottom: 5.9vw;
80
+}
81
+.title-wrapper > image {
82
+  width: 3.5vw;
83
+  height: 3.5vw;
84
+  padding: 0 5vw;
85
+  margin-right: -5vw;
86
+}
87
+/* .flex {
88
+  display: flex;
89
+  align-items: center;
90
+} */
91
+.wrap {
92
+  position: fixed;
93
+  z-index: 1;
94
+  top: 0;
95
+  left: 0;
96
+  right: 0;
97
+  bottom: 0;
98
+}
99
+
100
+.bottom-text {
101
+  margin-left: 40%;
102
+  width: 100%;
103
+  padding: 1.5em 0 1.5em 0;
104
+  display: flex;
105
+  align-items: center;
106
+}
107
+
108
+.bottom-text > image {
109
+  width: 32px;
110
+  height: 32px;
111
+}
112
+.bottom-text > text {
113
+  width: 110px;
114
+  font-size: 30px;
115
+  font-weight: bold;
116
+  color: #202020;
117
+}

+ 112
- 0
src/components/foodCards/CustomCard/index.jsx Näytä tiedosto

@@ -0,0 +1,112 @@
1
+import { useState, useEffect, useRef } from 'react'
2
+
3
+import Taro from '@tarojs/taro'
4
+import { deleteTravel, deleteTravelItem } from '@/services/travel'
5
+
6
+import { View, Text, Image, ScrollView } from '@tarojs/components'
7
+import CouponCard from '@/components/CouponCard'
8
+import { compressImage } from '@/utils'
9
+import SaveIcon from '@/components/SaveIcon'
10
+import Location from '@/components/Location'
11
+
12
+import grassOFF from '@/assets/icons/housemantj/grassOFF.png'
13
+import DeleteTravel from '@/assets/icons/Travel/delete.png'
14
+
15
+import grassNO from '@/assets/icons/housemantj/grassNO.png'
16
+import Popup from '@/components/Popup'
17
+
18
+import './style.less'
19
+
20
+
21
+const CouponMedia = CouponCard.Media
22
+const Action = CouponCard.Action
23
+
24
+//套餐卡片
25
+export default (props) => {
26
+  const { item, st, editable, setScroll, goshop, det, onDay, onDelete } = props
27
+  // const travelId = travelMineContent?.records[0]?.travelId
28
+  const { targetId, itemId } = props.item
29
+  const goDetail = () => {
30
+    Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${targetId}` })
31
+
32
+  }
33
+  const goFood = () => {
34
+    Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${targetId}` })
35
+
36
+  }
37
+  const [showCutover, setShowCutover] = useState(false)
38
+  const [valueList, setValueList] = useState([])
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+  // useEffect(() => {
49
+
50
+  // }, [item])
51
+
52
+  const onClose = () => {
53
+    //关闭当前套餐详情弹窗
54
+    setShowCutover(false)
55
+    //使父组件恢复滚动
56
+    setScroll(true)
57
+  }
58
+
59
+
60
+
61
+
62
+  const handlePayClick = (e) => {
63
+
64
+    onDelete(itemId)
65
+
66
+    // Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
67
+
68
+  }
69
+  const PayAction = <Action.Icon icon={DeleteTravel} text='删除' onClick={handlePayClick} />
70
+
71
+
72
+
73
+
74
+  return (
75
+    <View style={{ margin: '15px 5px' }} >
76
+      <View className='packageDetail' style={{ display: goshop ? '' : 'none' }}>
77
+        <Popup show={showCutover} maskClosable={showCutover} onClose={onClose}>
78
+          <ScrollView
79
+            scrollY
80
+            style={{ maxHeight: '60vh' }}
81
+          >
82
+            <Image mode='widthFix' src={item.details ? item.details : item.poster} />
83
+          </ScrollView>
84
+        </Popup >
85
+      </View>
86
+      <CouponCard action={PayAction}>
87
+        <CouponMedia onClick={item.targetType === 'tourist' ? goDetail : goFood}>
88
+          <CouponMedia.Header
89
+            cashback={item.cashback}
90
+            image={compressImage(item.poster)}
91
+          // badge='food'
92
+          />
93
+          <CouponMedia.Body star={st}>
94
+            <View className='foodCard'>
95
+              <View className='cpn-card-text'>
96
+                {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
97
+              </View>
98
+              <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
99
+                <Text className='cpn-card-text_mn'>¥{`${(item.averagePrice == '' ? '0.00' : item.averagePrice / 100)?.toFixed(2)}元`}</Text>
100
+                {/* <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text> */}
101
+              </View>
102
+              <View className='cpn-md-act'>
103
+                <Location {...det} />
104
+                <SaveIcon saved={item.isSaved > 0} targetType='shop_package' editable={editable} targetId={item.packageId} />
105
+              </View>
106
+            </View>
107
+          </CouponMedia.Body>
108
+        </CouponMedia>
109
+      </CouponCard>
110
+    </View>
111
+  )
112
+}

+ 52
- 0
src/components/foodCards/CustomCard/style.less Näytä tiedosto

@@ -0,0 +1,52 @@
1
+.view-picker {
2
+  position: relative;
3
+  top: 30%;
4
+}
5
+
6
+.foodCard {
7
+  .cpn-card-text {
8
+    font-size: 24px;
9
+    font-weight: 400;
10
+    color: #333333;
11
+    line-height: 40px;
12
+    vertical-align: baseline;
13
+
14
+    & > text {
15
+      display: inline-block;
16
+
17
+      & + text {
18
+        margin-left: 8px;
19
+      }
20
+    }
21
+    &_mn {
22
+      font-size: 24px;
23
+      font-weight: bold;
24
+      color: #333333;
25
+    }
26
+
27
+    &_rm {
28
+      font-size: 18px;
29
+      font-weight: 400;
30
+      text-decoration: line-through;
31
+      color: #666666;
32
+    }
33
+  }
34
+
35
+  .cpn-md-act {
36
+    display: flex;
37
+    margin-top: 10px;
38
+
39
+    & > view {
40
+      flex: 1;
41
+    }
42
+  }
43
+}
44
+.packageDetail {
45
+  Image {
46
+    width: 100%;
47
+  }
48
+  .weui-dialog__bd {
49
+    padding: 0;
50
+    margin: 0;
51
+  }
52
+}

+ 67
- 35
src/components/foodCards/NoteCard/index.jsx Näytä tiedosto

@@ -1,10 +1,12 @@
1 1
 import { useState, useEffect, useRef } from 'react'
2 2
 
3 3
 import Taro from '@tarojs/taro'
4
-import { View, Picker, Image, ScrollView } from '@tarojs/components'
4
+import { View, Picker, Image, ScrollView, Text } from '@tarojs/components'
5 5
 import CouponCard from '@/components/CouponCard'
6 6
 import { compressImage } from '@/utils'
7 7
 import SaveIcon from '@/components/SaveIcon'
8
+import Location from '@/components/Location'
9
+
8 10
 import grassOFF from '@/assets/icons/housemantj/grassOFF.png'
9 11
 import grassNO from '@/assets/icons/housemantj/grassNO.png'
10 12
 import Popup from '@/components/Popup'
@@ -18,9 +20,13 @@ const Action = CouponCard.Action
18 20
 
19 21
 //套餐卡片
20 22
 export default (props) => {
21
-  const { item, st, editable, setScroll, goshop, travelMine, travelMineContent } = props
23
+  const { item, st, editable, setScroll, goshop, travelMine, resourceList, det, handelNoteList } = props
24
+  console.log("🚀 ~ file: index.jsx ~ line 24 ~ item", item.targetId)
22 25
   // const travelId = travelMineContent?.records[0]?.travelId
23
-  const { targetId } = props.item
26
+  const targetId = props.item?.targetId
27
+  const targetType = props.item?.targetType
28
+
29
+
24 30
   const goFood = () => {
25 31
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${targetId}` })
26 32
 
@@ -30,10 +36,10 @@ export default (props) => {
30 36
 
31 37
 
32 38
   useEffect(() => {
33
-    setValueList(travelMine?.records)
39
+    setValueList(travelMine.records)
34 40
 
35 41
 
36
-  }, [travelMine?.records])
42
+  }, [travelMine.records, item])
37 43
 
38 44
   const onClose = () => {
39 45
     //关闭当前套餐详情弹窗
@@ -48,7 +54,7 @@ export default (props) => {
48 54
 
49 55
   const numberTrave = (new Array(traveCoumun).fill()).map((_, index) => ({ id: index + 1, title: `第 ${index + 1} 天` }))
50 56
 
51
-  const array = [valueList, numberTrave]
57
+  const array = [valueList, travelMine.records == '' ? [] : numberTrave]
52 58
 
53 59
 
54 60
   const handleColumn = e => {
@@ -58,55 +64,73 @@ export default (props) => {
58 64
 
59 65
 
60 66
     const firstValue = valueList[value]
61
-    console.log("🚀 ~ file: index.jsx ~ line 61 ~ firstValue", firstValue)
62 67
     setTraveCoumun(firstValue.dayNum)
63 68
 
64 69
   }
65 70
 
66 71
 
67
-
68 72
   const day = new Date();
69 73
   const y = day.getFullYear();
70
-  const m = day.getMonth();
74
+  const m = day.getMonth() + 1;
71 75
   const d = day.getDate();
72 76
   let number = 0
73
-
74 77
   const onChange = (e) => {
75
-    const [firstInx, secondInx] = e.detail.value
76 78
 
77
-    const firstValue = valueList[firstInx]
78
-    const secondValue = numberTrave[secondInx]
79 79
 
80
-    const { travelId } = firstValue//行程内容
81
-    const { i } = secondValue//天数
80
+
81
+    if (travelMine.records == '') {
82 82
 
83 83
 
84
-    console.log(firstValue, secondValue);
84
+      console.log('没有行程');
85
+      newTravelMine({ title: `我的行程 ${y}-${m}-${d}` }).then(res => {
86
+        handelNoteList()
87
+        // 首先创建一个行程,然后才能拿到下面的这些数据
85 88
 
89
+        const [firstInx, secondInx] = e.detail?.value
86 90
 
87
-    if (travelMine.records.total < 0) {
88
-      newTravelMine({ title: `我的行程 ${y}-${m == 0 ? 1 : m}-${d}` }).then(e => {
89
-        console.log("🚀 ~ file: index.jsx ~ line 61 ~ newTravelMine ~ e", e)
91
+        const firstValue = valueList[firstInx] || ''
92
+        console.log("🚀 ~ file: index.jsx ~ line 89 ~ newTravelMine ~ e.detail", firstValue)
93
+
94
+        const secondValue = numberTrave[secondInx] || ''
95
+
96
+        const { travelId } = firstValue
97
+
98
+        //行程内容
99
+        const { i } = secondValue//天数
90 100
         // saveTravel({})
91
-        saveTravel(travelId, { dayOrder: i, targetId: targetId, targetType: 'note' }).then((res) => {
92
-          Taro.
93
-            Taro.showToast({
94
-              title: '添加成功',
95
-              icon: 'none',
96
-              duration: 1000
97
-            })
98
-          console.log(res);
101
+        saveTravel(res.travelId, { dayOrder: i, targetId: targetId, targetType: targetType }).then((val) => {
102
+          Taro.showToast({
103
+            title: '添加成功',
104
+            icon: 'none',
105
+            duration: 1000
106
+          })
107
+          resourceList(travelId)
99 108
         })
100 109
       })
101 110
     } else {
102
-      saveTravel(travelId, { dayOrder: i, targetId: targetId, targetType: 'note' }).then((res) => {
103
-        console.log(res);
111
+      console.log('有行程');
112
+      const [firstInx, secondInx] = e.detail.value
113
+
114
+      const firstValue = valueList[firstInx]
115
+
116
+      const secondValue = numberTrave[secondInx]
117
+
118
+      const { travelId } = firstValue
119
+
120
+      //行程内容
121
+      const { i } = secondValue//天数
122
+
123
+      saveTravel(travelId, { dayOrder: i, targetId: targetId, targetType: targetType }).then((res) => {
104 124
         Taro.showToast({
105 125
           title: '添加成功',
106 126
           icon: 'none',
107 127
 
108 128
           duration: 1000
109 129
         })
130
+        resourceList(travelId)
131
+
132
+        // setGrowGrass(grassNO)
133
+
110 134
       })
111 135
       // console.log('else');
112 136
 
@@ -115,6 +139,14 @@ export default (props) => {
115 139
 
116 140
 
117 141
   const handlePayClick = () => {
142
+    travelMine.records == '' ?
143
+      Taro.showToast({
144
+        title: '暂无行程,点击种草自动创建',
145
+        icon: 'none',
146
+        duration: 3000
147
+      })
148
+      : ''
149
+
118 150
     // Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
119 151
 
120 152
   }
@@ -129,13 +161,9 @@ export default (props) => {
129 161
         onChange={onChange}
130 162
         scrollType='link'
131 163
       // value={}
132
-
133 164
       >
134
-
135
-        <Action.Icon icon={item.isVisited > 1 ? grassOFF : grassNO} text={item.isVisited > 1 ? '种草' : '已种草'} onClick={handlePayClick} />
136
-
165
+        <Action.Icon icon={item.isVisited < 1 ? grassOFF : grassNO} text={item.isVisited < 1 ? '种草' : '已种草'} onClick={handlePayClick} />
137 166
       </Picker>
138
-
139 167
     </View>
140 168
 
141 169
 
@@ -164,8 +192,12 @@ export default (props) => {
164 192
               <View className='cpn-card-text'>
165 193
                 {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
166 194
               </View>
195
+              <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
196
+                <Text className='cpn-card-text_mn'>¥{`${(item.averagePrice == '' ? '0.00' : item.averagePrice / 100)?.toFixed(2)}元`}</Text>
197
+                {/* <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text> */}
198
+              </View>
167 199
               <View className='cpn-md-act'>
168
-                {/* <Location {...det} /> */}
200
+                <Location {...det} />
169 201
                 <SaveIcon saved={item.isSaved > 0} targetType='shop_package' editable={editable} targetId={item.packageId} />
170 202
               </View>
171 203
             </View>

+ 109
- 0
src/components/foodCards/RecommendedCard/index.jsx Näytä tiedosto

@@ -0,0 +1,109 @@
1
+import { useState } from 'react'
2
+
3
+import Taro from '@tarojs/taro'
4
+import { saveTravel } from '@/services/travel'
5
+
6
+import { View, Text, Image, ScrollView } from '@tarojs/components'
7
+import CouponCard from '@/components/CouponCard'
8
+import { compressImage } from '@/utils'
9
+import SaveIcon from '@/components/SaveIcon'
10
+import Location from '@/components/Location'
11
+
12
+import add from '@/assets/icons/Travel/add.png'
13
+
14
+import Popup from '@/components/Popup'
15
+
16
+import './style.less'
17
+
18
+
19
+const CouponMedia = CouponCard.Media
20
+const Action = CouponCard.Action
21
+
22
+//套餐卡片
23
+export default (props) => {
24
+  const { item, st, editable, setScroll, goshop, det, travelId, handelAddTravel, dayNumber } = props
25
+  // const travelId = travelMineContent?.records[0]?.travelId
26
+  const { targetId, itemId, targetType } = props.item
27
+  const goDetail = () => {
28
+    Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${targetId}` })
29
+
30
+  }
31
+  const goFood = () => {
32
+    Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${targetId}` })
33
+
34
+  }
35
+  const [showCutover, setShowCutover] = useState(false)
36
+  const [valueList, setValueList] = useState([])
37
+
38
+
39
+  const onClose = () => {
40
+    //关闭当前套餐详情弹窗
41
+    setShowCutover(false)
42
+    //使父组件恢复滚动
43
+    setScroll(true)
44
+  }
45
+
46
+
47
+
48
+  const handlePayClick = (e) => {
49
+    console.log("🚀 ~ file: index.jsx ~ line 25 ~ item", item, travelId)
50
+
51
+    saveTravel(travelId, { dayOrder: dayNumber, targetId: targetId, targetType: targetType }).then((res) => {
52
+      Taro.showToast({
53
+        title: '添加成功',
54
+        icon: 'none',
55
+
56
+        duration: 1000
57
+      })
58
+      handelAddTravel()
59
+
60
+
61
+    })
62
+
63
+    // Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
64
+
65
+  }
66
+  const PayAction = <Action.Icon icon={add} text='增加' onClick={handlePayClick} />
67
+
68
+
69
+
70
+
71
+  return (
72
+    <View style={{ margin: '15px 5px' }} >
73
+      <View className='packageDetail' style={{ display: goshop ? '' : 'none' }}>
74
+        <Popup show={showCutover} maskClosable={showCutover} onClose={onClose}>
75
+          <ScrollView
76
+            scrollY
77
+            style={{ maxHeight: '60vh' }}
78
+          >
79
+            <Image mode='widthFix' src={item.details ? item.details : item.poster} />
80
+          </ScrollView>
81
+        </Popup >
82
+      </View>
83
+      <CouponCard action={PayAction}>
84
+        <CouponMedia onClick={item.targetType === 'tourist' ? goDetail : goFood}>
85
+          <CouponMedia.Header
86
+            cashback={item.cashback}
87
+            image={compressImage(item.poster)}
88
+          // badge='food'
89
+          />
90
+          <CouponMedia.Body star={st}>
91
+            <View className='foodCard'>
92
+              <View className='cpn-card-text'>
93
+                {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
94
+              </View>
95
+              <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
96
+                <Text className='cpn-card-text_mn'>¥{`${(item.averagePrice == '' ? '0.00' : item.averagePrice / 100)?.toFixed(2)}元`}</Text>
97
+                {/* <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text> */}
98
+              </View>
99
+              <View className='cpn-md-act'>
100
+                <Location {...det} />
101
+                <SaveIcon saved={item.isSaved > 0} targetType='shop_package' editable={editable} targetId={item.packageId} />
102
+              </View>
103
+            </View>
104
+          </CouponMedia.Body>
105
+        </CouponMedia>
106
+      </CouponCard>
107
+    </View>
108
+  )
109
+}

+ 54
- 0
src/components/foodCards/RecommendedCard/style.less Näytä tiedosto

@@ -0,0 +1,54 @@
1
+.view-picker {
2
+  position: relative;
3
+  top: 30%;
4
+}
5
+
6
+.foodCard {
7
+  .cpn-card-text {
8
+    font-size: 24px;
9
+    font-weight: 400;
10
+    color: #333333;
11
+    line-height: 40px;
12
+    vertical-align: baseline;
13
+    text-align: left;
14
+    & > text {
15
+      display: inline-block;
16
+
17
+      & + text {
18
+        margin-left: 8px;
19
+      }
20
+    }
21
+    &_mn {
22
+      font-size: 24px;
23
+      font-weight: bold;
24
+      color: #333333;
25
+      text-align: left;
26
+    }
27
+
28
+    &_rm {
29
+      font-size: 18px;
30
+      font-weight: 400;
31
+      text-decoration: line-through;
32
+      color: #666666;
33
+    }
34
+  }
35
+
36
+  .cpn-md-act {
37
+    display: flex;
38
+    margin-top: 10px;
39
+    text-align: left;
40
+
41
+    & > view {
42
+      flex: 1;
43
+    }
44
+  }
45
+}
46
+.packageDetail {
47
+  Image {
48
+    width: 100%;
49
+  }
50
+  .weui-dialog__bd {
51
+    padding: 0;
52
+    margin: 0;
53
+  }
54
+}

+ 4
- 4
src/components/foodCards/foodCards.jsx Näytä tiedosto

@@ -6,8 +6,8 @@ import { compressImage } from '@/utils'
6 6
 import SaveIcon from '@/components/SaveIcon'
7 7
 import Pay from '@/assets/icons/housemantj/pay.png'
8 8
 import Popup from '@/components/Popup'
9
-import './style.less'
10 9
 import { useState } from 'react'
10
+import './style.less'
11 11
 
12 12
 
13 13
 const CouponMedia = CouponCard.Media
@@ -15,7 +15,7 @@ const Action = CouponCard.Action
15 15
 
16 16
 //套餐卡片
17 17
 export default (props) => {
18
-  const { item, st, det, editable,setScroll, goshop, scene, subOrderId, id } = props
18
+  const { item, st, det, editable, setScroll, goshop, scene, subOrderId, id } = props
19 19
   const { shopId } = props.item
20 20
   const goFood = () => {
21 21
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
@@ -42,8 +42,8 @@ export default (props) => {
42 42
   const PayAction = <Action.Icon icon={Pay} text='支付' onClick={handlePayClick} />
43 43
   return (
44 44
     <View style={{ margin: '15px 5px' }} >
45
-      <View className='packageDetail' style={{display:goshop?'':'none'}}>
46
-        <Popup show={showCutover} maskClosable={showCutover}  onClose={onClose}>
45
+      <View className='packageDetail' style={{ display: goshop ? '' : 'none' }}>
46
+        <Popup show={showCutover} maskClosable={showCutover} onClose={onClose}>
47 47
           <ScrollView
48 48
             scrollY
49 49
             style={{ maxHeight: '60vh' }}

+ 66
- 17
src/pages/MineUserAll/MyTravel/index.jsx Näytä tiedosto

@@ -1,22 +1,64 @@
1 1
 import Taro from '@tarojs/taro'
2 2
 import { Image, Button, View } from '@tarojs/components'
3 3
 import SpinBox from "@/components/Spin/SpinBox";
4
+import formatTime from '@/utils/formatTime'
5
+import withLayout from '@/layouts'
6
+
4 7
 import { useState, useEffect } from "react";
5 8
 import SlideView from '@/components/SlideView';
6 9
 import editImg from '@/assets/icons/Travel/editimg.png'
7 10
 import CustomNav from '@/components/CustomNav'
11
+import { getTravelMine, deleteTravel } from '@/services/travel'
12
+
8 13
 import './style.less'
9 14
 
10
-export default (props) => {
15
+export default withLayout((props) => {
11 16
 
12 17
   const [loading, setLoading] = useState(false)
13 18
 
14
-  const handelDelete = () => {
19
+  //删除
20
+  const handelDelete = (e) => {
21
+    Taro.showModal({
22
+      title: '提示',
23
+      content: '确定要删除吗',
24
+      success: function (res) {
25
+        if (res.confirm) {
26
+
27
+          deleteTravel(e.travelId).then(r => {
28
+            Taro.showToast({
29
+              title: '删除成功',
30
+              icon: 'none',
31
+              duration: 1000
32
+            })
33
+            getList()
34
+
35
+          })
15 36
 
37
+        } else if (res.cancel) {
38
+
39
+
40
+        }
41
+      }
42
+    })
43
+
44
+  }
45
+  const handelEdit = (item) => {
46
+    Taro.navigateTo({ url: `/pages/Travel/Edit/index?id=${item.travelId}&dayNum=${item.dayNum}` })
16 47
   }
17
-  const handelEdit=()=>{
18
-    Taro.navigateTo({ url: '/pages/Travel/Edit/index' })
48
+
49
+  const [travelMine, setTravelMine] = useState([])
50
+  const getList = () => {
51
+    getTravelMine({ pageNum: 1, pageSize: 99, }).then(e => {
52
+      setTravelMine(e.records)
53
+
54
+
55
+    })
19 56
   }
57
+
58
+  useEffect(() => {
59
+    getList()
60
+
61
+  }, [])
20 62
   return (
21 63
     <View className='page-index box-content'>
22 64
       <View className='index-navbar'>
@@ -29,18 +71,25 @@ export default (props) => {
29 71
             style='height: 100%;'
30 72
           >
31 73
             <View className='View-box'>
32
-              <SlideView del onDelete={() => handelDelete(item)} className='myTravel'>
33
-                <View className='View-box-Card'>
34
-                <View className='bottom'>
35
-                  <View className='travelName'>定制行程1</View>
36
-                  <Image src={editImg} className='edit' onClick={handelEdit}></Image>
37
-                  </View>
38
-                  <View className='bottom'>
39
-                    <View className='travelDay'>行程时间:1天</View>
40
-                    <View className='travelDate'>创建时间:2021年10月31日</View>
41
-                  </View>
42
-                </View>
43
-              </SlideView>
74
+              {
75
+                travelMine.map((item, index) =>
76
+
77
+                  <SlideView key={index} del onDelete={() => handelDelete(item)} className='myTravel'>
78
+                    <View className='View-box-Card'>
79
+                      <View className='bottom'>
80
+                        <View className='travelName'>{item.title}</View>
81
+                        <Image src={editImg} className='edit' onClick={() => handelEdit(item)}></Image>
82
+                      </View>
83
+                      <View className='bottom'>
84
+                        <View className='travelDay'>行程时间:{item.dayNum}天</View>
85
+                        <View className='travelDate'>创建时间:{formatTime(item.createDate, "yyyy/MM/dd")}</View>
86
+                      </View>
87
+                    </View>
88
+                  </SlideView>
89
+
90
+                )
91
+              }
92
+
44 93
               <View className='foot'>这是我的底线</View>
45 94
             </View>
46 95
           </scroll-view>
@@ -48,4 +97,4 @@ export default (props) => {
48 97
       </View>
49 98
     </View >
50 99
   )
51
-}
100
+})

BIN
src/pages/Travel/Edit/NewCustom/ico/openUp.png Näytä tiedosto


BIN
src/pages/Travel/Edit/NewCustom/ico/packUp.png Näytä tiedosto


+ 86
- 0
src/pages/Travel/Edit/NewCustom/index.jsx Näytä tiedosto

@@ -0,0 +1,86 @@
1
+
2
+import { useState } from 'react'
3
+import CustomCard from '@/components/foodCards/CustomCard/index'
4
+
5
+import Taro from '@tarojs/taro'
6
+import { View, Button } from '@tarojs/components'
7
+import { getTravelMine, deleteTravelItem } from '@/services/travel'
8
+import openUp from './ico/openUp.png'
9
+import packUp from './ico/packUp.png'
10
+import './style.less'
11
+
12
+
13
+
14
+export default (props) => {
15
+  const { item, handleDelete } = props
16
+  const { travelItemList, travelId, dayNum } = item
17
+
18
+
19
+
20
+
21
+  const [unfold, setUnfold] = useState(false)
22
+  const onUnfold = () => {
23
+    setUnfold(!unfold)
24
+
25
+  }
26
+
27
+  const onDay = () => {
28
+    console.log("🚀 ~ file: index.jsx ~ line 17 ~ item", item)
29
+
30
+  }
31
+
32
+  const onDelete = (e) => {
33
+
34
+    const itemId = e
35
+    Taro.showModal({
36
+      title: '提示',
37
+      content: '确定要删除吗',
38
+      success: function (res) {
39
+        if (res.confirm) {
40
+          handleDelete()
41
+
42
+          deleteTravelItem(travelId, itemId).then(val => {
43
+            Taro.showToast({
44
+              title: '删除成功',
45
+              icon: 'none',
46
+              duration: 1000
47
+            })
48
+          })
49
+        } else if (res.cancel) {
50
+
51
+
52
+        }
53
+      }
54
+    })
55
+
56
+  }
57
+
58
+
59
+  return (
60
+    <view style='height:100%'>
61
+      {
62
+
63
+        travelItemList == '' ? '' : <view onClick={onUnfold} className='cssUnfold' >
64
+          <image className='unfoldIcoCss' src={unfold === true ? packUp : openUp} />
65
+          展开</view>
66
+      }
67
+
68
+
69
+      <scroll-view scrollY style={unfold === false ? 'height:100%;' : ' height:0em;'} >
70
+        {
71
+
72
+          travelItemList.map((ite, index) =>
73
+            item == '' ? <view></view> :
74
+
75
+              <CustomCard item={ite} det={ite} travelId={travelId} onDelete={onDelete} />
76
+
77
+          )
78
+
79
+        }
80
+
81
+      </scroll-view>
82
+    </view>
83
+
84
+
85
+  )
86
+}

+ 9
- 0
src/pages/Travel/Edit/NewCustom/style.less Näytä tiedosto

@@ -0,0 +1,9 @@
1
+.cssUnfold {
2
+  margin-left: 10px;
3
+  display: flex;
4
+  align-items: center;
5
+  .unfoldIcoCss {
6
+    width: 40px;
7
+    height: 40px;
8
+  }
9
+}

+ 4
- 1
src/pages/Travel/Edit/index.config.js Näytä tiedosto

@@ -4,7 +4,10 @@ export default {
4 4
   styleIsolation: 'shared',
5 5
   enableShareAppMessage: true,
6 6
   disableScroll: true,
7
+
7 8
   usingComponents: {
8
-    "mp-dialog": "weui-miniprogram/dialog/dialog"
9
+    "mp-dialog": "weui-miniprogram/dialog/dialog",
10
+
9 11
   }
10 12
 }
13
+

+ 198
- 85
src/pages/Travel/Edit/index.jsx Näytä tiedosto

@@ -1,110 +1,223 @@
1 1
 import Taro from '@tarojs/taro'
2
-import { Image, Button, View,Text } from '@tarojs/components'
2
+import { Image, Button, View, Text } from '@tarojs/components'
3 3
 import SpinBox from "@/components/Spin/SpinBox";
4
+import CustomCard from '@/components/foodCards/CustomCard/index'
5
+
4 6
 import { useState, useEffect } from "react";
5
-import NoData from '@/components/NoData'
6
-import MyCollect from '@/components/CollectList/MyCollect'
7
+import BottomMoadl from '@/components/BottomMoadl/index'
8
+import RecommendedCard from '@/components/foodCards/RecommendedCard'
7 9
 import Travel from '@/assets/icons/Travel/travel.png'
10
+import ChangeNext from '@/assets/icons/Travel/ChangeNext.png'
11
+import withLayout from '@/layouts'
12
+
8 13
 import editImg from '@/assets/icons/Travel/editimg.png'
9 14
 import CustomNav from '@/components/CustomNav'
10
-import RecommendModel from './components/RecommendModel'
15
+import { deleteTravelItem, getTravelID, getRecommendList } from '@/services/travel'
16
+
17
+import NewCustom from './NewCustom'
11 18
 import './style.less'
12 19
 
13
-export default (props) => {
20
+export default withLayout((props) => {
21
+  const { router, location } = props
22
+  const { id, dayNum } = router.params
23
+
14 24
 
15 25
   const [loading, setLoading] = useState(false)
16
-  const a = {
17
-    actualPrice: 0,
18
-    areaName: "建邺区",
19
-    areaPName: "南京市",
20
-    averagePrice: 2900,
21
-    cashback: 0,
22
-    cityId: "320105",
23
-    distance: 11131,
24
-    environmentScore: 0,
25
-    lat: "32.052602",
26
-    likeNum: 3,
27
-    lng: "118.846892",
28
-    poster: "http://yz-shigongli.oss-accelerate.aliyuncs.com/2021-09/1631772797192-1631772717(1).jpg",
29
-    pvNum: 325,
30
-    resourceNo: 128,
31
-    saveDate: "2021-09-26T15:42:58",
32
-    saveId: 512,
33
-    serviceScore: 0,
34
-    shopId: null,
35
-    standardPrice: 0,
36
-    status: 1,
37
-    sweetScore: 0,
38
-    targetId: "45c1fb5116bb429b22b68175481d7726",
39
-    targetName: "颐和路——一条颐和路,半部民国史",
40
-    targetType: "tourist",
41
-    title: "山川过雨晓光浮,初看江南第一州",
42
-    uvNum: 33,
43
-    weight: 3
26
+
27
+
28
+
29
+  const [showCutover, setShowCutover] = useState([])
30
+  const [travelCustom, setTravelCustom] = useState()
31
+
32
+
33
+  const handleDelete = (res) => {
34
+    setLoading(true)
35
+    getTravelID(id).then(e => {
36
+      setTravelCustom(e)
37
+      setShowCutover(e.travelItemList)
38
+      netx(e.travelItemList)
39
+      setLoading(false)
40
+
41
+    }).catch(r => {
42
+      setLoading(false)
43
+
44
+    })
44 45
   }
45
-  const b = [a];
46 46
 
47 47
 
48
-  const [showCutover, setShowCutover] = useState(false)
49 48
 
50
-  const handelDelete = () => {
49
+  const [dayNumber, setDayNumber] = useState(1)
50
+  const sum = dayNum - dayNumber
51
+
52
+
53
+  const addTextSum = () => {
54
+    setDayNumber(dayNumber + 1)
55
+    if (dayNumber > dayNum) {
56
+      console.log('asdasdsad');
57
+
58
+    } else {
59
+      console.log('98888888');
60
+    }
61
+
62
+
51 63
 
52 64
   }
53
-  const onClose = () => {
54
-    setShowCutover(false)
65
+  const minusTextSum = () => {
66
+    setDayNumber(dayNumber - 1)
67
+
68
+
55 69
   }
56
-  const handelEdit = () => {
57
-    //测试用的可以删
58
-    Taro.redirectTo({url:'/pages/Travel/customizedTravel/index'})
70
+
71
+
72
+  const netx = (e) => {
73
+
74
+
75
+    let a = e.filter((val) => {
76
+      return val.dayOrder == dayNumber
77
+    })
78
+    setShowCutover(a)
79
+
59 80
   }
60
-  const setRecommend=()=>{
61
-    setShowCutover(true)
81
+
82
+  const handelAddTravel = () => {
83
+    setLoading(true)
84
+
85
+    //获取我的行程。
86
+    getTravelID(id).then(e => {
87
+      setTravelCustom(e)
88
+      setShowCutover(e.travelItemList)
89
+      netx(e.travelItemList)
90
+      setLoading(false)
91
+
92
+    }).catch(e => {
93
+      setLoading(false)
94
+
95
+    })
96
+
62 97
 
63 98
   }
64
-  const handelCancel=()=>{
65
-    Taro.redirectTo({url:'/pages/MineUserAll/MyTravel/index'})
99
+
100
+  useEffect(() => {
101
+
102
+    setLoading(true)
103
+
104
+    //获取我的行程。
105
+    getTravelID(id).then(e => {
106
+      setTravelCustom(e)
107
+      setShowCutover(e.travelItemList)
108
+      netx(e.travelItemList)
109
+      setLoading(false)
110
+
111
+    }).catch(e => {
112
+      setLoading(false)
113
+
114
+    })
115
+
116
+
117
+  }, [id, dayNumber])
118
+
119
+
120
+
121
+  const onDelete = (e) => {
122
+
123
+    const itemId = e
124
+    Taro.showModal({
125
+      title: '提示',
126
+      content: '确定要删除吗',
127
+      success: function (res) {
128
+        if (res.confirm) {
129
+
130
+          deleteTravelItem(id, itemId).then(val => {
131
+            Taro.showToast({
132
+              title: '删除成功',
133
+              icon: 'none',
134
+              duration: 1000
135
+            })
136
+            handleDelete()
137
+
138
+          })
139
+        } else if (res.cancel) {
140
+
141
+
142
+        }
143
+      }
144
+    })
145
+
146
+  }
147
+
148
+
149
+  const [showFrame, setShowFrame] = useState(false)
150
+
151
+
152
+
153
+
154
+
155
+  //行程推荐
156
+  const setRecommend = () => {
157
+
158
+
159
+    setShowFrame(!showFrame)
160
+
66 161
   }
67
-  const sumbit=()=>{
68
-    // 新增修改
162
+
163
+  const handelCancel = () => {
164
+    Taro.redirectTo({ url: '/pages/MineUserAll/MyTravel/index' })
69 165
   }
166
+
70 167
   return (
71
-    <View className='page-index box-content'>
72
-      <View className='index-navbar'>
73
-        <CustomNav title='定制行程' />
74
-      </View>
75
-      <View className='TravelTitle'>
76
-        定制行程2<Image src={editImg} className='edit' onClick={handelEdit}></Image>
77
-      </View>
78
-        <RecommendModel showCutover={showCutover} onClose={onClose}>1111</RecommendModel>
79
-      <View className='index-container'>
80
-        <SpinBox loading={loading}>
81
-          <scroll-view
82
-            scrollY
83
-            style='height: 100%;'
84
-          >
85
-            <View className='View-box'>
86
-              {
87
-                b.length == 0 ?
88
-                  <NoData /> :
89
-                  <view className='waterfall'>
90
-                    {
91
-                      b.map((item, index) => { return <MyCollect key={(index)} item={item} /> })
92
-                    }
93
-                  </view>
94
-              }
95
-              <View className='tuijian' onClick={setRecommend}>
96
-                <Image src={Travel}></Image>
97
-                <Text>查看行程推荐</Text>
168
+    <view className='page-index'>
169
+      {/* 
170
+      frameTitle 标题
171
+      flag 弹窗显示 true false
172
+      ico 底部图标
173
+      textNext 底部文字
174
+      */}
175
+      <BottomMoadl frameTitle='行程推荐' dayNumber={dayNumber} travelId={id} flag={showFrame} handelAddTravel={handelAddTravel} onRecommend={setRecommend} ico={ChangeNext} textNext='换一批' location={location} />
176
+
177
+      <View className='box-content'>
178
+        <View className='index-navbar'>
179
+          <CustomNav title='定制行程' />
180
+        </View>
181
+        <scroll-view scrollY style='height: calc(100% - 75px);margin-bottom: 40px;' >
182
+
183
+          <View className='TravelTitle'>
184
+            {travelCustom?.title}<Image src={editImg} className='edit' ></Image>
185
+          </View>
186
+          <View className='index-container'>
187
+
188
+            <SpinBox loading={loading}>
189
+
190
+              <View className='View-box'>
191
+
192
+                {
193
+                  showCutover.map((item, index) =>
194
+
195
+                    <CustomCard key={index} item={item} det={item} travelId={item.travelId} onDelete={onDelete} />
196
+
197
+                  )
198
+                }
98 199
               </View>
99
-            </View>
100
-          </scroll-view>
101
-        </SpinBox>
102
-      </View>
103
-      <View className='bottom'>
104
-        <Button className='cancel' onClick={handelCancel}>取消</Button>
105
-        <Button className='btnok' onClick={sumbit}>确定</Button>
106
-      </View>
107
-
108
-    </View >
200
+            </SpinBox>
201
+          </View>
202
+
203
+
204
+          <View className='tuijian' onClick={setRecommend}>
205
+            <Image src={Travel}></Image>
206
+            <Text>查看行程推荐</Text>
207
+          </View>
208
+          <View className='bottom'>
209
+            {
210
+              dayNumber >= dayNum && <Button className='bottom-btn bottom-btn-cancel' onClick={minusTextSum} >上一天</Button>
211
+            }
212
+            {
213
+              sum >= 1 && <Button className='bottom-btn bottom-btn-ok' onClick={addTextSum}>下一天</Button>
214
+            }
215
+
216
+          </View>
217
+
218
+        </scroll-view>
219
+      </View >
220
+    </view>
221
+
109 222
   )
110
-}
223
+})

+ 54
- 12
src/pages/Travel/Edit/style.less Näytä tiedosto

@@ -1,12 +1,12 @@
1 1
 .box-content {
2 2
   height: 100vh;
3
-  .TravelTitle{
3
+  .TravelTitle {
4 4
     font-weight: bold;
5 5
     color: #333;
6 6
     line-height: 44px;
7 7
     margin: 63px 30px 15px;
8 8
     display: flex;
9
-    .edit{
9
+    .edit {
10 10
       width: 40px;
11 11
       height: 40px;
12 12
       margin: 0 30px;
@@ -15,14 +15,15 @@
15 15
   .View-box {
16 16
     margin: 30px 20px 0 20px;
17 17
   }
18
-  .tuijian{
18
+  .tuijian {
19
+    margin-bottom: 2em;
19 20
     font-size: 28px;
20 21
     font-weight: bold;
21 22
     text-decoration: underline;
22 23
     color: #274291;
23 24
     line-height: 30px;
24 25
     text-align: center;
25
-    image{
26
+    image {
26 27
       width: 42px;
27 28
       height: 41px;
28 29
       position: relative;
@@ -30,12 +31,37 @@
30 31
       right: 6px;
31 32
     }
32 33
   }
33
-  .bottom{
34
-    flex: none; 
35
-    margin: 60px 100px;
36
-    letter-spacing: 5px;
37
-    height: 78px;
38
-    .cancel{
34
+  .bottom {
35
+    // flex: none;
36
+    margin: 60px 0;
37
+    // letter-spacing: 5px;
38
+    // height: 78px;
39
+
40
+    text-align: center;
41
+
42
+    &-btn {
43
+      width: 236px;
44
+      font-size: 30px;
45
+      border-radius: 12px;
46
+      font-weight: bold;
47
+      display: inline-block;
48
+      border: 2px solid #274190;
49
+
50
+      &:nth-child(2) {
51
+        margin-left: 4em;
52
+      }
53
+    }
54
+
55
+    &-btn-cancel {
56
+      color: #274290;
57
+    }
58
+
59
+    &-btn-ok {
60
+      background: #274291;
61
+      color: #fff;
62
+    }
63
+
64
+    .cancel {
39 65
       width: 236px;
40 66
       font-size: 30px;
41 67
       border: 2px solid #274190;
@@ -45,14 +71,30 @@
45 71
       float: left;
46 72
     }
47 73
 
48
-    .btnok{
74
+    .btnok {
49 75
       width: 236px;
50 76
       background: #274291;
51 77
       border-radius: 12px;
52 78
       font-size: 30px;
53 79
       font-weight: bold;
54
-      color: #FFF;
80
+      color: #fff;
55 81
       float: right;
56 82
     }
83
+    .hoverBtnok {
84
+      width: 236px;
85
+      background: #274291;
86
+      border-radius: 12px;
87
+      font-size: 30px;
88
+      font-weight: bold;
89
+      color: #fff;
90
+    }
91
+    .hoverCanel {
92
+      width: 236px;
93
+      font-size: 30px;
94
+      border: 2px solid #274190;
95
+      border-radius: 12px;
96
+      font-weight: bold;
97
+      color: #274290;
98
+    }
57 99
   }
58 100
 }

+ 33
- 8
src/pages/Travel/customizedTravel/components/CustomDay/index.jsx Näytä tiedosto

@@ -1,21 +1,46 @@
1 1
 import React, { useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3
-import { Input, Button, View,  Label } from '@tarojs/components'
3
+import { Input, Button, View, Label } from '@tarojs/components'
4 4
 import Popup from '@/components/Popup'
5
+import { newTravelMine } from '@/services/travel'
6
+
5 7
 import './style.less'
6 8
 
7 9
 
8 10
 export default (props) => {
9 11
   const { showCutover, onClose, onFinish } = props
10
-  const [roomNum, setRoomNum] = useState('')
12
+  const [datNum, setDayNum] = useState('')
11 13
   const [loading, setLoading] = useState(false)
12
-  const handelShare = () => {
13
-    Taro.navigateTo({url:'/pages/Travel/Edit/index'})
14
+
15
+
16
+  const day = new Date();
17
+  const y = day.getFullYear();
18
+  const m = day.getMonth() + 1;
19
+  const d = day.getDate();
20
+
21
+  const handelShare = (e) => {
22
+    newTravelMine({ title: `我的自定义行程 ${y}-${m}-${d}`, dayNum: datNum }).then(res => {
23
+      Taro.showToast({
24
+        title: '创建成功',
25
+        icon: 'none',
26
+        duration: 2000
27
+      })
28
+      Taro.navigateTo({ url: `/pages/Travel/Edit/index?id=${res.travelId}&dayNum=${res.dayNum}` })
29
+
30
+    })
31
+
32
+
33
+    // Taro.navigateTo({url:'/pages/Travel/Edit/index'})
14 34
   }
15
-  const handelClose=()=>{
16
-    setRoomNum()
35
+  const handelClose = (e) => {
36
+
17 37
     onClose()
18 38
   }
39
+
40
+  const handelChangle = (e) => {
41
+    setDayNum(e)
42
+
43
+  }
19 44
   return (
20 45
     <Popup show={showCutover} maskClosable={showCutover} onClose={handelClose}>
21 46
       <View className='from-room srl'>
@@ -24,8 +49,8 @@ export default (props) => {
24 49
         </View>
25 50
         <View className='srleft'>
26 51
           <Label>出行天数:</Label>
27
-          <Input onInput={(e) => setRoomNum(e.detail.value)} value={roomNum} type='number' placeholder='请输入出行天数' />
28
-        </View>        
52
+          <Input onInput={(e) => handelChangle(e.detail.value)} value={datNum} type='number' maxlength='2' min='1' max='10' placeholder='请输入出行天数' />
53
+        </View>
29 54
         <View>
30 55
           <Button className='cancel' onClick={handelClose}>取消</Button>
31 56
           <Button className='btn' onClick={handelShare} loading={loading} disabled={loading}>确定</Button>

+ 56
- 0
src/pages/Travel/customizedTravel/components/ThreeModel/index.jsx Näytä tiedosto

@@ -0,0 +1,56 @@
1
+import React, { useState } from 'react'
2
+import Taro from '@tarojs/taro'
3
+import { Input, Button, View, Label } from '@tarojs/components'
4
+import Popup from '@/components/Popup'
5
+import { newTravelMine } from '@/services/travel'
6
+import './style.less'
7
+
8
+
9
+export default (props) => {
10
+  const { showCutover, onClose, onFinish } = props
11
+  const [roomNum, setRoomNum] = useState('')
12
+  const [loading, setLoading] = useState(false)
13
+  const day = new Date();
14
+  const y = day.getFullYear();
15
+  const m = day.getMonth() + 1;
16
+  const d = day.getDate();
17
+  const handelShare = () => {
18
+
19
+    newTravelMine({ title: `我的行程三日游 ${y}-${m}-${d}`, dayNum: 3 }).then(res => {
20
+      Taro.showToast({
21
+        title: '创建成功',
22
+        icon: 'none',
23
+        duration: 2000
24
+      })
25
+      Taro.navigateTo({ url: `/pages/Travel/Edit/index?id=${res.travelId}&dayNum=${res.dayNum}` })
26
+
27
+    })
28
+
29
+
30
+  }
31
+  const handelClose = () => {
32
+    setRoomNum()
33
+    onClose()
34
+  }
35
+  const goIndex = () => {
36
+    Taro.navigateTo({ url: '/pages/index/index' })
37
+  }
38
+  return (
39
+    <Popup show={showCutover} maskClosable={showCutover} onClose={handelClose}>
40
+      <View className='from-room srl'>
41
+        <View>
42
+          <View className='rzline' /><Label className='srl mg'>温馨提示</Label><View className='rzline' />
43
+        </View>
44
+        <View className='tips'>
45
+          <View>看看周边推荐</View>
46
+          <View className='goindex' onClick={goIndex}>戳我快速查看
47
+            <View className='arrow'><View className='v1'></View><View className='v2'></View></View></View>
48
+        </View>
49
+        <View>
50
+          <Button className='cancel' onClick={handelClose}>取消</Button>
51
+          <Button className='btn' onClick={handelShare} loading={loading} disabled={loading}>确定</Button>
52
+        </View>
53
+      </View>
54
+    </Popup>
55
+  )
56
+}

+ 73
- 0
src/pages/Travel/customizedTravel/components/ThreeModel/style.less Näytä tiedosto

@@ -0,0 +1,73 @@
1
+.from-room{
2
+  padding-top: 60px;
3
+}
4
+.srl{
5
+  font-size: 30px;
6
+  font-weight: bold;
7
+  color: #202020;  
8
+  .mg{
9
+    font-size: 38px;
10
+    margin: 0 20px 50px 20px;
11
+  }
12
+  .rzline{
13
+    border-top: 2px #999 dashed;
14
+    height: 2px;
15
+    width: 80px;
16
+    display: inline-block;
17
+    margin-bottom: 8px;
18
+  }
19
+   .tips{
20
+    font-size: 30px;
21
+    font-weight: bold;
22
+    color: #333333;
23
+    letter-spacing: 5px; 
24
+    line-height: 50px;   
25
+    margin: 40px 0;
26
+    .goindex{
27
+      color: #274291;
28
+      position: relative;
29
+    }
30
+    .arrow{
31
+      position: absolute;
32
+      right: 150px;
33
+      top: 12px;  
34
+      .v1{
35
+        width: 0;
36
+        height: 0;
37
+        border: 15px solid transparent;
38
+        border-left-color: #274291;
39
+      }
40
+      .v2{
41
+        width: 0;
42
+        height: 0;
43
+        border: 15px solid transparent;
44
+        border-left-color: #fff;
45
+        position: absolute;
46
+        bottom: 0;
47
+        left: -5px;
48
+      }
49
+    }
50
+   }
51
+  .cancel{
52
+    color: #274290;
53
+    display: inline-block;
54
+    margin: 20px 20px 0 0;
55
+    width: 236px;
56
+    height: 78px;
57
+    line-height: 78px;
58
+    border: 2px solid #274190;
59
+    border-radius: 12px;
60
+  }
61
+  .btn {
62
+    width: 236px;
63
+    height: 78px;
64
+    line-height: 78px;
65
+    background: #274291;
66
+    border-radius: 12px;
67
+    display: inline-block;
68
+    color: #fff;
69
+  }
70
+}
71
+
72
+  
73
+  

+ 18
- 2
src/pages/Travel/customizedTravel/components/TipModel/index.jsx Näytä tiedosto

@@ -2,6 +2,7 @@ import React, { useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { Input, Button, View, Label } from '@tarojs/components'
4 4
 import Popup from '@/components/Popup'
5
+import { newTravelMine } from '@/services/travel'
5 6
 import './style.less'
6 7
 
7 8
 
@@ -9,8 +10,23 @@ export default (props) => {
9 10
   const { showCutover, onClose, onFinish } = props
10 11
   const [roomNum, setRoomNum] = useState('')
11 12
   const [loading, setLoading] = useState(false)
13
+  const day = new Date();
14
+  const y = day.getFullYear();
15
+  const m = day.getMonth() + 1;
16
+  const d = day.getDate();
12 17
   const handelShare = () => {
13
-    Taro.navigateTo({ url: '/pages/Travel/Edit/index' })
18
+
19
+    newTravelMine({ title: `我的行程一日游 ${y}-${m}-${d}` }).then(res => {
20
+      Taro.showToast({
21
+        title: '创建成功',
22
+        icon: 'none',
23
+        duration: 2000
24
+      })
25
+      Taro.navigateTo({ url: `/pages/Travel/Edit/index?id=${res.travelId}&dayNum=${res.dayNum}` })
26
+
27
+    })
28
+
29
+
14 30
   }
15 31
   const handelClose = () => {
16 32
     setRoomNum()
@@ -28,7 +44,7 @@ export default (props) => {
28 44
         <View className='tips'>
29 45
           <View>看看周边推荐</View>
30 46
           <View className='goindex' onClick={goIndex}>戳我快速查看
31
-          <View className='arrow'><View className='v1'></View><View className='v2'></View></View></View>
47
+            <View className='arrow'><View className='v1'></View><View className='v2'></View></View></View>
32 48
         </View>
33 49
         <View>
34 50
           <Button className='cancel' onClick={handelClose}>取消</Button>

+ 56
- 0
src/pages/Travel/customizedTravel/components/TwoModel/index.jsx Näytä tiedosto

@@ -0,0 +1,56 @@
1
+import React, { useState } from 'react'
2
+import Taro from '@tarojs/taro'
3
+import { Input, Button, View, Label } from '@tarojs/components'
4
+import Popup from '@/components/Popup'
5
+import { newTravelMine } from '@/services/travel'
6
+import './style.less'
7
+
8
+
9
+export default (props) => {
10
+  const { showCutover, onClose, onFinish } = props
11
+  const [roomNum, setRoomNum] = useState('')
12
+  const [loading, setLoading] = useState(false)
13
+  const day = new Date();
14
+  const y = day.getFullYear();
15
+  const m = day.getMonth() + 1;
16
+  const d = day.getDate();
17
+  const handelShare = () => {
18
+
19
+    newTravelMine({ title: `我的行程二日游 ${y}-${m}-${d}`, dayNum: 2 }).then(res => {
20
+      Taro.showToast({
21
+        title: '创建成功',
22
+        icon: 'none',
23
+        duration: 2000
24
+      })
25
+      Taro.navigateTo({ url: `/pages/Travel/Edit/index?id=${res.travelId}&dayNum=${res.dayNum}` })
26
+
27
+    })
28
+
29
+
30
+  }
31
+  const handelClose = () => {
32
+    setRoomNum()
33
+    onClose()
34
+  }
35
+  const goIndex = () => {
36
+    Taro.navigateTo({ url: '/pages/index/index' })
37
+  }
38
+  return (
39
+    <Popup show={showCutover} maskClosable={showCutover} onClose={handelClose}>
40
+      <View className='from-room srl'>
41
+        <View>
42
+          <View className='rzline' /><Label className='srl mg'>温馨提示</Label><View className='rzline' />
43
+        </View>
44
+        <View className='tips'>
45
+          <View>看看周边推荐</View>
46
+          <View className='goindex' onClick={goIndex}>戳我快速查看
47
+            <View className='arrow'><View className='v1'></View><View className='v2'></View></View></View>
48
+        </View>
49
+        <View>
50
+          <Button className='cancel' onClick={handelClose}>取消</Button>
51
+          <Button className='btn' onClick={handelShare} loading={loading} disabled={loading}>确定</Button>
52
+        </View>
53
+      </View>
54
+    </Popup>
55
+  )
56
+}

+ 73
- 0
src/pages/Travel/customizedTravel/components/TwoModel/style.less Näytä tiedosto

@@ -0,0 +1,73 @@
1
+.from-room{
2
+  padding-top: 60px;
3
+}
4
+.srl{
5
+  font-size: 30px;
6
+  font-weight: bold;
7
+  color: #202020;  
8
+  .mg{
9
+    font-size: 38px;
10
+    margin: 0 20px 50px 20px;
11
+  }
12
+  .rzline{
13
+    border-top: 2px #999 dashed;
14
+    height: 2px;
15
+    width: 80px;
16
+    display: inline-block;
17
+    margin-bottom: 8px;
18
+  }
19
+   .tips{
20
+    font-size: 30px;
21
+    font-weight: bold;
22
+    color: #333333;
23
+    letter-spacing: 5px; 
24
+    line-height: 50px;   
25
+    margin: 40px 0;
26
+    .goindex{
27
+      color: #274291;
28
+      position: relative;
29
+    }
30
+    .arrow{
31
+      position: absolute;
32
+      right: 150px;
33
+      top: 12px;  
34
+      .v1{
35
+        width: 0;
36
+        height: 0;
37
+        border: 15px solid transparent;
38
+        border-left-color: #274291;
39
+      }
40
+      .v2{
41
+        width: 0;
42
+        height: 0;
43
+        border: 15px solid transparent;
44
+        border-left-color: #fff;
45
+        position: absolute;
46
+        bottom: 0;
47
+        left: -5px;
48
+      }
49
+    }
50
+   }
51
+  .cancel{
52
+    color: #274290;
53
+    display: inline-block;
54
+    margin: 20px 20px 0 0;
55
+    width: 236px;
56
+    height: 78px;
57
+    line-height: 78px;
58
+    border: 2px solid #274190;
59
+    border-radius: 12px;
60
+  }
61
+  .btn {
62
+    width: 236px;
63
+    height: 78px;
64
+    line-height: 78px;
65
+    background: #274291;
66
+    border-radius: 12px;
67
+    display: inline-block;
68
+    color: #fff;
69
+  }
70
+}
71
+
72
+  
73
+  

+ 38
- 10
src/pages/Travel/customizedTravel/index.jsx Näytä tiedosto

@@ -8,42 +8,70 @@ import threeDay from '@/assets/icons/Travel/threeDay.png'
8 8
 import custom from '@/assets/icons/Travel/custom.png'
9 9
 import CustomDay from './components/CustomDay/index.jsx'
10 10
 import TipModel from './components/TipModel/index.jsx'
11
+import TwoModel from './components/TwoModel/index.jsx'
12
+import ThreeModel from './components/ThreeModel/index.jsx'
11 13
 import './style.less'
12 14
 
13 15
 export default (props) => {
14 16
   const [showCutover, setShowCutover] = useState(false)
15 17
   const [showCutoverTip, setShowCutoverTip] = useState(false)
18
+  const [showCutoverTwo, setShowCutoverTwo] = useState(false)
19
+  const [showCutoverThree, setShowCutoverThree] = useState(false)
16 20
   const onClose = () => {
17 21
     setShowCutover(false)
18 22
   }
19 23
   const handleFinish = (val) => {
20
-   
21
-  }
22
-  const onClose2 = () => {
23
-    setShowCutoverTip(false)
24
+
24 25
   }
26
+
25 27
   const handleFinish2 = (val) => {
26
-   
28
+
27 29
   }
28
-  const handelCustom=()=>{
30
+  const handelCustom = () => {
29 31
     setShowCutover(true)
30 32
   }
31
-  const handelDay=()=>{
33
+  const onCloseTip = () => {
34
+    //关闭一日游
35
+    setShowCutoverTip(false)
36
+  }
37
+  const handelDay = () => {
38
+    //打开一日游
32 39
     setShowCutoverTip(true)
33 40
   }
41
+  // ------------------
42
+  const onCloseTwo = () => {
43
+    //关闭二日游
44
+    setShowCutoverTwo(false)
45
+  }
46
+  const handelTowDay = () => {
47
+    //打开二日游
48
+    setShowCutoverTwo(true)
49
+  }
50
+  // ------------------
51
+
52
+  const onCloseThree = () => {
53
+    //关闭三日游
54
+    setShowCutoverThree(false)
55
+  }
56
+  const handelThreeDay = () => {
57
+    //打开三日游
58
+    setShowCutoverThree(true)
59
+  }
34 60
   return (
35 61
     <View className='page-index'>
36 62
       <View className='index-navbar'>
37 63
         <CustomNav title='定制行程' />
38 64
       </View>
39 65
       <CustomDay showCutover={showCutover} onClose={onClose} onFinish={handleFinish} />
40
-      <TipModel showCutover={showCutoverTip} onClose={onClose2} onFinish={handleFinish2} />
66
+      <TipModel showCutover={showCutoverTip} onClose={onCloseTip} />
67
+      <TwoModel showCutover={showCutoverTwo} onClose={onCloseTwo} />
68
+      <ThreeModel showCutover={showCutoverThree} onClose={onCloseThree} />
41 69
 
42 70
       <View className='index-container custom'>
43 71
         <View className='selectbtn'>
44 72
           <Image src={oneDay} className='img' onClick={handelDay}></Image>
45
-          <Image src={twoDay} className='img'></Image>
46
-          <Image src={threeDay} className='img'></Image>
73
+          <Image src={twoDay} className='img' onClick={handelTowDay}></Image>
74
+          <Image src={threeDay} className='img' onClick={handelThreeDay}></Image>
47 75
           <Image src={custom} className='img' onClick={handelCustom}></Image>
48 76
         </View>
49 77
       </View>

+ 22
- 6
src/pages/details/NoteDetails/index.jsx Näytä tiedosto

@@ -3,8 +3,6 @@ import ax from '@/assets/icons/housemantj/onlove.png'
3 3
 import dw from '@/assets/icons/housemantj/loc-o.png'
4 4
 import TextMentioned from '@/assets/icons/housemantj/TextMentioned.png'
5 5
 import NoteasICO from '@/assets/icons/housemantj/NoteasICO.png'
6
-import { compressImage } from '@/utils'
7
-import MoreGuide from "@/components/MoreGuide";//视频
8 6
 
9 7
 import share from '@/assets/icons/housemantj/touristShare.png'
10 8
 import good from '@/assets/icons/housemantj/touristGood.png'
@@ -40,7 +38,6 @@ export default withLayout((props) => {
40 38
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
41 39
   const [loading, setLoading] = useState(false)
42 40
   const [travelMine, setTravelMine] = useState()
43
-  const [travelMineContent, setTravelMineContent] = useState()
44 41
   //banner图集数组
45 42
   const [imglist, setimglist] = useState([])
46 43
   const [index, setIndex] = useState(0)
@@ -62,16 +59,35 @@ export default withLayout((props) => {
62 59
       setGuidance('shareOn')
63 60
     }
64 61
   }, [router.params.enterType])
62
+  const resourceList = () => {
63
+    getNoteID(id).then((res) => {
64
+      setDetail(res)
65
+      setimglist(res.imageList || [])
66
+      setRecommend(res.wxResourceList || [])
65 67
 
66 68
 
67
-  useEffect(() => {
68
-    //获取我的行程。
69
+    }).catch(e => {
70
+      console.error("getNoteID错误", e)
71
+      setLoading(false)
72
+
73
+    })
74
+
75
+  }
76
+  const handelNoteList = () => {
69 77
     getTravelMine({ pageNum: 1, pageSize: 99, simple: true }).then(e => {
70 78
       setTravelMine(e)
71 79
 
72 80
     })
73 81
 
82
+  }
83
+
84
+  useEffect(() => {
85
+    //获取我的行程。
74 86
 
87
+    getTravelMine({ pageNum: 1, pageSize: 99, simple: true }).then(e => {
88
+      setTravelMine(e)
89
+
90
+    })
75 91
 
76 92
     if (id) {
77 93
       setLoading(true)
@@ -159,7 +175,7 @@ export default withLayout((props) => {
159 175
             <view className='title'>
160 176
               <image src={TextMentioned} />文中提及
161 177
             </view>
162
-            {(recommend || []).map((item) => <NoteCards travelMine={travelMine} travelMineContent={travelMineContent} key={item} item={item} det={item} />)}
178
+            {(recommend || []).map((item) => <NoteCards resourceList={resourceList} travelMine={travelMine} key={item} item={item} det={item} handelNoteList={handelNoteList} />)}
163 179
           </view>
164 180
           <view className='botton'>这是我的底线</view>
165 181
         </scroll-view>

+ 1
- 1
src/pages/details/foodDetails/foodDetails.less Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 .storeDetails {
2 2
   background-color: #fff;
3 3
   border-radius: 12px;
4
-  margin-bottom: 20px;  
4
+  margin-bottom: 20px;
5 5
   .storeJs {
6 6
     padding: 20px;
7 7
     .storeName {

+ 9
- 0
src/pages/index/tabs/Recommend.jsx Näytä tiedosto

@@ -117,8 +117,17 @@ export default (props) => {
117 117
             </List>
118 118
             :
119 119
             <RecommendNote />
120
+
121
+
122
+
123
+
124
+
125
+
120 126
         }
127
+
121 128
       </view>
129
+
130
+
122 131
     </view>
123 132
   )
124 133
 }

+ 58
- 1
src/services/travel.js Näytä tiedosto

@@ -13,6 +13,17 @@ export const getTravelMine = (params) => request(`/travel/mine`, { params })
13 13
 
14 14
 
15 15
 
16
+
17
+/**
18
+ * 获取行程详情
19
+ * @param {*} 
20
+ * @returns 
21
+ */
22
+
23
+export const getTravelID = (id, params) => request(`/travel/${id}`, { params })
24
+
25
+
26
+
16 27
 /**
17 28
  * 新建保存行程
18 29
  * @param {*} 
@@ -22,6 +33,45 @@ export const getTravelMine = (params) => request(`/travel/mine`, { params })
22 33
 export const newTravelMine = (data) => request(`/travel`, { method: 'post', data })
23 34
 
24 35
 
36
+/**
37
+ * 获取命定行程
38
+ * @param {*} 
39
+ * @returns 
40
+ */
41
+
42
+export const getTravelDestiny = (data) => request(`/travel/destiny`, { method: 'get', data })
43
+/**
44
+ * 保存命定行程
45
+ * @param {*} 
46
+ * @returns 
47
+ */
48
+
49
+export const addTravelDestiny = (data) => request(`/travel/destiny`, { method: 'post', data })
50
+
51
+
52
+
53
+/**
54
+ * 删除行程
55
+ * @param {*} 
56
+ * @returns 
57
+ */
58
+
59
+export const deleteTravel = (id, data) => request(`/travel/${id}`, { method: 'delete', data })
60
+
61
+
62
+
63
+
64
+
65
+
66
+/**
67
+ * 删除行程地点
68
+ * @param {*} 
69
+ * @returns 
70
+ */
71
+
72
+export const deleteTravelItem = (id, no, data) => request(`/travel/${id}/travel-item/${no}`, { method: 'delete', data })
73
+
74
+
25 75
 
26 76
 /**
27 77
  * 保存行程地点
@@ -29,4 +79,11 @@ export const newTravelMine = (data) => request(`/travel`, { method: 'post', data
29 79
  * @returns 
30 80
  */
31 81
 
32
-export const saveTravel = (id, data) => request(`/travel/${id}/travel-item`, { method: 'post', data })
82
+export const saveTravel = (id, data) => request(`/travel/${id}/travel-item`, { method: 'post', data })
83
+
84
+/**
85
+ * 行程资源推荐 换一批
86
+ * @returns 
87
+ * params 
88
+ */
89
+export const getRecommendList = (params) => request('/resource/recommend', { params })