李志伟 3 年之前
父節點
當前提交
bfdea8635a
共有 3 個文件被更改,包括 59 次插入64 次删除
  1. 26
    31
      src/pages/MineUserAll/MyTravel/index.jsx
  2. 31
    32
      src/pages/Travel/Edit/index.jsx
  3. 2
    1
      src/pages/Travel/Edit/style.less

+ 26
- 31
src/pages/MineUserAll/MyTravel/index.jsx 查看文件

@@ -1,8 +1,8 @@
1 1
 import Taro, { useDidShow } from '@tarojs/taro'
2
-import { Image, Button, View } from '@tarojs/components'
2
+import { Image, View } from '@tarojs/components'
3 3
 import formatTime from '@/utils/formatTime'
4 4
 import withLayout from '@/layouts'
5
-import { useState, useEffect } from "react";
5
+import { useState } from "react";
6 6
 import SlideView from '@/components/SlideView';
7 7
 import editImg from '@/assets/icons/Travel/editimg.png'
8 8
 import CustomNav from '@/components/CustomNav'
@@ -25,8 +25,6 @@ export default withLayout((props) => {
25 25
               duration: 1000
26 26
             })
27 27
           })
28
-        } else if (res.cancel) {
29
-          getList()
30 28
         }
31 29
       }
32 30
     })
@@ -41,41 +39,38 @@ export default withLayout((props) => {
41 39
       setTravelMine(e.records)
42 40
     })
43 41
   }
42
+  //页面切换回来时查询列表   两种情况第一是从个人中心进入  第二是从行程编辑页面返回时重新查询列表
44 43
   useDidShow(() => getList())
45
-
46
-  useEffect(() => {
47
-    getList()
48
-  }, [])
49 44
   return (
50 45
     <View className='page-index box-content'>
51 46
       <View className='index-navbar'>
52 47
         <CustomNav title='我的行程' />
53 48
       </View>
54 49
       <View className='index-container'>
55
-          <scroll-view
56
-            scrollY
57
-            style='height: 100%;'
58
-          >
59
-            <View className='View-box'>
60
-              {
61
-                travelMine.map((item, index) =>
62
-                  <SlideView key={index} del onDelete={() => handelDelete(item)} className='myTravel'>
63
-                    <View className='View-box-Card' onClick={() => handelEdit(item)}>
64
-                      <View className='bottom'>
65
-                        <View className='travelName'>{item.title}</View>
66
-                        <Image src={editImg} className='edit'></Image>
67
-                      </View>
68
-                      <View className='bottom'>
69
-                        <View className='travelDay'>行程时间:{item.dayNum}天</View>
70
-                        <View className='travelDate'>创建时间:{formatTime(item.createDate, "yyyy/MM/dd")}</View>
71
-                      </View>
50
+        <scroll-view
51
+          scrollY
52
+          style='height: 100%;'
53
+        >
54
+          <View className='View-box'>
55
+            {
56
+              travelMine.map((item, index) =>
57
+                <SlideView key={index} del onDelete={() => handelDelete(item)} className='myTravel'>
58
+                  <View className='View-box-Card' onClick={() => handelEdit(item)}>
59
+                    <View className='bottom'>
60
+                      <View className='travelName'>{item.title}</View>
61
+                      <Image src={editImg} className='edit'></Image>
62
+                    </View>
63
+                    <View className='bottom'>
64
+                      <View className='travelDay'>行程时间:{item.dayNum}天</View>
65
+                      <View className='travelDate'>创建时间:{formatTime(item.createDate, "yyyy/MM/dd")}</View>
72 66
                     </View>
73
-                  </SlideView>
74
-                )
75
-              }
76
-              <View className='foot'>这是我的底线</View>
77
-            </View>
78
-          </scroll-view>
67
+                  </View>
68
+                </SlideView>
69
+              )
70
+            }
71
+            <View className='foot'>这是我的底线</View>
72
+          </View>
73
+        </scroll-view>
79 74
       </View>
80 75
     </View >
81 76
   )

+ 31
- 32
src/pages/Travel/Edit/index.jsx 查看文件

@@ -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'
@@ -16,7 +16,7 @@ import './style.less'
16 16
 
17 17
 export default withLayout((props) => {
18 18
   const { router, location } = props
19
-  const { id, dayNum} = router.params
19
+  const { id, dayNum } = router.params
20 20
 
21 21
   const [loading, setLoading] = useState(false)
22 22
   const [bottomDayNum, setBottomDayNum] = useState(true)
@@ -133,7 +133,7 @@ export default withLayout((props) => {
133 133
   }
134 134
   //确认
135 135
   const ButtonOK = () => {
136
-    seaveTravelID(id, { title: inputChangle}).then(val => {
136
+    seaveTravelID(id, { title: inputChangle }).then(val => {
137 137
       Taro.showToast({
138 138
         title: '修改成功',
139 139
         icon: 'none',
@@ -150,34 +150,33 @@ export default withLayout((props) => {
150 150
   }
151 151
 
152 152
   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 底部文字
153
+    <View className='page-index box-content'>
154
+      <View style={{ flex: 'none' }}>
155
+        <Popup show={showDialog} maskClosable={false}>
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
+          <View className='travel-button-box' >
163
+            <Button className='travelButton-Cancel' onClick={ButtonCancel} >取消</Button>
164
+            <Button className='travelButton-OK' onClick={ButtonOK} >确定</Button>
165
+          </View>
166
+        </Popup>
167
+        {/* 
168
+        frameTitle 标题
169
+        flag 弹窗显示 true false
170
+        ico 底部图标
171
+        textNext 底部文字
173 172
       */}
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;' >
173
+        <BottomMoadl frameTitle='行程推荐' dayNumber={dayNumber} travelId={id} flag={showFrame} handelAddTravel={handelAddTravel} onRecommend={setRecommend} ico={ChangeNext} textNext='换一批' location={location} />
174
+      </View>
175
+      <View className='index-navbar'>
176
+        <CustomNav title='定制行程' />
177
+      </View>
178
+      <View className='index-container'>
179
+        <scroll-view scrollY style='height:100%;' >
181 180
           <View className='TravelTitle'>
182 181
             {travelCustom?.title}<Image src={editImg} className='edit' onClick={handleModale} ></Image>
183 182
           </View>
@@ -208,7 +207,7 @@ export default withLayout((props) => {
208 207
             </View>
209 208
           }
210 209
         </scroll-view>
211
-      </View >
212
-    </view>
210
+      </View>
211
+    </View>
213 212
   )
214 213
 })

+ 2
- 1
src/pages/Travel/Edit/style.less 查看文件

@@ -55,7 +55,8 @@
55 55
     font-weight: bold;
56 56
     color: #333;
57 57
     line-height: 44px;
58
-    margin: 63px 30px 15px;
58
+    margin: 0 30px 15px;
59
+    padding-top: 63px;
59 60
     display: flex;
60 61
     .edit {
61 62
       width: 40px;