瀏覽代碼

信息修改

1002884655 3 年之前
父節點
當前提交
713e80ed57

+ 5
- 0
src/components/Auth/AuthPhone.jsx 查看文件

11
     router,
11
     router,
12
     page,
12
     page,
13
     onCancel = (x => x),
13
     onCancel = (x => x),
14
+    onSuccess = () => {},
15
+    onError = () => {},
14
   } = props;
16
   } = props;
15
 
17
 
16
   const [loading, setLoading] = useState(false)
18
   const [loading, setLoading] = useState(false)
22
       setLoading(true)
24
       setLoading(true)
23
       updatePhoneNumber(data).then(() => {
25
       updatePhoneNumber(data).then(() => {
24
         setLoading(false)
26
         setLoading(false)
27
+        onSuccess()
25
       }).catch((err) => {
28
       }).catch((err) => {
26
         console.error(err)
29
         console.error(err)
27
         setLoading(false)
30
         setLoading(false)
31
+        onError()
28
       })
32
       })
29
     } else {
33
     } else {
30
       console.error(errMsg);
34
       console.error(errMsg);
33
         icon: 'none',
37
         icon: 'none',
34
         duration: 2000
38
         duration: 2000
35
       })
39
       })
40
+      onCancel()
36
     }
41
     }
37
   }
42
   }
38
 
43
 

+ 4
- 1
src/pages/index/buildingAround/index.jsx 查看文件

232
                         <view className='flex-item'>
232
                         <view className='flex-item'>
233
                           <text>{item.name}</text>
233
                           <text>{item.name}</text>
234
                         </view>
234
                         </view>
235
-                        <text className='iconfont icon-dingwei'></text>
235
+                        {
236
+                          item.distance &&
237
+                          <text className='iconfont icon-dingwei'></text>
238
+                        }
236
                         {
239
                         {
237
                           item.distance &&
240
                           item.distance &&
238
                           <text className='distance'>{`${item.distance || '-'}m`}</text>
241
                           <text className='distance'>{`${item.distance || '-'}m`}</text>

+ 10
- 1
src/pages/index/helpToFindHouse/components/BuyHouse/index.jsx 查看文件

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import '@/assets/css/iconfont.css'
2
 import '@/assets/css/iconfont.css'
3
-import { Image, Slider, Textarea, ScrollView } from '@tarojs/components'
3
+import { Image, Slider, Textarea, ScrollView, Form } from '@tarojs/components'
4
 import Taro from '@tarojs/taro'
4
 import Taro from '@tarojs/taro'
5
 import './index.scss'
5
 import './index.scss'
6
 import questions from './formData'
6
 import questions from './formData'
25
     change(StepId)
25
     change(StepId)
26
   }, [StepId])
26
   }, [StepId])
27
 
27
 
28
+  useEffect(() => {
29
+    if(AreaInfo.id) {
30
+      const res = FormData.find((item) => { return item.key === 'intentArea' })
31
+      res.resultId = AreaInfo.id
32
+      res.result = AreaInfo.name
33
+      setFormData([...FormData])
34
+    }
35
+  }, [AreaInfo])
36
+
28
   const CutCheckboxs = (index, subItem, subIndex) => {
37
   const CutCheckboxs = (index, subItem, subIndex) => {
29
     return () => {
38
     return () => {
30
       let newFormData = [...FormData]
39
       let newFormData = [...FormData]

+ 9
- 0
src/pages/index/helpToFindHouse/components/HousePurchasing/index.jsx 查看文件

20
     change(StepId)
20
     change(StepId)
21
   }, [StepId])
21
   }, [StepId])
22
 
22
 
23
+  useEffect(() => {
24
+    if(AreaInfo.id) {
25
+      const res = FormData.find((item) => { return item.key === 'intentArea' })
26
+      res.resultId = AreaInfo.id
27
+      res.result = AreaInfo.name
28
+      setFormData([...FormData])
29
+    }
30
+  }, [AreaInfo])
31
+
23
   const CutCheckbox = (item, index) => {
32
   const CutCheckbox = (item, index) => {
24
     return () => {
33
     return () => {
25
       let newFormData = [...FormData]
34
       let newFormData = [...FormData]

+ 9
- 0
src/pages/index/helpToFindHouse/components/RentingHouse/index.jsx 查看文件

22
     change(StepId)
22
     change(StepId)
23
   }, [StepId])
23
   }, [StepId])
