张延森 4 years ago
parent
commit
527163518f

+ 9
- 2
src/pages/addimg/index.jsx View File

@@ -27,7 +27,7 @@ const addimg = (props) => {
27 27
     const getImageList = () => {
28 28
 
29 29
 
30
-        request({ url: '/taMetaImageTag', params: { tagIds: tagIds } }).then((res) => {
30
+        request({ url: '/taMetaImageTag', params: { tagIds: tagIds, pageSize: 999 } }).then((res) => {
31 31
             const { records, ...page } = res.data.data
32 32
 
33 33
             const r = records.reduce((all, next) => all.some((atom) => atom.imageId == next.imageId) ? all : [...all, next], []);
@@ -83,6 +83,13 @@ const addimg = (props) => {
83 83
 
84 84
     }
85 85
 
86
+    const handleImageClick = url => {
87
+        Taro.previewImage({
88
+            current: url,
89
+            urls: [url]
90
+        })
91
+    }
92
+
86 93
 
87 94
     return <View className='addimg'>
88 95
 
@@ -95,7 +102,7 @@ const addimg = (props) => {
95 102
                         <View className='addimg-view-card-radio' onClick={() => choiceImg(x)}>
96 103
                             {choiceList.find(y => y.imageId == x.imageId) && <Image src={radio} style={{ width: '30rpx', height: '20rpx' }}></Image>}
97 104
                         </View>
98
-                        <Image src={x.image} mode='aspectFit' style={{ width: '100%', height: '200rpx' }} ></Image>
105
+                        <Image src={x.image} mode='aspectFit' style={{ width: '100%', height: '200rpx' }} onClick={() => handleImageClick(x.image)} ></Image>
99 106
                     </View>
100 107
                 })}
101 108
                 {/* {list.map((x) => {

+ 10
- 1
src/pages/customer/index.js View File

@@ -1,5 +1,5 @@
1 1
 import React, { useEffect, useMemo, useState } from 'react'
2
-import Taro from '@tarojs/taro'
2
+import Taro, { useShareAppMessage  } from '@tarojs/taro'
3 3
 import { useSelector } from 'react-redux'
4 4
 import { View, Image,Text } from '@tarojs/components'
5 5
 import  Layout from '../../layout/index'
@@ -13,6 +13,8 @@ import './index.scss'
13 13
 import request from '../../util/request'
14 14
 import usericon from '../../assets/usericon.png'
15 15
 
16
+const defaultImgUrl= 'https://zhiyun-image.oss-cn-shanghai.aliyuncs.com/shigongli/shigongli_share_default-min.jpg'
17
+
16 18
 const index = (props) => {
17 19
   const {houseId,orderId} = props
18 20
  
@@ -41,6 +43,13 @@ const index = (props) => {
41 43
     }
42 44
   }, [props.orderId])
43 45
 
46
+  useShareAppMessage(() => {
47
+    return {
48
+      title: `欢迎来和我一起探索吃喝玩乐~`,
49
+      imageUrl: defaultImgUrl
50
+    }
51
+  })
52
+
44 53
   useEffect(() => {
45 54
     if(props.orderId && regUnFinished){
46 55
       setPageState('1')

+ 20
- 0
src/pages/house/list/index.jsx View File

@@ -63,6 +63,23 @@ let house = (props, ref) => {
63 63
     Taro.navigateTo({ url: `/pages/share/index?houseId=${x.houseId}&&title=${x.title}` });
64 64
   };
65 65
 
66
+  const handleDelete = x => {
67
+    Taro.showModal({
68
+      title: '删除',
69
+      content: '确认删除当前房源?',
70
+      success: res => {
71
+        if (res.confirm) {
72
+          request({
73
+            url: `/taHouse/${x.houseId}`,
74
+            method: 'DELETE'
75
+          }).then(res => {
76
+            setList(list.filter(t => t.houseId != x.houseId))
77
+          });
78
+        }
79
+      }
80
+    })
81
+  }
82
+
66 83
   useEffect(() => {
67 84
     
68 85
 
@@ -177,6 +194,9 @@ let house = (props, ref) => {
177 194
                 <View className="bottom-btn" onClick={() => onShare(x)}>
178 195
                   分享链接
179 196
                 </View>
197
+                <View className="bottom-btn" onClick={() => handleDelete(x)}>
198
+                  删除房源
199
+                </View>
180 200
               </View>
181 201
             </ContainerLayout>
182 202
           </View>        

+ 2
- 1
src/pages/index/index.config.js View File

@@ -1,4 +1,5 @@
1 1
 export default {
2 2
   // navigationBarTitleText: '首页',
3
-  "navigationStyle": "custom"
3
+  navigationStyle: "custom",
4
+  enableShareAppMessage: true
4 5
 }

+ 0
- 7
src/pages/landlord/index.jsx View File

@@ -27,25 +27,18 @@ const index = (props) => {
27 27
   const childRef = useRef();
28 28
 
29 29
 
30
-
31
-
32
-
33
-
34 30
   const handleClose = () => {
35 31
     setIsOpened(false)
36 32
   }
37 33
   const onTabClick = (e) => {
38
-    console.log(e, '111')
39 34
     setUserRole(e)
40 35
 
41 36
   }
42 37
 
43 38
   const onRegisterChange = (e) => {
44
-    console.log(e, '111')
45 39
   }
46 40
   const onCopy = (e) => {
47 41
 
48
-    console.log(childRef, '111')
49 42
     if (radioHouseData.houseId) {
50 43
 
51 44
       const {houseId,...data} = radioHouseData

+ 5
- 5
src/pages/material/index.jsx View File

@@ -90,11 +90,11 @@ const index = (props) => {
90 90
             }), (e) => onSearch()]}></Tab>
91 91
         </View>
92 92
 
93
-
94
-        {pageState == '1' && <><Layout>
95
-            12222222
96
-        </Layout>
97
-            <Tab pageState='3' value={['取消', '确认']} onClick={[(e) => setPageState('2'), (e) => setPageState('3')]}></Tab></>}
93
+        {pageState == '1' && <>
94
+            <Layout> </Layout>
95
+            <Tab pageState='3' value={['取消', '确认']} onClick={[(e) => setPageState('2'), (e) => setPageState('3')]}></Tab>
96
+            </>
97
+        }
98 98
     </View>
99 99
 }
100 100
 

+ 9
- 8
src/pages/share/index.jsx View File

@@ -31,13 +31,15 @@ const Index = () => {
31 31
     const [showShareModal, setShowShareModal] = useState(false)
32 32
 
33 33
     useEffect(() => {
34
-        request({ url: "/taHouseSetting/last", params: { houseId } }).then((res) => {
35
-            if (res.data.data) {
36
-                setPersonNum(res.data.data.personNum)
37
-                setStartTime(res.data.data.startDate)
38
-                setEndTime(res.data.data.endDate)
39
-            }
40
-        })
34
+        if (houseId) {
35
+            request({ url: "/taHouseSetting/last", params: { houseId } }).then((res) => {
36
+                if (res.data.data) {
37
+                    setPersonNum(res.data.data.personNum)
38
+                    setStartTime(res.data.data.startDate)
39
+                    setEndTime(res.data.data.endDate)
40
+                }
41
+            })
42
+        }
41 43
         // eslint-disable-next-line react-hooks/exhaustive-deps
42 44
     }, [])
43 45
 
@@ -52,7 +54,6 @@ const Index = () => {
52 54
         wx.requestSubscribeMessage({
53 55
             tmplIds: subscribeMessageList.filter(x=>x.type==='settled-in').map(x=>x.code),
54 56
             success (res) { 
55
-              console.log(res,'-------2222222----------')
56 57
               handleShareReady()
57 58
             //   setShowShareModal(false)
58 59
             },