|
@@ -2,7 +2,7 @@ import Taro from '@tarojs/taro'
|
2
|
2
|
import { Image, Button, View, Text, Input } from '@tarojs/components'
|
3
|
3
|
import SpinBox from "@/components/Spin/SpinBox";
|
4
|
4
|
import CustomCard from '@/components/foodCards/CustomCard/index'
|
5
|
|
-import { useState, useEffect, useRef } from "react";
|
|
5
|
+import { useState, useEffect } from "react";
|
6
|
6
|
import BottomMoadl from '@/components/BottomMoadl/index'
|
7
|
7
|
import Travel from '@/assets/icons/Travel/travel.png'
|
8
|
8
|
import ChangeNext from '@/assets/icons/Travel/ChangeNext.png'
|
|
@@ -19,12 +19,17 @@ export default withLayout((props) => {
|
19
|
19
|
const { id, dayNum } = router.params
|
20
|
20
|
|
21
|
21
|
const [loading, setLoading] = useState(false)
|
|
22
|
+ //判断一天行程还是多天行程的标识位 一天就不用显示上一天下一天按钮
|
22
|
23
|
const [bottomDayNum, setBottomDayNum] = useState(true)
|
23
|
24
|
|
|
25
|
+ //获取当前行程详情不包括标题
|
24
|
26
|
const [showCutover, setShowCutover] = useState([])
|
|
27
|
+ //获取行程列表包括标题
|
25
|
28
|
const [travelCustom, setTravelCustom] = useState()
|
26
|
29
|
|
|
30
|
+ //文本框弹窗
|
27
|
31
|
const [showDialog, setShowDialog] = useState(false);
|
|
32
|
+ //行程标题获取弹窗的文本框的值
|
28
|
33
|
const [inputChangle, setInputChangle] = useState();
|
29
|
34
|
|
30
|
35
|
const handleDelete = (res) => {
|
|
@@ -94,9 +99,11 @@ export default withLayout((props) => {
|
94
|
99
|
}, [id, dayNumber])
|
95
|
100
|
|
96
|
101
|
|
97
|
|
-
|
|
102
|
+ //删除行程
|
98
|
103
|
const onDelete = (e) => {
|
|
104
|
+ //这个删除是需要两个id的前一个id是整个行程的id需要根据这个id找到这条行程的全部信息 后面那个itemId是行程数组travelItemList里面的一条当前点击的需要删除的信息的id
|
99
|
105
|
const itemId = e
|
|
106
|
+ console.log(e)
|
100
|
107
|
Taro.showModal({
|
101
|
108
|
title: '提示',
|
102
|
109
|
content: '确定要删除吗',
|
|
@@ -110,7 +117,6 @@ export default withLayout((props) => {
|
110
|
117
|
})
|
111
|
118
|
handleDelete()
|
112
|
119
|
})
|
113
|
|
- } else if (res.cancel) {
|
114
|
120
|
}
|
115
|
121
|
}
|
116
|
122
|
})
|
|
@@ -122,7 +128,6 @@ export default withLayout((props) => {
|
122
|
128
|
setShowFrame(!showFrame)
|
123
|
129
|
}
|
124
|
130
|
//修改行程名字
|
125
|
|
-
|
126
|
131
|
const handelInput = (e) => {
|
127
|
132
|
setInputChangle(e.detail.value)
|
128
|
133
|
}
|
|
@@ -150,34 +155,33 @@ export default withLayout((props) => {
|
150
|
155
|
}
|
151
|
156
|
|
152
|
157
|
return (
|
153
|
|
- <view className='page-index'>
|
154
|
|
- <Popup show={showDialog} maskClosable={false}>
|
155
|
|
-
|
156
|
|
- <view className='travel-box-info-ROOM'>
|
157
|
|
- <view className='travel-bi-name-ROOM' >
|
158
|
|
- <view className='travel-bin-title-ROOM'>修改行程名称:</view>
|
159
|
|
- <Input className='travel-bint-nameInfo-ROOM' value={inputChangle} onInput={handelInput} />
|
160
|
|
- </view>
|
161
|
|
- </view>
|
162
|
|
-
|
163
|
|
- <view className='travel-button-box' >
|
164
|
|
- <button className='travelButton-Cancel' onClick={ButtonCancel} >取消</button>
|
165
|
|
- <button className='travelButton-OK' onClick={ButtonOK} >确定</button>
|
166
|
|
- </view>
|
167
|
|
- </Popup>
|
168
|
|
- {/*
|
169
|
|
- frameTitle 标题
|
170
|
|
- flag 弹窗显示 true false
|
171
|
|
- ico 底部图标
|
172
|
|
- textNext 底部文字
|
|
158
|
+ <View className='page-index box-content'>
|
|
159
|
+ <View style={{ flex: 'none' }}>
|
|
160
|
+ <Popup show={showDialog} maskClosable={false}>
|
|
161
|
+ <View className='travel-box-info-ROOM'>
|
|
162
|
+ <View className='travel-bi-name-ROOM' >
|
|
163
|
+ <View className='travel-bin-title-ROOM'>修改行程名称:</View>
|
|
164
|
+ <Input className='travel-bint-nameInfo-ROOM' value={inputChangle} onInput={handelInput} />
|
|
165
|
+ </View>
|
|
166
|
+ </View>
|
|
167
|
+ <View className='travel-button-box' >
|
|
168
|
+ <Button className='travelButton-Cancel' onClick={ButtonCancel} >取消</Button>
|
|
169
|
+ <Button className='travelButton-OK' onClick={ButtonOK} >确定</Button>
|
|
170
|
+ </View>
|
|
171
|
+ </Popup>
|
|
172
|
+ {/*
|
|
173
|
+ frameTitle 标题
|
|
174
|
+ flag 弹窗显示 true false
|
|
175
|
+ ico 底部图标
|
|
176
|
+ textNext 底部文字
|
173
|
177
|
*/}
|
174
|
|
- <BottomMoadl frameTitle='行程推荐' dayNumber={dayNumber} travelId={id} flag={showFrame} handelAddTravel={handelAddTravel} onRecommend={setRecommend} ico={ChangeNext} textNext='换一批' location={location} />
|
175
|
|
-
|
176
|
|
- <View className='box-content'>
|
177
|
|
- <View className='index-navbar'>
|
178
|
|
- <CustomNav title='定制行程' />
|
179
|
|
- </View>
|
180
|
|
- <scroll-view scrollY style='height: calc(100% - 75px);margin-bottom: 40px;' >
|
|
178
|
+ <BottomMoadl frameTitle='行程推荐' dayNumber={dayNumber} travelId={id} flag={showFrame} handelAddTravel={handelAddTravel} onRecommend={setRecommend} ico={ChangeNext} textNext='换一批' location={location} />
|
|
179
|
+ </View>
|
|
180
|
+ <View className='index-navbar'>
|
|
181
|
+ <CustomNav title='定制行程' />
|
|
182
|
+ </View>
|
|
183
|
+ <View className='index-container'>
|
|
184
|
+ <scroll-view scrollY style='height:100%;' >
|
181
|
185
|
<View className='TravelTitle'>
|
182
|
186
|
{travelCustom?.title}<Image src={editImg} className='edit' onClick={handleModale} ></Image>
|
183
|
187
|
</View>
|
|
@@ -208,7 +212,7 @@ export default withLayout((props) => {
|
208
|
212
|
</View>
|
209
|
213
|
}
|
210
|
214
|
</scroll-view>
|
211
|
|
- </View >
|
212
|
|
- </view>
|
|
215
|
+ </View>
|
|
216
|
+ </View>
|
213
|
217
|
)
|
214
|
218
|
})
|