24
 
24
 
25
+  useEffect(() => {
26
+    if(AreaInfo.id) {
27
+      const res = FormData.find((item) => { return item.key === 'intentArea' })
28
+      res.resultId = AreaInfo.id
29
+      res.result = AreaInfo.name
30
+      setFormData([...FormData])
31
+    }
32
+  }, [AreaInfo])
33
+
25
   const CutCheckboxs = (index, subItem, subIndex) => {
34
   const CutCheckboxs = (index, subItem, subIndex) => {
26
     return () => {
35
     return () => {
27
       let newFormData = [...FormData]
36
       let newFormData = [...FormData]

+ 1
- 0
src/pages/index/helpToFindHouse/index.jsx 查看文件

41
   }
41
   }
42
 
42
 
43
   const AreaChange = (e) => {
43
   const AreaChange = (e) => {
44
+    console.log(e)
44
     setAreaInfo(e[2])
45
     setAreaInfo(e[2])
45
     setShowCitysPopup(false)
46
     setShowCitysPopup(false)
46
   }
47
   }

+ 1
- 1
src/pages/mine/addCustomer/components/BuildingPicker.jsx 查看文件

12
   const [dicts, setDicts] = useState([])
12
   const [dicts, setDicts] = useState([])
13
 
13
 
14
   useEffect(() => {
14
   useEffect(() => {
15
-    if (type !== ROLE_CODE.CUSTOMER && type !== ROLE_CODE.DRIFT) {
15
+    if (type !== ROLE_CODE.CUSTOMER && type !== ROLE_CODE.DRIFT && type !== ROLE_CODE.CONSULTANT) {
16
       fetch({ url: API_GET_AGENT_BUILDINGS }).then((res) => {
16
       fetch({ url: API_GET_AGENT_BUILDINGS }).then((res) => {
17
         setDicts(res || [])
17
         setDicts(res || [])
18
       })
18
       })

+ 63
- 34
src/pages/video/liveDetail/index.jsx 查看文件

2
 import Taro from "@tarojs/taro";
2
 import Taro from "@tarojs/taro";
3
 import { savePoint } from '@/services/common'
3
 import { savePoint } from '@/services/common'
4
 import withLayout from "@/layout";
4
 import withLayout from "@/layout";
5
-import { Image } from "@tarojs/components";
5
+import { Image, View } from "@tarojs/components";
6
 import { queryLiveDetail } from "@/services/item";
6
 import { queryLiveDetail } from "@/services/item";
7
-import { fetch } from '@/utils/request'
8
-import { API_VIDEO_DETAIL } from '@/constants/api'
9
 import useParams from "@/utils/hooks/useParams";
7
 import useParams from "@/utils/hooks/useParams";
10
 import useShare from "@/utils/hooks/useShare";
8
 import useShare from "@/utils/hooks/useShare";
11
 import { getImgURL } from "@/utils/image";
9
 import { getImgURL } from "@/utils/image";
12
 import { getLivingCode } from '@/services/activity'
10
 import { getLivingCode } from '@/services/activity'
11
+import Overlay from '@/components/Overlay'
12
+import AuthPhone from '@/components/Auth/AuthPhone'
13
+import { useSelector } from 'react-redux'
13
 import "@/assets/css/iconfont.css";
14
 import "@/assets/css/iconfont.css";
14
 import "./index.scss";
15
 import "./index.scss";
15
 
16
 
19
 
20
 
20
   const [data, setData] = useState({})
21
   const [data, setData] = useState({})
21
   const [CanPlay, setCanPlay] = useState(false)
22
   const [CanPlay, setCanPlay] = useState(false)
23
+  const consultant = useSelector(s => s.system.consultant)
24
+  const [authPhone, setAuthPhone] = useState(false)
22
   // 直播间信息
25
   // 直播间信息
23
   const livingRef = useRef()
26
   const livingRef = useRef()
24
 
27
 
70
     }
73
     }
71
   }
74
   }
72
 
75
 
73
-  const handleLive = () => {
74
-    if(type === 'live') {
75
-      if (!livingRef.current) {
76
-        Taro.showToast({
77
-          title: '查询直播凭证失败, 请退出重试',
78
-          icon: 'none',
79
-        })
80
-        return;
81
-      }
82
-  
83
-      // https://work.weixin.qq.com/api/doc/90000/90135/93635
84
-      const { livingCode, status } = livingRef.current
85
-  
86
-      //
87
-      if (status >= 3) {
88
-        Taro.showToast({
89
-          title: `直播活动已${status === 3 ? '过期' : '取消'}`,
90
-          icon: 'none',
91
-        })
92
-        return;
93
-      }
94
-  
95
-      // 如果已经结束的则播放回放
96
-      const replay = status === 2 ? '&replay=1' : ''
97
-  
98
-      // 跳转到直播
99
-      Taro.navigateToMiniProgram({
100
-        // 固定跳转到微信企业直播
101
-        appId: 'wx7424030d69bde86e',
102
-        path: `pages/watch/index?living_code=${encodeURIComponent(livingCode)}${replay}`,
76
+  const AuthPhoneSuccess = () => {
77
+    setAuthPhone(false)
78
+    ToLiving()
79
+  }
80
+
81
+  const AuthPhoneError = () => {
82
+    setAuthPhone(false)
83
+    ToLiving()
84
+  }
85
+
86
+  const AuthPhoneCancel = () => {
87
+    setAuthPhone(false)
88
+    ToLiving()
89
+  }
90
+
91
+  const ToLiving = () => {
92
+    if (!livingRef.current) {
93
+      Taro.showToast({
94
+        title: '查询直播凭证失败, 请退出重试',
95
+        icon: 'none',
103
       })
96
       })
97
+      return;
98
+    }
99
+
100
+    // https://work.weixin.qq.com/api/doc/90000/90135/93635
101
+    const { livingCode, status } = livingRef.current
102
+
103
+    //
104
+    if (status >= 3) {
105
+      Taro.showToast({
106
+        title: `直播活动已${status === 3 ? '过期' : '取消'}`,
107
+        icon: 'none',
108
+      })
109
+      return;
110
+    }
111
+
112
+    // 如果已经结束的则播放回放
113
+    const replay = status === 2 ? '&replay=1' : ''
114
+
115
+    // 跳转到直播
116
+    Taro.navigateToMiniProgram({
117
+      // 固定跳转到微信企业直播
118
+      appId: 'wx7424030d69bde86e',
119
+      path: `pages/watch/index?living_code=${encodeURIComponent(livingCode)}${replay}`,
120
+    })
121
+  }
122
+
123
+  const handleLive = () => {
124
+    if(person.inited && !person.phone) {
125
+      setAuthPhone(true)
104
     } else {
126
     } else {
105
-      setCanPlay(true)
127
+      ToLiving()
106
     }
128
     }
107
   }
129
   }
108
 
130
 
113
   }, [id]);
135
   }, [id]);
114
   //   
136
   //   
115
   return <view className="liveDetail">
137
   return <view className="liveDetail">
138
+
139
+  {/* 授权手机 */}
140
+  <Overlay visible={authPhone} aligin='bottom'>
141
+    <View className='auth-wrapper'>
142
+      <AuthPhone consultant={consultant} router={router} page={page} onSuccess={(AuthPhoneSuccess)} onError={AuthPhoneError} onCancel={AuthPhoneCancel} />
143
+    </View>
144
+  </Overlay>
116
     {
145
     {
117
       type === 'video' && data.videoUrl && CanPlay &&
146
       type === 'video' && data.videoUrl && CanPlay &&
118
       <view className="myVideo">
147
       <view className="myVideo">

+ 1
- 1
src/routes.js 查看文件

244
     page: 'pages/video/liveDetail/index',
244
     page: 'pages/video/liveDetail/index',
245
     pkg: 'main',
245
     pkg: 'main',
246
     type: 'live',
246
     type: 'live',
247
-    auth: ['phone'],
247
+    // auth: ['phone'],
248
   },
248
   },
249
   {
249
   {
250
     name: '视频详情',
250
     name: '视频详情',