Your Name 3 vuotta sitten
vanhempi
commit
3895497178

+ 11
- 0
src/layout/index.js Näytä tiedosto

46
     nav2Target(screenInfo)
46
     nav2Target(screenInfo)
47
   }
47
   }
48
 
48
 
49
+  // 分享朋友圈提示
49
   const showShareTimeline = (visible) => setShareTimelineVisible(visible)
50
   const showShareTimeline = (visible) => setShareTimelineVisible(visible)
50
 
51
 
52
+  // 设置当前页标题
53
+  const setNavigationBarTitle = title => {
54
+    if (!title) return;
55
+
56
+    Taro.nextTick(() => {
57
+      Taro.setNavigationBarTitle({ title })
58
+    })
59
+  }
60
+
51
   // 报备客户
61
   // 报备客户
52
   useEffect(() => {
62
   useEffect(() => {
53
     reportCustomer(person, consultant, false).catch(() => {})
63
     reportCustomer(person, consultant, false).catch(() => {})
123
             shareContent={shareContent}
133
             shareContent={shareContent}
124
             trackData={trackData}
134
             trackData={trackData}
125
             showShareTimeline={showShareTimeline}
135
             showShareTimeline={showShareTimeline}
136
+            setNavigationBarTitle={setNavigationBarTitle}
126
             {...props}
137
             {...props}
127
             {...extInfo}
138
             {...extInfo}
128
           />
139
           />

+ 3
- 2
src/pages/index/activityDetail/index.jsx Näytä tiedosto

52
 };
52
 };
53
 
53
 
54
 export default withLayout((props) => {
54
 export default withLayout((props) => {
55
-  const { router, shareContent, trackData, person, page, showShareTimeline } = props;
55
+  const { router, shareContent, trackData, person, page, showShareTimeline, setNavigationBarTitle } = props;
56
   const { id } = router.params;
56
   const { id } = router.params;
57
 
57
 
58
   const user = useSelector((state) => state.user);
58
   const user = useSelector((state) => state.user);
74
       const maxperson = 10
74
       const maxperson = 10
75
       setSelector(times(maxperson).map((_, i) => `${i + 1}`));
75
       setSelector(times(maxperson).map((_, i) => `${i + 1}`));
76
 
76
 
77
-      setDetail(res);
77
+      setDetail(res ||{});
78
+      setNavigationBarTitle(res?.title)
78
       Taro.hideLoading();
79
       Taro.hideLoading();
79
     });
80
     });
80
   };
81
   };

+ 2
- 1
src/pages/index/buildingDetail/index.jsx Näytä tiedosto

24
 import './index.scss'
24
 import './index.scss'
25
 
25
 
