张延森 3 jaren geleden
bovenliggende
commit
369bd4b3db

+ 2
- 2
config/dev.js Bestand weergeven

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://xlk.njyz.tech"',
7
-    // HOST: '"http://127.0.0.1:8081"',
6
+    // HOST: '"https://xlk.njyz.tech"',
7
+    HOST: '"http://127.0.0.1:8081"',
8
     WSS_HOST: '"wss://xlk.njyz.tech"',
8
     WSS_HOST: '"wss://xlk.njyz.tech"',
9
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
9
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',

+ 1
- 1
src/constants/api.js Bestand weergeven

70
 export const API_TACUSTOMIMG = resolvePath('taCustomImg')
70
 export const API_TACUSTOMIMG = resolvePath('taCustomImg')
71
 export const API_INDEX_PROJECTS = resolvePath('building/main')
71
 export const API_INDEX_PROJECTS = resolvePath('building/main')
72
 export const API_INDEX_ICONS = resolvePath('taMiniappOrgIcon')
72
 export const API_INDEX_ICONS = resolvePath('taMiniappOrgIcon')
73
-
73
+export const API_BUILDING_RULE = resolvePath('buildingChannel')
74
 
74
 
75
 
75
 
76
 export const API_HOUSE_LIST = resolvePath('listHousingResources')
76
 export const API_HOUSE_LIST = resolvePath('listHousingResources')

+ 8
- 4
src/pages/index/buildingDetail/components/BasicInfo/index.jsx Bestand weergeven

1
 import { useState } from 'react'
1
 import { useState } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import { ScrollView, Image } from '@tarojs/components'
3
 import { ScrollView, Image } from '@tarojs/components'
4
+import AuthRole from '@/components/Auth/AuthRole'
5
+import { ROLE_CODE } from '@/constants/user'
4
 import classNames from 'classnames'
6
 import classNames from 'classnames'
5
 import useFavor from '@/utils/hooks/useFavor'
7
 import useFavor from '@/utils/hooks/useFavor'
6
 import '@/assets/css/iconfont.css'
8
 import '@/assets/css/iconfont.css'
172
       </view>
174
       </view>
173
 
175
 
174
       {/* 提示 */}
176
       {/* 提示 */}
175
-      <view className='Tips'>
176
-        <text className='iconfont icon-bangzhu'></text>
177
-        <text onClick={() => goto(`/pages/index/buildingRules/index?buildingId=${buildingId}`)}>查看报备规则?</text>
178
-      </view>
177
+      <AuthRole role={ROLE_CODE.CHANNEL_AGENT}>
178
+        <view className='Tips'>
179
+          <text className='iconfont icon-bangzhu'></text>
180
+          <text onClick={() => goto(`/pages/index/buildingRules/index?buildingId=${buildingId}`)}>查看报备规则?</text>
181
+        </view>
182
+      </AuthRole>
179
     </view>
183
     </view>
180
   )
184
   )
181
 }
185
 }

+ 28
- 18
src/pages/index/buildingRules/index.jsx Bestand weergeven

1
 
1
 
2
+import { useEffect, useState } from 'react'
3
+import Taro from '@tarojs/taro'
2
 import withLayout from '@/layout'
4
 import withLayout from '@/layout'
3
 import { ScrollView, Image } from '@tarojs/components'
5
 import { ScrollView, Image } from '@tarojs/components'
6
+import { getBuildingRule } from '@/services/item'
4
 import '@/assets/css/iconfont.css'
7
 import '@/assets/css/iconfont.css'
5
 import './index.scss'
8
 import './index.scss'
6
 
9
 
7
 const defaultRuleImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon18.jpg'
10
 const defaultRuleImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon18.jpg'
8
 
11
 
