张延森 преди 3 години
родител
ревизия
369bd4b3db

+ 2
- 2
config/dev.js Целия файл

@@ -3,8 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 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 8
     WSS_HOST: '"wss://xlk.njyz.tech"',
9 9
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10 10
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',

+ 1
- 1
src/constants/api.js Целия файл

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

+ 8
- 4
src/pages/index/buildingDetail/components/BasicInfo/index.jsx Целия файл

@@ -1,6 +1,8 @@
1 1
 import { useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { ScrollView, Image } from '@tarojs/components'
4
+import AuthRole from '@/components/Auth/AuthRole'
5
+import { ROLE_CODE } from '@/constants/user'
4 6
 import classNames from 'classnames'
5 7
 import useFavor from '@/utils/hooks/useFavor'
6 8
 import '@/assets/css/iconfont.css'
@@ -172,10 +174,12 @@ export default function BasicInfo (props) {
172 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 183
     </view>
180 184
   )
181 185
 }

+ 28
- 18
src/pages/index/buildingRules/index.jsx Целия файл

@@ -1,12 +1,38 @@
1 1
 
2
+import { useEffect, useState } from 'react'
3
+import Taro from '@tarojs/taro'
2 4
 import withLayout from '@/layout'
3 5
 import { ScrollView, Image } from '@tarojs/components'
6
+import { getBuildingRule } from '@/services/item'
4 7
 import '@/assets/css/iconfont.css'
5 8
 import './index.scss'
6 9
 
7 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 37
   return (
12 38
     <view className='Page buildingRules'>
@@ -23,24 +49,8 @@ export default withLayout(() => {
23 49
           </view>
24 50
 
25 51
           <view className='Text'>
26
-            <text>南京城际空间站渠道报备客户后,15天内客户到访并确认到访单即客户有效,客户成交相关佣金请咨询驻场管理或所属渠道经理。</text>
27
-            <text>南京城际空间站渠道报备客户后,15天内客户到访并确认到访单即客户有效,客户成交相关佣金请咨询驻场管理或所属渠道经理。</text>
28
-            <text>南京城际空间站渠道报备客户后,15天内客户到访并确认到访单即客户有效,客户成交相关佣金请咨询驻场管理或所属渠道经理。</text>
52
+            {rule?.remark}
29 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 54
         </view>
45 55
       </ScrollView>
46 56
     </view>

+ 5
- 0
src/services/item.js Целия файл

@@ -12,6 +12,7 @@ import {
12 12
   API_LIVE_DEATIL,
13 13
   API_ADDLIVE_NUM,
14 14
   API_LIVE_LIST,
15
+  API_BUILDING_RULE,
15 16
 } from '@/constants/api'
16 17
 
17 18
 /**
@@ -109,3 +110,7 @@ export const addLiveNum = id => fetch({ url: `${API_ADDLIVE_NUM}?id=${id}`, meth
109 110
  */
110 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 Целия файл

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