26
 export default withLayout((props) => {
26
 export default withLayout((props) => {
27
-  const { router, person, shareContent, trackData, page } = props
27
+  const { router, person, shareContent, trackData, page, setNavigationBarTitle } = props
28
   const { id } = router.params
28
   const { id } = router.params
29
 
29
 
30
   const [showPoster, setShowPoster] = useState(false)
30
   const [showPoster, setShowPoster] = useState(false)
52
     // 获取楼盘信息
52
     // 获取楼盘信息
53
     fetch({ url: `${API_ITEMS_DETAIL}/${id}`, spin: true }).then((res) => {
53
     fetch({ url: `${API_ITEMS_DETAIL}/${id}`, spin: true }).then((res) => {
54
       setDetailInfo(res || {})
54
       setDetailInfo(res || {})
55
+      setNavigationBarTitle(res?.buildingName)
55
       
56
       
56
       if (res?.buildingApartment) {
57
       if (res?.buildingApartment) {
57
         const List = res.buildingApartment.filter(item => item.apartmentType === 'photo')
58
         const List = res.buildingApartment.filter(item => item.apartmentType === 'photo')

+ 3
- 2
src/pages/index/encyDetail/index.jsx Näytä tiedosto

9
 import { formatDate } from "@/utils/chatDate";
9
 import { formatDate } from "@/utils/chatDate";
10
 
10
 
11
 export default withLayout((props) => {
11
 export default withLayout((props) => {
12
-  const { router, shareContent, trackData, person, page } = props;
12
+  const { router, shareContent, trackData, person, page, setNavigationBarTitle } = props;
13
   const { id } = router.params;
13
   const { id } = router.params;
14
   const [data, setData] = useState({});
14
   const [data, setData] = useState({});
15
 
15
 
16
   const getData = (params) => {
16
   const getData = (params) => {
17
     Taro.showLoading();
17
     Taro.showLoading();
18
     queryPolicyDetail(params).then((res) => {
18
     queryPolicyDetail(params).then((res) => {
19
-      setData(res);
19
+      setData(res||{});
20
+      setNavigationBarTitle(res?.title)
20
       Taro.hideLoading();
21
       Taro.hideLoading();
21
     });
22
     });
22
   };
23
   };

+ 3
- 3
src/pages/index/encyclopediasOfBuyHouse/index.jsx Näytä tiedosto

9
 import { queryPolicyTypeList, queryPolicyList } from "@/services/policy";
9
 import { queryPolicyTypeList, queryPolicyList } from "@/services/policy";
10
 
10
 
11
 const EncyItem = (props) => {
11
 const EncyItem = (props) => {
12
-  const city = useSelector(state => state.city)
12
+  const { city } = props
13
 
13
 
14
   const { item, index } = props;
14
   const { item, index } = props;
15
   const [list, setList] = useState([]);
15
   const [list, setList] = useState([]);
18
     if (item.policyTypeId) {
18
     if (item.policyTypeId) {
19
       getPolicyListByType(item.policyTypeId);
19
       getPolicyListByType(item.policyTypeId);
20
     }
20
     }
21
-  }, [item,city]);
21
+  }, [item,city?.id]);
22
 
22
 
23
   const getPolicyListByType = policyTypeId => {
23
   const getPolicyListByType = policyTypeId => {
24
-    queryPolicyList({ pageSize: 100,policyTypeId,cityId: city?.curCity?.id }).then((res) => {
24
+    queryPolicyList({ pageSize: 100, policyTypeId, cityId: city?.id }).then((res) => {
25
       setList(res.records);
25
       setList(res.records);
26
     });
26
     });
27
   };
27
   };

+ 2
- 1
src/pages/index/newsDetail/index.jsx Näytä tiedosto

11
 import "./index.scss";
11
 import "./index.scss";
12
 
12
 
13
 export default withLayout((props) => {
13
 export default withLayout((props) => {
14
-  const { router, shareContent, person, trackData, page, showShareTimeline } = props
14
+  const { router, shareContent, person, trackData, page, showShareTimeline, setNavigationBarTitle } = props
15
   const { id } = props.router.params;
15
   const { id } = props.router.params;
16
 
16
 
17
   const paramsRef = useParams({person, from: `${page.type}_share`})
17
   const paramsRef = useParams({person, from: `${page.type}_share`})
40
     queryNewsDetail(params).then((res) => {
40
     queryNewsDetail(params).then((res) => {
41
 
41
 
42
       setData(res);
42
       setData(res);
43
+      setNavigationBarTitle(res?.newsName);
43
       Taro.hideLoading();
44
       Taro.hideLoading();
44
     });
45
     });
45
   };
46
   };

+ 3
- 2
src/pages/video/liveDetail/index.jsx Näytä tiedosto

11
 import "./index.scss";
11
 import "./index.scss";
12
 
12
 
13
 export default withLayout((props) => {
13
 export default withLayout((props) => {
14
-  const { router, shareContent, trackData, person, page } = props;
14
+  const { router, shareContent, trackData, person, page, setNavigationBarTitle } = props;
15
   const { id } = router.params;
15
   const { id } = router.params;
16
 
16
 
17
   const [data, setData] = useState({})
17
   const [data, setData] = useState({})
38
 
38
 
39
   const getData = () => {
39
   const getData = () => {
40
     queryLiveDetail(id).then(res => {
40
     queryLiveDetail(id).then(res => {
41
-      setData(res)
41
+      setData(res||{})
42
+      setNavigationBarTitle(res?.name)
42
       if (res?.liveRoomParam) {
43
       if (res?.liveRoomParam) {
43
         const { livingid } = JSON.parse(res.liveRoomParam)
44
         const { livingid } = JSON.parse(res.liveRoomParam)
44
         getLivingCode(livingid).then((liveInfo) => {
45
         getLivingCode(livingid).then((liveInfo) => {

+ 3
- 2
src/pages/video/videoDetail/index.jsx Näytä tiedosto

11
 import "./index.scss";
11
 import "./index.scss";
12
 
12
 
13
 export default withLayout((props) => {
13
 export default withLayout((props) => {
14
-  const { router, shareContent, trackData, person, page } = props;
14
+  const { router, shareContent, trackData, person, page, setNavigationBarTitle } = props;
15
   const { id } = router.params;
15
   const { id } = router.params;
16
 
16
 
17
   const [data, setData] = useState({});
17
   const [data, setData] = useState({});
36
 
36
 
37
   const getData = () => {
37
   const getData = () => {
38
     fetch({ url: `${API_VIDEO_DETAIL}/${id}` }).then(res=>{
38
     fetch({ url: `${API_VIDEO_DETAIL}/${id}` }).then(res=>{
39
-      setData(res)
39
+      setData(res||{})
40
+      setNavigationBarTitle(res?.name)
40
     });
41
     });
41
   };
42
   };
42
 
43