Procházet zdrojové kódy

Merge branch 'master' of http://git.ycjcjy.com/shigongli/client-miniapp

张延森 před 4 roky
rodič
revize
6358ad1d2a

+ 3
- 3
config/dev.js Zobrazit soubor

@@ -5,9 +5,9 @@ module.exports = {
5 5
   },
6 6
   defineConstants: {
7 7
     // HOST: '"http://localhost:7080"',
8
-    // HOST: '"https://sgl.ycjcjy.com"',
9
-    // HOST: '"http://192.168.31.211:7080"',
10
-    HOST: '"http://192.168.211.105:7080"',
8
+    // HOST: '"https://sgl.njyunzhi.com"',
9
+    HOST: '"http://192.168.31.211:7080"',
10
+    // HOST: '"http://192.168.211.105:7080"',
11 11
  
12 12
     // OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
13 13
     // OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",

+ 1
- 1
package.json Zobrazit soubor

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "shigongliApp",
3
-  "version": "1.0.0",
3
+  "version": "0.0.10",
4 4
   "private": true,
5 5
   "description": "十公里小程序",
6 6
   "templateInfo": {

+ 1
- 1
src/compents/navcustom/index.jsx Zobrazit soubor

@@ -50,7 +50,7 @@ const NavCustom = props => {
50 50
                   height: 40,
51 51
                   borderRadius: 20,
52 52
                   margin:0,
53
-                  background: "#000"
53
+                 
54 54
                 }}
55 55
                 src={taShop.logo}
56 56
               ></Image>

+ 41
- 15
src/pages/customer/register/index.jsx Zobrazit soubor

@@ -7,6 +7,8 @@ import ContainerLayout from "../../../compents/container/index";
7 7
 import Tab from "../../../compents/tab";
8 8
 import Layout from "../../../layout";
9 9
 import request from "@/util/request";
10
+import { useSelector, } from 'react-redux'
11
+
10 12
 
11 13
 const InputGroup = props => {
12 14
   const [name, setName] = useState(props.dataSource.name);
@@ -83,6 +85,7 @@ const InputGroup = props => {
83 85
 
84 86
 const register = props => {
85 87
   let [list, setList] = useState([]);
88
+  const user = useSelector(state => state.user)
86 89
   useEffect(() => {
87 90
     if (props.dataSource) {
88 91
       const { personNum } = props.dataSource.houseSetting || {};
@@ -107,28 +110,51 @@ const register = props => {
107 110
       return;
108 111
     }
109 112
 
113
+  
114
+
115
+    const {subscribeMessageList=[]}= user
116
+    wx.requestSubscribeMessage({
117
+        tmplIds: subscribeMessageList.filter(x=>x.type==='check-out').map(x=>x.code),
118
+        success (res) { 
119
+          console.log(res,'-------2222222----------')
120
+          postRegister()
121
+        },
122
+        fail (err) { 
123
+          console.log(err,'-------err----------')
124
+        },
125
+        
126
+        complete (res) { 
127
+          console.log(res,'-------2222222-00---------')
128
+        },
129
+
130
+        
131
+      })
132
+
133
+   
134
+  };
135
+
136
+  const postRegister=()=>{
110 137
     const data = {
111 138
       orderId: props.dataSource.orderId,
112 139
       houseId: props.dataSource.houseSetting.houseId,
113 140
       personList: list
114 141
     };
115
-
116 142
     request({ url: "/taHousePerson", method: "POST", data })
117
-      .then(res => {
118
-        if (props.onFinished) {
119
-          props.onFinished(res);
120
-        }
121
-      })
122
-      .catch(err => {
123
-        console.error(err);
124
-        const message = err.message || err.errMsg || err;
125
-        Taro.showToast({
126
-          title: message,
127
-          icon: "none",
128
-          duration: 3000
129
-        });
143
+    .then(res => {
144
+      if (props.onFinished) {
145
+        props.onFinished(res);
146
+      }
147
+    })
148
+    .catch(err => {
149
+      console.error(err);
150
+      const message = err.message || err.errMsg || err;
151
+      Taro.showToast({
152
+        title: message,
153
+        icon: "none",
154
+        duration: 3000
130 155
       });
131
-  };
156
+    });
157
+  }
132 158
 
133 159
   const onChangeList = index => value => {
134 160
     list[index] = value;

+ 2
- 2
src/pages/house/addnewhouse/index.jsx Zobrazit soubor

@@ -93,8 +93,8 @@ const index = (props) => {
93 93
     const onParkingAdderssChange = (e) => {
94 94
         console.log(e,'formReset')
95 95
         setParking({
96
-            ...address,
97
-            parking:e.detail.value
96
+            ...parking,
97
+            address:e.detail.value
98 98
         })
99 99
     }
100 100
     

+ 1
- 1
src/pages/house/household/index.config.js Zobrazit soubor

@@ -1,3 +1,3 @@
1 1
 export default {
2
-    navigationBarTitleText: '民宿房源管理',
2
+    navigationBarTitleText: '查看入住人',
3 3
 }

+ 66
- 5
src/pages/share/index.jsx Zobrazit soubor

@@ -16,10 +16,13 @@ import request from '../../util/request';
16 16
 //         array: [{ msg: '1' }, { msg: '2' }]
17 17
 //     }
18 18
 // })
19
+const defaultImgUrl= 'https://zhiyun-image.oss-cn-shanghai.aliyuncs.com/shigongli/shigongli_share_default-min.jpg'
19 20
 
20 21
 const Index = () => {
21 22
     const router = useRouter()
22 23
     const { houseId,title } = router.params
24
+    const user = useSelector(state => state.user)
25
+
23 26
     const [personNum, setPersonNum] = useState()
24 27
     const [startTime, setStartTime] = useState('')
25 28
     const [endTime, setEndTime] = useState('')
@@ -44,8 +47,31 @@ const Index = () => {
44 47
         setStartTime(e.detail.value)
45 48
     }
46 49
 
50
+    const   handSubscribeMessage=()=>{
51
+        const {subscribeMessageList=[]}= user
52
+        wx.requestSubscribeMessage({
53
+            tmplIds: subscribeMessageList.filter(x=>x.type==='settled-in').map(x=>x.code),
54
+            success (res) { 
55
+              console.log(res,'-------2222222----------')
56
+              handleShareReady()
57
+            //   setShowShareModal(false)
58
+            },
59
+            fail (err) { 
60
+              console.log(err,'-------err----------')
61
+            },
62
+            
63
+            complete (res) { 
64
+              console.log(res,'-------2222222-00---------')
65
+            },
66
+    
67
+            
68
+          })
69
+    }  
70
+
47 71
     const handleShareReady = () => {
48 72
 
73
+
74
+
49 75
         const data = {
50 76
             houseId,
51 77
             personNum,
@@ -64,13 +90,27 @@ const Index = () => {
64 90
 
65 91
                     const share = {
66 92
                         title: `欢迎来到${title}`,
67
-                        imageUrl: (res.data.data || {}).image,
93
+                        imageUrl: (res.data.data || {}).image||defaultImgUrl,
68 94
                         path: `/pages/index/index?houseId=${houseId}&personNum=${personNum}&startTime=${startTime}&endTime=${endTime}&orderId=${orderId}`
69 95
                     }
70 96
 
71 97
                     setShareObj(share)
72 98
                     setShowShareLoading(false)
73 99
                     setShowShareModal(true)
100
+                }).catch((err)=>{
101
+                    setShowShareLoading(false)
102
+                Taro.showModal({
103
+                    title: '输入信息有误',
104
+                    content: '请重新输入',
105
+                    showCancel: false,
106
+                    success: function (res) {
107
+                        if (res.confirm) {
108
+                            console.log('用户点击确定')
109
+                        } else if (res.cancel) {
110
+                            console.log('用户点击取消')
111
+                        }
112
+                    }
113
+                })
74 114
                 })
75 115
             } else {
76 116
                 setShowShareLoading(false)
@@ -88,6 +128,20 @@ const Index = () => {
88 128
                 })
89 129
             }
90 130
 
131
+        }).catch((err)=>{
132
+            setShowShareLoading(false)
133
+                Taro.showModal({
134
+                    title: '输入信息有误',
135
+                    content: '请重新输入',
136
+                    showCancel: false,
137
+                    success: function (res) {
138
+                        if (res.confirm) {
139
+                            console.log('用户点击确定')
140
+                        } else if (res.cancel) {
141
+                            console.log('用户点击取消')
142
+                        }
143
+                    }
144
+                })
91 145
         })
92 146
 
93 147
     }
@@ -96,6 +150,13 @@ const Index = () => {
96 150
         return shareObj
97 151
     })
98 152
 
153
+    const onShare=()=>{
154
+        setShowShareModal(false)
155
+
156
+    }
157
+
158
+    
159
+
99 160
     return <View className='share'>
100 161
         <Layout>
101 162
             <View className='inputstyle-view'>
@@ -128,8 +189,8 @@ const Index = () => {
128 189
                 </Container>
129 190
             </View>
130 191
         </Layout>
131
-        <Tab className='addhousetab' color='#ffffff' pageState='3' onClick={handleShareReady} value={['分享到微信']} ></Tab>
132
-        <AtModal isOpened={showShareLoading} closeOnClickOverlay={false}>
192
+        <Tab className='addhousetab' color='#ffffff' pageState='3' onClick={handSubscribeMessage} value={['分享到微信']} ></Tab>
193
+        <AtModal isOpened={showShareLoading} onClose={()=>{setShowShareLoading(false)}} closeOnClickOverlay={false}>
133 194
             <AtModalContent>
134 195
                 <View style={{textAlign: 'center'}}>
135 196
                     <Loading size='48px' />
@@ -137,10 +198,10 @@ const Index = () => {
137 198
                 <View style={{marginTop: '2em', textAlign: 'center'}}>正在生成分享内容, 请稍候...</View>
138 199
             </AtModalContent>
139 200
         </AtModal>
140
-        <AtModal isOpened={showShareModal}>
201
+        <AtModal isOpened={showShareModal} onClose={()=>{setShowShareModal(false)}}>
141 202
             <AtModalHeader>分享到微信</AtModalHeader>
142 203
             <AtModalAction>
143
-                <Button open-type='share' onClick={() => setShowShareModal(false)}>去分享</Button>
204
+                <Button open-type='share' onClick={() => onShare() }>去分享</Button>
144 205
             </AtModalAction>
145 206
         </AtModal>
146 207
     </View>