9
-export default withLayout(() => {
12
+export default withLayout((props) => {
13
+  const { router } = props
14
+  const { buildingId } = router.params
15
+
16
+  const [rule, setRule] = useState({})
17
+  
18
+  useEffect(() => {
19
+    if (buildingId) {
20
+      Taro.showLoading({
21
+        title: '请稍候...',
22
+      })
23
+      getBuildingRule(buildingId).then((res) => {
24
+        setRule(res)
25
+        Taro.hideLoading()
26
+      }).catch((err) => {
27
+        console.error(err)
28
+        Taro.hideLoading()
29
+        Taro.showToast({
30
+          title: '获取规则失败',
31
+          icon: 'none',
32
+        })
33
+      })
34
+    }
35
+  }, [buildingId])
10
 
36
 
11
   return (
37
   return (
12
     <view className='Page buildingRules'>
38
     <view className='Page buildingRules'>
23
           </view>
49
           </view>
24
 
50
 
25
           <view className='Text'>
51
           <view className='Text'>
26
-            <text>南京城际空间站渠道报备客户后,15天内客户到访并确认到访单即客户有效,客户成交相关佣金请咨询驻场管理或所属渠道经理。</text>
27
-            <text>南京城际空间站渠道报备客户后,15天内客户到访并确认到访单即客户有效,客户成交相关佣金请咨询驻场管理或所属渠道经理。</text>
28
-            <text>南京城际空间站渠道报备客户后,15天内客户到访并确认到访单即客户有效,客户成交相关佣金请咨询驻场管理或所属渠道经理。</text>
52
+            {rule?.remark}
29
           </view>
53
           </view>
30
-
31
-          <view className='Bottom'>
32
-            <view>
33
-              <view>
34
-                <text className='iconfont icon-shengming'></text>
35
-                <text>免责声明</text>
36
-              </view>
37
-              <view>
38
-                <text>&emsp;&emsp;以上价格仅供参考,具体一房一价的信息以售楼处展示为准。房屋位置交通、医疗、教育、商业等配套信息,来源于第三方不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。本平台对项目周边文化教育的介绍旨在提供相关信息1 意味着信息发布方对就学安排作出承诺。相关教育资首页信息存在调整的可能,应以政府教育主管部门门及办学颁布的政策规定为准。详情请仔细阅读</text>
39
-                <text className='active'>《新联宝使用免责条款》</text>
40
-              </view>
41
-            </view>
42
-          </view>
43
-
44
         </view>
54
         </view>
45
       </ScrollView>
55
       </ScrollView>
46
     </view>
56
     </view>

+ 5
- 0
src/services/item.js Bestand weergeven

12
   API_LIVE_DEATIL,
12
   API_LIVE_DEATIL,
13
   API_ADDLIVE_NUM,
13
   API_ADDLIVE_NUM,
14
   API_LIVE_LIST,
14
   API_LIVE_LIST,
15
+  API_BUILDING_RULE,
15
 } from '@/constants/api'
16
 } from '@/constants/api'
16
 
17
 
17
 /**
18
 /**
109
  */
110
  */
110
 export const queryItemTypeList = () => fetch({ url: API_ITEMS_TYPE })
111
 export const queryItemTypeList = () => fetch({ url: API_ITEMS_TYPE })
111
 
112
 
113
+/**
114
+ * 项目报备规则
115
+ */
116
+export const getBuildingRule = (buildingId) => fetch({ url: `${API_BUILDING_RULE}/${buildingId}` })

+ 1
- 2
src/services/project.js Bestand weergeven

18
   API_CONTRACT_AUTO,
18
   API_CONTRACT_AUTO,
19
   API_CONTRACT_MANUAL,
19
   API_CONTRACT_MANUAL,
20
   API_CONTRACT_CHECK,
20
   API_CONTRACT_CHECK,
21
-  API_INDEX_CUSTOMER
22
-
21
+  API_INDEX_CUSTOMER,
23
 } from '@/constants/api'
22
 } from '@/constants/api'
24
 
23
 
25
 
24