Selaa lähdekoodia

Merge branch 'dev'

张延森 5 vuotta sitten
vanhempi
commit
a97e3c51b1
100 muutettua tiedostoa jossa 4612 lisäystä ja 904 poistoa
  1. 7
    5
      config/dev.js
  2. 5
    3
      config/prod.js
  3. 214
    214
      package-lock.json
  4. 13
    6
      project.config.json
  5. 33
    0
      src/actions/house.js
  6. 11
    3
      src/app.js
  7. 5
    5
      src/app.scss
  8. 0
    0
      src/components/indexMenus-deprecated/icons.js
  9. 0
    0
      src/components/indexMenus-deprecated/index.js
  10. 0
    0
      src/components/indexMenus-deprecated/index.scss
  11. 12
    0
      src/constants/api.js
  12. 18
    0
      src/constants/house.js
  13. BIN
      src/onlineSelling/assets/add.png
  14. BIN
      src/onlineSelling/assets/card.png
  15. BIN
      src/onlineSelling/assets/chips.png
  16. BIN
      src/onlineSelling/assets/close.png
  17. BIN
      src/onlineSelling/assets/copy.png
  18. BIN
      src/onlineSelling/assets/lock.png
  19. BIN
      src/onlineSelling/assets/pay.png
  20. BIN
      src/onlineSelling/assets/preselection.png
  21. BIN
      src/onlineSelling/assets/reduce.png
  22. BIN
      src/onlineSelling/assets/void.png
  23. 1
    2
      src/onlineSelling/components/Blank/index.js
  24. 36
    0
      src/onlineSelling/components/ConsultantItem/index.js
  25. 65
    0
      src/onlineSelling/components/ConsultantItem/index.scss
  26. 16
    0
      src/onlineSelling/components/ContactConsultant/index.js
  27. 6
    0
      src/onlineSelling/components/ContactConsultant/index.scss
  28. 1
    1
      src/onlineSelling/components/GrantProfile/index.js
  29. 1
    1
      src/onlineSelling/components/HotBlock/index.js
  30. 56
    0
      src/onlineSelling/components/HotBlock/index.scss
  31. 35
    10
      src/onlineSelling/components/HouseCard/index.js
  32. 3
    17
      src/onlineSelling/components/HouseCard/index.scss
  33. 8
    1
      src/onlineSelling/components/HouseGrid/Floor.js
  34. 58
    17
      src/onlineSelling/components/HouseGrid/Room.js
  35. 11
    2
      src/onlineSelling/components/HouseGrid/Unit.js
  36. 11
    9
      src/onlineSelling/components/HouseGrid/floor.scss
  37. 14
    4
      src/onlineSelling/components/HouseGrid/index.js
  38. 49
    5
      src/onlineSelling/components/HouseGrid/room.scss
  39. 28
    0
      src/onlineSelling/components/Picker/index.js
  40. 40
    0
      src/onlineSelling/components/Picker/index.scss
  41. 112
    0
      src/onlineSelling/components/RaiseCard/index.js
  42. 100
    0
      src/onlineSelling/components/RaiseCard/index.scss
  43. 0
    1
      src/onlineSelling/components/ScrollMessage/index.js
  44. 0
    1
      src/onlineSelling/components/ShareButtons/ShareBtn.js
  45. 12
    0
      src/onlineSelling/components/Statement/index.js
  46. 10
    0
      src/onlineSelling/components/Statement/index.scss
  47. 145
    0
      src/onlineSelling/pages/addHouse/index.js
  48. 40
    0
      src/onlineSelling/pages/addHouse/index.scss
  49. 65
    0
      src/onlineSelling/pages/chooseConsultant/index.js
  50. 5
    0
      src/onlineSelling/pages/chooseConsultant/index.scss
  51. 67
    32
      src/onlineSelling/pages/detail/index.js
  52. 3
    4
      src/onlineSelling/pages/detail/index.scss
  53. 5
    11
      src/onlineSelling/pages/detail/resultPage.js
  54. 64
    62
      src/onlineSelling/pages/help/index.js
  55. 300
    0
      src/onlineSelling/pages/houseCart/index.js
  56. 141
    0
      src/onlineSelling/pages/houseCart/index.scss
  57. 51
    22
      src/onlineSelling/pages/houseList/index.js
  58. 46
    14
      src/onlineSelling/pages/houseList/index.scss
  59. 33
    0
      src/onlineSelling/pages/protocol/index.js
  60. 13
    0
      src/onlineSelling/pages/protocol/index.scss
  61. 53
    0
      src/onlineSelling/pages/raiseMoney/Captcha/index.js
  62. 9
    0
      src/onlineSelling/pages/raiseMoney/Captcha/index.scss
  63. 48
    0
      src/onlineSelling/pages/raiseMoney/NextStep/index.js
  64. 14
    0
      src/onlineSelling/pages/raiseMoney/NextStep/index.scss
  65. 33
    0
      src/onlineSelling/pages/raiseMoney/RadioList/index.js
  66. 28
    0
      src/onlineSelling/pages/raiseMoney/RadioList/index.scss
  67. 810
    0
      src/onlineSelling/pages/raiseMoney/index.js
  68. 199
    0
      src/onlineSelling/pages/raiseMoney/index.scss
  69. 34
    0
      src/onlineSelling/pages/raiseProfile/Cell.js
  70. 34
    0
      src/onlineSelling/pages/raiseProfile/CellBlock.js
  71. 49
    0
      src/onlineSelling/pages/raiseProfile/houseResource.js
  72. 278
    0
      src/onlineSelling/pages/raiseProfile/index.js
  73. 156
    0
      src/onlineSelling/pages/raiseProfile/index.scss
  74. 415
    27
      src/onlineSelling/pages/records/index.js
  75. 127
    4
      src/onlineSelling/pages/records/index.scss
  76. 2
    6
      src/onlineSelling/pages/screenHouse/index.js
  77. 0
    105
      src/onlineSelling/pages/selectionRecord/index.js
  78. 0
    28
      src/onlineSelling/pages/selectionRecord/index.scss
  79. 1
    0
      src/pages/activity/index.js
  80. 6
    0
      src/pages/activity/index.scss
  81. 1
    0
      src/pages/news/index.js
  82. 1
    1
      src/pages/person/spread/index.js
  83. 2
    2
      src/pages/person/spread/index.scss
  84. 111
    0
      src/pages/project/NavIcons/icons.js
  85. 56
    0
      src/pages/project/NavIcons/index.js
  86. 26
    0
      src/pages/project/NavIcons/index.scss
  87. 5
    3
      src/pages/project/h5Page.js
  88. 0
    144
      src/pages/project/icons.js
  89. 10
    123
      src/pages/project/index.js
  90. 5
    0
      src/pages/shop/index.scss
  91. 73
    0
      src/reducers/house.js
  92. 2
    0
      src/reducers/index.js
  93. 4
    1
      src/services/getCode.js
  94. 3
    0
      src/services/house.js
  95. 41
    5
      src/services/project.js
  96. 1
    2
      src/useless/pages/agent/recommend/index.js
  97. 1
    0
      src/useless/pages/person/customerAnalysis/followUpCustomer/index.js
  98. 4
    1
      src/useless/pages/person/customerAnalysis/index.scss
  99. 1
    0
      src/useless/pages/person/customerAnalysis/transactionCustomer/index.js
  100. 0
    0
      src/utils/request.js

+ 7
- 5
config/dev.js Näytä tiedosto

@@ -5,15 +5,17 @@ module.exports = {
5 5
   defineConstants: {
6 6
     // HOST: '"http://47.101.36.130:8085"',//测试
7 7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    HOST: '"https://dev.pawoma.cn"',//测试
9
-    WSS_HOST: '"wss://dev.pawoma.cn"',
8
+    // HOST: '"https://dev.pawoma.cn"',//测试
9
+    // WSS_HOST: '"wss://dev.pawoma.cn"',
10 10
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
11 11
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
12 12
     // HOST: '"https://lt.pawoma.cn"',
13 13
     // WSS_HOST: '"wss://lt.pawoma.cn"',
14
-    // HOST: '"http://127.0.0.1:8080"',
15
-    // WSS_HOST: '"ws://127.0.0.1:8080"',
16
-    Version: 'V3.5.11'
14
+    HOST: '"http://127.0.0.1:8080"',
15
+    WSS_HOST: '"ws://127.0.0.1:8080"',
16
+    OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
17
+    OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
18
+    Version: 'V3.5.13'
17 19
   },
18 20
   weapp: {},
19 21
   h5: {}

+ 5
- 3
config/prod.js Näytä tiedosto

@@ -3,13 +3,15 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
-    // HOST: '"http://192.168.2.54:8080"',
7
-    // WSS_HOST: '"ws://192.168.2.54:8080"',
6
+    // HOST: '"http://192.168.2.52:8080"',
7
+    // WSS_HOST: '"ws://192.168.2.52:8080"',
8 8
     // HOST: '"https://dev.pawoma.cn"',// 新测试
9 9
     // WSS_HOST: '"wss://dev.pawoma.cn"',
10 10
     HOST: '"https://lt.pawoma.cn"',
11 11
     WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    Version: 'V3.5.12'
12
+    OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
13
+    OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
14
+    Version: 'V3.5.13'
13 15
   },
14 16
   weapp: {},
15 17
   h5: {}

+ 214
- 214
package-lock.json
File diff suppressed because it is too large
Näytä tiedosto


+ 13
- 6
project.config.json Näytä tiedosto

@@ -1,8 +1,8 @@
1 1
 {
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "mini-chengjiao",
4
-	"description": "知与行互动",
5
-	"appid": "wxd6f47a9bb3052175",
4
+	"description": "橙蕉宁房",
5
+	"appid": "wxbbb069a341055ef0",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,
@@ -48,15 +48,22 @@
48 48
 			"list": [
49 49
 				{
50 50
 					"id": -1,
51
+					"name": "pages/raiseMoney/index",
52
+					"pathName": "onlineSelling/pages/raiseMoney/index",
53
+					"query": "",
54
+					"scene": null
55
+				},
56
+				{
57
+					"id": 1,
51 58
 					"name": "pages/houseList/index",
52 59
 					"pathName": "onlineSelling/pages/houseList/index",
53
-					"query": "id=6&buildingId=7a46e04f15c324fa9cf44ce27f9573c5",
60
+					"query": "id=14&buildingId=71d7e60efe75d387a9d8387d1646c0c8",
54 61
 					"scene": null
55 62
 				},
56 63
 				{
57
-					"id": 1,
58
-					"name": "pages/records/index",
59
-					"pathName": "onlineSelling/pages/records/index",
64
+					"id": 2,
65
+					"name": "pages/chooseConsultant/index",
66
+					"pathName": "onlineSelling/pages/chooseConsultant/index",
60 67
 					"query": "",
61 68
 					"scene": null
62 69
 				}

+ 33
- 0
src/actions/house.js Näytä tiedosto

@@ -0,0 +1,33 @@
1
+import { createAction, createActionNormal } from '@/utils/redux'
2
+import { API_CARDS_LIST, API_PRESELECTION_RECORD } from '@/constants/api'
3
+import {
4
+  ADD_CART,
5
+  SUB_CART,
6
+  FLUSH_TO_CART,
7
+  ADD_CONSULTANT,
8
+  CHOOSE_CONSULTANT,
9
+  MY_PRESELECT_RECORD,
10
+} from '@/constants/house'
11
+
12
+// 加入临时车
13
+export const dispatchAddCart = payload => createActionNormal({ type: ADD_CART, payload })
14
+// 删减临时车
15
+export const dispatchSubCart = payload => createActionNormal({ type: SUB_CART, payload })
16
+// 全部进入临时车
17
+export const dispatchFlush2Cart = payload => createActionNormal({ type: FLUSH_TO_CART, payload })
18
+// 获取置业顾问
19
+export const dispatchGetConsultants = payload => createAction({
20
+  type: ADD_CONSULTANT,
21
+  url: API_CARDS_LIST,
22
+  payload
23
+})
24
+
25
+// 临时选择置业
26
+export const dispatchChooseConsultant = payload => createActionNormal({ type: CHOOSE_CONSULTANT, payload })
27
+
28
+// 获取预选记录
29
+export const dispatchGetMySelection = payload => createAction({
30
+  type: MY_PRESELECT_RECORD,
31
+  url: API_PRESELECTION_RECORD,
32
+  payload,
33
+})

+ 11
- 3
src/app.js Näytä tiedosto

@@ -34,6 +34,9 @@ import socket from '@/utils/im'
34 34
 
35 35
 // const store = configStore()
36 36
 
37
+// for dev
38
+global.store = store
39
+
37 40
 class App extends Component {
38 41
   config = {
39 42
     debug: process.env.NODE_ENV === 'development',
@@ -125,13 +128,19 @@ class App extends Component {
125 128
         root: "onlineSelling",
126 129
         pages: [
127 130
           'pages/houseList/index',
131
+          'pages/raiseMoney/index',
128 132
           'pages/live/index',
129 133
           'pages/help/index',
130 134
           'pages/records/index',
131 135
           'pages/detail/index',
132 136
           'pages/detail/resultPage',
133
-          'pages/selectionRecord/index',
134 137
           'pages/screenHouse/index',
138
+          'pages/chooseConsultant/index',
139
+          'pages/protocol/index',
140
+          'pages/raiseProfile/index',
141
+          'pages/raiseProfile/houseResource',
142
+          'pages/addHouse/index',
143
+          'pages/houseCart/index',
135 144
         ],
136 145
       }
137 146
     ],
@@ -141,7 +150,6 @@ class App extends Component {
141 150
       navigationBarBackgroundColor: '#BB9C79',
142 151
       navigationBarTitleText: '',
143 152
       navigationBarTextStyle: 'white',
144
-
145 153
     },
146 154
     tabBar: {
147 155
       color: '#666',
@@ -258,7 +266,7 @@ class App extends Component {
258 266
     //     payload: res,
259 267
     //   })
260 268
     // })
261
-    wx.setBackgroundFetchToken()
269
+    // wx.setBackgroundFetchToken()
262 270
     wx.getBackgroundFetchData({
263 271
       fetchType: 'pre',
264 272
       success: (res) => {

+ 5
- 5
src/app.scss Näytä tiedosto

@@ -23,12 +23,12 @@
23 23
   border-radius: 0;
24 24
   border:none;
25 25
 }
26
-.at-tabs-pane--active{
27
-  height: 100vh!important;
28
-  overflow: scroll;
29
-  padding-bottom: 100px;
26
+// .at-tabs-pane--active{
27
+//   height: 100vh!important;
28
+//   overflow: scroll;
29
+//   padding-bottom: 100px;
30 30
 
31
-}
31
+// }
32 32
 @keyframes fadeBottomIn {
33 33
   0% {
34 34
     transform: translateY(10%);

src/components/indexMenus/icons.js → src/components/indexMenus-deprecated/icons.js Näytä tiedosto


src/components/indexMenus/index.js → src/components/indexMenus-deprecated/index.js Näytä tiedosto


src/components/indexMenus/index.scss → src/components/indexMenus-deprecated/index.scss Näytä tiedosto


+ 12
- 0
src/constants/api.js Näytä tiedosto

@@ -59,10 +59,18 @@ export const API_INDEX_ICONS = resolvePath('taMiniappOrgIcon')
59 59
 
60 60
 export const API_HOUSE_LIST = resolvePath('listHousingResources')
61 61
 export const API_PRESELECTION_RECORD = resolvePath('listPreselectionRecord')
62
+export const API_RAISE_CHECK = resolvePath('check/raise')
63
+export const API_RAISE_PROFILE = resolvePath('taRaise')
64
+export const API_SAVE_RAISE_RECORD = resolvePath('taRaiseRecord')
65
+export const API_RATSE_RECORD = resolvePath('taRaiseRecord/list')
66
+export const API_RATSE_DETAIL = resolvePath('taRaiseRecord')
67
+export const API_RATSE_ORDER = resolvePath('unifiedOrder')
68
+export const API_CANCEL_ORDER = resolvePath('cancel')
62 69
 export const API_HOUSE_DETAIL = resolvePath('getHousingDetailById')
63 70
 export const API_ADD_PRESELECTION = resolvePath('taPreselectionRecord')
64 71
 export const API_CANCEL_PRESELECTION = resolvePath('taPreselectionRecordCancel')
65 72
 export const API_APARTMENT_TYPE = resolvePath('listBuildApartmentBySalesBatchId')
73
+export const API_SALESBATCH_LIST = resolvePath('taSalesBatch/choice')
66 74
 export const API_NOTICE_INFO = resolvePath('getNoticeInfo')
67 75
 export const API_SALES_BATCH = resolvePath('taSalesBatch')
68 76
 export const API_ADDLIVE_NUM = resolvePath('addVisitNum')
@@ -151,6 +159,10 @@ export const API_FEEDBACK_SUBMIT = resolvePath('taCustomerMessage')
151 159
 // getCode
152 160
 export const API_GET_CODE = resolvePath('captcha')
153 161
 
162
+// checkCode
163
+export const API_CHECK_CODE = resolvePath('check/captcha')
164
+
165
+
154 166
 // /wx/registerConsultantOneClick
155 167
 // registerConsultant
156 168
 export const API_PUT_REGISTER = resolvePath('registerConsultant')

+ 18
- 0
src/constants/house.js Näytä tiedosto

@@ -0,0 +1,18 @@
1
+
2
+// 加入选择-暂存
3
+export const ADD_CART = 'ADD_CART'
4
+
5
+// 取消选择-暂存
6
+export const SUB_CART = 'SUB_CART'
7
+
8
+// 所有进入-暂存
9
+export const FLUSH_TO_CART = 'FLUSH_TO_CART'
10
+
11
+// 置业顾问列表
12
+export const ADD_CONSULTANT = 'ADD_CONSULTANT'
13
+
14
+// 临时选择置业
15
+export const CHOOSE_CONSULTANT = 'CHOOSE_CONSULTANT'
16
+
17
+// 获取预选记录
18
+export const MY_PRESELECT_RECORD = 'MY_PRESELECT_RECORD'

BIN
src/onlineSelling/assets/add.png Näytä tiedosto


BIN
src/onlineSelling/assets/card.png Näytä tiedosto


BIN
src/onlineSelling/assets/chips.png Näytä tiedosto


BIN
src/onlineSelling/assets/close.png Näytä tiedosto


BIN
src/onlineSelling/assets/copy.png Näytä tiedosto


BIN
src/onlineSelling/assets/lock.png Näytä tiedosto


BIN
src/onlineSelling/assets/pay.png Näytä tiedosto


BIN
src/onlineSelling/assets/preselection.png Näytä tiedosto


BIN
src/onlineSelling/assets/reduce.png Näytä tiedosto


BIN
src/onlineSelling/assets/void.png Näytä tiedosto


+ 1
- 2
src/onlineSelling/components/Blank/index.js Näytä tiedosto

@@ -4,9 +4,8 @@ import './index.scss'
4 4
 
5 5
 export default function Blank(props) {
6 6
   return (
7
-    <View className="blank">
7
+    <View className="blank" style={props.style}>
8 8
       <Image className="nodata-img" src={require('../../assets/norecord.png')}></Image>
9
-      {/* <View className="nodata"></View> */}
10 9
       {
11 10
         props.tips && <View className="tips">{props.tips}</View>
12 11
       }

+ 36
- 0
src/onlineSelling/components/ConsultantItem/index.js Näytä tiedosto

@@ -0,0 +1,36 @@
1
+import { View, Block } from "@tarojs/components";
2
+import './index.scss'
3
+
4
+export default function ConsultantItem(props) {
5
+
6
+  const { data = {}, style, type, tips } = props
7
+
8
+  return (
9
+    <Block>
10
+      {(!data || !data.id) && tips == 'show' && (<View style="margin-top: 20px; text-align: center">暂无数据</View>)}
11
+      {
12
+        (data && (data.id || data.consultantPersonId)) &&
13
+        (
14
+          <View className="card-item" style={style}>
15
+            <View onClick={() => props.onClick && props.onClick(data)}>
16
+              <Image src={data.photo || data.avatar} className='avatar' ></Image>
17
+              {
18
+                (data.name || data.userName) &&
19
+                (
20
+                  <View className="name">
21
+                    {data.name || data.userName}
22
+                    <Image src={require('@/assets/person/card.png')} className='card' ></Image>
23
+                    {type == 'raiseProfile' && <View className="tip">您的专属置业顾问</View>}
24
+                  </View>
25
+                )
26
+              }
27
+              <View className="phone">{data.phone}</View>
28
+            </View>
29
+            {!type && <View className="home" onClick={props.onHomepage}>主页</View>}
30
+            {type == 'raiseProfile' && <View className="contact" onClick={props.contactClick}>联系我<Text className="right-icon"></Text></View>}
31
+          </View >
32
+        )
33
+      }
34
+    </Block>
35
+  )
36
+}

+ 65
- 0
src/onlineSelling/components/ConsultantItem/index.scss Näytä tiedosto

@@ -0,0 +1,65 @@
1
+.card-item{
2
+  width: 100vw;
3
+  height:156px;
4
+  background-color: #fff;
5
+  padding: 30px;
6
+  margin-bottom: 20px;
7
+  display: flex;
8
+  align-items: center;
9
+  justify-content: space-between;
10
+  position: relative;
11
+  .avatar{
12
+    width:92px;
13
+    height:92px;
14
+    border-radius:50%;
15
+  }
16
+  .name{
17
+    font-size: 32px;
18
+    color: #333;
19
+    display: flex;
20
+    align-items: center;
21
+    position: absolute;
22
+    left: 134px;
23
+    top:30px;
24
+    .card{
25
+      width:48px;
26
+      height:35px;
27
+      margin-left: 18px;
28
+      border-radius: 6px;
29
+    }
30
+    .tip{
31
+      font-size: 24px;
32
+      color: #333;
33
+      margin-left: 20px;
34
+    }
35
+  }
36
+  .phone{
37
+    font-size: 28px;
38
+    color: #666;
39
+    position: absolute;
40
+    left: 134px;
41
+    bottom:30px;
42
+    font-weight:300;
43
+  }
44
+  .home{
45
+    font-size: 28px;
46
+    color: #333;
47
+  }
48
+  .contact{
49
+    position: absolute;
50
+    right: 0;
51
+    top: 28px;
52
+    font-size: 32px;
53
+    color: #BB9C79;
54
+    display: flex;
55
+    align-items: center;
56
+     .right-icon{
57
+      width:20px;
58
+      height:20px;
59
+      border-top: 2px solid #999;
60
+      border-right: 2px solid #999;
61
+      transform:rotate(45deg);
62
+      display: inline-block;
63
+    }
64
+  }
65
+}

+ 16
- 0
src/onlineSelling/components/ContactConsultant/index.js Näytä tiedosto

@@ -0,0 +1,16 @@
1
+import { View } from "@tarojs/components";
2
+import './index.scss'
3
+
4
+export default function ContactConsultant(props) {
5
+  const handleChat = () => {
6
+    const { buildingId } = props
7
+
8
+    Taro.navigateTo({
9
+      url: `/pages/card/list/index?buildingId=${buildingId}`
10
+    })
11
+  }
12
+
13
+  return (
14
+    <View className="contact" style={props.style} onClick={handleChat}>{props.text || '联系置业顾问'}</View>
15
+  )
16
+}

+ 6
- 0
src/onlineSelling/components/ContactConsultant/index.scss Näytä tiedosto

@@ -0,0 +1,6 @@
1
+.contact{
2
+  width: 100vw;
3
+  text-align: center;
4
+  font-size: 36px;
5
+  color: #3DE344;
6
+}

+ 1
- 1
src/onlineSelling/components/GrantProfile/index.js Näytä tiedosto

@@ -9,7 +9,7 @@ function noop(){}
9 9
 export default function GrantProfile(props) {
10 10
   if (isEmpty(props.person)) return <Block />;
11 11
 
12
-  const { tel, phone, avatarurl } = props.person
12
+  const { tel, phone, avatarurl } = props.person || {}
13 13
 
14 14
   const noPhone = !(tel || phone)
15 15
   const noAvatar = !avatarurl || avatarurl.indexOf('wx.qlogo.cn') === -1

+ 1
- 1
src/onlineSelling/components/HotBlock/index.js Näytä tiedosto

@@ -28,5 +28,5 @@ function computeLevel (num) {
28 28
 
29 29
 export default function HotBlock(props) {
30 30
   const level = computeLevel(props.number)
31
-  return (<View className={`hotblock bkg-${level}`}>{props.children}</View>)
31
+  return (<View className={`hotblock bkg-${level}`}><View className="inside">{props.children}</View></View>)
32 32
 }

+ 56
- 0
src/onlineSelling/components/HotBlock/index.scss Näytä tiedosto

@@ -1,45 +1,101 @@
1 1
 
2 2
 .hotblock {
3
+    display: inline-block;
4
+    height: 110px;
5
+    margin-top: 55px;
6
+    margin-left: 10px;
7
+    position: relative;
8
+    width: 132px;
9
+    border-radius: 6px;
10
+    .inside{
11
+      position: absolute;
12
+      height: 110px;
13
+      width: 132px;
14
+      left:0;
15
+      top: -6px;
16
+
17
+    }
18
+
3 19
   &.bkg-0 {
4 20
     background:#F8F8F8;
21
+    border-color:#F8F8F8;
5 22
   }
6 23
   &.bkg-1 {
7 24
     background:#F9DED1;
25
+    border-color:#F9DED1;
8 26
   }
9 27
   &.bkg-2 {
10 28
     background:#F6D4C3;
29
+    border-color:#F6D4C3;
11 30
   }
12 31
   &.bkg-3 {
13 32
     background:#F8C6AD;
33
+    border-color:#F8C6AD;
14 34
   }
15 35
   &.bkg-4 {
16 36
     background:#FDDBDB;
37
+    border-color:#FDDBDB;
17 38
   }
18 39
   &.bkg-5 {
19 40
     background:#F9CCCC;
41
+    border-color:#F9CCCC;
20 42
   }
21 43
   &.bkg-6 {
22 44
     background:#F9B7B7;
45
+    border-color:#F9B7B7;
23 46
   }
24 47
   &.bkg-7 {
25 48
     background:#FFADAD;
49
+    border-color:#FFADAD;
26 50
   }
27 51
   &.bkg-8 {
28 52
     background:#F59683;
53
+    border-color:#F59683;
29 54
   }
30 55
   &.bkg-9 {
31 56
     background:#F7836C;
57
+    border-color:#F7836C;
32 58
   }
33 59
   &.bkg-10 {
34 60
     background:#F97459;
61
+    border-color:#F97459;
35 62
   }
36 63
   &.bkg-11 {
37 64
     background:#FC6749;
65
+    border-color:#FC6749;
38 66
   }
39 67
   &.bkg-12 {
40 68
     background:#FD4E2B;
69
+    border-color:#FD4E2B;
41 70
   }
42 71
   &.bkg-13 {
43 72
     background:#FE2E2E;
73
+    border-color:#FE2E2E;
74
+    
44 75
   }
76
+}
77
+
78
+.hotblock:before {
79
+  border-bottom: 50px solid transparent;
80
+  border-left: 76px solid transparent;
81
+  border-right: 76px solid transparent;
82
+  content: "";
83
+  height: 0;
84
+  left: -10px;
85
+  position: absolute;
86
+  top: -40px;
87
+  width: 0;
88
+  border-bottom-color:inherit ;
89
+}
90
+
91
+.hotblock:after {
92
+  background: inherit;
93
+  position: absolute;
94
+  content: " ";
95
+  top: -34px;
96
+  right: 22px;
97
+  border-top-left-radius: 4px;
98
+  border-top-right-radius: 4px;
99
+  width: 12px;
100
+  height: 30px;
45 101
 }

+ 35
- 10
src/onlineSelling/components/HouseCard/index.js Näytä tiedosto

@@ -9,39 +9,64 @@ export default function HouseCard(props) {
9 9
   const {
10 10
     buildingName,
11 11
     termname,
12
+    termName,
12 13
     blockName,
14
+    displayHousePrice,
13 15
     unitName,
16
+    floorName,
14 17
     roomName,
15 18
     price,
19
+    housingStatus,
20
+    saleBatchStatus,
21
+    houseId,
16 22
     createDate,
17
-    status,
23
+    apartmentImgList = [],
18 24
     buildingImgList = [],
19 25
   } = props.summary || {}
20 26
 
21
-  const title = `${buildingName} ${termname||''} ${blockName} ${unitName} ${roomName}`
27
+  const title = `${buildingName || ''} ${termname || termName || ''} ${blockName || ''} ${unitName || ''} ${floorName || ''} ${roomName || ''}`
22 28
   const thumb = (buildingImgList || []).length
23
-  // const thumb = (buildingImgList || []).length ? transferImage((buildingImgList)[0].url) : emptyImg
29
+  const thumb2 = (apartmentImgList || []).length
24 30
   const showDT = dayjs(createDate).format('YYYY/MM/DD')
25 31
   const wanY = Number(price)
26 32
 
33
+  const toHouseDetail = () => {
34
+    if (props.onClick) {
35
+      props.onClick(props.summary)
36
+      return;
37
+    }
38
+
39
+    if (housingStatus == '0' || saleBatchStatus == '0') {
40
+      Taro.showToast({ title: '当前销售批次或该房源已被取消发布', icon: 'none', duration: 2000 })
41
+    } else {
42
+      Taro.navigateTo({
43
+        url: `/onlineSelling/pages/detail/index?id=${houseId}`
44
+      })
45
+    }
46
+  }
27 47
   return (
28 48
     <View className="housecard">
29
-      <View className="head">
30
-        {thumb ? <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" /> :
49
+      <View className="head" onClick={toHouseDetail}>
50
+        {thumb && <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" />
51
+        }
52
+        {!thumb && !thumb2 &&
31 53
           <Text style="font-size:26rpx;color:#666">暂无户型图</Text>
32 54
         }
33
-        {/* <Image className="thumb" src={thumb} mode="aspectFit" /> */}
55
+        {thumb2 && <Image className="thumb" src={transferImage((apartmentImgList)[0].url)} mode="aspectFit" />
56
+        }
34 57
       </View>
35
-      <View className="body">
58
+      <View className="body" onClick={toHouseDetail}>
36 59
         <View className="badge">已预选</View>
37 60
         <View className="title">{title}</View>
38
-        <View className="subtitle">
61
+        {displayHousePrice && <View className="subtitle">
39 62
           <Text>现价</Text>
40 63
           <Text className="red">{wanY + '万元' || '待定'}</Text>
41
-        </View>
64
+        </View>}
65
+
42 66
         <View className="meta">{showDT}预选</View>
43
-        <View className="sign bg-success"></View>
44 67
       </View>
68
+
69
+
45 70
     </View>
46 71
   )
47 72
 }

+ 3
- 17
src/onlineSelling/components/HouseCard/index.scss Näytä tiedosto

@@ -1,12 +1,8 @@
1 1
 .housecard {
2
-  // width: calc(100% - 32px);
3
-  width: 690px;
2
+  width: 100%;
4 3
   height: 250px;
5 4
   background:#fff;
6
-  border-radius: 8px;
7 5
   display: flex;
8
-  margin: 16px 30px;
9
-  box-shadow: 0 4px 15px 1px rgba(0, 0, 0, 0.12);
10 6
   font-weight: 400;
11 7
 
12 8
   .head {
@@ -18,7 +14,6 @@
18 14
     align-items: center;
19 15
     justify-content: center;
20 16
 
21
-
22 17
     .thumb {
23 18
       width: 100%;
24 19
       height: 100%;
@@ -26,11 +21,11 @@
26 21
   }
27 22
 
28 23
   .body {
29
-    width: 438px;
24
+    width: 415px;
30 25
     flex: none;
31 26
     position: relative;
32 27
     line-height: 40px;
33
-    padding: 20px 16px;
28
+    padding: 16px 40px 16px 16px;
34 29
 
35 30
     .badge {
36 31
       font-size: 30px;
@@ -69,13 +64,4 @@
69 64
     color: #FF3C3C;
70 65
   }
71 66
 
72
-  .bg-success {
73
-    background: url(../../assets/success.png);
74
-    background-size: cover;
75
-  }
76
-
77
-  .bg-fail {
78
-    background: url(../../assets/fail.png);
79
-    background-size: cover;
80
-  }
81 67
 }

+ 8
- 1
src/onlineSelling/components/HouseGrid/Floor.js Näytä tiedosto

@@ -12,7 +12,14 @@ export default function Floor(props) {
12 12
         {roomList.map((room) => {
13 13
           return (
14 14
             <View className="item" key={room.houseId} >
15
-              <Room dataset={room} onClick={props.onRoomClick}/>
15
+              <Room
16
+                dataset={room}
17
+                showDataType={props.showDataType}
18
+                onClick={props.onRoomClick}
19
+                chooseList={props.chooseList}
20
+                showAction={props.showAction}
21
+                onActionClick={props.onActionClick}
22
+              />
16 23
             </View>
17 24
           )
18 25
         })}

+ 58
- 17
src/onlineSelling/components/HouseGrid/Room.js Näytä tiedosto

@@ -1,28 +1,69 @@
1
+import Taro, { Component } from '@tarojs/taro'
1 2
 import { View } from "@tarojs/components";
2 3
 import HotBlock from "../HotBlock";
3 4
 import './room.scss'
5
+import lockImg from '../../assets/lock.png'
6
+import preselectionImg from '../../assets/preselection.png'
7
+import chipsImg from '../../assets/chips.png'
4 8
 
5
-export default function Room(props) {
6
-  const { roomName, heat, realHeat, price, apartmentName, status } = props.dataset || {}
7
-  const personNum = `(${realHeat + heat + 0}人)`
9
+export default class Room extends Component {
10
+  handleClick = () => {
11
+    const { onClick, dataset } = this.props
12
+    if (onClick) {
13
+      onClick(dataset || {})
14
+    }
15
+  }
16
+
17
+  handleActionClick = () => {
18
+    const { onActionClick, showAction, dataset } = this.props
8 19
 
9
-  const handleClick = () => {
10
-    if (props.onClick) {
11
-      props.onClick(props.dataset || {})
20
+    if (showAction && onActionClick) {
21
+      onActionClick(dataset || {})
12 22
     }
13 23
   }
14 24
 
15
-  const wanY = Number(price)
25
+  render() {
26
+    const { dataset, showAction, chooseList, showDataType = 1 } = this.props
16 27
 
17
-  return (
18
-    <HotBlock number={heat + realHeat + 0}>
19
-      {status == '1' && <View className="room" onClick={handleClick}>
20
-        <View className="warn">{roomName || ''}</View>
21
-        <View className="warn">{personNum || ''}</View>
22
-        <View className="info" >{wanY}万元</View>
23
-        <View className="info">{apartmentName || ''}</View>
24
-      </View>}
28
+    const {
29
+      houseId,
30
+      roomName,
31
+      heat,
32
+      realHeat,
33
+      raiseHeat,
34
+      raiseRealHeat,
35
+      houseLockingStatus,
36
+      mineLocked,
37
+      minePreselection,
38
+      mineRaise
39
+    } = dataset || {}
25 40
 
26
-    </HotBlock>
27
-  )
41
+    // const personNum = `(${realHeat + heat + 0}人)`
42
+    const personNum = realHeat + heat + 0
43
+    const raisePersonNum = raiseHeat + raiseRealHeat + 0
44
+
45
+    const actionIcon = (chooseList || []).filter(x => x.houseId == houseId)[0] ? 'subtract-circle' : 'add-circle'
46
+
47
+    return (
48
+      <HotBlock number={showDataType === 1 ? personNum : raisePersonNum}>
49
+        <View className="room">
50
+          <View onClick={this.handleClick.bind(this)}>
51
+            <View className="roomname">{roomName || ''}</View>
52
+            <View className="yuxuan">{personNum}预选</View>
53
+            <View className="yuxuan">{raisePersonNum}认筹</View>
54
+            {!showAction && minePreselection && <Image src={preselectionImg} className="preselection-img"></Image>}
55
+            {!showAction && mineRaise && <Image src={chipsImg} className="chips-img"></Image>}
56
+            {!showAction && houseLockingStatus == 'locked' && <Image src={lockImg} className={mineLocked == 'mine' ? "lock-img2" : 'lock-img'}></Image>}
57
+          </View>
58
+          {
59
+            showAction && (
60
+              <View className="action" onClick={this.handleActionClick.bind(this)}>
61
+                <View className={`at-icon at-icon-${actionIcon}`}></View>
62
+              </View>
63
+            )
64
+          }
65
+        </View>
66
+      </HotBlock>
67
+    )
68
+  }
28 69
 }

+ 11
- 2
src/onlineSelling/components/HouseGrid/Unit.js Näytä tiedosto

@@ -13,7 +13,7 @@ export default class Unit extends Component {
13 13
     } else {
14 14
       item.noshow = false
15 15
     }
16
-    this.setState({})
16
+    this.setState({})  // 强制页面刷新
17 17
   }
18 18
   render() {
19 19
     const { termName, blockName, unitName, noshow = false, floorList = [] } = this.props.dataset || {}
@@ -29,7 +29,16 @@ export default class Unit extends Component {
29 29
         </View>
30 30
         <View className="body" >
31 31
           {!noshow && floorList.map((floor) => {
32
-            return <Floor key={floor.floorId} dataset={floor} onRoomClick={this.props.onRoomClick} />
32
+            return (
33
+              <Floor
34
+                key={floor.floorId}
35
+                dataset={floor}
36
+                showDataType={this.props.showDataType}
37
+                onRoomClick={this.props.onRoomClick}
38
+                chooseList={this.props.chooseList}
39
+                showAction={this.props.showAction}
40
+                onActionClick={this.props.onActionClick}                
41
+              />)
33 42
           })}
34 43
         </View>
35 44
       </View>

+ 11
- 9
src/onlineSelling/components/HouseGrid/floor.scss Näytä tiedosto

@@ -2,11 +2,14 @@
2 2
   display: flex;
3 3
 
4 4
   .head {
5
-    font-size: 32rpx;
6
-    padding-top: 68rpx;
5
+    font-size: 32px;
7 6
     flex: none;
8
-    width: 14%;
7
+    width: 60px;
9 8
     text-align: left;
9
+    height: 174px;
10
+    align-items: center;
11
+    display: flex;
12
+
10 13
   }
11 14
 
12 15
   .body {
@@ -17,13 +20,12 @@
17 20
     flex-wrap: wrap;
18 21
 
19 22
     .item {
20
-      width: 31%;
23
+      width: 25%;
21 24
       flex: none;
22
-      margin-right: 2%;
23
-      
24
-      &:nth-child(3) {
25
-        margin-right: 0;
26
-      }
25
+      text-align: center;
26
+      // &:nth-child(3) {
27
+      //   margin-right: 0;
28
+      // }
27 29
     }
28 30
   }
29 31
 }

+ 14
- 4
src/onlineSelling/components/HouseGrid/index.js Näytä tiedosto

@@ -3,14 +3,24 @@ import Unit from './Unit'
3 3
 
4 4
 export default (props) => {
5 5
   const unitList = (props.dataset || {}).unitList || []
6
-  const onRoomClick = props.onRoomClick || (() => {})
6
+  const handleRoomClick = props.onRoomClick || (() => {})
7
+  const handleActionClick = props.onActionClick || (() => {})
7 8
 
8 9
   return (
9 10
     <Block>
10 11
       {
11
-        unitList.map((unit) => (<Unit key={unit.unitId} dataset={unit} onRoomClick={onRoomClick} />))
12
+        unitList.map((unit) => (
13
+          <Unit
14
+            key={unit.unitId}
15
+            dataset={unit}
16
+            showDataType={props.showDataType}
17
+            onRoomClick={handleRoomClick}
18
+            chooseList={props.chooseList}
19
+            showAction={props.showAction}
20
+            onActionClick={handleActionClick}
21
+          />
22
+        ))
12 23
       }
13 24
     </Block>
14 25
   )
15
-
16
-}
26
+}

+ 49
- 5
src/onlineSelling/components/HouseGrid/room.scss Näytä tiedosto

@@ -1,22 +1,66 @@
1
+@import "~taro-ui/dist/style/components/icon.scss";
2
+
1 3
 .room {
2 4
   text-align: center;
3 5
   margin-bottom: 16px;
4
-  padding: 20px 10px;
6
+  padding: 10px;
5 7
   font-size: 28px;
6
-  line-height: 1.4em;
7
-  height: 192px;
8
+  height: 110px;
8 9
   overflow: hidden;
10
+  line-height: 1.24;
9 11
 
10 12
   .info {
11 13
     color: #333;
12 14
     white-space:nowrap;
13 15
   }
14
-
15
-  .warn {
16
+  .roomname{
16 17
     color: #730000;
17 18
   }
18 19
 
20
+  .yuxuan {
21
+   color: #333;
22
+   white-space: nowrap;
23
+  }
24
+
19 25
   .tip {
20 26
     color: #BB9C79;
21 27
   }
28
+  .lock-img{
29
+    width:22px;
30
+    height:23px;
31
+    position: absolute;
32
+    left: 2px;
33
+    bottom: 3px;
34
+  }
35
+  .lock-img2{
36
+    width:22px;
37
+    height:23px;
38
+    position: absolute;
39
+    right: 2px;
40
+    bottom: 3px;
41
+  }
42
+  .preselection-img{
43
+    width:18px;
44
+    height:18px;
45
+    position: absolute;
46
+    left: 10px;
47
+    top: 12px;
48
+  }
49
+  .chips-img{
50
+    width:18px;
51
+    height:18px;
52
+    position: absolute;
53
+    right: 10px;
54
+    top: 12px;
55
+  }
56
+
57
+  .action {
58
+    position: absolute;
59
+    width: 100%;
60
+    left: 0;
61
+    top: -30px;
62
+    height: 35px;
63
+    background: transparent;
64
+    text-align: center;
65
+  }
22 66
 }

+ 28
- 0
src/onlineSelling/components/Picker/index.js Näytä tiedosto

@@ -0,0 +1,28 @@
1
+import { View, Image, Text } from "@tarojs/components";
2
+import { transferImage } from '@/utils/tools'
3
+import dayjs from 'dayjs'
4
+import emptyImg from '@/assets/empty.png'
5
+
6
+import './index.scss'
7
+
8
+export default function (props) {
9
+  const { selector, title, currentValue, keyValue } = props || {}
10
+
11
+
12
+
13
+  return (
14
+    <View className="con-item">
15
+      <View className="title">
16
+        {title}
17
+      </View>
18
+      <View className="con-picker" >
19
+        <Picker mode='selector' range={selector} range-key={keyValue} onChange={props.handleChange}>
20
+          <View className='picker'>
21
+            {currentValue}
22
+          </View>
23
+        </Picker>
24
+        <View className="choose">请选择</View>
25
+      </View>
26
+    </View>
27
+  )
28
+}

+ 40
- 0
src/onlineSelling/components/Picker/index.scss Näytä tiedosto

@@ -0,0 +1,40 @@
1
+.con-item{
2
+  display: flex;
3
+  justify-content: space-between;
4
+  border-bottom: 1px solid #dcdcdc;
5
+  line-height: 98px;
6
+  align-items: center;
7
+  position: relative;
8
+  .title{
9
+    font-size: 33px;
10
+    color: #333;
11
+  } 
12
+  .con-picker{
13
+    display: flex;
14
+    align-items: center;
15
+    justify-content: space-between;
16
+    width:456px;
17
+    height:48px ;
18
+    line-height: 48px;
19
+    padding: 0 16px;
20
+    border-radius: 4px;
21
+    .picker{
22
+      width: 450px;
23
+      line-height:98px ;
24
+      height: 98px;
25
+      z-index: 1;
26
+      position: absolute;
27
+      top: 0;
28
+      font-size: 32px;
29
+    }
30
+  }
31
+  .choose{
32
+   font-size: 24px;
33
+   color: #E4A938;
34
+   float: right;
35
+   position: absolute;
36
+   right: 40px;
37
+
38
+  }
39
+}
40
+

+ 112
- 0
src/onlineSelling/components/RaiseCard/index.js Näytä tiedosto

@@ -0,0 +1,112 @@
1
+import { View, Image, Text, Block } from "@tarojs/components";
2
+import { transferImage } from '@/utils/tools'
3
+import dayjs from 'dayjs'
4
+import copyImg from '../../assets/copy.png'
5
+import closeImg from '../../assets/close.png'
6
+
7
+import './index.scss'
8
+
9
+export default function RaiseCard(props) {
10
+  let {
11
+    buildingName,
12
+    termName,
13
+    blockName,
14
+    unitName,
15
+    floorName,
16
+    roomName,
17
+    price,
18
+    houseLockingStatus,
19
+    displayHousePrice,
20
+    apartmentName,
21
+    mineLocked,
22
+    createDate,
23
+    buildingArea,
24
+    insideArea,
25
+    payStatus,
26
+    houseId,
27
+    statusType = '',
28
+    status,
29
+    taHousingResourcesList = [],
30
+    apartmentImgList = [],
31
+    taRaise = {},
32
+    buildingImgList = [],
33
+  } = props.summary || {}
34
+
35
+  if (!taRaise) {
36
+    taRaise = {}
37
+  }
38
+
39
+  const defHouse = taHousingResourcesList[0] || {}
40
+  const ellipsis = taHousingResourcesList.length > 1 ? `等${taHousingResourcesList.length}套房源` : ''
41
+  const title = `${buildingName || defHouse.buildingName || ''} ${termName || defHouse.termName || ''} ${blockName || defHouse.blockName || ''} ${unitName || defHouse.unitName || ''} ${floorName || defHouse.floorName || ''} ${roomName || defHouse.roomName || ' '}${ellipsis}`
42
+  const thumb = (buildingImgList || []).length
43
+  const thumb2 = (apartmentImgList || []).length
44
+  const showDT = dayjs(createDate).format('YYYY/MM/DD')
45
+  const wanY = Number(price)
46
+
47
+
48
+  const copyData = (e) => {
49
+    e.stopPropagation()
50
+    Taro.setClipboardData({
51
+      data: `${houseId}`,
52
+      onSuccess: (() => { }),
53
+    })
54
+  }
55
+
56
+  const handleCancel = () => {
57
+    if (props.onCancel) {
58
+      props.onCancel(props.summary)
59
+    }
60
+  }
61
+  return (
62
+
63
+    <Block>
64
+      {status == -1 && statusType == "raise" ? '' :
65
+        <View className="housecard" style={props.style} >
66
+          <View className="head" onClick={() => (props.handleCard && props.handleCard())}>
67
+            {thumb && <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" />
68
+            }
69
+            {!thumb && !thumb2 &&
70
+              <Text style="font-size:26rpx;color:#666">暂无户型图</Text>
71
+            }
72
+            {thumb2 && <Image className="thumb" src={transferImage((apartmentImgList)[0].url)} mode="aspectFit" />
73
+            }
74
+          </View>
75
+          <View className="body">
76
+            {props.type == 'raiseMoney' && !props.disableCancel && <Image src={closeImg} onClick={handleCancel} className="close-img"></Image>}
77
+            <View onClick={() => (props.handleCard && props.handleCard())}>
78
+              {!props.type && <View style={status == '0' ? 'color:#999' : ''} className={payStatus == 'paid' ? 'raised badge' : payStatus == 'unpaid' ? 'unraise badge' : 'badge'}>{payStatus == 'paid' ? '已缴费' : payStatus == 'unpaid' ? '未缴费' : '已退费'}</View>}
79
+              {(props.type == 'raiseProfile' || props.type == 'houseResource') && <View style="color:#FF3C3C" className='badge'>{mineLocked ? '已锁给我' : ' '}</View>}
80
+              {(props.type == 'raiseProfile' || props.type == 'raiseMoney') && <View style={props.type == 'raiseMoney' ? 'color:#BB9C79;font-size:30rpx' : 'color:#BB9C79;font-size:30rpx;margin-top:-20rpx'}>{apartmentName || ' '}</View>}
81
+              {props.type == 'raiseMoney' && (taRaise.displayHousePrice || displayHousePrice) && <View className="red-price">现价{wanY}万</View>}
82
+              {props.type == 'houseResource' && <View style="color:#BB9C79;font-size:28rpx;margin:-40rpx 0 12rpx 0">{houseLockingStatus == 'locked' ? '已锁定' : '未锁定'}</View>}
83
+              <View className={props.type == 'raiseMoney' && !props.disableCancel ? 'title max' : 'title'} style={status == '0' ? 'color:#999' : ''}>{title}</View>
84
+              {!props.type && <View className="meta">{showDT}</View>}
85
+              {props.type == 'raiseProfile' && (taRaise.displayHousePrice || displayHousePrice) && <View className="price">现价<Text className="red">{wanY}</Text>万</View>}
86
+              {status == '0' && <View style="color:#999;font-size:30rpx">已作废</View>}
87
+              {(props.type == 'raiseProfile' || props.type == 'raiseMoney') &&
88
+                <Block>
89
+                  {buildingArea ? <View className="area">建筑面积约 <Text className="red">{buildingArea}m²</Text>
90
+                  </View> : <View className="area">建筑面积待定
91
+             </View>}
92
+                </Block>
93
+              }
94
+              {(props.type == 'raiseProfile' || props.type == 'raiseMoney') &&
95
+                <Block>
96
+                  {insideArea ? <View className="area">使用面积约 <Text className="red">{insideArea}m²</Text>
97
+                  </View> : <View className="area">使用面积待定
98
+             </View>}
99
+                </Block>
100
+              }
101
+            </View>
102
+            {props.type == 'houseResource' && <View className="house-code" style="margin-top:14rpx">房源编号:{houseId}
103
+              <Image src={copyImg} className="copy-img" onClick={copyData}></Image>
104
+            </View>}
105
+          </View>
106
+
107
+        </View>
108
+      }
109
+    </Block>
110
+
111
+  )
112
+}

+ 100
- 0
src/onlineSelling/components/RaiseCard/index.scss Näytä tiedosto

@@ -0,0 +1,100 @@
1
+.housecard {
2
+  width: 690px;
3
+  min-height: 250px;
4
+  background:#fff;
5
+  display: flex;
6
+  font-weight: 400;
7
+  margin: 0 auto 30px auto;
8
+  box-shadow:0px 4px 15px 1px rgba(0, 0, 0, 0.12);
9
+  border-radius:8px;
10
+  .head {
11
+    width: 250px;
12
+    flex: none;
13
+    border-right: 2px solid rgba(0, 0, 0, 0.04);
14
+    padding: 20px;
15
+    display: flex;
16
+    align-items: center;
17
+    justify-content: center;
18
+
19
+    .thumb {
20
+      width: 100%;
21
+      height: 100%;
22
+    }
23
+  }
24
+
25
+  .body {
26
+    width: 440px;
27
+    flex: none;
28
+    position: relative;
29
+    line-height: 40px;
30
+    padding: 16px;
31
+    .close-img{
32
+      width: 46px;
33
+      height: 46px;
34
+      padding: 10px;
35
+      position: absolute;
36
+      right: 10px;
37
+      top: 10px;
38
+    }
39
+    .badge {
40
+      font-size: 30px;
41
+      color: #999;
42
+      text-align: right;
43
+      margin-right: 12px;
44
+    }
45
+    .unraise{
46
+      color: #FE1C1C
47
+    }
48
+    .raised{
49
+     color: #3DE344; 
50
+    }
51
+    .title {
52
+      font-size: 26px;
53
+      font-weight: bold;
54
+      color:#333;
55
+      line-height: 1.6;
56
+    }
57
+    .max{
58
+      max-width:340px
59
+    }
60
+
61
+    .meta {
62
+      font-size: 24px;
63
+      color:#999;
64
+      float: right;
65
+    }
66
+    .price{
67
+      font-size: 28px;
68
+      color: #333;
69
+      display: flex;
70
+      align-items: center;
71
+    }
72
+    .house-code{
73
+      font-size: 28px;
74
+      color: #333;
75
+      display: flex;
76
+      align-items: center;
77
+      justify-content: space-between;
78
+    }
79
+    .area{
80
+      font-size: 24px;
81
+      color: #333;
82
+    }
83
+    .red-price{
84
+      color: #FF3C3C;
85
+      font-weight: 900;
86
+      line-height: 2;
87
+      font-size: 24px;
88
+    }
89
+    .red{
90
+      color: #FF3C3C;
91
+      margin: 0 6px;
92
+    }
93
+    .copy-img{
94
+      width:34px;
95
+      height:38px;
96
+    }
97
+
98
+  }
99
+
100
+}

+ 0
- 1
src/onlineSelling/components/ScrollMessage/index.js Näytä tiedosto

@@ -54,7 +54,6 @@ export default class ScrollMessage extends Component {
54 54
       <View className="scrollmessage">
55 55
         <View className="head">
56 56
           <Image style="width:44rpx;height:44rpx;margin-top: 10rpx;" src={require('../../assets/notice.png')}></Image>
57
-          {/* <NamedIcon name="notice" size={44} /> */}
58 57
         </View>
59 58
         <View className="body">
60 59
           <Swiper vertical autoplay>

+ 0
- 1
src/onlineSelling/components/ShareButtons/ShareBtn.js Näytä tiedosto

@@ -9,7 +9,6 @@ export default function ShareBtn(props) {
9 9
   return (
10 10
     <Button className="sharebtn" onClick={handleClick} openType={props.openType}>
11 11
       <View>
12
-        {/* <NamedIcon name={props.name} size={props.size || 56} /> */}
13 12
         {props.name=='share-friends'&&<Image style="width:56rpx;height:56rpx" src={require('../../assets/share-friends.png')}></Image>}
14 13
         {props.name=='sharing-circleoffriends'&&<Image style="width:56rpx;height:56rpx" src={require('../../assets/sharing-circleoffriends.png')}></Image>}
15 14
       </View>

+ 12
- 0
src/onlineSelling/components/Statement/index.js Näytä tiedosto

@@ -0,0 +1,12 @@
1
+import { View} from "@tarojs/components";
2
+import './index.scss'
3
+
4
+export default function Statement(props) {
5
+
6
+  return (
7
+    <View className="bottom-con" style={props.style}>
8
+      <View className="statement">!免责声明:</View>
9
+      <View className="statement">房源信息、选房协议等来源于开发商,具体销售数据可能会有延迟,最终以开发商官网公告为准,请在执行具体操作前和置业顾问沟通确认,并谨慎核查。</View>
10
+    </View>
11
+  )
12
+}

+ 10
- 0
src/onlineSelling/components/Statement/index.scss Näytä tiedosto

@@ -0,0 +1,10 @@
1
+.bottom-con{
2
+  padding: 26px 30px;
3
+  background-color: #F8F8F8;
4
+
5
+  .statement{
6
+    font-size: 24px;
7
+    color: #999;
8
+    line-height: 1.6;
9
+  }
10
+} 

+ 145
- 0
src/onlineSelling/pages/addHouse/index.js Näytä tiedosto

@@ -0,0 +1,145 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View, ScrollView, Block } from '@tarojs/components'
3
+import './index.scss'
4
+import Blank from '../../components/Blank'
5
+import HouseCard from '../../components/HouseCard'
6
+import ready from '@/utils/ready'
7
+import { connect } from '@tarojs/redux'
8
+import * as houseActions from '@/actions/house'
9
+
10
+function noop() { }
11
+
12
+@connect(
13
+  ({ user, house }) => ({ ...user, house }),
14
+  { ...houseActions }
15
+)
16
+export default class extends Component {
17
+  config = {
18
+    navigationBarTitleText: '添加预选房源',
19
+  }
20
+
21
+  state = {
22
+    chooseList: [],
23
+  }
24
+
25
+  componentWillMount() {
26
+    ready.queue(() => {
27
+      const { userInfo, house } = this.props
28
+      const { id: salesBatchId } = this.$router.params
29
+
30
+      this.props.dispatchGetMySelection({
31
+        source: 'raiseChoose',
32
+        salesBatchId,
33
+        personId: userInfo.person.personId,
34
+      })
35
+
36
+      if (house.raiseCart && house.raiseCart.length) {
37
+        this.setState({ chooseList: house.raiseCart })
38
+      }
39
+    })
40
+  }
41
+
42
+  handleCheckboxChange = (e) => {
43
+    const { house } = this.props
44
+    const houseIdList = e.detail.value.map(x => x - 0)
45
+    const chooseList = (house.mySelectHouses || []).filter(x => houseIdList.indexOf(x.houseId) > -1).map(x => ({
46
+      ...x.housingInfo,
47
+      buildingImgList: x.buildingImgList,
48
+      displayHousePrice: x.displayHousePrice,
49
+      displayHousePrice: x.displayHousePrice
50
+    }))
51
+
52
+    this.setState({ chooseList })
53
+  }
54
+
55
+  handleSubmit = () => {
56
+    const { chooseList } = this.state
57
+    const { house } = this.props
58
+
59
+    if (!chooseList.length) {
60
+      Taro.showModal({
61
+        title: '提示',
62
+        content: '您未选择房源, 确认离开?',
63
+        success: (res) => {
64
+          if (res.confirm) {
65
+            const leftHouses = house.raiseCart.filter(x => !(house.mySelectHouses || []).filter(it => it.houseId == x.houseId)[0])
66
+
67
+            this.props.dispatchFlush2Cart(leftHouses)
68
+            Taro.navigateBack({ delta: 1 })
69
+          }
70
+        }
71
+      })
72
+    } else {
73
+      const notInPreSelect = house.raiseCart.filter(x => !chooseList.filter(it => it.houseId == x.houseId)[0])
74
+
75
+      this.props.dispatchFlush2Cart(notInPreSelect.concat(chooseList))
76
+      Taro.navigateBack({ delta: 1 })
77
+    }
78
+  }
79
+
80
+  renderHead() {
81
+    return (
82
+      <View className="head">仅展示符合认筹条件的已预选房源,左侧勾选</View>
83
+    );
84
+  }
85
+
86
+  renderHouses() {
87
+    const { chooseList } = this.state
88
+    const { house } = this.props
89
+
90
+    // 从预选记录中过滤出来, 状态正常且未锁定的房源
91
+    const houseList = (house.mySelectHouses || []).map(x => ({
92
+      ...x.housingInfo,
93
+      buildingImgList: x.buildingImgList,
94
+      displayHousePrice: x.displayHousePrice,
95
+      displayHousePrice: x.displayHousePrice
96
+    })).filter(x => x.status == 1)
97
+
98
+    return houseList.length && (
99
+      <Block>
100
+        <ScrollView scrollY className="container">
101
+          <CheckboxGroup onChange={this.handleCheckboxChange}>
102
+            {
103
+              houseList.map((item) => {
104
+                const checked = !!chooseList.filter(x => x.houseId == item.houseId)[0]
105
+
106
+                return (
107
+                  <Label class="checkbox" key={item.houseId}>
108
+                    <Checkbox value={item.houseId} checked={checked} >
109
+                      <View className="carditem" >
110
+                        <HouseCard summary={item} onClick={noop} />
111
+                      </View>
112
+                    </Checkbox>
113
+                  </Label>
114
+                )
115
+              })
116
+            }
117
+          </CheckboxGroup>
118
+        </ScrollView >
119
+        <View className="raise-box">
120
+          <View className="raise-btn" onClick={this.handleSubmit}>确认以上选择</View>
121
+        </View>
122
+      </Block>
123
+    )
124
+  }
125
+
126
+
127
+  renderBlank() {
128
+    const { house } = this.props
129
+    const hasData = house.mySelectHouses && house.mySelectHouses.length
130
+
131
+    return !hasData && (
132
+      <Blank tips="没有符合认筹条件的预选房源" />
133
+    )
134
+  }
135
+
136
+  render() {
137
+    return (
138
+      <View className="add-house">
139
+        {this.renderHead()}
140
+        {this.renderBlank()}
141
+        {this.renderHouses()}
142
+      </View>
143
+    )
144
+  }
145
+}

+ 40
- 0
src/onlineSelling/pages/addHouse/index.scss Näytä tiedosto

@@ -0,0 +1,40 @@
1
+
2
+.add-house {
3
+  background-color: #F8F8F8;
4
+  min-height: 100vh;
5
+
6
+  .head {
7
+    padding: 0 30px;
8
+    font-size:28px;
9
+    color: #666;
10
+    line-height:88px;
11
+  }
12
+  .container {
13
+    height: calc(100vh - 242px);
14
+  }
15
+  .checkbox{
16
+    display: block;
17
+    height: 250px;
18
+    background-color: #fff;
19
+    padding-left: 30px;
20
+    margin-bottom: 20px;
21
+  }
22
+
23
+  .raise-box{
24
+    position: fixed;
25
+    width: 100vw;
26
+    padding: 30px;
27
+    .raise-btn{
28
+     
29
+      height:94px;
30
+      line-height: 94px;
31
+      background:rgba(187,156,121,1);
32
+      border-radius:10px;
33
+      color: #fff;
34
+      font-size: 36px;
35
+      text-align: center;
36
+    }  
37
+  }
38
+
39
+
40
+}

+ 65
- 0
src/onlineSelling/pages/chooseConsultant/index.js Näytä tiedosto

@@ -0,0 +1,65 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View } from '@tarojs/components'
3
+import ConsultantItem from '../../components/ConsultantItem/index'
4
+import './index.scss'
5
+
6
+import { connect } from '@tarojs/redux'
7
+import * as houseActions from '@/actions/house'
8
+import Blank from '../../components/Blank'
9
+
10
+@connect(({ house }) => ({ house }), { ...houseActions })
11
+export default class ConsultantList extends Component {
12
+  config = {
13
+    navigationBarTitleText: '选择置业顾问'
14
+  }
15
+
16
+  componentDidMount() {
17
+    const { buildingId } = this.$router.params
18
+    const { house } = this.props
19
+
20
+    // if (!house.consultantList || !house.consultantList.length) {
21
+    this.props.dispatchGetConsultants({
22
+      buildingId,
23
+      pageSize: 999,
24
+      pageNumber: 1,
25
+    })
26
+    // }
27
+  }
28
+
29
+  handleItemClick = (consultant) => {
30
+    console.log('----------------->', consultant)
31
+    this.props.dispatchChooseConsultant(consultant)
32
+
33
+    Taro.navigateBack({ delta: 1 })
34
+  }
35
+  toConsultantDetail(item) {
36
+    Taro.navigateTo({
37
+      url: `/pages/card/index?id=${item.id}`
38
+    })
39
+  }
40
+  render() {
41
+    const { house } = this.props
42
+
43
+    return (
44
+      <View className="consultantList">
45
+        {
46
+          (!house.consultantList || !house.consultantList.length) &&
47
+          (<Blank tips="暂无数据" />)
48
+        }
49
+
50
+        {
51
+          house.consultantList.map((item, index) => (
52
+            <ConsultantItem
53
+              data={item}
54
+              key={index + 'card'}
55
+              onClick={this.handleItemClick}
56
+              onHomepage={() => this.toConsultantDetail(item)}
57
+            >
58
+            </ConsultantItem>
59
+          ))
60
+        }
61
+      </View>
62
+    )
63
+  }
64
+
65
+}

+ 5
- 0
src/onlineSelling/pages/chooseConsultant/index.scss Näytä tiedosto

@@ -0,0 +1,5 @@
1
+.consultantList{
2
+  background-color: #F8F8F8;
3
+  min-height: 100vh;
4
+  padding-top: 20px;
5
+}

+ 67
- 32
src/onlineSelling/pages/detail/index.js Näytä tiedosto

@@ -9,9 +9,14 @@ import dayjs from 'dayjs'
9 9
 import { transferImage } from '@/utils/tools'
10 10
 import Blank from '../../components/Blank'
11 11
 import * as noticeType from '@/constants/common.js'
12
+import Statement from '../../components/Statement'
13
+import { View } from '@tarojs/components'
14
+import * as houseActions from '@/actions/house'
15
+import { checkRaise } from '@/services/house'
12 16
 
13 17
 @connect(
14
-  ({ user }) => ({ ...user })
18
+  ({ user, house }) => ({ ...user, house }),
19
+  { ...houseActions }
15 20
 )
16 21
 
17 22
 export default class Index extends Component {
@@ -22,13 +27,11 @@ export default class Index extends Component {
22 27
   state = {
23 28
     grantPhoneVisible: false, // 授权电话
24 29
     grantAvatarVisible: false, // 授权头像
25
-    houseDetail: null,
30
+    houseDetail: {},
26 31
     popVisiable: false,
27 32
   }
28 33
 
29
-
30 34
   componentDidShow() {
31
-
32 35
     ready.queue(() => {
33 36
       // 分享场景需要先授权手机, 再授权头像
34 37
       if (this.toggleGrantPhone()) {
@@ -42,7 +45,7 @@ export default class Index extends Component {
42 45
       }
43 46
       queryHouseDetail(params).then(res => {
44 47
         this.setState({
45
-          houseDetail: res || {},
48
+          houseDetail: !res ? {} : res,
46 49
           buildingImgList: res.buildingImgList || []
47 50
         })
48 51
       })
@@ -50,8 +53,6 @@ export default class Index extends Component {
50 53
     })
51 54
   }
52 55
 
53
-
54
-
55 56
   // 调起授权电话
56 57
   toggleGrantPhone = () => {
57 58
     const { userInfo: { person: { phone, tel } } } = this.props
@@ -95,7 +96,6 @@ export default class Index extends Component {
95 96
   }
96 97
 
97 98
   handlePanoramaClick(panoramaLink) {
98
-    console.log(panoramaLink, "panoramapanoramapanoramapanoramapanoramapanoramapanoramapanoramapanorama")
99 99
 
100 100
     if (!panoramaLink) return;
101 101
 
@@ -137,10 +137,42 @@ export default class Index extends Component {
137 137
 
138 138
   }
139 139
 
140
+  toRaiseMoney() {
141
+    const detail = this.state.houseDetail || {}
142
+
143
+    if (detail.status != 1) {
144
+      Taro.showToast({
145
+        url: '当前房源未发布, 不能认筹',
146
+        icon: 'none',
147
+      })
148
+
149
+      return;
150
+    }
151
+
152
+    checkRaise([detail.houseId]).then(() => {
153
+      this.props.dispatchAddCart(detail)
154
+      Taro.navigateTo({ url: `/onlineSelling/pages/raiseMoney/index?houseId=${detail.houseId}&salesBatchId=${detail.salesBatchId}` })
155
+    })
156
+  }
157
+
158
+  // 查看大图
159
+  onPreview = (item, e) => {
160
+
161
+    var previewArr = [];
162
+    for (var i = 0; i < item.length; i++) {
163
+      previewArr.push(item[i].url);
164
+    }
165
+
166
+    Taro.previewImage({
167
+      current: previewArr,
168
+      urls: previewArr
169
+    })
140 170
 
171
+  }
141 172
 
142 173
   render() {
143
-    const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList, popVisiable } = this.state
174
+    const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList = [], popVisiable } = this.state
175
+    const { taRaise } = this.state.houseDetail
144 176
     const { userInfo } = this.props
145 177
     const address = `${houseDetail.buildingName || ''}${houseDetail.termName || ''}${houseDetail.blockName || ''}${houseDetail.unitName || ''}${houseDetail.floorName || ''}${houseDetail.roomName || ''}`
146 178
 
@@ -167,12 +199,12 @@ export default class Index extends Component {
167 199
 
168 200
         <View className='detail'>
169 201
           <View className='detail-top'>
170
-            {buildingImgList.length ?
171
-              <Image className="cover-img" mode="widthFix" onClick={() => buildingImgList[0].type == '1' ? this.handlePanoramaClick(buildingImgList[0].panoramaLink) : ''} src={transferImage(buildingImgList[0].url)} />
202
+            {buildingImgList && buildingImgList.length ?
203
+              <Image className="cover-img" mode="widthFix" onClick={() => buildingImgList[0].type == '1' ? this.handlePanoramaClick(buildingImgList[0].panoramaLink) : this.onPreview(buildingImgList)} src={transferImage(buildingImgList[0].url)} />
172 204
               : <Blank tips="暂无户型信息"></Blank>
173 205
             }
174 206
           </View>
175
-          {buildingImgList.length && buildingImgList[0].type == '1' &&
207
+          {buildingImgList && buildingImgList.length && buildingImgList[0].type == '1' &&
176 208
             <Image className="vr-img" onClick={() => this.handlePanoramaClick(buildingImgList[0].panoramaLink)} src={require('@/assets/vr.png')} />
177 209
           }
178 210
           <ScrollView
@@ -181,11 +213,12 @@ export default class Index extends Component {
181 213
             scrollY>
182 214
             <View className='detail__main'>
183 215
               <View style="padding: 0 30rpx;">
184
-                <View className="name">{houseDetail.apartmentName || ''}</View>
216
+                <View className="name">{houseDetail.apartmentName || ' '}</View>
185 217
                 <View className="btn" onClick={() => this.handleChat(houseDetail.buildingId)}>询问优惠</View>
186
-                <View className="price">
187
-                  现价:{houseDetail.price}万
188
-              </View>
218
+                {
219
+                  (taRaise.displayHousePrice || houseDetail.displayHousePrice) && <View className="price"> 现价:{houseDetail.price}万</View>
220
+                }
221
+
189 222
                 {houseDetail.apartmentName &&
190 223
                   <View className="area">
191 224
                     {houseDetail.buildingArea ? <Text>建筑面积约<Text style="color:#FE1C1C">{houseDetail.buildingArea}</Text>m² </Text> : '建筑面积待定'}
@@ -195,35 +228,37 @@ export default class Index extends Component {
195 228
                 <View className="address">
196 229
                   <Image className="location-icon" src={require('../../assets/location.png')}></Image>{address || ''}
197 230
                 </View>
198
-                <View className="date">
231
+                {houseDetail.preselectionStartTime && <View className="date">
199 232
                   预选时间:{dayjs(houseDetail.preselectionStartTime).format('MM/DD HH:mm:ss')}--{dayjs(houseDetail.preselectionEndTime).format('MM/DD HH:mm:ss')}
200 233
                 </View>
201
-                {/* <View className="date">
202
-                  认筹时间:2/12 12:23:33--2/13 12:23:34
203
-              </View> */}
234
+                }
235
+                {taRaise && <View className="date">认筹时间:{dayjs(taRaise.raiseStartTime).format('MM/DD HH:mm:ss')}--{dayjs(taRaise.raiseEndTime).format('MM/DD HH:mm:ss')}
236
+                </View>}
237
+
204 238
               </View>
205 239
               <View className="num">
206 240
                 已有{houseDetail.realHeat + houseDetail.heat + 0}人预选此房源,快快预选认筹~
207 241
               </View>
242
+              <Statement style="margin: 104rpx 0 30rpx 0" />
208 243
               <View style="padding: 0 30rpx;">
209
-                {!houseDetail.isPreselect ?
210
-                  <View className="choose-btn" onClick={() => this.open()}>
211
-                    预选此房源
244
+                {
245
+                  houseDetail.preselectionBtn && <View>
246
+                    {!houseDetail.isPreselect ?
247
+                      <View className="choose-btn" onClick={() => this.open()}>
248
+                        预选此房源
212 249
                   </View> : <View className="choose-btn" onClick={() => this.open()}>
213
-                    取消预选
250
+                        取消预选
251
+                  </View>
252
+                    }
214 253
                   </View>
215 254
                 }
216
-                <View className="close-btn">
217
-                  认筹功能未开放
218
-              </View>
219
-              </View>
220
-
221 255
 
256
+                {houseDetail.raiseBtn && <View className="raise-btn" onClick={() => this.toRaiseMoney()}>
257
+                  认筹此房源
258
+              </View>}
259
+              </View>
222 260
             </View>
223 261
           </ScrollView>
224
-
225
-
226
-
227 262
         </View>
228 263
 
229 264
       </Block >

+ 3
- 4
src/onlineSelling/pages/detail/index.scss Näytä tiedosto

@@ -144,7 +144,6 @@
144 144
       padding: 0 30px;
145 145
       margin-top: 10px;
146 146
       font-weight: 300;
147
-      margin-bottom: 78px;
148 147
    
149 148
     }
150 149
     .choose-btn{
@@ -155,10 +154,10 @@
155 154
       border-radius:10px;
156 155
       text-align: center; 
157 156
     }
158
-    .close-btn{
159
-      color: $primary-color;
157
+    .raise-btn{
158
+      color: #333;
160 159
       font-size: 36px;
161
-      background-color: #F8F8F8;
160
+      border:1px solid #dcdcdc;
162 161
       line-height: 94px;
163 162
       border-radius:10px;
164 163
       text-align: center;

+ 5
- 11
src/onlineSelling/pages/detail/resultPage.js Näytä tiedosto

@@ -3,12 +3,13 @@ import './index.scss'
3 3
 import { connect } from '@tarojs/redux'
4 4
 import ready from '@/utils/ready'
5 5
 import { addPreselection, cancelPreselection } from '@/services/project'
6
+import ContactConsultant from '../../components/ContactConsultant'
6 7
 
7 8
 @connect(
8 9
   ({ user }) => ({ ...user })
9 10
 )
10 11
 
11
-export default class Index extends Component {
12
+export default class resultPage extends Component {
12 13
   config = {
13 14
     navigationBarTitleText: '',
14 15
   }
@@ -49,7 +50,7 @@ export default class Index extends Component {
49 50
         })
50 51
       } else {
51 52
         Taro.setNavigationBarTitle({ title: '取消预选' })
52
-        cancelPreselection( params2).then(res => {
53
+        cancelPreselection(params2).then(res => {
53 54
           this.setState({
54 55
             status: 1,
55 56
             statusText: '您已成功取消预选此房源'
@@ -63,16 +64,10 @@ export default class Index extends Component {
63 64
       }
64 65
     })
65 66
   }
66
-  handleChat() {
67
-    const { buildingId } = this.$router.params
68 67
 
69
-    Taro.navigateTo({
70
-      url: `/pages/card/list/index?buildingId=${buildingId}`
71
-    })
72
-  }
73 68
   render() {
74 69
     const { status, statusText2 } = this.state
75
-    const { type } = this.$router.params
70
+    const { type, buildingId } = this.$router.params
76 71
     return (
77 72
       <View className="result">
78 73
         {status == 1 && <Image className="result-img" src={require('../../assets/success2.png')}></Image>}
@@ -82,8 +77,7 @@ export default class Index extends Component {
82 77
         {type != 'add' && <View className="status">{status == 1 ? '取消成功' : status == 2 ? '正在处理' : '取消失败'}</View>}
83 78
         <View className="tip" style="margin-bottom:10rpx">{statusText}</View>
84 79
         {statusText2 && <View className="tip">{statusText2}</View>}
85
-
86
-        <View className="contact" onClick={() => this.handleChat()}>联系置业顾问</View>
80
+        <ContactConsultant buildingId={buildingId} style=" position: absolute;bottom: 8vh;" />
87 81
       </View>
88 82
 
89 83
     );

+ 64
- 62
src/onlineSelling/pages/help/index.js Näytä tiedosto

@@ -1,6 +1,7 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2 2
 import { View } from '@tarojs/components'
3 3
 import './index.scss'
4
+import { transferImage } from '@/utils/tools'
4 5
 import HotBlock from '../../components/HotBlock'
5 6
 
6 7
 export default class Help extends Component {
@@ -16,71 +17,71 @@ export default class Help extends Component {
16 17
     } else {
17 18
       Taro.showToast({ title: '未获取到buildingId', icon: 'none', duration: 2000 })
18 19
     }
19
-
20 20
   }
21 21
   render() {
22
-    const hots = [
23
-      {
24
-        label: '(0)',
25
-        value: 0,
26
-      },
27
-      {
28
-        label: '(1)',
29
-        value: 1,
30
-      },
31
-      {
32
-        label: '(2)',
33
-        value: 2,
34
-      },
35
-      {
36
-        label: '(3)',
37
-        value: 3,
38
-      },
39
-      {
40
-        label: '(4)',
41
-        value: 4,
42
-      },
43
-      {
44
-        label: '(5)',
45
-        value: 5,
46
-      },
47
-      {
48
-        label: '(6~10)',
49
-        value: 8,
50
-      },
51
-      {
52
-        label: '(11~20)',
53
-        value: 15,
54
-      },
55
-      {
56
-        label: '(21~30)',
57
-        value: 25,
58
-      },
59
-      {
60
-        label: '(31~40)',
61
-        value: 35,
62
-      },
63
-      {
64
-        label: '(41~50)',
65
-        value: 45,
66
-      },
67
-      {
68
-        label: '(51~100)',
69
-        value: 80,
70
-      },
71
-      {
72
-        label: '(101~200)',
73
-        value: 150,
74
-      },
75
-      {
76
-        label: '(200以上)',
77
-        value: 201,
78
-      },
79
-    ]
22
+    // const hots = [
23
+    //   {
24
+    //     label: '(0)',
25
+    //     value: 0,
26
+    //   },
27
+    //   {
28
+    //     label: '(1)',
29
+    //     value: 1,
30
+    //   },
31
+    //   {
32
+    //     label: '(2)',
33
+    //     value: 2,
34
+    //   },
35
+    //   {
36
+    //     label: '(3)',
37
+    //     value: 3,
38
+    //   },
39
+    //   {
40
+    //     label: '(4)',
41
+    //     value: 4,
42
+    //   },
43
+    //   {
44
+    //     label: '(5)',
45
+    //     value: 5,
46
+    //   },
47
+    //   {
48
+    //     label: '(6~10)',
49
+    //     value: 8,
50
+    //   },
51
+    //   {
52
+    //     label: '(11~20)',
53
+    //     value: 15,
54
+    //   },
55
+    //   {
56
+    //     label: '(21~30)',
57
+    //     value: 25,
58
+    //   },
59
+    //   {
60
+    //     label: '(31~40)',
61
+    //     value: 35,
62
+    //   },
63
+    //   {
64
+    //     label: '(41~50)',
65
+    //     value: 45,
66
+    //   },
67
+    //   {
68
+    //     label: '(51~100)',
69
+    //     value: 80,
70
+    //   },
71
+    //   {
72
+    //     label: '(101~200)',
73
+    //     value: 150,
74
+    //   },
75
+    //   {
76
+    //     label: '(200以上)',
77
+    //     value: 201,
78
+    //   },
79
+    // ]
80 80
 
81 81
     return (
82
-      <View className="article">
83
-        <View className="section">
82
+      <View>
83
+      {/* <View className="article"> */}
84
+        {/* <View className="section">
84 85
           <View className="title">1.图例解释:</View>
85 86
           <View>
86 87
             <View className="cell flex">
@@ -151,7 +152,8 @@ export default class Help extends Component {
151 152
         <View className="section">
152 153
           <View className="title">10.如何查看我的选房记录:</View>
153 154
           <View>房源页面点击下方选房记录按钮进入个人选房记录查看。或直接进入个人中心查看选房记录。</View>
154
-        </View>
155
+        </View> */}
156
+        <Image mode="widthFix" style="width:100%" src={transferImage('https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/explain.png')}></Image>
155 157
         <Image onClick={() => this.handleChat()} style="width: 110rpx;height: 110rpx;position: fixed;bottom: 40px;right: 20rpx;" src={require('../../assets/consultant.png')}></Image>
156 158
       </View>
157 159
     )

+ 300
- 0
src/onlineSelling/pages/houseCart/index.js Näytä tiedosto

@@ -0,0 +1,300 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View, ScrollView } from '@tarojs/components'
3
+
4
+import './index.scss'
5
+import Blank from '../../components/Blank'
6
+import HouseGrid from '../../components/HouseGrid'
7
+import { queryHouseList } from '@/services/project'
8
+
9
+import ready from '@/utils/ready'
10
+import { connect } from '@tarojs/redux'
11
+import * as houseActions from '@/actions/house'
12
+import { fetch, apis } from '@/utils/request'
13
+
14
+const getRaiseProfile = ({ salesBatchId, raiseRecordId, personId }) => {
15
+  const queryString = [
16
+    `${raiseRecordId ? 'raiseRecordId=' + raiseRecordId : ''}`,
17
+    `${salesBatchId ? 'salesBatchId=' + salesBatchId : ''}`,
18
+    `${personId ? 'personId=' + personId : ''}`,
19
+  ].filter(Boolean).join('&')
20
+
21
+  return fetch({ url: `${apis.API_RAISE_PROFILE}?${queryString}` })
22
+}
23
+
24
+@connect(
25
+  ({ user, house }) => ({ ...user, house }),
26
+  {...houseActions}
27
+)
28
+export default class extends Component {
29
+  config = {
30
+    navigationBarTitleText: '添加其他房源',
31
+  }
32
+
33
+  state = {
34
+    loading: true,
35
+    dataType: 1, // maybe need change  1 预选, 2 认筹
36
+    houseList: [],
37
+    chooseList: [], // 已经选择的房源列表
38
+    collapsed: true,      // 已选列表默认关闭, true 关闭, false 开启
39
+    multiSelect: true,  // 是否多选, 自动锁房是单选
40
+  }
41
+
42
+  componentWillMount () {
43
+    ready.queue(() => {
44
+      const { userInfo, house } = this.props
45
+      const { id: salesBatchId, multi } = this.$router.params
46
+
47
+      const params = {
48
+        source: 'raiseChoose',
49
+        salesBatchId,
50
+        pageNum: 1,
51
+        pageSize: 9999,
52
+      }
53
+
54
+      queryHouseList(params).then(res => {
55
+        this.setState({
56
+          houseList: this.groupHouseList(res) || [],
57
+          loading: false,
58
+        })
59
+      })
60
+
61
+      // 获取认筹信息
62
+      // getRaiseProfile(salesBatchId, undefined, userInfo.person.personId)
63
+
64
+      if (house.raiseCart && house.raiseCart.length) {
65
+        this.setState({ chooseList: house.raiseCart })
66
+      }
67
+
68
+      this.setState({ multiSelect: multi !== 'false' })
69
+    })
70
+  }
71
+  
72
+  groupHouseList(houseList = []) {
73
+    // 先按照楼层分组
74
+    const floorList = houseList.reduce((list, room) => {
75
+      let found = false
76
+
77
+      list.forEach((floor) => {
78
+        if (floor.floorId === room.floorId) {
79
+          found = true
80
+          floor.roomList.push(room)
81
+        }
82
+      })
83
+
84
+      if (!found) {
85
+        list.push({ ...room, roomList: [room] })
86
+      }
87
+
88
+      return list
89
+    }, [])
90
+
91
+    // 再按照单元分组
92
+    const unitList = floorList.reduce((list, floor) => {
93
+      let found = false
94
+      list.forEach((unit) => {
95
+        if (unit.unitId === floor.unitId) {
96
+          found = true
97
+          unit.floorList.push(floor)
98
+        }
99
+      })
100
+
101
+      if (!found) {
102
+        list.push({ ...floor, floorList: [floor] })
103
+      }
104
+
105
+      return list
106
+    }, [])
107
+
108
+    // 最后按照楼栋分组
109
+    return unitList.reduce((list, unit) => {
110
+      let found = false
111
+      list.forEach((block) => {
112
+        if (block.blockId === unit.blockId) {
113
+          found = true
114
+          block.unitList.push(unit)
115
+        }
116
+      })
117
+
118
+      if (!found) {
119
+        list.push({ ...unit, unitList: [unit] })
120
+      }
121
+
122
+      return list
123
+    }, [])
124
+  }
125
+
126
+  changeShowData = (dataType) => {
127
+    // 此处需要按照 dataType 去切换数据
128
+    // 切换成功之后
129
+    this.setState({ dataType })
130
+  }
131
+
132
+  // 添加到选择列表
133
+  // 注意, 不是确认选择
134
+  add2Cart = (room) => {
135
+    // const locked = room.houseLockingStatus == 'locked'
136
+    // if (locked) {
137
+    //   Taro.showToast({ title: '该房源已经被锁定', icon: 'none' })
138
+    //   return;
139
+    // }
140
+
141
+    const { chooseList, multiSelect } = this.state
142
+    const checked = (chooseList || []).filter(x => x.houseId == room.houseId)[0]
143
+
144
+    if (checked) {
145
+      this.setState({ chooseList: chooseList.filter(x => x.houseId != room.houseId) })
146
+    } else {
147
+      if (multiSelect) {
148
+        this.setState({ chooseList: chooseList.concat(room) })
149
+      } else {
150
+        this.setState({ chooseList: [room] })
151
+      }
152
+    }
153
+  }
154
+
155
+  // 确认选择
156
+  handleSubmit = () => {
157
+    if (!this.state.chooseList.length) {
158
+      Taro.showModal({
159
+        title: '提示',
160
+        content: '您未选择房源, 确认离开?',
161
+        success: (res) => {
162
+          if (res.confirm) {
163
+            this.props.dispatchFlush2Cart([])
164
+            Taro.navigateBack({ delta: 1 })
165
+          }
166
+        }
167
+      })
168
+    } else {
169
+      this.props.dispatchFlush2Cart(this.state.chooseList)
170
+      Taro.navigateBack({ delta: 1 })
171
+    }
172
+  }
173
+
174
+  // 取消选择
175
+  subChooseList = (house) => {
176
+    const name = [house.termName, house.blockName, house.unitName, house.floorName, house.roomName].join('')
177
+    const { chooseList } = this.state
178
+
179
+    Taro.showModal({
180
+      title: '取消选择',
181
+      content: `确认取消 ${name} ?`,
182
+      success: (res) => {
183
+        if (res.confirm) {
184
+          this.setState({ chooseList: chooseList.filter(x => x.houseId != house.houseId) })
185
+        }
186
+      }
187
+    })
188
+  }
189
+
190
+  // 是否展开已选列表
191
+  trigCartPannel = () => {
192
+    const { collapsed } = this.state;
193
+    this.setState({ collapsed: !collapsed })
194
+  }
195
+
196
+  renderHead() {
197
+    const { dataType, houseList } = this.state
198
+    const hasData = houseList && houseList.length
199
+
200
+    return (
201
+      <View className="head">
202
+        <View className="tips">仅显示符合认筹条件的房源。点击房源卡片查看房源详情,不要在房源详情页做操作。请在当前页面选择提交认筹。</View>
203
+        {
204
+          hasData && (
205
+            <View className="actions">
206
+              <View className={`action ${dataType === 1 ? 'active' : ''}`} onClick={() => this.changeShowData(1)}>预选热度图</View>
207
+              <View className={`action ${dataType === 2 ? 'active' : ''}`} onClick={() => this.changeShowData(2)}>认筹热度图</View>
208
+            </View>
209
+          )
210
+        }
211
+      </View>
212
+    );
213
+  }
214
+
215
+  renderHouses() {
216
+    const { houseList, dataType, chooseList } = this.state
217
+    const hasData = houseList && houseList.length
218
+
219
+    return hasData && (
220
+      <ScrollView className="body" scrollY>
221
+      {
222
+        houseList.map((item) => {
223
+          return (
224
+            <HouseGrid
225
+              key={item.unitId}
226
+              dataset={item}
227
+              showAction
228
+              showDataType={dataType}
229
+              chooseList={chooseList}
230
+              onRoomClick={this.handleRoomClick}
231
+              onActionClick={this.add2Cart}
232
+            />
233
+          )
234
+        })
235
+      }
236
+      </ScrollView>
237
+    )
238
+  }
239
+
240
+  renderAction() {
241
+    const { chooseList, collapsed, houseList } = this.state;
242
+    const defChoose = chooseList[0] || {}
243
+    const defName = [defChoose.termName, defChoose.blockName, defChoose.unitName, defChoose.floorName, defChoose.roomName].join('')
244
+    const title = collapsed ? `已选择: ${defName} 等 ${chooseList.length} 个房源` : '已选列表'
245
+    const opened = collapsed ? 'off' : 'on'
246
+    const nodata = houseList && houseList.length ? '' : 'nodata'
247
+    const btnText = chooseList && chooseList.length ? '确认以上选择' : '未选择房源'
248
+    const choosed = chooseList && chooseList.length
249
+
250
+    return (
251
+      <View className="footer">
252
+      {
253
+        choosed && (
254
+          <View className="shoping-cart collapse">
255
+            <View className={`title ${opened}`} onClick={this.trigCartPannel}>
256
+              <Text>{title}</Text>
257
+              {collapsed?<Text className="at-icon at-icon-chevron-up"></Text> :<Text className="at-icon at-icon-chevron-down"></Text> }           
258
+            </View>
259
+
260
+            <View className={`choose-list ${opened}`}>
261
+              {chooseList.map((house, index) => {
262
+                const name = [house.termName, house.blockName, house.unitName, house.floorName, house.roomName].join('')
263
+
264
+                return (
265
+                  <View key={`cart-item-${index}`} className="choose-item" onClick={() => this.subChooseList(house)}>
266
+                    <View className="choose-item-body">{name}</View>
267
+                    <View className="choose-item-action">
268
+                      <Text className="at-icon at-icon-subtract-circle"></Text>
269
+                    </View>
270
+                  </View>
271
+                )
272
+              })}
273
+            </View>          
274
+          </View>
275
+        )
276
+      }
277
+        <Button className={`btn ${nodata}`} onClick={this.handleSubmit}>{btnText}</Button>
278
+      </View>
279
+    )
280
+  }
281
+
282
+  renderBlank() {
283
+    const { houseList } = this.state
284
+
285
+    return !(houseList && houseList.length) && (
286
+      <Blank tips="暂无符合条件的房源" />
287
+    )
288
+  }
289
+
290
+  render() {
291
+    return (
292
+      <View className="house-cart">
293
+        {this.renderHead()}
294
+        {this.renderBlank()}
295
+        {this.renderHouses()}
296
+        {this.renderAction()}
297
+      </View>
298
+    )
299
+  }
300
+}

+ 141
- 0
src/onlineSelling/pages/houseCart/index.scss Näytä tiedosto

@@ -0,0 +1,141 @@
1
+@import "~taro-ui/dist/style/components/icon.scss";
2
+
3
+.house-cart {
4
+
5
+  .head {
6
+    margin: 30px 0;
7
+    padding: 0 30px;
8
+    font-size:24px;
9
+
10
+    .tip {
11
+      color:#666;
12
+      line-height:36px;
13
+    }
14
+
15
+    .actions {
16
+      margin-top: 20px;
17
+
18
+      .action {
19
+        display: inline-block;
20
+        color:#333;
21
+        background:#fff;
22
+        line-height:48px;
23
+        padding: 0 24px;
24
+        border:1px solid #E4E4E4;
25
+        border-radius: 24px;
26
+  
27
+        &.active {
28
+          color:#fff;
29
+          background:#BB9C79;
30
+          border:1px solid #BB9C79;
31
+          box-shadow:0px 4px 12px 0px rgba(255,171,50,0.08);
32
+        }
33
+  
34
+        & + .action {
35
+          margin-left: 30px;
36
+        }
37
+      }
38
+    }
39
+  }
40
+
41
+  .body {
42
+    height: calc(100vh - 450px);
43
+
44
+  }
45
+
46
+  .footer {
47
+    position: fixed;
48
+    width: 100%;
49
+    bottom: 0;
50
+    background: #fff;
51
+    z-index: 10;
52
+    text-align: center;
53
+    padding: 0 30px 30px;
54
+
55
+    .btn {
56
+      font-size: 36px;
57
+      color: #fff;
58
+      height: 94px;
59
+      line-height: 94px;
60
+      background: #BB9C79;
61
+      border-radius: 10px;
62
+
63
+      &.nodata {
64
+        background:#000;
65
+        opacity:0.6;
66
+      }
67
+    }
68
+  }
69
+
70
+  .shoping-cart {
71
+    position: absolute;
72
+    bottom: 125px;
73
+    font-size: 28px;
74
+    line-height: 30px;
75
+    color: #333;
76
+    width: calc(100% - 70px);
77
+    box-shadow:0px 4px 12px 0px rgba(0, 0, 0, 0.08);
78
+    border-radius:44px 44px 0px 0px;
79
+    background-color: #fff;
80
+
81
+    .title {
82
+      text-align: center;
83
+      font-size: 24px;
84
+
85
+      .at-icon {
86
+        display: inline-block;
87
+        margin-left: 20px;
88
+      }
89
+    }
90
+
91
+    .choose-list {
92
+      padding: 30px;
93
+      overflow: hidden;
94
+
95
+      .choose-item {
96
+        display: flex;
97
+        
98
+        &-body {
99
+          text-align: left;
100
+          flex: auto;
101
+        }
102
+
103
+        &-action {
104
+          width: 30px;
105
+          flex: none;
106
+          text-align: right;
107
+        }
108
+
109
+        & + .choose-item {
110
+          margin-top: 24px;
111
+        }
112
+      }
113
+    }
114
+  }
115
+
116
+  .collapse {
117
+    .on {
118
+      &.title {
119
+        height: 64px;
120
+        padding: 20px 0;
121
+      }
122
+
123
+      &.choose-list{
124
+        height: auto;
125
+      }
126
+    }
127
+
128
+    .off {
129
+      &.title {
130
+        padding: 40px 0;
131
+        height: 100px;
132
+      }
133
+
134
+      &.choose-list {
135
+        height: 0;
136
+        padding: 0;
137
+      }
138
+    }
139
+  }
140
+
141
+}

+ 51
- 22
src/onlineSelling/pages/houseList/index.js Näytä tiedosto

@@ -23,8 +23,9 @@ import { getCardDetail } from '@/services/card'
23 23
 import Consultant from '@/components/consultant'
24 24
 import './index.scss'
25 25
 import { Loading } from '@/components/Loading'
26
+import * as houseActions from '@/actions/house'
26 27
 
27
-@connect(s => s.user)
28
+@connect(s => s.user, { ...houseActions })
28 29
 @withDetail({
29 30
   track: {
30 31
     event: 'house_list',
@@ -52,7 +53,6 @@ export default class HouseList extends Component {
52 53
     endPrice: '',
53 54
     apartmentId: '',
54 55
     reportedCustomer: false,
55
-    posterShow: false,
56 56
     posterData: {},
57 57
     buildingId: null,
58 58
     salesBatchDetail: {},
@@ -61,17 +61,20 @@ export default class HouseList extends Component {
61 61
     consultShow: false,  // 置业顾问悬浮框显示隐藏
62 62
     noRecord: false,
63 63
     loading: true,
64
+    dataType: 1,
64 65
   }
65 66
 
66 67
 
67 68
   componentDidShow() {
68
-
69 69
     ready.queue(() => {
70 70
       this.setState({ showShareMenu: false })
71 71
       this.initPageData()
72 72
     })
73
+
74
+    // 清空认筹选择
75
+    this.props.dispatchFlush2Cart([])
73 76
   }
74
-  
77
+
75 78
 
76 79
   componentWillReceiveProps() {
77 80
     this.reportClientFn()
@@ -127,7 +130,7 @@ export default class HouseList extends Component {
127 130
       endPrice,
128 131
       apartmentId,
129 132
       pageNum: 1,
130
-      pageSize: 999,
133
+      pageSize: 9999,
131 134
     }
132 135
     queryHouseList(params).then(res => {
133 136
       this.setState({
@@ -168,7 +171,7 @@ export default class HouseList extends Component {
168 171
         salesBatchDetail: res || {},
169 172
         noRecord: res.status == '1' ? false : true
170 173
       })
171
-      const { templates = [], posterImg = '' } = (res.posters || [])[0]
174
+      const { templates = [], posterImg = '' } = (res.posters || [])[0] || {}
172 175
 
173 176
       this.setState({
174 177
         posterData: { poster: posterImg },
@@ -260,8 +263,10 @@ export default class HouseList extends Component {
260 263
   }
261 264
 
262 265
   handleRecordBtn = e => {
263
-    this.goto('/onlineSelling/pages/records/index')
266
+    const { salesBatchDetail } = this.state
267
+    this.goto(`/onlineSelling/pages/records/index?id=${salesBatchDetail.salesBatchId}`)
264 268
   }
269
+
265 270
   currentPageAndParams() {
266 271
     const id = this.$router.params.id || this.state.id
267 272
     const {
@@ -380,12 +385,10 @@ export default class HouseList extends Component {
380 385
         </View>
381 386
         <View className="action">
382 387
           <View onClick={this.handleExplainClick}>
383
-            {/* <NamedIcon name="explain" size={50} /> */}
384 388
             <Image style="width:50rpx;height:50rpx" src={transferImage(require('../../assets/explain.png'))}></Image>
385 389
           </View>
386 390
           <View onClick={this.handleSearchClick}>
387 391
             <Image style="width:50rpx;height:50rpx" src={transferImage(require('../../assets/screen.png'))}></Image>
388
-            {/* <NamedIcon name="screen" size={50} /> */}
389 392
           </View>
390 393
         </View>
391 394
       </View>
@@ -393,13 +396,13 @@ export default class HouseList extends Component {
393 396
   }
394 397
 
395 398
   renderHouses() {
396
-    const { houseList } = this.state
399
+    const { houseList, dataType } = this.state
397 400
 
398 401
     return (
399 402
       <ScrollView className="container" scrollY scrollWithAnimation>
400 403
         {
401 404
           houseList.map((item) => {
402
-            return <HouseGrid key={item.unitId} dataset={item} onRoomClick={this.handleRoomClick} />
405
+            return <HouseGrid key={item.unitId} showDataType={dataType} dataset={item} onRoomClick={this.handleRoomClick} />
403 406
           })
404 407
         }
405 408
       </ScrollView>
@@ -416,12 +419,10 @@ export default class HouseList extends Component {
416 419
     return (
417 420
       <View className="bottombar">
418 421
         <Button className="btn record" onClick={this.handleRecordBtn}>
419
-          {/* <NamedIcon name="record" size="42" /> */}
420 422
           <Image style="width:42rpx;height:42rpx" src={transferImage(require('../../assets/record.png'))}></Image>
421 423
           <Text className="txt">选房记录</Text>
422 424
         </Button>
423 425
         <Button className="btn share" onClick={this.handleShareBtn}>
424
-          {/* <NamedIcon name="share" size="42" /> */}
425 426
           <Image style="width:42rpx;height:42rpx" src={transferImage(require('../../assets/share.png'))}></Image>
426 427
           <Text className="txt">分享</Text>
427 428
         </Button>
@@ -430,6 +431,18 @@ export default class HouseList extends Component {
430 431
   }
431 432
 
432 433
   handleCondition(value) {
434
+    const { salesBatchDetail: { displayHousePrice } } = this.state
435
+    if ((!displayHousePrice && value == 1) || value == 2) {
436
+      this.setState({
437
+        apartmentId: '',
438
+        startPrice: '',
439
+        endPrice: '',
440
+        conditionVisible: false,
441
+      }, () => {
442
+        const id = this.$router.params.id || this.state.id
443
+        this.getInfo(id)
444
+      })
445
+    }
433 446
     this.setState({
434 447
       current: value,
435 448
     })
@@ -550,28 +563,30 @@ export default class HouseList extends Component {
550 563
             </View>
551 564
           ))}
552 565
         </View>
553
-          : <Blank tips="暂无户型图,请按价格筛选"></Blank>
566
+          : <Blank tips="暂无户型"></Blank>
554 567
         }
555 568
       </Block>
556 569
     )
557 570
   }
558 571
 
559 572
   renderCondition() {
560
-    const { current } = this.state
561
-    const condition = [{ title: '按价格', value: 0 }, { title: '按户型', value: 1 }]
573
+    const { current, salesBatchDetail: { displayHousePrice } } = this.state
574
+    const condition = [{ title: '按户型', value: 0 }, { title: '按价格', value: 1 }, { title: '不限条件', value: 2 }]
575
+    const condition2 = [{ title: '按户型', value: 0 }, { title: '不限条件', value: 2 }]
576
+    const conditionList = displayHousePrice ? condition : condition2
562 577
     return (
563 578
       <View className="screen-page">
564 579
         <View className="screen-top">
565 580
           筛选房源
566
-            {condition.map(item => (
581
+            {conditionList.map(item => (
567 582
             <View key={item.value} onClick={() => this.handleCondition(item.value)} className={current == item.value ? 'top-item active' : 'top-item'}>
568 583
               {item.title}
569 584
             </View>
570 585
           ))}
571 586
         </View>
572
-        {current == 0 && this.renderPrice()
573
-        }
574
-        {current == 1 && this.renderApartment()}
587
+        {current == 0 && this.renderApartment()}
588
+        {current == 1 && displayHousePrice && this.renderPrice()}
589
+
575 590
 
576 591
       </View>
577 592
 
@@ -581,6 +596,9 @@ export default class HouseList extends Component {
581 596
     const buildingId = this.$router.params.buildingId || this.state.buildingId
582 597
     this.goto(`/pages/project/detail/index?id=${buildingId}`)
583 598
   }
599
+  handleScreen(value) {
600
+    this.setState({ dataType: value })
601
+  }
584 602
 
585 603
   render() {
586 604
     const {
@@ -595,6 +613,7 @@ export default class HouseList extends Component {
595 613
       noRecord,
596 614
       loading,
597 615
       salesBatchDetail,
616
+      dataType
598 617
     } = this.state
599 618
 
600 619
     if (loading) {
@@ -603,8 +622,11 @@ export default class HouseList extends Component {
603 622
 
604 623
     const { userInfo: { person } } = this.props
605 624
 
606
-    const showCircleBtn = posterData && posterData.qrcode
625
+    // 必须正确生成二维码, 且维护了海报图
626
+    const showCircleBtn = posterData && posterData.qrcode && posterData.poster
607 627
     console.log('==============>', posterData, showPoster, posterConfig)
628
+
629
+    const screenList = [{ title: '预选热度图', value: 1 }, { title: '认筹热度图', value: 2 }]
608 630
     return (
609 631
       <Block>
610 632
         {conditionVisible && this.renderCondition()}
@@ -624,8 +646,16 @@ export default class HouseList extends Component {
624 646
                 <View className="building-top">
625 647
                   <View style="color:#333;font-size:28rpx">{salesBatchDetail.buildingName || ''}</View>
626 648
                   <View style="color:#666;font-size:24rpx;" onClick={() => this.toBuildingDetail()}>查看楼盘详情<Text className="right-icon"></Text></View>
649
+                </View>
627 650
 
651
+                <View className="screen-flex" >
652
+                  {screenList.map(item => (
653
+                    <View key={item.value} onClick={() => this.handleScreen(item.value)} className={dataType == item.value ? 'top-item active' : 'top-item'}>
654
+                      {item.title}
655
+                    </View>
656
+                  ))}
628 657
                 </View>
658
+
629 659
                 {houseList.length ? this.renderHouses() : this.renderBlank()}
630 660
                 {this.renderBottom()}
631 661
               </View>
@@ -635,7 +665,6 @@ export default class HouseList extends Component {
635 665
                   circleBtn={showCircleBtn}
636 666
                   onShareFrineds={this.handleShareFrineds}
637 667
                   onSharingCircleOfFriends={() => this.togglePosterStatus(true)}
638
-                // onSharingCircleOfFriends={this.handleSharingCircleOfFriends}
639 668
                 />
640 669
               </ActSheet>
641 670
             </Block>

+ 46
- 14
src/onlineSelling/pages/houseList/index.scss Näytä tiedosto

@@ -41,7 +41,34 @@
41 41
       display: inline-block;
42 42
     }
43 43
   }
44
-  
44
+  .screen-flex{
45
+    display: flex;
46
+    align-items: center;
47
+    background:#fff;
48
+    font-size: 34px;
49
+    color: #666;
50
+    padding-bottom: 30px;
51
+    font-size: 400;
52
+    .top-item{
53
+      width:164px;
54
+      height:48px;
55
+      font-size:24px;
56
+      font-weight:300;
57
+      color: #333;
58
+      line-height: 48px;
59
+      background:rgba(255,255,255,1);
60
+      border:1px solid rgba(228,228,228,1);
61
+      box-shadow:0px 4px 12px 0px rgba(255,171,50,0.08);
62
+      border-radius:24px;
63
+      margin-left: 30px;
64
+      text-align: center;
65
+
66
+    }
67
+    .active{
68
+      background-color: #BB9C79;
69
+      color: #fff;
70
+    }
71
+  }
45 72
   .bottombar {
46 73
     height: 168px;
47 74
     box-shadow:0px 16px 48px 0px rgba(0, 0, 0, 0.12);
@@ -84,7 +111,7 @@
84 111
 
85 112
   .container {
86 113
     // top + margin + bottom
87
-    height: calc(100% - 350px);
114
+    height: calc(100% - 428px);
88 115
   }
89 116
 }
90 117
 .screen-page{
@@ -98,18 +125,23 @@
98 125
     padding: 0 30px;
99 126
     font-size: 400;
100 127
     .top-item{
101
-      font-size: 28px;
102
-      color: #999;
103
-      padding: 0 18px;
104
-      border-radius: 32px;
105
-      line-height: 60px;
106
-      background-color: #EEEEEE;
107
-      margin-left: 22px;
128
+      width:128px;
129
+      height:48px;
130
+      font-size:24px;
131
+      font-weight:300;
132
+      color: #333;
133
+      line-height: 48px;
134
+      background:rgba(255,255,255,1);
135
+      border:1px solid rgba(228,228,228,1);
136
+      box-shadow:0px 4px 12px 0px rgba(255,171,50,0.08);
137
+      border-radius:24px;
138
+      margin-left: 30px;
139
+      text-align: center;
108 140
 
109 141
     }
110 142
     .active{
111
-      background-color: #fff;
112
-      box-shadow:0px 4px 12px 0px rgba(0, 0, 0, 0.08);
143
+      background-color: #BB9C79;
144
+      color: #fff;
113 145
     }
114 146
   }
115 147
   .price-con{
@@ -135,12 +167,12 @@
135 167
         text-align: center;
136 168
         margin: 18px;
137 169
         line-height:60px;
138
-        background-color: #fff;
170
+        background-color: #BB9C79;
171
+        border:1px solid rgba(187,156,121,1);
139 172
         box-shadow:0px 4px 12px 0px rgba(0, 0, 0, 0.08);
140 173
         border-radius:6px;
141 174
         font-size: 28px;
142
-        color: #999;
143
-        border:1px solid #bb9c79;
175
+        color: #fff;
144 176
       }
145 177
     }
146 178
   }

+ 33
- 0
src/onlineSelling/pages/protocol/index.js Näytä tiedosto

@@ -0,0 +1,33 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View, RichText } from '@tarojs/components'
3
+import Statement from '../../components/Statement'
4
+import ContactConsultant from '../../components/ContactConsultant'
5
+
6
+import './index.scss'
7
+
8
+export default class Protocol extends Component {
9
+  config = {
10
+    navigationBarTitleText: '线上选房协议',
11
+  }
12
+
13
+  state = {
14
+
15
+  }
16
+
17
+  render() {
18
+
19
+    const { agreement, buildingId } = this.$router.params
20
+
21
+    return (
22
+      <View className="protocal-box">
23
+        <View className="content">
24
+          <RichText nodes={agreement} />
25
+        </View>
26
+        <View className="contact">
27
+          <ContactConsultant text="如有问题,请联系置业顾问" buildingId={buildingId} />
28
+        </View>
29
+        <Statement />
30
+      </View>
31
+    )
32
+  }
33
+}

+ 13
- 0
src/onlineSelling/pages/protocol/index.scss Näytä tiedosto

@@ -0,0 +1,13 @@
1
+.protocal-box {
2
+  width: 100vw;
3
+
4
+  .content {
5
+    margin-top: 48px;
6
+    width: 100%;
7
+    padding: 0 40px;
8
+  }
9
+
10
+  .contact {
11
+    margin: 40px 0;
12
+  }
13
+}

+ 53
- 0
src/onlineSelling/pages/raiseMoney/Captcha/index.js Näytä tiedosto

@@ -0,0 +1,53 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View } from '@tarojs/components'
3
+
4
+import './index.scss'
5
+
6
+export default class extends Component {
7
+
8
+  state = {
9
+    sec: 0
10
+  }
11
+
12
+  handleClick = (left) => {
13
+    if (!this.props.require()) return;
14
+    if (!this.props.countdown) return;
15
+
16
+    // 计时中
17
+    if (left > 0 && left < this.props.countdown) return;
18
+    
19
+    if (this.props.onClick) {
20
+      this.props.onClick().then(() => {
21
+        // 开始跑表
22
+        if (this.props.countdown) {
23
+          let s = 0
24
+          this.setState({ sec: s })
25
+    
26
+          const tk = setInterval(() => {
27
+            if (s >= this.props.countdown) {
28
+              clearInterval(tk)
29
+              this.setState({ sec: 0 })
30
+            } else {
31
+              s += 1
32
+              this.setState({ sec: s })
33
+            }
34
+          }, 1000)
35
+        }
36
+      })
37
+    }
38
+  }
39
+
40
+  render() {
41
+    const { sec } = this.state
42
+    const { countdown } = this.props
43
+    const left = countdown - sec
44
+
45
+    return (
46
+      <View className="captcha" onClick={() => this.handleClick(left)}>
47
+        {
48
+          left > 0 && left < countdown ? `${left}s 后重试` : '获取验证码'
49
+        }        
50
+      </View>
51
+    )
52
+  }
53
+}

+ 9
- 0
src/onlineSelling/pages/raiseMoney/Captcha/index.scss Näytä tiedosto

@@ -0,0 +1,9 @@
1
+.captcha {  
2
+  font-size: 32px;
3
+  color: #F6B61D;
4
+  line-height:64px;
5
+  border:1px solid #F6B61D;
6
+  border-radius:8px;
7
+  width: 220px;
8
+  text-align: center;
9
+}

+ 48
- 0
src/onlineSelling/pages/raiseMoney/NextStep/index.js Näytä tiedosto

@@ -0,0 +1,48 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import './index.scss'
3
+
4
+export default class extends Component {
5
+  state = {
6
+    sec: 0,
7
+  }
8
+
9
+  componentWillReceiveProps(nextProps) {
10
+    if (nextProps.countdown !== this.props.countdown) {
11
+      if (nextProps.countdown) {
12
+        let s = 0
13
+        const tk = setInterval(() => {
14
+          s += 1
15
+          this.setState({ sec: s })
16
+  
17
+          if (s >= this.props.countdown) {
18
+            clearInterval(tk)
19
+          }
20
+        }, 1000)
21
+      } else {
22
+        this.setState({ sec: 0 })
23
+      }
24
+    }
25
+  }
26
+
27
+  handleClick = (disable) => {
28
+    if (disable) return;
29
+
30
+    if (this.props.onClick) {
31
+      this.props.onClick()
32
+    }
33
+  }
34
+
35
+  render() {
36
+    const disable = this.props.countdown > 0 && this.state.sec < this.props.countdown ? 'disable' : ''
37
+    
38
+    return (
39
+      <View className={`btn-step ${disable}`} onClick={() => this.handleClick(disable)}>
40
+        {this.props.text}
41
+        {
42
+          disable ? ` (${this.props.countdown - this.state.sec}s) ` : ''
43
+        }
44
+      </View>
45
+    )
46
+
47
+  }
48
+}

+ 14
- 0
src/onlineSelling/pages/raiseMoney/NextStep/index.scss Näytä tiedosto

@@ -0,0 +1,14 @@
1
+.btn-step {
2
+  height:94px;
3
+  line-height: 94px;
4
+  background:rgba(187,156,121,1);
5
+  border-radius:10px;
6
+  color: #fff;
7
+  font-size: 36px;
8
+  text-align: center;
9
+
10
+  &.disable {
11
+    background: #000;
12
+    opacity:0.6;
13
+  }
14
+}

+ 33
- 0
src/onlineSelling/pages/raiseMoney/RadioList/index.js Näytä tiedosto

@@ -0,0 +1,33 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View, Label, Radio } from "@tarojs/components";
3
+import './index.scss'
4
+
5
+export default class extends Component {
6
+
7
+  render() {
8
+    const { value, color, size, dataset = [], onChange } = this.props
9
+
10
+    return (
11
+      <RadioGroup onChange={onChange}>
12
+        {
13
+          dataset.map((item) => {
14
+
15
+            const checked = item.value === value
16
+            const checkedColor = color && checked ? `border-color: ${color}` : ''
17
+            const btnSize = size ? `width: ${size}; height: ${size}` : ''
18
+            const btnStyle = `${checkedColor};${btnSize}`
19
+
20
+            return (
21
+              <Label key={item.value} className="radio-btn">
22
+                <Radio hidden value={item.value} checked={checked}></Radio>
23
+                <View className={`icon ${checked ? 'checked' : ''}`} style={btnStyle}></View>
24
+                <View className="label">{item.label}</View>
25
+              </Label>
26
+            )
27
+          })
28
+        }
29
+      </RadioGroup>
30
+    )
31
+  }
32
+
33
+}

+ 28
- 0
src/onlineSelling/pages/raiseMoney/RadioList/index.scss Näytä tiedosto

@@ -0,0 +1,28 @@
1
+.radio-btn {
2
+  display: inline-block;
3
+
4
+  .icon {
5
+    width: 20px;
6
+    height: 20px;
7
+    display: inline-block;
8
+    border:2px solid #999;
9
+    border-radius:50%;
10
+    position: relative;
11
+    margin-right: 10px;
12
+    vertical-align: middle;
13
+
14
+    &.checked {
15
+      border-width: 6px;
16
+      border-style: solid;
17
+      border-color: #f00;
18
+    }
19
+  }
20
+
21
+  .label {
22
+    display: inline-block;
23
+  }
24
+
25
+  & + .radio-btn {
26
+    margin-left: 40px;
27
+  }
28
+}

+ 810
- 0
src/onlineSelling/pages/raiseMoney/index.js Näytä tiedosto

@@ -0,0 +1,810 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View, Block, RichText } from '@tarojs/components'
3
+import './index.scss'
4
+import RaiseCard from '../../components/RaiseCard'
5
+import Statement from '../../components/Statement'
6
+import ConsultantItem from '../../components/ConsultantItem/index'
7
+import ready from '@/utils/ready'
8
+import dayjs from 'dayjs'
9
+import { connect } from '@tarojs/redux'
10
+import * as houseActions from '@/actions/house'
11
+import NextStep from './NextStep'
12
+import { fetch, apis } from '@/utils/request'
13
+import Captcha from './Captcha'
14
+import { raiseOrder, cancelOrder, queryPreselectionRecord, raiseOffline } from '@/services/project'
15
+import { getCodeMessage, checkCaptcha } from '@/services/getCode'
16
+import { checkRaise } from '@/services/house'
17
+import { checkIDCard, isEmpty } from '@/utils/tools'
18
+import ContactConsultant from '../../components/ContactConsultant'
19
+import RadioList from './RadioList'
20
+import * as noticeType from '@/constants/common.js'
21
+
22
+const getRaiseProfile = ({ salesBatchId, raiseRecordId }) => {
23
+  const queryString = [
24
+    `${raiseRecordId ? 'raiseRecordId=' + raiseRecordId : ''}`,
25
+    `${salesBatchId ? 'salesBatchId=' + salesBatchId : ''}`,
26
+  ].filter(Boolean).join('&')
27
+
28
+  return fetch({ url: `${apis.API_RAISE_PROFILE}?${queryString}` })
29
+}
30
+
31
+const saveRaiseRecord = (record, raise) => {
32
+  const payload = {
33
+    ...record,
34
+    raiseId: raise.raiseId,
35
+    orgId: raise.orgId,
36
+    salesBatchId: raise.salesBatchId,
37
+    buildingId: raise.buildingId,
38
+  }
39
+
40
+  return fetch({ url: `${apis.API_SAVE_RAISE_RECORD}`, method: 'POST', payload })
41
+}
42
+
43
+@connect(({ user, house }) => ({ ...user, house }), { ...houseActions })
44
+export default class raiseMoney extends Component {
45
+  config = {
46
+    navigationBarTitleText: '认筹确认'
47
+  }
48
+  state = {
49
+    current: 0,
50
+    inputName: '',
51
+    raiseProfile: undefined,  // 认筹主记录
52
+    record: {},               // 认筹单
53
+    preselectList: [],        // 我的预选 - 当前批次
54
+    protocolCountdown: 5,    // 单位 s
55
+    captchaCountdown: 60,     // 单位 s
56
+    payType: 'onLine',          // 缴费方式
57
+    failInfo: undefined,      // 操作失败 - 对象 { title, desc }
58
+    disableCaptcha: false,    // 锁定验证码输入
59
+    payTypeList: [
60
+      { label: '线上缴费', value: 'onLine' },
61
+      { label: '线下缴费', value: 'offLine' },
62
+    ],
63
+  }
64
+
65
+  captchaLock = false
66
+  paying = false
67
+
68
+  // 此页面不支持分享,以及二维码
69
+  componentWillMount() {
70
+    ready.queue(() => {
71
+      if (this.$router.params.type != 'pay') {
72
+        this.props.dispatchChooseConsultant() //清空默认选择的置业顾问
73
+      }
74
+      const {
75
+        salesBatchId,    // 批次, 从房源详情进入的
76
+        houseId,       // 房源号, 备用
77
+        raiseRecordId,  // 认筹单ID, // 从认筹列表进入
78
+      } = this.$router.params
79
+
80
+      if (!salesBatchId && !raiseRecordId) {
81
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '未确定批次或者认筹单记录' } })
82
+        return;
83
+      }
84
+
85
+      this.loadInfo(salesBatchId, raiseRecordId)
86
+
87
+      if (this.$router.params.type == 'pay') {
88
+        this.setState({ current: 3 })
89
+      }
90
+    })
91
+  }
92
+
93
+  loadInfo(salesBatchId, raiseRecordId) {
94
+    const { userInfo, house } = this.props
95
+    const { personId } = userInfo.person
96
+    const defaultRecord = this.initRecord()
97
+
98
+    // 请求认筹信息
99
+    getRaiseProfile({ salesBatchId, raiseRecordId }).then(res => {
100
+      let { payType } = this.state
101
+      const payTypeSettings = (res.payType || '').split(',')
102
+      if (payTypeSettings.length === 1) {
103
+        payType = payTypeSettings[0]
104
+      }
105
+
106
+      this.setState({ raiseProfile: res, payType, record: res.record || defaultRecord })
107
+
108
+      // 销售批次已被取消发布
109
+      if (res.status != 1) {
110
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '销售批次已被取消发布' } })
111
+      }
112
+
113
+      // 不在认筹时间内
114
+      if (!dayjs().isBefore(res.raiseEndTime) || !dayjs().isAfter(res.raiseStartTime)) {
115
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '不在认筹时间内' } })
116
+      }
117
+
118
+      // 请求置业顾问列表
119
+      // if (!house.consultantList || !house.consultantList.length) {
120
+      this.props.dispatchGetConsultants({
121
+        buildingId: res.buildingId,
122
+        pageSize: 999,
123
+        pageNumber: 1,
124
+      })
125
+      // }
126
+
127
+      this.getMyPreselection({
128
+        personId,
129
+        pageNumber: 1,
130
+        pageSize: 999,
131
+        salesBatchId: res.salesBatchId,
132
+      }).then((houseList) => {
133
+        // 如果认筹必须预选
134
+        if (res.needPreselection && house.raiseCart.length > 0) {
135
+          if (!houseList || !houseList.length) {
136
+            this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '需要先预选才能认筹' } })
137
+            return
138
+          }
139
+
140
+          for (let i in house.raiseCart) {
141
+            const exists = houseList.filter(x => x.houseId === house.raiseCart[i].houseId)[0]
142
+            if (!exists) {
143
+              this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '需要先预选才能认筹' } })
144
+              return
145
+            }
146
+          }
147
+        }
148
+      })
149
+    })
150
+  }
151
+
152
+  // 我的预选
153
+  getMyPreselection = (params) => {
154
+    return new Promise((resolve, reject) => {
155
+      queryPreselectionRecord(params).then((res) => {
156
+        this.setState({ preselectList: res.records })
157
+        resolve(res.records)
158
+      }).catch(() => {
159
+        resolve([])
160
+        // reject()
161
+      })
162
+    })
163
+  }
164
+
165
+  initRecord = () => {
166
+    const { userInfo } = this.props
167
+    const { personId, name, nickname, idcard, tel, phone } = userInfo.person
168
+
169
+    return { personId, name: name || nickname, idcard, tel: tel || phone }
170
+  }
171
+
172
+  handleCancel = (house) => {
173
+    Taro.showModal({
174
+      title: '提示',
175
+      content: '确认取消选择该房源?',
176
+      success: (res) => {
177
+        if (res.confirm) {
178
+          this.props.dispatchSubCart(house)
179
+        }
180
+      }
181
+    })
182
+  }
183
+
184
+  gotoHouseSelect = (pageType) => {
185
+    const { raiseProfile } = this.state
186
+    const isMulti = raiseProfile.houseLockingType != 'auto'
187
+
188
+    const url = pageType == 'all' ?
189
+      `/onlineSelling/pages/houseCart/index?id=${raiseProfile.salesBatchId}&multi=${isMulti}` :
190
+      `/onlineSelling/pages/addHouse/index?id=${raiseProfile.salesBatchId}`
191
+
192
+    Taro.navigateTo({ url })
193
+  }
194
+
195
+  renderTop() {
196
+    const tabList = [
197
+      { title: '确认房源', value: 0 },
198
+      { title: '阅读协议', value: 1 },
199
+      { title: '填写资料', value: 2 },
200
+      { title: '缴纳定金', value: 3 },
201
+      { title: '认筹结果', value: 4 },
202
+    ]
203
+    const { current } = this.state
204
+
205
+    return (
206
+      <View className="top-con">
207
+        {tabList.map((item, index) => (
208
+          <View className="flex" key={index + 'top'} style={current == item.value ? 'color:#333;font-weight:700' : ''}>
209
+            {item.title}
210
+            {item.value != 4 &&
211
+              <View className="flex" style="margin:0 12rpx 0 4rpx">
212
+                <View className='right-icon'></View>
213
+                <View className='right-icon icon2'></View>
214
+                <View className='right-icon icon3'></View>
215
+              </View>
216
+            }
217
+
218
+          </View>
219
+        ))
220
+        }
221
+      </View>
222
+    )
223
+  }
224
+  renderHouse() {
225
+    const { house: { raiseCart } } = this.props
226
+    const { raiseProfile = {}, record } = this.state
227
+    const disabled = raiseProfile.houseLockingType === 'auto' || !!record.raiseRecordId
228
+
229
+    return (
230
+      <ScrollView scrollY className="container">
231
+        {
232
+          raiseCart.map(item => (
233
+            <View key={item.houseId} >
234
+              <RaiseCard type="raiseMoney" style="height:auto" summary={item} onCancel={this.handleCancel} disableCancel={disabled} />
235
+            </View>
236
+          ))
237
+        }
238
+        {
239
+          !disabled &&
240
+          (
241
+            <Block>
242
+              {
243
+                !raiseProfile.needPreselection &&
244
+                (<View className="addhouse">从 <Text style="color:#F3B82E" onClick={this.gotoHouseSelect.bind(this, 'all')}>房源列表</Text> 中添加其他房源</View>)
245
+              }
246
+              <View className="addhouse">从 <Text style="color:#BB9C79" onClick={this.gotoHouseSelect.bind(this, 'select')}>预选记录</Text> 中添加其他房源</View>
247
+            </Block>
248
+          )
249
+        }
250
+        <Statement style="margin-top:80rpx" />
251
+      </ScrollView>
252
+    )
253
+  }
254
+  renderAgreement() {
255
+    const { raiseProfile = {} } = this.state
256
+
257
+    return (
258
+      <ScrollView scrollY className="container3">
259
+        <View className="agent-box">
260
+          <View className="center-title">线上选房协议</View>
261
+          <View className="rich-text">
262
+            <RichText nodes={raiseProfile.payProtocol || ''} />
263
+          </View>
264
+        </View>
265
+      </ScrollView >
266
+    )
267
+  }
268
+
269
+  // 获取输入
270
+  handleInput = (key, e) => {
271
+    const { person } = this.props.userInfo
272
+
273
+    this.setState({
274
+      record: {
275
+        ...(this.state.record || {}),
276
+        personId: person.personId,
277
+        [`${key}`]: e.detail.value,
278
+      }
279
+    })
280
+  }
281
+
282
+  //
283
+  prepareGetCaptcha = () => {
284
+    const { record } = this.state
285
+    const disabled = !!record.raiseRecordId
286
+    if (disabled) return false;
287
+
288
+    if (this.captchaLock) {
289
+      Taro.showToast({
290
+        title: '发送中, 请稍后',
291
+        icon: 'none'
292
+      })
293
+      return false;
294
+    }
295
+
296
+    const { tel } = this.state.record || {}
297
+
298
+    if (isEmpty(tel) || tel.length < 11) {
299
+      Taro.showToast({
300
+        title: '请填写正确的手机号',
301
+        icon: 'none'
302
+      })
303
+      return false;
304
+    }
305
+
306
+    return true
307
+  }
308
+
309
+  // 获取验证码
310
+  handleCaptcha = e => {
311
+    const { tel } = this.state.record || {}
312
+
313
+    if (!tel) {
314
+      Taro.showToast({
315
+        title: '请填写手机号',
316
+        icon: 'none'
317
+      })
318
+      return Promise.reject();
319
+    }
320
+
321
+    return new Promise((resolve, reject) => {
322
+      this.captchaLock = true
323
+      getCodeMessage(tel).then(() => {
324
+        Taro.showToast({ title: '发送成功' })
325
+        this.captchaLock = false
326
+        resolve()
327
+      }).catch(() => {
328
+        this.captchaLock = false
329
+        reject()
330
+      })
331
+    })
332
+  }
333
+
334
+  tochooseConsultant() {
335
+    const { raiseProfile: { buildingId } } = this.state
336
+    Taro.navigateTo({
337
+      url: '/onlineSelling/pages/chooseConsultant/index?buildingId=' + buildingId
338
+    })
339
+  }
340
+
341
+  getConsultant = () => {
342
+    const { house } = this.props
343
+    const { record } = this.state
344
+    return house.chooseConsultant || (house.consultantList || []).filter(x => x.userId == record.userId)[0]
345
+  }
346
+
347
+  renderProfile() {
348
+    const { record, captchaCountdown, disableCaptcha } = this.state
349
+    const consultant = this.getConsultant()
350
+    const disabled = !!record.raiseRecordId
351
+
352
+    return (
353
+      <ScrollView scrollY className="container2">
354
+        <View className="profile-box">
355
+          <View className="title">我的个人信息</View>
356
+          <View style="font-size:24rpx;color:#999;line-height:60rpx">除手机号外其他信息修改后会保存到个人信息中</View>
357
+          <View className="profile-item">
358
+            <View className="name">
359
+              <Text style="color:#FF3C3C;font-size:32rpx;margin-right:8rpx">*</Text>
360
+              姓名
361
+            </View>
362
+            <Input className='input' placeholder-style="color:#999" maxlength="10" disabled={disabled} value={record.name} onInput={this.handleInput.bind(this, 'name')} type='text' placeholder='请填写真实姓名' />
363
+          </View>
364
+          <View className="profile-item">
365
+            <View className="name">
366
+              <Text style="color:#FF3C3C;font-size:32rpx;margin-right:8rpx">*</Text>
367
+              身份证号
368
+            </View>
369
+            <Input className='input' placeholder-style="color:#999" disabled={disabled} value={record.idcard} onInput={this.handleInput.bind(this, 'idcard')} type='text' placeholder='请填写身份证号' />
370
+          </View>
371
+          <View className="profile-item">
372
+            <View className="name">
373
+              <Text style="color:#FF3C3C;font-size:32rpx;margin-right:8rpx">*</Text>
374
+              手机号
375
+            </View>
376
+            <Input className='input' placeholder-style="color:#999" disabled={disabled || disableCaptcha} value={record.tel} type='text' onInput={this.handleInput.bind(this, 'tel')} placeholder='请填写手机号' />
377
+          </View>
378
+          <View className="profile-item">
379
+            <View className="name">
380
+              <Text style="color:#FF3C3C;font-size:32rpx;margin-right:8rpx">*</Text>
381
+              验证码
382
+            </View>
383
+            <Input className='inputCode' placeholder-style="color:#999" type='text' disabled={disabled || disableCaptcha} onInput={this.handleInput.bind(this, 'captcha')} placeholder='请填写验证码' />
384
+            <Captcha countdown={captchaCountdown} require={this.prepareGetCaptcha.bind(this)} onClick={this.handleCaptcha} />
385
+          </View>
386
+          <View className="profile-flex" style="margin-top:20rpx">
387
+            <View className="title">我的置业顾问信息</View>
388
+            <View className="choose" onClick={this.tochooseConsultant}>选择置业顾问</View>
389
+          </View>
390
+          <ConsultantItem
391
+            data={consultant}
392
+            style="padding:30rpx 0;width:690rpx; border-bottom: 1px solid #dcdcdc;"
393
+            type="raiseMoney"
394
+            tips="show"
395
+          />
396
+        </View>
397
+      </ScrollView >
398
+    )
399
+  }
400
+  toDecimal2 = (x) => {
401
+    var f = parseFloat(x);
402
+    if (isNaN(f)) {
403
+      return false;
404
+    }
405
+    var f = Math.round(x * 100) / 100;
406
+    var s = f.toString();
407
+    var rs = s.indexOf('.');
408
+    if (rs < 0) {
409
+      rs = s.length;
410
+      s += '.';
411
+    }
412
+    while (s.length <= rs + 2) {
413
+      s += '0';
414
+    }
415
+    return s;
416
+  }
417
+  regFenToYuan = (fen) => {
418
+    var num = fen;
419
+    num = fen * 0.01;
420
+    num += '';
421
+    var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
422
+    num = num.replace(reg, '$1');
423
+    num = this.toDecimal2(num)
424
+    return num
425
+  }
426
+
427
+  handleChangeType = (e) => {
428
+    this.setState({ payType: e.detail.value })
429
+  }
430
+
431
+  renderMoney() {
432
+    const { raiseProfile = {}, payTypeList, payType } = this.state
433
+    const payTypeSettings = (raiseProfile.payType || '').split(',')
434
+    const showTypes = payTypeList.filter(x => (payTypeSettings.indexOf(x.value) > -1))
435
+    const showProtocal = payType === 'onLine' ? raiseProfile.payDescriptionOnline : raiseProfile.payDescriptionOffline
436
+    const payTip = payType === 'onLine' ? '线上缴费说明' : '线下缴费说明'
437
+
438
+    return (
439
+      <ScrollView scrollY className="container2" style="padding:0 30rpx">
440
+        <View className="profile-flex">
441
+          <View className="title">认筹金额</View>
442
+          <View className="price">{this.regFenToYuan(raiseProfile.raisePrice)}元</View>
443
+        </View>
444
+        {
445
+          (payTypeSettings.length > 1) &&
446
+          (
447
+            <View className="pay-type">
448
+              <View className="head">请选择缴费方式:</View>
449
+              <View className="body">
450
+                <RadioList dataset={showTypes} value={payType} onChange={this.handleChangeType} />
451
+              </View>
452
+            </View>
453
+          )
454
+        }
455
+        <View className="center-title">{payTip}</View>
456
+        <RichText nodes={showProtocal || ''} />
457
+      </ScrollView >
458
+    )
459
+  }
460
+
461
+  validRaise = () => {
462
+    const { record } = this.state
463
+    const { house } = this.props
464
+
465
+    // 从认筹单页面进来, 不验证
466
+    if (record.raiseRecordId) {
467
+      return Promise.resolve()
468
+    }
469
+
470
+    // 当前选中房源
471
+    const houseList = house.raiseCart || []
472
+
473
+    if (!houseList.length) {
474
+      Taro.showToast({ title: '请选择房源', icon: 'none' })
475
+      return Promise.reject()
476
+    }
477
+
478
+    return new Promise((resolve, reject) => {
479
+      checkRaise(houseList.map(x => x.houseId)).then(resolve).catch(reject)
480
+    })
481
+
482
+    // // 如果要求预选, 预先房源跟当前列表必须一致
483
+    // if (raiseProfile.needPreselection) {
484
+    //   for (let i in houseList) {
485
+    //     const exists = preselectList.filter(x => x.houseId === houseList[i].houseId)[0]
486
+    //     if (!exists) {
487
+    //       Taro.showToast({ title: '需要先预选才能认筹', icon: 'none' })
488
+    //       return Promise.reject()
489
+    //     }
490
+    //   }
491
+    // }
492
+
493
+    // if (record.raiseRecordId) {
494
+    //   // 如果认筹单跟预选的房源不一致, 说明是新的认筹
495
+    //   let found = true
496
+    //   for (let inx in houseList) {
497
+    //     const has = (record.taHousingResourcesList || []).filter(x => x.houseId == houseList[inx].houseId)[0]
498
+
499
+    //     if (!has) {
500
+    //       found = false;
501
+    //       break;
502
+    //     }
503
+    //   }
504
+
505
+    //   if (!found) {
506
+    //     const defaultRecord = this.initRecord()
507
+    //     this.setState({ record: defaultRecord })
508
+    //   }
509
+    // }
510
+
511
+    // return Promise.resolve()
512
+  }
513
+
514
+  makeRaiseRecord = () => {
515
+    const { record, raiseProfile } = this.state
516
+    const { house } = this.props
517
+    const houseList = house.raiseCart.map(x => x.houseId)
518
+    const disabled = !!record.raiseRecordId
519
+    if (disabled) return Promise.resolve();
520
+
521
+    return new Promise((resolve, reject) => {
522
+      if (isEmpty(record.name)) {
523
+        Taro.showToast({
524
+          title: '姓名不能为空',
525
+          icon: 'none',
526
+        })
527
+
528
+        return reject()
529
+      }
530
+
531
+      // 校验身份证号
532
+      if (isEmpty(record.idcard) || !checkIDCard(record.idcard)) {
533
+        Taro.showToast({
534
+          title: '身份证号码不合法',
535
+          icon: 'none',
536
+        })
537
+
538
+        return reject()
539
+      }
540
+
541
+      // 校验手机号
542
+      if (isEmpty(record.tel) || record.tel.length < 11) {
543
+        Taro.showToast({
544
+          title: '手机号格式不正确',
545
+          icon: 'none',
546
+        })
547
+
548
+        return reject()
549
+      }
550
+
551
+      // 验证码 不能为空
552
+      if (isEmpty(record.captcha)) {
553
+        Taro.showToast({
554
+          title: '验证码不能为空',
555
+          icon: 'none',
556
+        })
557
+
558
+        return reject()
559
+      }
560
+
561
+      // 校验置业
562
+      const consultant = this.getConsultant()
563
+      if (!consultant || !consultant.id) {
564
+        Taro.showToast({
565
+          title: '置业顾问不能为空',
566
+          icon: 'none',
567
+        })
568
+        return reject()
569
+      }
570
+
571
+      // 最后, 校验验证码      
572
+      checkCaptcha(record.tel, record.captcha).then(() => {
573
+        this.setState({ disableCaptcha: true })
574
+
575
+        saveRaiseRecord({
576
+          ...record,
577
+          houseList,
578
+          userId: consultant.userId,
579
+          userName: consultant.name,
580
+        }, raiseProfile).then((res) => {
581
+          this.setState({ record: res, disableCaptcha: false })
582
+          resolve(res)
583
+        }).catch((err) => {
584
+          this.setState({ disableCaptcha: false, current: 4, failInfo: { title: '认筹失败', desc: err.message || err } })
585
+        })
586
+
587
+      }).catch(() => {
588
+        Taro.showToast({
589
+          title: '验证码不正确',
590
+          icon: 'none',
591
+        })
592
+
593
+        this.setState({ disableCaptcha: false })
594
+        reject()
595
+      })
596
+
597
+    })
598
+  }
599
+
600
+  makePay = () => {
601
+    const { payType, record = {} } = this.state
602
+    if (!payType) {
603
+      Taro.showToast({
604
+        title: '请确定支付方式',
605
+        icon: 'none'
606
+      })
607
+      return Promise.reject()
608
+    }
609
+
610
+    if (payType === 'offLine') {
611
+      const paramsId = this.$router.params.raiseRecordId || record.raiseRecordId
612
+      return new Promise((resolve, reject) => {
613
+        raiseOffline(paramsId).then(res => {
614
+          resolve()
615
+        }).catch(err => {
616
+          reject()
617
+        })
618
+      })
619
+    }
620
+
621
+    const params = {
622
+      targetId: this.$router.params.raiseRecordId || record.raiseRecordId,
623
+      targetType: 'house'
624
+    }
625
+
626
+    return new Promise((resolve, reject) => {
627
+      raiseOrder(params).then(res => {
628
+
629
+        Taro.requestPayment({
630
+          timeStamp: String(res.timeStamp),
631
+          nonceStr: res.nonceStr,
632
+          package: res.package,
633
+          signType: res.signType,
634
+          paySign: res.sign,
635
+
636
+          success(res) {
637
+            // 最后
638
+            resolve()
639
+          },
640
+          fail(err) {
641
+            cancelOrder(params).then(res => { })
642
+
643
+            // 然后
644
+            reject()
645
+          }
646
+        })
647
+      })
648
+    })
649
+
650
+  }
651
+
652
+  toRaiseProfile(id) {
653
+    const { userInfo: { miniApp: { tpls } } } = this.props
654
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
655
+
656
+    wx.requestSubscribeMessage({
657
+      tmplIds: [tplId],
658
+      success(res) {
659
+      },
660
+      fail(res) {
661
+
662
+      },
663
+      complete() {
664
+        Taro.navigateTo({
665
+          url: `/onlineSelling/pages/raiseProfile/index?id=${id}`
666
+        })
667
+      }
668
+    })
669
+
670
+  }
671
+  renderResult() {
672
+    const { raiseProfile = {}, record = {}, failInfo } = this.state
673
+    const isOk = !failInfo
674
+    const showIcon = isOk ? require('../../assets/success2.png') : require('../../assets/fail2.png')
675
+    const showTitle = isOk ? '提交成功' : failInfo.title
676
+
677
+    return (
678
+      <View className="result">
679
+        <Image className="result-img" src={showIcon}></Image>
680
+
681
+        <View className="status">{showTitle}</View>
682
+
683
+        {
684
+          isOk &&
685
+          (
686
+            <Block>
687
+              <View className="tip" style="margin-bottom:10rpx">详情请查看认筹单</View>
688
+              <View className="tip">支付结果请留意微信支付通知</View>
689
+            </Block>
690
+          )
691
+        }
692
+
693
+        {
694
+          !isOk && (<View className="tip">{(failInfo || {}).desc}</View>)
695
+        }
696
+
697
+        <ContactConsultant buildingId={raiseProfile.buildingId} style=" position: absolute;bottom: 11vh;" />
698
+        {
699
+          record.raiseRecordId &&
700
+          (<View className="look-btn" onClick={() => this.toRaiseProfile(record.raiseRecordId)}>查看认筹单</View>)
701
+        }
702
+      </View>
703
+
704
+    );
705
+  }
706
+
707
+  nextStep(current) {
708
+    if (this.paying) return;
709
+
710
+    // 缴费的下一步
711
+    if (current > 3) {
712
+      this.setState({
713
+        current: current + 1
714
+      })
715
+
716
+      return;
717
+    }
718
+
719
+    this.validRaise().then(() => {
720
+
721
+      switch (current) {
722
+        // 认筹确认
723
+        case 2:
724
+          this.makeRaiseRecord().then((res) => {
725
+            const { userInfo: { miniApp: { tpls } } } = this.props
726
+            const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
727
+            const that = this
728
+            wx.requestSubscribeMessage({
729
+              tmplIds: [tplId],
730
+              success(res) {
731
+              },
732
+              fail(res) {
733
+
734
+              },
735
+              complete() {
736
+                that.setState({
737
+                  current: current + 1
738
+                })
739
+              }
740
+            })
741
+          })
742
+          return;
743
+
744
+        // 缴费
745
+        case 3:
746
+          this.paying = true
747
+
748
+          this.makePay().then(() => {
749
+            this.setState({
750
+              current: current + 1
751
+            })
752
+
753
+            this.paying = false
754
+          }).catch(() => {            
755
+            this.paying = false
756
+          })
757
+
758
+          return;
759
+
760
+        //
761
+        default:
762
+          this.setState({
763
+            current: current + 1
764
+          })
765
+      }
766
+
767
+    })
768
+
769
+  }
770
+
771
+  upStep(current) {
772
+    this.setState({
773
+      current: current - 1
774
+    })
775
+  }
776
+
777
+  renderBottomBtn() {
778
+    const { current, protocolCountdown } = this.state
779
+    const { payType } = this.state
780
+    return (
781
+      <View className="bottom-btn">
782
+        {current == 1 && <View style="font-size:24rpx;color:#999;line-height:70rpx">请仔细阅读选房协议直到结尾才能进入下一步</View>}
783
+        {current != 4 &&
784
+          <NextStep
785
+            countdown={current == 1 ? protocolCountdown : 0}
786
+            onClick={() => this.nextStep(current)}
787
+            text={current == 3 && payType === 'onLine' ? '现在缴费' : '下一步'}
788
+          />
789
+        }
790
+        {current != 0 && current != 4 && <View className="up-btn" onClick={() => this.upStep(current)}>上一步</View>}
791
+      </View>
792
+    )
793
+  }
794
+
795
+  render() {
796
+    const { current } = this.state
797
+    return (
798
+      <View className="raiseMoney">
799
+        {this.renderTop()}
800
+        {current == 0 && this.renderHouse()}
801
+        {current == 1 && this.renderAgreement()}
802
+        {current == 2 && this.renderProfile()}
803
+        {current == 3 && this.renderMoney()}
804
+        {current == 4 && this.renderResult()}
805
+        {this.renderBottomBtn()}
806
+      </View>
807
+    )
808
+  }
809
+
810
+}

+ 199
- 0
src/onlineSelling/pages/raiseMoney/index.scss Näytä tiedosto

@@ -0,0 +1,199 @@
1
+.raiseMoney{
2
+  .top-con{
3
+    display: flex;
4
+    align-items: center;
5
+    padding: 0 30px;
6
+    line-height: 100px;
7
+    color: #666;
8
+    font-size: 24px;
9
+    .flex{
10
+      display: flex;
11
+      align-items: center;
12
+      .right-icon{
13
+        width:10px;
14
+        height:10px;
15
+        border-top: 1px solid rgba(0,0,0,0.4);
16
+        border-right: 1px solid rgba(0,0,0,0.4);
17
+        transform:rotate(45deg);
18
+        display: inline-block;
19
+      }
20
+      .icon2{
21
+        width:13px;
22
+        height:13px;
23
+        border-top: 1px solid rgba(0,0,0,0.7);
24
+        border-right: 1px solid rgba(0,0,0,0.7);
25
+        margin-left: -2px;
26
+      }
27
+      .icon3{
28
+        width:17px;
29
+        height:17px;
30
+        border-top: 0.6px solid rgba(0,0,0,1);
31
+        border-right: 0.6px solid rgba(0,0,0,1);
32
+        margin-left: -2px;
33
+      }
34
+    }
35
+  }
36
+  .addhouse{
37
+    font-size:28px;
38
+    color: #333;
39
+    line-height: 70px;
40
+    text-align: center;
41
+  }
42
+  .container {
43
+    height: calc(100vh - 254px);
44
+  }
45
+  .container2 {
46
+    height: calc(100vh - 382px);
47
+
48
+    .pay-type {
49
+      display: flex;
50
+      margin: 30px 0 40px;
51
+      font-size:28px;
52
+      color: #333;
53
+
54
+      .head {
55
+        width: 240px;
56
+        flex: none;
57
+      }
58
+
59
+      .body {
60
+        flex: auto;
61
+
62
+        .item {
63
+          display: inline-block;
64
+        }
65
+      }
66
+    }
67
+  }
68
+  .container3 {
69
+    height: calc(100vh - 452px);
70
+
71
+    .rich-text {
72
+      width: 100%;
73
+      overflow-x: hidden;
74
+    }
75
+  }
76
+  .agent-box{
77
+    padding: 30px;
78
+  }
79
+  .center-title{
80
+    font-size: 24px;
81
+    color: #333;
82
+    text-align: center;
83
+    line-height: 2;
84
+  }
85
+  .profile-box{
86
+    padding: 0 30px;
87
+    .title{
88
+      font-size: 36px;
89
+      color: #333;
90
+      font-weight: 700;
91
+    }
92
+    .profile-item{
93
+      display: flex;
94
+      align-items: center;
95
+      justify-content: space-between;
96
+      height:98px;
97
+      border-bottom: 1px solid #dcdcdc;
98
+      .name{
99
+        font-size: 32px;
100
+        color: #333;
101
+      }
102
+      .input{
103
+        font-size:32px ;
104
+        width: 480px;
105
+      }
106
+      .inputCode{
107
+        font-size:32px ;
108
+        width: 222px;
109
+        margin-right: -40px;
110
+      }
111
+      .getCode{
112
+        font-size: 32px;
113
+        color: #F6B61D;
114
+        line-height:64px;
115
+        border:1px solid #F6B61D;
116
+        border-radius:8px;
117
+        width: 220px;
118
+        text-align: center;
119
+      }
120
+    }
121
+  }
122
+  .profile-flex{
123
+    display: flex;
124
+    align-items: center;
125
+    justify-content: space-between;
126
+    .choose{
127
+      font-size: 24px;
128
+      color: #BB9C79;
129
+    }
130
+    .title{
131
+      font-size: 36px;
132
+      color: #333;
133
+      font-weight: 700;
134
+    }
135
+    .price{
136
+      color: #FF3C3C;
137
+      font-size: 44px;
138
+    }
139
+  }
140
+  .bottom-btn{
141
+      position: fixed;
142
+      width: 100vw;
143
+      padding: 30px;
144
+      .next-btn{
145
+        height:94px;
146
+        line-height: 94px;
147
+        background:rgba(187,156,121,1);
148
+        border-radius:10px;
149
+        color: #fff;
150
+        font-size: 36px;
151
+        text-align: center; 
152
+    }
153
+      .up-btn{
154
+        height:94px;
155
+        line-height: 94px;
156
+        border-radius:10px;
157
+        color: #BB9C79;
158
+        border: 2px solid #BB9C79;
159
+        font-size: 36px;
160
+        text-align: center; 
161
+        margin-top: 36px;
162
+    }
163
+  }
164
+  .result{
165
+    background-color: #fff;
166
+    height: 88vh;
167
+    width: 100vw;
168
+    position: relative;
169
+    text-align: center;
170
+    padding-top: 20vh;
171
+    font-weight: 300;
172
+    .result-img{
173
+      width:168px;
174
+      height:168px;
175
+    }
176
+    .status{
177
+      font-size: 36px;
178
+      color: #333;
179
+      line-height: 1.8;
180
+    }
181
+    .tip{
182
+      font-size: 34px;
183
+      color: #999;
184
+      padding: 0 100px;
185
+    }
186
+   .look-btn{
187
+     width: 690px;
188
+     height:94px;
189
+     background:rgba(187,156,121,1);
190
+     border-radius:10px;
191
+     color: #fff;
192
+     font-size: 36px;
193
+     line-height: 94px;
194
+     position: absolute;
195
+     bottom: 1vh;
196
+     left: 30px;
197
+   }
198
+  }
199
+}

+ 34
- 0
src/onlineSelling/pages/raiseProfile/Cell.js Näytä tiedosto

@@ -0,0 +1,34 @@
1
+import { View, Block } from '@tarojs/components'
2
+import './index.scss'
3
+import NamedIcon from '../../components/NamedIcon'
4
+
5
+export default function (props) {
6
+  const disable = props.disable ? 'disable' : ''
7
+  console.log('------->', props)
8
+
9
+  return (
10
+    <Block>
11
+      {
12
+        !props.hide && <View className={`raiseCell ${disable}`}>
13
+          <View className="row">
14
+            <View className="head">{props.head}</View>
15
+            <View className="body">{props.body}</View>
16
+            <View className="action" onClick={props.onActionClick}>
17
+              {
18
+                props.action && (<Image src={require('../../assets/copy.png')} style="width:34rpx;height:34rpx"></Image>)
19
+              }
20
+            </View>
21
+          </View>
22
+          {
23
+            props.desc &&
24
+            (
25
+              <View className="row desc">
26
+                <View className="desc">{props.desc}</View>
27
+              </View>
28
+            )
29
+          }
30
+        </View>
31
+      }
32
+    </Block>
33
+  )
34
+}

+ 34
- 0
src/onlineSelling/pages/raiseProfile/CellBlock.js Näytä tiedosto

@@ -0,0 +1,34 @@
1
+
2
+import Cell from './Cell'
3
+import './index.scss'
4
+
5
+export default function(props) {
6
+  const dataset = props.dataset || []
7
+  const disable = props.disable
8
+
9
+  const handleActionClick = (item) => {
10
+    if (item.action && props.onActionClick) {
11
+      props.onActionClick(item)
12
+    }
13
+  }
14
+
15
+  return (
16
+    <View className="cell-block">
17
+      {
18
+        dataset.map((item, inx) => (
19
+          <View key={`cell-${inx}`} className="cell-block-item">
20
+            <Cell
21
+              disable={disable}
22
+              head={item.head}
23
+              body={item.body}
24
+              action={item.action}
25
+              hide={item.hide}
26
+              desc={item.desc}
27
+              onActionClick={handleActionClick.bind(this, item)}
28
+              />
29
+          </View>
30
+        ))
31
+      }
32
+    </View>
33
+  )
34
+}

+ 49
- 0
src/onlineSelling/pages/raiseProfile/houseResource.js Näytä tiedosto

@@ -0,0 +1,49 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View } from '@tarojs/components'
3
+import './index.scss'
4
+import RaiseCard from '../../components/RaiseCard'
5
+import { queryRaiseDetail } from '@/services/project'
6
+
7
+export default class HouseResource extends Component {
8
+  config = {
9
+    navigationBarTitleText: '房源清单'
10
+  }
11
+  state = {
12
+    houseList: [],
13
+  }
14
+
15
+  componentWillMount() {
16
+    const { raiseRecordId } = this.$router.params
17
+    queryRaiseDetail(raiseRecordId).then(res => {
18
+      this.setState({
19
+        houseList: res.houseList || [],
20
+
21
+      })
22
+    })
23
+  }
24
+  toHouseDetail(item) {
25
+    if (item.housingStatus == '0' || item.saleBatchStatus == '0') {
26
+      Taro.showToast({ title: '当前销售批次或该房源已被取消发布', icon: 'none', duration: 2000 })
27
+    } else {
28
+      Taro.navigateTo({
29
+        url: `/onlineSelling/pages/detail/index?id=${item.houseId}`
30
+      })
31
+    }
32
+  }
33
+  render() {
34
+    const { houseList } = this.state
35
+    return (
36
+      <View style="padding-top:30rpx">
37
+        {
38
+          houseList.map(item => (
39
+            <View key={item.raiseRecordId} >
40
+              <RaiseCard type="houseResource" handleCard={() => this.toHouseDetail(item)} summary={item} />
41
+            </View>
42
+          )
43
+          )
44
+        }
45
+      </View>
46
+    )
47
+  }
48
+
49
+}

+ 278
- 0
src/onlineSelling/pages/raiseProfile/index.js Näytä tiedosto

@@ -0,0 +1,278 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View, Block } from '@tarojs/components'
3
+import dayjs from 'dayjs'
4
+import CellBlock from './CellBlock'
5
+import Statement from '../../components/Statement'
6
+import ContactConsultant from '../../components/ContactConsultant'
7
+import ConsultantItem from '../../components/ConsultantItem/index'
8
+import NamedIcon from '../../components/NamedIcon'
9
+import RaiseCard from '../../components/RaiseCard'
10
+import { queryRaiseDetail } from '@/services/project'
11
+import { connect } from '@tarojs/redux'
12
+import * as noticeType from '@/constants/common.js'
13
+import './index.scss'
14
+
15
+@connect(({ user }) => ({ user }))
16
+
17
+export default class Raise extends Component {
18
+  config = {
19
+    navigationBarTitleText: '认筹单',
20
+  }
21
+
22
+  state = {
23
+    buildingId: '',
24
+    raiseDeatil: {},
25
+    houseList: [],
26
+    raiseOrder: {},
27
+    orderDetail: {},
28
+    refundOrder: {},
29
+    payDisable: true,
30
+  }
31
+
32
+  componentWillMount() {
33
+    const { id: raiseRecordId } = this.$router.params
34
+    queryRaiseDetail(raiseRecordId).then(res => {
35
+      this.setState({
36
+        buildingId: res.taRaiseRecord.buildingId,
37
+        raiseDeatil: res.taRaiseRecord || {},
38
+        houseList: res.houseList || [],
39
+        raiseOrder: res.taRaise || {},
40
+        orderDetail: res.taOrder || {},
41
+        refundOrder: res.refundOrder || {},
42
+      })
43
+    })
44
+  }
45
+
46
+  // 复制数据
47
+  copyData(data) {
48
+    Taro.setClipboardData({
49
+      data: `${data}`,
50
+      onSuccess: (() => { }),
51
+    })
52
+  }
53
+
54
+  // 查看所有认筹房源
55
+  viewAllHouses = () => {
56
+    const { id } = this.$router.params
57
+    Taro.navigateTo({
58
+      url: `/onlineSelling/pages/raiseProfile/houseResource?raiseRecordId=${id}`
59
+    })
60
+  }
61
+
62
+  renderHead() {
63
+    const { houseList } = this.state
64
+    const showHouse = (houseList || []).filter(x => x.mineLocked == 'mine')[0] || houseList[0]
65
+    return (
66
+      <Block>
67
+        <View className="head flexSpace">
68
+          <View className="flexSpace-fixed">
69
+            <View className="title">认筹房源</View>
70
+          </View>
71
+          <View className="flexSpace-fixed">
72
+            {houseList.length > 1 && <View className="gray" onClick={this.viewAllHouses}>
73
+              <Text>查看全部({houseList.length})</Text>
74
+              <Text className='at-icon at-icon-chevron-right'></Text>
75
+            </View>}
76
+          </View>
77
+        </View>
78
+        <RaiseCard summary={showHouse} type="raiseProfile" style="height:auto" />
79
+      </Block>
80
+    )
81
+  }
82
+
83
+  // 取消认购原因
84
+  renderCancelReason() {
85
+    const { raiseDeatil } = this.state;
86
+    return (
87
+      <Block>
88
+        <View className="cancelReason flexSpace">
89
+          <View className="flexSpace-fixed">
90
+            <Image src={require('../../assets/void.png')} style="width:120rpx;height:120rpx"></Image>
91
+          </View>
92
+          <View className="flexSpace-item" style="margin-left: 20px">
93
+            <View>认筹单作废原因:</View>
94
+            <View className="gray">{raiseDeatil.invalidReason}</View>
95
+          </View>
96
+        </View>
97
+        <View className="hr"></View>
98
+      </Block>
99
+    )
100
+  }
101
+  // 跳转去交费
102
+  toPay = () => {
103
+    this.setState({
104
+      payDisable: false,
105
+    })
106
+    const { raiseDeatil: { raiseRecordId } } = this.state
107
+    const { user: { userInfo: { miniApp: { tpls } } } } = this.props
108
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
109
+    const that = this
110
+    wx.requestSubscribeMessage({
111
+      tmplIds: [tplId],
112
+      success(res) {
113
+      },
114
+      fail(res) {
115
+
116
+      },
117
+      complete() {
118
+        that.setState({
119
+          payDisable: true
120
+        })
121
+        Taro.navigateTo({
122
+          url: `/onlineSelling/pages/raiseMoney/index?type=pay&raiseRecordId=${raiseRecordId}`
123
+        })
124
+      }
125
+    })
126
+
127
+  }
128
+  // 未交费提示
129
+  renderUnpayNotice() {
130
+    const { raiseOrder, payDisable } = this.state
131
+    return (
132
+      <Block>
133
+        <View className="unpayNotice flexSpace" onClick={payDisable ? this.toPay : ''}>
134
+          <View className="flexSpace-fixed">
135
+            <Image src={require('../../assets/pay.png')} style="width:64rpx;height:64rpx"></Image>
136
+            <View className="a-line txt">未缴费?点我缴费</View>
137
+          </View>
138
+          <View className="flexSpace-fixed">
139
+            <Text className="a-line">认筹金额</Text>
140
+            <Text className="a-line price">{this.regFenToYuan(raiseOrder.raisePrice)}元</Text>
141
+          </View>
142
+        </View>
143
+        <View className="hr"></View>
144
+      </Block>
145
+    )
146
+  }
147
+  handleChatClick(item) {
148
+
149
+    const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
150
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
151
+    wx.requestSubscribeMessage({
152
+      tmplIds: [tplId],
153
+      success(res) {
154
+      },
155
+      fail(res) {
156
+
157
+      },
158
+      complete() {
159
+        Taro.navigateTo({
160
+          url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.consultantPersonId}&receiverName=${encodeURIComponent(item.name || item.nickname || item.userName)}`
161
+        })
162
+      }
163
+    })
164
+  }
165
+  toDecimal2 = (x) => {
166
+    var f = parseFloat(x);
167
+    if (isNaN(f)) {
168
+      return false;
169
+    }
170
+    var f = Math.round(x * 100) / 100;
171
+    var s = f.toString();
172
+    var rs = s.indexOf('.');
173
+    if (rs < 0) {
174
+      rs = s.length;
175
+      s += '.';
176
+    }
177
+    while (s.length <= rs + 2) {
178
+      s += '0';
179
+    }
180
+    return s;
181
+  }
182
+  regFenToYuan = (fen) => {
183
+    var num = fen;
184
+    num = fen * 0.01;
185
+    num += '';
186
+    var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
187
+    num = num.replace(reg, '$1');
188
+    num = this.toDecimal2(num)
189
+    return num
190
+  }
191
+  toAgreement(agreement, buildingId) {
192
+    Taro.navigateTo({
193
+      url: `/onlineSelling/pages/protocol/index?agreement=${agreement}&buildingId=${buildingId}`
194
+    })
195
+  }
196
+
197
+  render() {
198
+    const { buildingId, raiseDeatil, orderDetail, refundOrder, raiseOrder } = this.state;
199
+
200
+
201
+    // 认筹信息
202
+    const raiseInfo = [
203
+      { head: '认筹人', body: raiseDeatil.name || '', },
204
+      { head: '身份证号', body: raiseDeatil.idcard || '' },
205
+      { head: '手机号', body: raiseDeatil.tel || '' },
206
+    ]
207
+
208
+    // 缴费信息
209
+    const payInfo = [
210
+      { head: '缴费方式', body: `${raiseDeatil.payType == 'onLine' ? '线上缴费' : '线下缴费'}` },
211
+      { head: '实际支付费用', body: raiseDeatil.payType == 'onLine' ? this.regFenToYuan(orderDetail.totalFee) + '元' : this.regFenToYuan(raiseOrder.raisePrice) + '元' },
212
+      { head: '缴费成功时间', body: dayjs(orderDetail.payTime).format('YYYY/MM/DD HH:mm:ss') },
213
+    ]
214
+
215
+    // 退费信息
216
+    const refundInfo = [
217
+      { head: '退费状态', body: refundOrder.payStatus == 'refunded' ? '退费完成' : '退费中' },
218
+      { head: '退费结果', body: refundOrder.payStatus == 'refunded' ? '成功' : '失败' },
219
+      { head: '退费发起时间', body: dayjs(refundOrder.createDate).format('YYYY/MM/DD HH:mm:ss') },
220
+      { head: '实退费用', body: this.regFenToYuan(refundOrder.totalFee) + '元' },
221
+      { head: '退费到账时间', body: dayjs(refundOrder.payTime).format('YYYY/MM/DD HH:mm:ss') },
222
+      { head: '退费原因', desc: raiseDeatil.refundReason },
223
+    ]
224
+
225
+    // 其他信息
226
+    const otherInfo = [
227
+      { head: '其他信息', body: '供核对数据使用' },
228
+      { head: '认筹单编号', body: raiseDeatil.raiseRecordId || '', action: true },
229
+      { head: '缴费单编号', body: raiseDeatil.orderId || '', action: true, hide: (raiseDeatil.payStatus != 'refunded' && raiseDeatil.payStatus != 'paid') || raiseDeatil.payType != 'onLine' },
230
+      { head: '退费单编号', body: refundOrder.orderId || '', action: true, hide: raiseDeatil.payStatus != 'refunded' },
231
+    ]
232
+
233
+
234
+    return (
235
+      <View className="raiseProfilePage">
236
+        <View className="main">
237
+          {this.renderHead()}
238
+          <View className="tip">{raiseOrder.raisePrecautions || ''}</View>
239
+          {raiseDeatil.status == '0' && this.renderCancelReason()}
240
+          {raiseDeatil.payStatus == 'unpaid' && raiseDeatil.status == 1 && this.renderUnpayNotice()}
241
+          <View className="raise-flex">
242
+            <View className="date">认筹提交时间  {dayjs(raiseDeatil.createDate).format('YYYY/MM/DD HH:mm:ss')}</View>
243
+            <View className="agreement" onClick={() => this.toAgreement(raiseOrder.payProtocol, raiseOrder.buildingId)}>线上选房协议<Text className="right-icon"></Text></View>
244
+          </View>
245
+          <View>
246
+            <CellBlock dataset={raiseInfo} />
247
+            {raiseDeatil.consultantInfo && <ConsultantItem
248
+              data={raiseDeatil.consultantInfo}
249
+              type="raiseProfile"
250
+              style="height:140rpx;margin-bottom:0rpx;width:690rpx"
251
+              contactClick={() => this.handleChatClick(raiseDeatil.consultantInfo)}
252
+            />}
253
+            <View className="hr" />
254
+            {(raiseDeatil.payStatus == 'paid' || raiseDeatil.payStatus == 'refunded') &&
255
+              <Block>
256
+                <CellBlock dataset={payInfo} />
257
+                <View className="hr" />
258
+              </Block>}
259
+
260
+            {/* unpaid未缴费paid已缴费refunded已退费 */}
261
+            {raiseDeatil.payStatus == 'refunded' &&
262
+              <Block>
263
+                <CellBlock dataset={refundInfo} />
264
+                <View className="hr" />
265
+              </Block>}
266
+            <CellBlock dataset={otherInfo} disable onActionClick={dt => this.copyData(dt.body)} />
267
+          </View>
268
+          <View></View>
269
+          <View></View>
270
+        </View>
271
+        <View className="contact">
272
+          <ContactConsultant text="如有问题,请联系置业顾问" buildingId={buildingId} />
273
+        </View>
274
+        <Statement />
275
+      </View>
276
+    )
277
+  }
278
+}

+ 156
- 0
src/onlineSelling/pages/raiseProfile/index.scss Näytä tiedosto

@@ -0,0 +1,156 @@
1
+
2
+@import "~taro-ui/dist/style/components/icon.scss";
3
+
4
+.raiseProfilePage {
5
+
6
+  .main {
7
+    padding: 0 30px;
8
+    font-size: 30px;
9
+
10
+    .head {
11
+      margin: 40px 0 30px;
12
+    }
13
+
14
+    .title {
15
+      font-weight: 700;
16
+    }
17
+
18
+    .tip {
19
+      font-size: 24px;
20
+      line-height: 36px;
21
+      color: #FF3C3C;
22
+    }
23
+
24
+    .cancelReason {
25
+      font-size: 21px;
26
+      line-height: 32px;
27
+      color: #333;
28
+      margin: 40px 0 30px;
29
+    }
30
+
31
+    .unpayNotice {
32
+      margin: 30px 0 20px;
33
+      font-size: 28px;
34
+      color: #333;
35
+
36
+      .a-line {
37
+        display: inline-block;
38
+        height: 64px;
39
+        line-height: 64px;
40
+        vertical-align: bottom;
41
+      }
42
+
43
+      .txt {
44
+        margin-left: 10px;
45
+        font-size: 30px;
46
+        color: #666;
47
+      }
48
+
49
+      .price {
50
+        margin-left: 20px;
51
+        font-size: 44px;
52
+        color: #FF3C3C;
53
+      }
54
+    }
55
+
56
+    .gray {
57
+      color: #999;
58
+    }
59
+  }
60
+
61
+  .hr {
62
+    height: 2px;
63
+    box-shadow:0px 2px 0px 0px rgba(0, 0, 0, 0.08);
64
+  }
65
+
66
+  .contact {
67
+    margin: 44px 0;
68
+  } 
69
+}
70
+
71
+.flexSpace {
72
+  display: flex;
73
+  justify-content: space-between;
74
+  align-items: center;
75
+
76
+  &-fixed {
77
+    flex: none;
78
+  }
79
+
80
+  &-item {
81
+    flex: auto;
82
+    font-size: 22px;
83
+  }
84
+}
85
+
86
+.cell-block {
87
+  padding: 45px 0;
88
+
89
+  .cell-block-item {
90
+    & + .cell-block-item {
91
+      margin-top: 70px;
92
+    }
93
+  }
94
+}
95
+
96
+
97
+.raiseCell {
98
+  color: #333;
99
+  text-align: left;
100
+  font-size: 30px;
101
+
102
+  &.disable {
103
+    color: #999;
104
+  }
105
+
106
+  .row {
107
+    display: flex;
108
+    line-height: 1.1em;
109
+
110
+    .head {
111
+      width: 260px;
112
+      flex: none;
113
+    }
114
+
115
+    .action {
116
+      width: 54px;
117
+      text-align: right;
118
+      flex: none;
119
+    }
120
+
121
+    .body {
122
+      flex: auto;
123
+    }
124
+
125
+    .desc {
126
+      color: #999;
127
+      font-size: 32px;
128
+      line-height: 40px;
129
+      margin-top: 28px;
130
+    }
131
+  }
132
+}
133
+.raise-flex{
134
+  margin-top: 40px;
135
+  display: flex;
136
+  align-items: center;
137
+  justify-content: space-between;
138
+  .date{
139
+    font-size: 28px;
140
+    color: #666;
141
+  }
142
+  .agreement{
143
+    color: #BB9C79;
144
+    font-size: 32px;
145
+    display: flex;
146
+    align-items: center;
147
+     .right-icon{
148
+      width:20px;
149
+      height:20px;
150
+      border-top: 2px solid #999;
151
+      border-right: 2px solid #999;
152
+      transform:rotate(45deg);
153
+      display: inline-block;
154
+    }
155
+  }
156
+}

+ 415
- 27
src/onlineSelling/pages/records/index.js Näytä tiedosto

@@ -1,41 +1,161 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2 2
 import { View, ScrollView, Block } from '@tarojs/components'
3 3
 import HouseCard from '../../components/HouseCard'
4
-import { queryPreselectionRecord } from '@/services/project'
4
+import RaiseCard from '../../components/RaiseCard'
5
+import { getItemList } from '@/services/item'
6
+import { queryPreselectionRecord, queryRaiseRecord, querySalesList, queryApartmentType } from '@/services/project'
5 7
 import { connect } from '@tarojs/redux'
6 8
 import ready from '@/utils/ready'
7 9
 import Blank from '../../components/Blank'
10
+import Statement from '../../components/Statement'
11
+import { transferImage } from '@/utils/tools'
12
+import PickerComponent from '../../components/Picker'
8 13
 import './index.scss'
14
+import * as houseActions from '@/actions/house'
15
+import * as noticeType from '@/constants/common.js'
16
+
9 17
 
10 18
 @connect(
11
-  ({ user }) => ({ ...user })
19
+  ({ user, city, house }) => ({ ...user, ...city, house }),
20
+  { ...houseActions }
12 21
 )
13
-
14 22
 export default class Records extends Component {
15 23
   config = {
16 24
     navigationBarTitleText: '选房记录'
17 25
   }
18 26
 
19 27
   state = {
20
-    recordList: []
28
+
29
+    current: 0,
30
+    recordList: [],
31
+    noRecord: false,
32
+    raiseList: [],
33
+    noRaiseRecord: false,
34
+    screenVisible: false,
35
+    buildingList: [],
36
+    buildingValue: '',
37
+    buildingId: '',
38
+
39
+    salesList: [],
40
+    saleBatch: '',
41
+    salesBatchId: '',
42
+
43
+    apartmentList: [],
44
+    apartmentValue: '',
45
+    apartmentId: '',
46
+
47
+    lockStatus: [{ value: '不限', code: '' }, { value: '未锁定', code: 'unlocked' }, { value: '已锁定', code: 'locked' }],
48
+    lockStatusValue: '',
49
+    houseLockingStatus: '',
50
+
51
+    lockCustomer: [{ value: '不限', code: '' }, { value: '我自己', code: 'mine' }, { value: '其他人', code: 'other' }],
52
+    lockCustomerValue: '',
53
+    customerLocked: '',
54
+
55
+    chooseList: [], // 选中的房源ID列表
56
+    clickDisable: true,
21 57
   }
22 58
   componentDidShow() {
23 59
     ready.queue(() => {
24 60
 
25
-      const { userInfo: { person: { personId } } } = this.props
61
+      const { id: salesBatchId = '' } = this.$router.params
62
+      const { userInfo: { person: { personId } }, house } = this.props
26 63
       const params = {
27 64
         personId,
28
-        pageNum: 1,
65
+        // salesBatchId,
66
+        pageNumber: 1,
29 67
         pageSize: 999,
30 68
       }
31
-      queryPreselectionRecord(params).then(res => {
32
-        const list = res.records
69
+      this.getPreselection(params)
70
+      this.getRaise(params)
71
+      querySalesList().then(res => {
72
+        res.unshift({ salesBatchName: '请选择', salesBatchId })
73
+        this.setState({
74
+          salesList: res || [],
75
+        })
76
+      })
77
+      this.loadBuildingList()
78
+
79
+      if (house.raiseCart.length) {
80
+        this.setState({ chooseList: house.raiseCart.map(x => x.houseId) })
81
+      }
82
+
83
+      this.setState({ salesBatchId })
84
+
85
+      // 清空认筹选择
86
+      this.props.dispatchFlush2Cart([])
87
+    })
88
+  }
89
+  getPreselection(params) {
90
+    queryPreselectionRecord(params).then(res => {
91
+      const list = res.records
92
+      this.setState({
93
+        recordList: list.filter(item => item.status == '1') || [],
94
+
95
+      }, () => {
33 96
         this.setState({
34
-          recordList: list.filter(item => item.status == '1') || []
97
+          noRecord: this.state.recordList.length > 0 ? false : true
35 98
         })
36 99
       })
37 100
     })
38 101
   }
102
+  getRaise(params) {
103
+    queryRaiseRecord(params).then(res => {
104
+      this.setState({
105
+        raiseList: res.records || [],
106
+
107
+      }, () => {
108
+        this.setState({
109
+          noRaiseRecord: this.state.raiseList.length > 0 ? false : true
110
+        })
111
+      })
112
+    })
113
+  }
114
+  loadBuildingList() {
115
+    const params = {
116
+      pageNumber: 1,
117
+      pageSize: 50,
118
+      // cityId: this.props.curCity.id || ''
119
+    }
120
+    getItemList(params).then(res => {
121
+      res.records.unshift({ buildingName: '请选择', buildingId: '' })
122
+      this.setState({
123
+        buildingList: res.records,
124
+      })
125
+    })
126
+
127
+  }
128
+
129
+  CheckboxChange = (e) => {
130
+    // 加了一个转整型的处理
131
+    // 因为所有的 houseId 都是整型
132
+    this.setState({ chooseList: e.detail.value.map(x => (x - 0)) })
133
+  }
134
+
135
+  handleSubmit = () => {
136
+    const { recordList, chooseList } = this.state
137
+    if (!chooseList.length) {
138
+      Taro.showToast({ title: '请选择房源', icon: 'none' })
139
+      return;
140
+    }
141
+
142
+    const houseList = recordList.map(x => x.housingInfo).filter(x => chooseList.indexOf(x.houseId) > -1)
143
+
144
+    // 选择房源必须同一批次
145
+    const checkHouse = houseList[0]
146
+    for (let inx in houseList) {
147
+      if (houseList[inx].salesBatchId != checkHouse.salesBatchId) {
148
+        Taro.showToast({ title: '所选房源不属于同一销售批次, 请筛选后重选', icon: 'none', duration: 2000, })
149
+        return;
150
+      }
151
+    }
152
+
153
+    this.props.dispatchFlush2Cart(houseList);
154
+
155
+    Taro.navigateTo({
156
+      url: `/onlineSelling/pages/raiseMoney/index?salesBatchId=${checkHouse.salesBatchId}`
157
+    })
158
+  }
39 159
   toHouseDetail(item) {
40 160
     if (item.housingStatus == '0' || item.saleBatchStatus == '0') {
41 161
       Taro.showToast({ title: '当前销售批次或该房源已被取消发布', icon: 'none', duration: 2000 })
@@ -45,29 +165,297 @@ export default class Records extends Component {
45 165
       })
46 166
     }
47 167
   }
168
+  renderPreselection() {
169
+    const { recordList, noRecord, chooseList } = this.state
170
+
171
+    return (
172
+      <Block>
173
+        <ScrollView scrollY className="container">
174
+          <CheckboxGroup onChange={this.CheckboxChange}>
175
+            {
176
+              noRecord ? <Blank style="margin:10vh 0 22vh 0" tips="暂无预选记录" /> :
177
+                <View>
178
+                  {
179
+                    recordList.map((item) => {
180
+                      // const checked = (chooseList || []).filter(x => x == item.houseId)[0]
181
+                      // const disabled = item.housingInfo.houseLockingStatus == 'locked'
182
+
183
+                      return (
184
+                        <Label class="checkbox" >
185
+                          {/* <Checkbox value={item.houseId - 0} checked={checked} disabled={disabled}> */}
186
+                          <View className="carditem" key={item.preselectionRecordId} >
187
+                            <HouseCard summary={item} onClick={() => this.toHouseDetail(item)} />
188
+                          </View>
189
+                          {/* </Checkbox> */}
190
+                        </Label>
191
+                      )
192
+                    })
193
+                  }
194
+                </View>
195
+            }
196
+          </CheckboxGroup>
197
+          <Statement />
198
+        </ScrollView >
199
+
200
+        {/* <View className="raise-box"> <View className="raise-btn" onClick={this.handleSubmit}>认筹房源</View></View> */}
201
+
202
+      </Block>
203
+    )
204
+  }
205
+  toRaiseProfile(id) {
206
+    this.setState({
207
+      clickDisable: false
208
+    })
209
+
210
+    const { userInfo: { miniApp: { tpls } } } = this.props
211
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
212
+    const that = this
213
+    wx.requestSubscribeMessage({
214
+      tmplIds: [tplId],
215
+      success(res) {
216
+      },
217
+      fail(res) {
218
+
219
+      },
220
+      complete() {
221
+        that.setState({
222
+          clickDisable: true
223
+        })
224
+        Taro.navigateTo({
225
+          url: `/onlineSelling/pages/raiseProfile/index?id=${id}`
226
+        })
227
+      }
228
+    })
229
+
230
+  }
231
+  renderRaise() {
232
+    const { raiseList, noRaiseRecord, clickDisable } = this.state
233
+    return (
234
+      <Block>
235
+        <ScrollView scrollY className="container">
236
+          {
237
+            noRaiseRecord ? <Blank style="margin:10vh 0 22vh 0" tips="暂无认筹记录" /> :
238
+              <Block>
239
+                {
240
+                  raiseList.map(item => (
241
+                    <View key={item.raiseRecordId} >
242
+                      <RaiseCard handleCard={clickDisable ? () => this.toRaiseProfile(item.raiseRecordId) : ''} summary={item} statusType="raise" />
243
+                    </View>
244
+                  )
245
+                  )
246
+                }
247
+
248
+              </Block>
249
+          }
250
+          <Statement styel="margin-top:80rpx" />
251
+        </ScrollView >
252
+
253
+      </Block>
254
+    )
255
+  }
256
+
257
+
258
+  handleBuildingChange = e => {
259
+    const { buildingList } = this.state
260
+    this.setState({
261
+      buildingValue: buildingList[e.detail.value].buildingName,
262
+      buildingId: buildingList[e.detail.value].buildingId,
263
+    })
264
+  }
265
+  handleSaleBatchChange = e => {
266
+    const { salesList } = this.state
267
+    this.setState({
268
+      saleBatch: salesList[e.detail.value].salesBatchName,
269
+      salesBatchId: salesList[e.detail.value].salesBatchId,
48 270
 
271
+    }, () => {
272
+      if (this.state.salesBatchId) {
273
+        this.loadAparamentType(this.state.salesBatchId)
274
+      } else {
275
+        this.setState({
276
+          apartmentList: [{ apartmentName: '请选择', apartmentId: '' }]
277
+        })
278
+      }
279
+    })
280
+  }
281
+
282
+  loadAparamentType(salesBatchId) {
283
+    queryApartmentType({ salesBatchId: salesBatchId }).then(res => {
284
+      res.unshift({ apartmentName: '请选择', apartmentId: '' })
285
+      this.setState({
286
+        apartmentList: res || []
287
+      })
288
+    })
289
+  }
290
+
291
+  handleApartmentChange = e => {
292
+    const { apartmentList } = this.state
293
+
294
+    this.setState({
295
+      apartmentValue: apartmentList[e.detail.value].apartmentName,
296
+      apartmentId: apartmentList[e.detail.value].apartmentId,
297
+    })
298
+
299
+  }
300
+  handleLockStatusChange = e => {
301
+    const { lockStatus } = this.state
302
+    this.setState({
303
+      lockStatusValue: lockStatus[e.detail.value].value,
304
+      houseLockingStatus: lockStatus[e.detail.value].code,
305
+    })
306
+  }
307
+  handleCustomerChange = e => {
308
+    const { lockCustomer } = this.state
309
+    this.setState({
310
+      lockCustomerValue: lockCustomer[e.detail.value].value,
311
+      customerLocked: lockCustomer[e.detail.value].code,
312
+    })
313
+  }
314
+
315
+
316
+  unlimitedBtn() {
317
+
318
+    this.setState({
319
+      screenVisible: false,
320
+      buildingValue: '',
321
+      buildingId: '',
322
+      saleBatch: '',
323
+      salesBatchId: '',
324
+      apartmentValue: '',
325
+      apartmentId: '',
326
+      lockStatusValue: '',
327
+      houseLockingStatus: '',
328
+      lockCustomerValue: '',
329
+      customerLocked: '',
330
+    })
331
+    const { userInfo: { person: { personId } } } = this.props
332
+    const params = {
333
+      personId,
334
+      pageNumber: 1,
335
+      pageSize: 999,
336
+    }
337
+    this.getPreselection(params)
338
+    this.getRaise(params)
339
+  }
340
+  ScreenBtn() {
341
+    this.setState({
342
+      screenVisible: false
343
+    })
344
+    const { userInfo: { person: { personId } } } = this.props
345
+    const { buildingId, salesBatchId, houseLockingStatus, apartmentId, customerLocked } = this.state
346
+
347
+    if (this.state.current == '0') {
348
+
349
+      const params = {
350
+        personId,
351
+        pageNumber: 1,
352
+        pageSize: 999,
353
+        buildingId,
354
+        salesBatchId,
355
+        apartmentId,
356
+        houseLockingStatus,
357
+        customerLocked
358
+      }
359
+      this.getPreselection(params)
360
+    } else {
361
+
362
+      const params = {
363
+        personId,
364
+        pageNumber: 1,
365
+        pageSize: 999,
366
+        buildingId,
367
+        salesBatchId,
368
+        houseLockingStatus,
369
+      }
370
+
371
+      this.getRaise(params)
372
+    }
373
+
374
+
375
+  }
376
+
377
+  renderPreselectScreen() {
378
+    const { current, buildingValue, buildingList, saleBatch, salesList, apartmentList, apartmentValue, lockCustomerValue, lockCustomer, lockStatusValue, lockStatus } = this.state
379
+
380
+    const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
381
+
382
+    return (
383
+
384
+      <View className="base-con">
385
+        <PickerComponent title="选择楼盘" selector={buildingList} keyValue={"buildingName"} currentValue={buildingValue || ''} handleChange={this.handleBuildingChange} />
386
+        <PickerComponent title="选择销售批次" selector={salesList} keyValue={"salesBatchName"} currentValue={saleBatch || ''} handleChange={this.handleSaleBatchChange} />
387
+        {current == '0' && <PickerComponent title="选择户型" selector={apartmentList} keyValue={"apartmentName"} currentValue={apartmentValue || ''} handleChange={this.handleApartmentChange} />}
388
+        <PickerComponent title="锁定状态" selector={lockStatus} keyValue={"value"} currentValue={lockStatusValue || ''} handleChange={this.handleLockStatusChange} />
389
+        {current == '0' && <PickerComponent title="锁定客户" keyValue={"value"} selector={lockCustomer} currentValue={lockCustomerValue || ''} handleChange={this.handleCustomerChange} />}
390
+
391
+        <View className="bottom-btn">
392
+          <View className="save" onClick={this.ScreenBtn}>
393
+            筛选
394
+            </View>
395
+          <View className="cancel" onClick={this.unlimitedBtn}>
396
+            不限
397
+          </View>
398
+        </View>
399
+      </View>
400
+    )
401
+  }
402
+
403
+
404
+  handleScreenClick() {
405
+
406
+
407
+    this.setState({
408
+      screenVisible: true
409
+    })
410
+
411
+  }
412
+  handleCondition(value) {
413
+    this.setState({
414
+      current: value,
415
+      buildingValue: '',
416
+      buildingId: '',
417
+      saleBatch: '',
418
+      salesBatchId: '',
419
+      apartmentValue: '',
420
+      apartmentId: '',
421
+      lockStatusValue: '',
422
+      houseLockingStatus: '',
423
+      lockCustomerValue: '',
424
+      customerLocked: '',
425
+
426
+
427
+    })
428
+  }
429
+  renderBar() {
430
+    const { current } = this.state
431
+    const condition = [{ title: '预选记录', value: 0 }, { title: '认筹单', value: 1 }]
432
+
433
+    return (
434
+      <Block>
435
+        <View className="screen-top">
436
+          <View className="flex">
437
+            {condition.map(item => (
438
+              <View key={item.value} onClick={() => this.handleCondition(item.value)} className={current == item.value ? 'top-item active' : 'top-item'}>
439
+                {item.title}
440
+              </View>
441
+            ))}
442
+          </View>
443
+          <View onClick={this.handleScreenClick}>
444
+            <Image style="width:50rpx;height:50rpx" src={transferImage(require('../../assets/screen.png'))}></Image>
445
+          </View>
446
+        </View>
447
+        {current == 0 && this.renderPreselection()}
448
+        {current == 1 && this.renderRaise()}
449
+      </Block>
450
+    )
451
+  }
49 452
   render() {
50
-    const { recordList } = this.state
51 453
 
454
+    const { screenVisible } = this.state
52 455
     return (
53 456
       <View className="records" >
54
-
55
-        {
56
-          !recordList.length ? <Blank tips="暂无预选记录" /> :
57
-            <ScrollView scrollY>
58
-              {
59
-                recordList.map((item) => {
60
-                  return (
61
-                    <Block>
62
-                      {item.status == '1' && <View className="carditem" key={item.preselectionRecordId} onClick={() => this.toHouseDetail(item)}>
63
-                        <HouseCard summary={item} />
64
-                      </View>}
65
-                    </Block>
66
-                  )
67
-                })
68
-              }
69
-            </ScrollView >
70
-        }
457
+        {!screenVisible && this.renderBar()}
458
+        {screenVisible && this.renderPreselectScreen()}
71 459
 
72 460
       </View >
73 461
     )

+ 127
- 4
src/onlineSelling/pages/records/index.scss Näytä tiedosto

@@ -1,9 +1,132 @@
1
+@import "@/styles/theme.scss";
2
+
1 3
 .records {
2
-  padding: 10px 0;
4
+  background-color: #F8F8F8;
5
+  min-height: 100vh;
6
+  .screen-top{
7
+    display: flex;
8
+    align-items: center;
9
+    justify-content: space-between;
10
+    height:100px;
11
+    background:rgba(248,248,248,1);
12
+    font-size: 34px;
13
+    color: #666;
14
+    padding: 0 30px;
15
+    font-size: 400;
16
+    .flex{
17
+      display: flex;
18
+      align-items: center;
19
+      .top-item{
20
+        width:164px;
21
+        height:48px;
22
+        font-size:24px;
23
+        font-weight:300;
24
+        color: #333;
25
+        line-height: 48px;
26
+        background:rgba(255,255,255,1);
27
+        border:1px solid rgba(228,228,228,1);
28
+        box-shadow:0px 4px 12px 0px rgba(255,171,50,0.08);
29
+        border-radius:24px;
30
+        margin-right: 30px;
31
+        text-align: center;
32
+  
33
+      }
34
+      .active{
35
+        background-color: #BB9C79;
36
+        color: #fff;
37
+      }
38
+    }
39
+  }
40
+  .checkbox{
41
+    display: block;
42
+    height: 250px;
43
+    background-color: #fff;
44
+    padding-left: 30px;
45
+    margin-bottom: 20px;
46
+  }
47
+  .container {
48
+    height: calc(100vh - 100px);
49
+  }
50
+  .raise-box{
51
+    position: fixed;
52
+    width: 100vw;
53
+    padding: 30px;
54
+    .raise-btn{
55
+     
56
+      height:94px;
57
+      line-height: 94px;
58
+      background:rgba(187,156,121,1);
59
+      border-radius:10px;
60
+      color: #fff;
61
+      font-size: 36px;
62
+      text-align: center;
63
+    }  
64
+  }
65
+}
3 66
 
4
-  .carditem {
5
-    & + .carditem {
6
-      margin-top: 40px;
67
+.base-con{
68
+  width: 100vw;
69
+  height:100vh;
70
+  background-color: #fff;
71
+  padding: 0 30px;
72
+  border-radius:12px;
73
+  .con-item{
74
+    display: flex;
75
+    justify-content: space-between;
76
+    margin-bottom: 30px;
77
+   
78
+    .title{
79
+      font-size: 33px;
80
+      color: #333;
81
+    } 
82
+  }
83
+
84
+  .con-picker{
85
+    display: flex;
86
+    align-items: center;
87
+    justify-content: space-between;
88
+    width:456px;
89
+    height:48px ;
90
+    line-height: 48px;
91
+    padding: 0 16px;
92
+    border: 1px solid #dcdcdc;
93
+    border-radius: 4px;
94
+    .picker{
95
+      width: 400px;
96
+    }
97
+  }
98
+  .right-icon{
99
+    width:18px;
100
+    height:18px;
101
+    border-top: 2px solid #999;
102
+    border-right: 2px solid #999;
103
+    transform:rotate(45deg);
104
+    float: right;
105
+  }
106
+  .bottom-btn{
107
+
108
+    font-size: 34px;
109
+    position: absolute;
110
+    width: 690px;
111
+    top: 70vh;
112
+  
113
+    .save{
114
+      background-color: $primary-color;
115
+      color:#fff;
116
+      height: 94px;
117
+      line-height: 94px;
118
+      text-align: center;
119
+      border-radius:10px;
120
+      border:2px solid $primary-color;
121
+      margin-bottom: 40px;
122
+    }
123
+    .cancel{
124
+      color: 333;
125
+      text-align: center;
126
+      height: 94px;
127
+      line-height: 94px;
128
+      border-radius:10px;
129
+      border:2px solid #dcdcdc;
7 130
     }
8 131
   }
9 132
 }

+ 2
- 6
src/onlineSelling/pages/screenHouse/index.js Näytä tiedosto

@@ -18,11 +18,7 @@ export default class Index extends Component {
18 18
     priceCurrent: 0,
19 19
     startPrice: '100',
20 20
     endPrice: null,
21
-    apartmentList: [
22
-      // { apartmentName: 'A 户型', buildingArea: '149', area2: '131' },
23
-      // { apartmentName: 'B 户型', buildingArea: '95', area2: '84.7' },
24
-      // { apartmentName: 'C 户型', buildingArea: '95', area2: '84.7' },
25
-    ]
21
+    apartmentList: []
26 22
   }
27 23
 
28 24
   componentWillMount() {
@@ -118,7 +114,7 @@ export default class Index extends Component {
118 114
               <View className='construction__area'>
119 115
                 <Text>{apartmentItem.buildingArea ? '建筑面积约' + apartmentItem.buildingArea + 'm²' : '建筑面积待定'}</Text>
120 116
                 {
121
-                  apartmentItem.area2 ? <Text>使用面积约{apartmentItem.area2}m²</Text> : <Text>使用面积待定</Text>
117
+                  apartmentItem.insideArea ? <Text>使用面积约{apartmentItem.insideArea}m²</Text> : <Text>使用面积待定</Text>
122 118
                 }
123 119
               </View>
124 120
             </View>

+ 0
- 105
src/onlineSelling/pages/selectionRecord/index.js Näytä tiedosto

@@ -1,105 +0,0 @@
1
-import Taro, { Component } from '@tarojs/taro';
2
-import './index.scss'
3
-import HouseCard from '../../components/HouseCard'
4
-import Blank from '../../components/Blank'
5
-import { AtTabs, AtTabsPane } from 'taro-ui'
6
-import "taro-ui/dist/style/components/tabs.scss"
7
-import { connect } from '@tarojs/redux'
8
-
9
-
10
-@connect(({ user, city }) => ({ user, city }))
11
-export default class selectionRecord extends Component {
12
-
13
-  config = {
14
-    navigationBarTitleText: '选房记录'
15
-  }
16
-
17
-  state = {
18
-    current: 0,
19
-    recordId: undefined, // 埋点ID
20
-    testData: [
21
-      {
22
-        preselectionRecordId: 1,
23
-        buildingName: '艾菲国际二期',
24
-        blockName: '6栋',
25
-        unitName: '一单元',
26
-        roomName: '1502',
27
-        aerialViewImg: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1573738541467-25667811-b020-4c1f-b57d-e65a410d6fbd3103856559286073565.jpg',
28
-        price: '234万',
29
-        createDate: '2020-02-8',
30
-        status: 1
31
-      },
32
-      {
33
-        preselectionRecordId: 2,
34
-        buildingName: '艾菲国际二期',
35
-        blockName: '6栋',
36
-        unitName: '一单元',
37
-        roomName: '1502',
38
-        aerialViewImg: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1573738541467-25667811-b020-4c1f-b57d-e65a410d6fbd3103856559286073565.jpg',
39
-        price: '234万',
40
-        createDate: '2020-02-9',
41
-        status: 0
42
-      },
43
-      {
44
-        preselectionRecordId: 3,
45
-        buildingName: '艾菲国际二期',
46
-        blockName: '6栋',
47
-        unitName: '二单元',
48
-        roomName: '1503',
49
-        aerialViewImg: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1573738541467-25667811-b020-4c1f-b57d-e65a410d6fbd3103856559286073565.jpg',
50
-        price: '234万',
51
-        createDate: '2020-02-10',
52
-        status: 1
53
-      },
54
-      {
55
-        preselectionRecordId: 4,
56
-        buildingName: '艾菲国际二期',
57
-        blockName: '6栋',
58
-        unitName: '二单元',
59
-        roomName: '1504',
60
-        aerialViewImg: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1573738541467-25667811-b020-4c1f-b57d-e65a410d6fbd3103856559286073565.jpg',
61
-        price: '234万',
62
-        createDate: '2020-02-11',
63
-        status: 0
64
-      },
65
-    ]
66
-  }
67
-
68
-  componentWillMount() {
69
-
70
-  }
71
-
72
-
73
-  handleClick(value) {
74
-    this.setState({
75
-      current: value
76
-    })
77
-  }
78
-
79
-
80
-  render() {
81
-    const { testData } = this.state
82
-    return (
83
-      <View style="height:100vh">
84
-        <AtTabs className="selectionRecord" scroll current={this.state.current} tabList={[{ title: '预选记录' }, { title: '认筹记录' }]} onClick={this.handleClick.bind(this)}>
85
-          <AtTabsPane current={this.state.current} index={0} >
86
-            {
87
-              testData.map((item) => {
88
-                return (
89
-                  <View className="carditem" key={item.preselectionRecordId}>
90
-                    <HouseCard summary={item} />
91
-                  </View>
92
-                )
93
-              })
94
-            }
95
-          </AtTabsPane>
96
-          <AtTabsPane current={this.state.current} index={1}>
97
-            <View>
98
-              <Blank tips="暂无认筹记录" />
99
-            </View>
100
-          </AtTabsPane>
101
-        </AtTabs>
102
-      </View>
103
-    )
104
-  }
105
-}

+ 0
- 28
src/onlineSelling/pages/selectionRecord/index.scss Näytä tiedosto

@@ -1,28 +0,0 @@
1
-@import "@/styles/mixins.scss";
2
-@import "@/styles/theme.scss";
3
-.selectionRecord{
4
-    .at-tabs__header{
5
-      width: 86%;
6
-      background-color: #fff;
7
-      box-shadow:0px 4px 12px 0px rgba(0,0,0,0.12);
8
-      margin: 20px auto 10px auto;
9
-      border-radius: 44px;
10
-    }
11
-    .at-tabs__item{
12
-      width:50%;
13
-      flex: none;
14
-      color: #333;
15
-      font-size: 28px;
16
-    }
17
-    .at-tabs__item--active{
18
-      color: $primary-color;
19
-      background-color: #f4f4f4;
20
-    }
21
-    .at-tabs__item-underline{
22
-      height: 0;
23
-    }
24
-    .at-tabs__underline{
25
-      display: none;
26
-    }
27
-  
28
-}

+ 1
- 0
src/pages/activity/index.js Näytä tiedosto

@@ -134,6 +134,7 @@ export default class Index extends Component {
134 134
     return (
135 135
       <ListView
136 136
         className="wrap"
137
+        style="height: calc(100vh - 118rpx);"
137 138
         needInit
138 139
         isEmpty={isEmpty}
139 140
         emptyText="暂无活动~"

+ 6
- 0
src/pages/activity/index.scss Näytä tiedosto

@@ -31,3 +31,9 @@
31 31
   }
32 32
 
33 33
 }
34
+.at-tabs-pane--active{
35
+  height: 100vh!important;
36
+  overflow: scroll;
37
+  padding-bottom: 100px;
38
+
39
+}

+ 1
- 0
src/pages/news/index.js Näytä tiedosto

@@ -115,6 +115,7 @@ export default class Index extends Component {
115 115
     return (
116 116
       <ListView
117 117
         className="wrap"
118
+        style="height: calc(100vh - 118rpx);"
118 119
         needInit
119 120
         isEmpty={isEmpty}
120 121
         emptyText="暂无资讯~"

+ 1
- 1
src/pages/person/spread/index.js Näytä tiedosto

@@ -78,7 +78,7 @@ export default class Index extends Component {
78 78
       <Block>
79 79
         {/* 生成海报 */}
80 80
         {makePosterStatus && (<Poster data={posterData} toggle={this.toggleVisiblePoster}></Poster>)}
81
-        <View className='page'>
81
+        <View className='spread-page'>
82 82
           <View className='spread-code'>
83 83
             <View className='spread-code-head'>
84 84
               <Image src={avatarurl} className='spread-code-head_img'></Image>

+ 2
- 2
src/pages/person/spread/index.scss Näytä tiedosto

@@ -1,8 +1,8 @@
1 1
 @import "@/styles/theme.scss";
2
-.page {
2
+.spread-page {
3 3
   position: relative;
4 4
   width: 100%;
5
-  height: 100%;
5
+  height: 100vh;
6 6
   background: #f0f0f0;
7 7
 }
8 8
 .spread-code {

+ 111
- 0
src/pages/project/NavIcons/icons.js Näytä tiedosto

@@ -0,0 +1,111 @@
1
+import { ROLE_CODE } from '@/constants/user'
2
+
3
+export default [
4
+  {
5
+    iconCode: 'integralMall',
6
+    iconName: '赚积分',
7
+    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811839725-mall-icon.png',
8
+    tab: '/pages/shop/index',
9
+    default: true,
10
+  },
11
+  {
12
+    iconCode: 'refercustomers',
13
+    iconName: '推荐客户',
14
+    page: ({ city, personType }) => {
15
+      if (personType === ROLE_CODE['CONSULTANT']) return false;
16
+
17
+      return `/useless/pages/agent/recommend/index?type=index&cityId=${(city || {}).id}`
18
+    },
19
+    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811691300-recommend-icon.png',
20
+    default: true,
21
+  },
22
+  {
23
+    iconCode: 'buyingEncyclopedia',
24
+    iconName: '购房须知',
25
+    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811865979-encyclopedia-icon.png',
26
+    page: '/pages/policy/index?from=mine',
27
+    default: true,
28
+  },
29
+  {
30
+    iconCode: 'findRoom',
31
+    iconName: '选好房',
32
+    page: '/pages/project/map/index',
33
+    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811880140-map-icon.png',
34
+    default: true,
35
+  },
36
+  {
37
+    iconCode: 'Highlyrecommented',
38
+    iconName: '重点推荐',
39
+    page: '/pages/project/highlyRecommented',
40
+  },
41
+  {
42
+    iconCode: 'MortgageCalculator',
43
+    iconName: '算房贷',
44
+    page: '/pages/toolKit/index',
45
+  },
46
+  {
47
+    iconCode: 'PropertyListing',
48
+    iconName: '楼盘列表',
49
+    page: '/pages/project/list/index',
50
+  },
51
+  {
52
+    iconCode: 'EventInformation',
53
+    iconName: '活动资讯',
54
+    tab: '/pages/activity/activity',
55
+  },
56
+  {
57
+    iconCode: 'Popularactivities',
58
+    iconName: '参加活动',
59
+    tab: '/pages/activity/activity',
60
+  },
61
+  {
62
+    iconCode: 'LatestInformation',
63
+    iconName: '最新资讯',
64
+    tab: '/pages/activity/activity',
65
+  },
66
+  {
67
+    iconCode: 'Myclient',
68
+    iconName: '我的客户',
69
+    page: '/useless/pages/agent/client/index',
70
+  },
71
+  {
72
+    iconCode: 'MyActivities',
73
+    iconName: '我的活动',
74
+    page: '/pages/activity/myActivity?from=mine',
75
+  },
76
+  {
77
+    iconCode: 'Myhelp',
78
+    iconName: '我的助力',
79
+    page: '/pages/activity/assistancePage',
80
+  },
81
+  {
82
+    iconCode: 'Mygroup',
83
+    iconName: '我的拼团',
84
+    page: '/pages/activity/assemblePage',
85
+  },
86
+  {
87
+    iconCode: 'MyFavorites',
88
+    iconName: '我的收藏',
89
+    page: '/pages/person/favorite/index',
90
+  },
91
+  {
92
+    iconCode: 'MyInformation',
93
+    iconName: '我的资料',
94
+    page: '/useless/pages/person/profile/index',
95
+  },
96
+  {
97
+    iconCode: 'Mymessage',
98
+    iconName: '我的消息',
99
+    page: '/pages/im/list/index',
100
+  },
101
+  {
102
+    iconCode: 'Exchangerecords',
103
+    iconName: '兑换记录',
104
+    page: '/useless/pages/shop/record/index',
105
+  },
106
+  {
107
+    iconCode: 'Feedback',
108
+    iconName: '意见反馈',
109
+    page: '/useless/pages/person/feedback/index',
110
+  },
111
+]

+ 56
- 0
src/pages/project/NavIcons/index.js Näytä tiedosto

@@ -0,0 +1,56 @@
1
+import { isFunction, isEmpty } from '@/utils/tools'
2
+import allIcons from './icons'
3
+import './index.scss'
4
+
5
+const defaultIcons = allIcons.filter(x => x.default)
6
+
7
+export default function (props) {
8
+  const iconList = props.iconList && props.iconList.length ? props.iconList : defaultIcons
9
+  const showIcons = iconList.map((icon) => {
10
+    const defIcon = allIcons.filter(x => icon.iconCode === x.iconCode)[0]
11
+
12
+    if (!defIcon) return false;
13
+
14
+    const navIcon = {
15
+      ...defIcon,
16
+      ...icon,
17
+    }
18
+
19
+    if (isEmpty(navIcon.page) && isEmpty(navIcon.tab)) return false;
20
+
21
+    if (isFunction(navIcon.page)) {
22
+      const pg = navIcon.page(props)
23
+      if (!pg) return false;
24
+
25
+      return { ...navIcon, page: pg }
26
+    }
27
+
28
+    return navIcon
29
+  }).filter(Boolean)
30
+
31
+  const naviTo = (icon) => {
32
+    const { page, tab } = icon || {}
33
+
34
+    if (tab) {
35
+      Taro.switchTab({ url: tab })
36
+    } else {
37
+      Taro.navigateTo({ url: page })
38
+    }
39
+  }
40
+
41
+  return (
42
+    <View className="navicons" style={showIcons.length == 3 ? "padding:0 8%" : ""}>
43
+        {showIcons.map((item) => (
44
+            <View onClick={() => naviTo(item)} className="nav-item" key={item.iconCode}>
45
+                <Image className="icon" src={item.iconUrl} ></Image>
46
+                <View className="nav-text">
47
+                  <Text>{item.iconName}</Text>
48
+                  { item.iconCode== 'refercustomers' && 
49
+                    <Image style="width:30rpx;height:30rpx;margin-left:4rpx" src={require('@/assets/award.png')} ></Image>
50
+                  }
51
+                </View>
52
+            </View>
53
+        ))}
54
+    </View>
55
+  )
56
+}

+ 26
- 0
src/pages/project/NavIcons/index.scss Näytä tiedosto

@@ -0,0 +1,26 @@
1
+.navicons {
2
+  width:690px;
3
+  height:188px;
4
+  background:#fff;
5
+  box-shadow:0px 4px 12px 0px rgba(0,0,0,0.12);
6
+  border-radius:12px;
7
+  display: flex;
8
+  align-items: center;
9
+  justify-content: space-between;
10
+  margin: -64px auto 0 auto;
11
+  position: relative;
12
+  .nav-item{
13
+    text-align: center;
14
+    width: 25%;
15
+    .icon{
16
+      width:84px;
17
+      height:84px;
18
+    }
19
+    .nav-text{
20
+      display: flex;
21
+      align-items: center;
22
+      justify-content: center;
23
+      
24
+    }
25
+  }
26
+}

+ 5
- 3
src/pages/project/h5Page.js Näytä tiedosto

@@ -9,7 +9,7 @@ import { connect } from '@tarojs/redux'
9 9
 import { ROLE_CODE } from '@/constants/user'
10 10
 import { getQrCodeParams } from '@/utils/qrcode'
11 11
 import { getMiniQrcode, savePoint, updatePoint } from '@/services/common'
12
-import { isEmpty } from '@/utils/tools'
12
+import { isEmpty, parseURL } from '@/utils/tools'
13 13
 import { rule as ruleToast } from '@/utils/ruleToast'
14 14
 import { share as shareSavePoint } from '@/utils/shareSavePoint'
15 15
 import { report as reportCustomer } from '@/utils/customer'
@@ -381,12 +381,14 @@ export default class Index extends Component {
381 381
 
382 382
     const showH5 = !isEmpty(h5Id) && pageInfo.h5Address && pageInfo.h5Address !== 'about' && pageInfo.h5Address !== 'http://about' && pageInfo.h5Address !== 'https://about'
383 383
 
384
-    // console.log('----web-h5------>', showH5, `${pageInfo.h5Address}?${webUrlParams}`)
384
+    const originURL = parseURL(pageInfo.h5Address) || {}
385
+    const queryString = [webUrlParams, originURL.query].join('&')
386
+    const webURL = [`${originURL.origin}${originURL.path}?${queryString}`, originURL.hash].join('#')
385 387
 
386 388
     return (
387 389
       <Block>
388 390
         {this.renderMaskBanner()}
389
-        {webViewVisible && showH5 && <WebView src={`${pageInfo.h5Address}?${webUrlParams}`} />}
391
+        {webViewVisible && showH5 && <WebView src={webURL} />}
390 392
       </Block>
391 393
     )
392 394
   }

+ 0
- 144
src/pages/project/icons.js Näytä tiedosto

@@ -1,144 +0,0 @@
1
-import { ROLE_CODE } from '@/constants/user'
2
-
3
-const icons = {
4
-    shop: require('@/assets/index/mall-icon.png'),
5
-    encyclopedia: require('@/assets/index/encyclopedia-icon.png'),
6
-    recommend: require('@/assets/index/recommend-icon.png'),
7
-    map: require('@/assets/index/map-icon.png'),
8
-    calculator: require('@/assets/index/calculator-icon.png'),
9
-    Highlyrecommented: require('@/assets/index/recommend.png'),
10
-}
11
-
12
-const DRIFT = ROLE_CODE['DRIFT']
13
-const CUSTOMER = ROLE_CODE['CUSTOMER']
14
-const CONSULTANT = ROLE_CODE['CONSULTANT']
15
-// const ESTATE_AGENT = ROLE_CODE['ESTATE_AGENT']
16
-// const CHANNEL_AGENT = ROLE_CODE['CHANNEL_AGENT']
17
-
18
-const menus = [
19
-
20
-    {
21
-        name: '赚积分',
22
-        url: '/pages/shop/index',
23
-        icon: icons.shop,
24
-        switchTab: true,
25
-        iconCode: 'integralMall',
26
-    },
27
-    {
28
-        name: '购房须知',
29
-        url: '/pages/policy/index?from=mine',
30
-        icon: icons.encyclopedia,
31
-        iconCode: 'buyingEncyclopedia'
32
-    },
33
-    {
34
-        name: '推荐客户',
35
-        url: '/useless/pages/agent/recommend/index?type=index&cityId=',
36
-        icon: icons.recommend,
37
-        iconCode: 'refercustomers',
38
-        city: true,
39
-    },
40
-    {
41
-        name: '选好房',
42
-        url: '/pages/project/map/index',
43
-        icon: icons.map,
44
-        iconCode: 'findRoom'
45
-    },
46
-    {
47
-        name: '重点推荐',
48
-        url: '/pages/project/highlyRecommented',
49
-        icon: icons.Highlyrecommented,
50
-        iconCode: 'Highlyrecommented'
51
-    },
52
-    {
53
-        name: '算房贷',
54
-        url: '/pages/toolKit/index',
55
-        icon: icons.calculator,
56
-        iconCode: 'MortgageCalculator'
57
-    },
58
-
59
-    {
60
-        name: '楼盘列表',
61
-        url: '/pages/project/list/index',
62
-        icon: icons.buildingList,
63
-        iconCode: 'PropertyListing'
64
-    },
65
-    {
66
-        name: '活动资讯',
67
-        url: '/pages/activity/activity',
68
-        icon: icons.calculator,
69
-        iconCode: 'EventInformation',
70
-        switchTab: true,
71
-    },
72
-    {
73
-        name: '参加活动',
74
-        url: '/pages/activity/activity',
75
-        icon: icons.activity,
76
-        iconCode: 'Popularactivities',
77
-        switchTab: true,
78
-    },
79
-    {
80
-        name: '最新资讯',
81
-        url: '/pages/activity/activity',
82
-        icon: icons.news,
83
-        iconCode: 'LatestInformation',
84
-        switchTab: true,
85
-    },
86
-    {
87
-        name: '我的客户',
88
-        url: '/useless/pages/agent/client/index',
89
-        icon: icons.myGuest,
90
-        iconCode: 'Myclient',
91
-    },
92
-    {
93
-        name: '我的活动',
94
-        url: '/pages/activity/myActivity?from=mine',
95
-        icon: icons.activities,
96
-        iconCode: 'MyActivities'
97
-    },
98
-    {
99
-        name: '我的助力',
100
-        url: '/pages/activity/assistancePage',
101
-        icon: icons.help,
102
-        iconCode: 'Myhelp'
103
-    },
104
-    {
105
-        name: '我的拼团',
106
-        url: '/pages/activity/assemblePage',
107
-        icon: icons.group,
108
-        iconCode: 'Mygroup'
109
-    },
110
-    {
111
-        name: '我的收藏',
112
-        url: '/pages/person/favorite/index',
113
-        icon: icons.collection,
114
-        iconCode: 'MyFavorites'
115
-    },
116
-    {
117
-        name: '我的资料',
118
-        url: '/useless/pages/person/profile/index',
119
-        icon: icons.profile,
120
-        iconCode: 'MyInformation'
121
-    },
122
-    {
123
-        name: '我的消息',
124
-        url: '/pages/im/list/index',
125
-        icon: icons.chatList,
126
-        iconCode: 'Mymessage'
127
-    },
128
-    {
129
-        name: '兑换记录',
130
-        url: '/useless/pages/shop/record/index',
131
-        icon: icons.exchange,
132
-        iconCode: 'Exchangerecords'
133
-    },
134
-    {
135
-        name: '意见反馈',
136
-        url: '/useless/pages/person/feedback/index',
137
-        icon: icons.feedback,
138
-        iconCode: 'Feedback'
139
-    },
140
-
141
-
142
-]
143
-
144
-export { icons, menus }

+ 10
- 123
src/pages/project/index.js Näytä tiedosto

@@ -5,29 +5,17 @@ import Banner from './banner'
5 5
 import Newsbanner from './newsbanner'
6 6
 import Activity from './activity'
7 7
 import BannerTwo from './swiper'
8
-// import ActivityItem from '../activity/item'
9 8
 import ready from '@/utils/ready'
10
-import { getLocationCity } from '@/services/map'
11
-import { queryBanners, savePoint, updatePoint, queryExtContents, queryIndexIcons } from '@/services/common'
9
+import { savePoint, updatePoint, queryExtContents, queryIndexIcons } from '@/services/common'
12 10
 import { queryHelpGroup } from '@/services/news'
13 11
 import { getIndexShare } from '@/services/user'
14
-// import { queryActivityList } from '@/services/activity'
15 12
 import { dispatchCitySelected } from '@/actions/city'
16
-import { ROLE_CODE, DECREASE_UNREADNUM } from '@/constants/user'
17 13
 import { SET_SCREEN_SHOWED } from '@/constants/project'
18 14
 import { getStore, connect } from '@tarojs/redux'
19 15
 import * as actions from '@/actions/project'
20 16
 import { transferImage } from '@/utils/tools'
21 17
 import Notice from '@/components/Notice'
22
-import { menus } from './icons'
23
-import Menus from '@/components/indexMenus'
24
-
25
-const bgImg = "https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1578724562550-background.png"
26
-// import { getIndexPreloadData } from '@/utils/preload'
27
-// import Authorize from '@/components/authorize'
28
-// import * as noticeType from '@/constants/common.js'
29
-
30
-// const { miniProgram: { appId } } = wx.getAccountInfoSync();
18
+import NavIcons from './NavIcons'
31 19
 
32 20
 @connect(
33 21
   state => ({ ...state.project, ...state.city, ...state.user, system: state.system }),
@@ -57,7 +45,7 @@ export default class Index extends Component {
57 45
     propagandaBanner: [],
58 46
     newsShow: false,
59 47
     city: null,
60
-    menusList: [],
48
+    iconList: [],
61 49
   }
62 50
 
63 51
   componentWillMount() {
@@ -66,7 +54,7 @@ export default class Index extends Component {
66 54
 
67 55
     ready.queue(() => {
68 56
 
69
-      Taro.setNavigationBarTitle({ title: `${this.props.userInfo.miniApp.name}欢迎` })
57
+      Taro.setNavigationBarTitle({ title: `${this.props.userInfo.miniApp.name}欢迎` })
70 58
       const city = this.state.city || this.props.curCity
71 59
       this.loadData({ curCity: city })
72 60
 
@@ -87,58 +75,9 @@ export default class Index extends Component {
87 75
   }
88 76
 
89 77
   getIndexIcons() {
90
-
91 78
     queryIndexIcons().then(res => {
92
-      if (res.length) {
93
-        const Arr = [];
94
-
95
-        res.forEach(item => {
96
-          menus.forEach(menu => {
97
-            if (menu.iconCode == item.iconCode) {
98
-              Arr.push(menu);
99
-            }
100
-          })
101
-        })
102
-        const { userInfo: { person: { personType } } } = this.props
103
-        this.setState({
104
-          menusList: personType == ROLE_CODE['CONSULTANT'] ? Arr.filter(item => item.iconCode != 'refercustomers') : Arr
105
-        })
106
-      } else {
107
-        const iconList = [
108
-          {
109
-            iconCode: 'integralMall',
110
-            iconName: '赚积分',
111
-            iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811839725-mall-icon.png'
112
-          },
113
-          {
114
-            iconCode: 'refercustomers',
115
-            iconName: '推荐客户',
116
-            iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811691300-recommend-icon.png',
117
-          },
118
-          {
119
-            iconCode: 'buyingEncyclopedia',
120
-            iconName: '购房须知',
121
-            iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811865979-encyclopedia-icon.png'
122
-          },
123
-          {
124
-            iconCode: 'findRoom',
125
-            iconName: '选好房',
126
-            iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811880140-map-icon.png',
127
-
128
-          },
129
-        ]
130
-        const newArr = [];
131
-        iconList.forEach(item => {
132
-          menus.forEach(menu => {
133
-            if (menu.iconCode == item.iconCode) {
134
-              newArr.push(menu);
135
-            }
136
-          })
137
-        })
138
-        const { userInfo: { person: { personType } } } = this.props
139
-        this.setState({
140
-          menusList: personType == ROLE_CODE['CONSULTANT'] ? newArr.filter(item => item.iconCode != 'refercustomers') : newArr
141
-        })
79
+      if (res && res.length) {
80
+        this.setState({ iconList: res })
142 81
       }
143 82
     })
144 83
   }
@@ -179,57 +118,6 @@ export default class Index extends Component {
179 118
     recordId && updatePoint(recordId)
180 119
   }
181 120
 
182
-  // getLocation() {
183
-  //   Taro.getLocation().then(location => {
184
-  //     Taro.setStorageSync('lat', location.latitude)
185
-  //     Taro.setStorageSync('lon', location.longitude)
186
-
187
-  //     const payload = { location: `${location.longitude},${location.latitude}` }
188
-
189
-  //     getLocationCity(payload).then(res => {
190
-  //       if (!res || !res.id) {
191
-  //         Taro.showToast({
192
-  //           title: '未查询到当前城市信息, 请手动选择',
193
-  //           icon: 'none',
194
-  //           duration: 3000,
195
-  //         })
196
-  //       } else {
197
-  //         this.setState({ city: res })
198
-  //         this.loadData({ curCity: res })
199
-  //         this.updateCity(res)
200
-  //       }
201
-  //     }).catch(err => {
202
-  //       console.error(err)
203
-
204
-  //       Taro.showToast({
205
-  //         title: '服务错误, 请手动选择城市',
206
-  //         icon: 'none',
207
-  //         duration: 3000,
208
-  //       })
209
-  //     })
210
-  //   }).catch(err => {
211
-  //     if (err.errMsg === 'getLocation:fail auth deny') {
212
-  //       Taro.showModal({
213
-  //         content: '请同意授权您的定位功能',
214
-  //         showCancel: false,
215
-  //         duration: 3000,
216
-  //       })
217
-  //     } else {
218
-  //       Taro.showToast({
219
-  //         title: `定位失败, 请手动选择城市: ${err.errMsg}`,
220
-  //         icon: 'none',
221
-  //         duration: 3000,
222
-  //       })
223
-  //     }
224
-
225
-  //     console.error(err)
226
-  //   })
227
-  // }
228
-
229
-  // updateCity(payload) {
230
-  //   this.props.dispatchCitySelected(payload)
231
-  // }
232
-
233 121
   loadData(props = {}) {
234 122
     this.loadHelpGroupList(props)
235 123
     this.loadList(props)
@@ -606,10 +494,9 @@ export default class Index extends Component {
606 494
     })
607 495
   }
608 496
   render() {
609
-    const { curCity } = this.props
610
-    const { achieve, helpGroupList, propagandaBanner, newsShow, menusList } = this.state
611
-    const { userInfo: { person: { personType, phone } } } = this.props
612
-    const { unReadNum, userInfo: { person } } = this.props
497
+    const { achieve, helpGroupList, propagandaBanner, newsShow, iconList } = this.state
498
+    const { curCity, unReadNum, userInfo: { person } } = this.props
499
+
613 500
     return (
614 501
       <Block>
615 502
         {this.state.loaded && (
@@ -653,7 +540,7 @@ export default class Index extends Component {
653 540
                 </View>
654 541
               </View>
655 542
               {/* 菜单栏 */}
656
-              <Menus menusList={menusList}></Menus>
543
+              <NavIcons city={curCity} person={person} iconList={iconList} ></NavIcons>
657 544
               {/* <View style={propagandaBanner.length > 0 ? "border-bottom:20rpx solid #f5f5f5" : ''}> */}
658 545
               <View style={(newsShow || propagandaBanner.length > 0) ? "border-bottom:20rpx solid #f5f5f5" : ''}>
659 546
                 {/* 展示位轮播图 */}

+ 5
- 0
src/pages/shop/index.scss Näytä tiedosto

@@ -156,7 +156,12 @@
156 156
     font-weight: bold;
157 157
   }
158 158
 }
159
+.at-tabs-pane--active{
160
+  height: 100vh!important;
161
+  overflow: scroll;
162
+  padding-bottom: 100px;
159 163
 
164
+}
160 165
 .list__wrap {
161 166
   margin-top: 20px;
162 167
   overflow: hidden;

+ 73
- 0
src/reducers/house.js Näytä tiedosto

@@ -0,0 +1,73 @@
1
+/**
2
+ * 房源相关
3
+ */
4
+
5
+ import {
6
+   ADD_CART,
7
+   SUB_CART,
8
+   FLUSH_TO_CART,
9
+   ADD_CONSULTANT,
10
+   CHOOSE_CONSULTANT,
11
+   MY_PRESELECT_RECORD,
12
+ } from '@/constants/house'
13
+
14
+const INITIAL_STATE = {
15
+  // 认筹临时选中房源
16
+  raiseCart: [],
17
+
18
+  // 置业顾问列表
19
+  consultantList: [],
20
+
21
+  // 认筹选中置业
22
+  chooseConsultant: undefined,
23
+
24
+  // 预选房源列表
25
+  mySelectHouses: [],
26
+}
27
+
28
+export default function(state = INITIAL_STATE, action) {
29
+  const { type, payload } = action
30
+
31
+  switch(type) {
32
+    // 加入临时选择
33
+    case ADD_CART:
34
+      return {
35
+        ...state,
36
+        raiseCart: state.raiseCart.filter(x => x.houseId != payload.houseId).concat(payload),
37
+      };
38
+
39
+    // 取消临时选择
40
+    case SUB_CART:
41
+      return {
42
+        ...state,
43
+        raiseCart: state.raiseCart.filter(x => x.houseId != payload.houseId),
44
+      };
45
+
46
+    //
47
+    case FLUSH_TO_CART:
48
+      return {
49
+        ...state,
50
+        raiseCart: payload,
51
+      };
52
+
53
+    case ADD_CONSULTANT:
54
+      return {
55
+        ...state,
56
+        consultantList: payload.records,
57
+      };
58
+
59
+    case CHOOSE_CONSULTANT:
60
+      return {
61
+        ...state,
62
+        chooseConsultant: payload,
63
+      };
64
+
65
+    case MY_PRESELECT_RECORD:
66
+      return {
67
+        ...state,
68
+        mySelectHouses: payload.records,
69
+      };
70
+    default:
71
+      return state;
72
+  }
73
+}

+ 2
- 0
src/reducers/index.js Näytä tiedosto

@@ -6,6 +6,7 @@ import shop from './shop'
6 6
 import news from './news'
7 7
 import city from './city'
8 8
 import system from './system'
9
+import house from './house'
9 10
 
10 11
 export default combineReducers({
11 12
   user,
@@ -15,4 +16,5 @@ export default combineReducers({
15 16
   news,
16 17
   city,
17 18
   system,
19
+  house,
18 20
 })

+ 4
- 1
src/services/getCode.js Näytä tiedosto

@@ -2,7 +2,8 @@ import { fetch } from '@/utils/request'
2 2
 import {
3 3
   API_GET_CODE,
4 4
   API_PUT_REGISTER,
5
-  API_PUT_REGISTERCONSULTANT
5
+  API_PUT_REGISTERCONSULTANT,
6
+  API_CHECK_CODE
6 7
 } from '@/constants/api'
7 8
 
8 9
 /**
@@ -11,6 +12,8 @@ import {
11 12
  */
12 13
 export const getCodeMessage = tel => fetch({ url: `${API_GET_CODE}?tel=${tel}`, method: 'POST' })
13 14
 
15
+export const checkCaptcha = (tel, captcha) => fetch({ url: `${API_CHECK_CODE}?tel=${tel}&captcha=${captcha}`, method: 'POST' })
16
+
14 17
 export const putRegister = payload => fetch({ url: `${API_PUT_REGISTER}?phone=${payload.tel}&&code=${payload.code}`, payload, method: 'PUT' })
15 18
 
16 19
 export const putRegisterConsultant = payload => fetch({ url: `${API_PUT_REGISTERCONSULTANT}`, method: 'PUT' })

+ 3
- 0
src/services/house.js Näytä tiedosto

@@ -0,0 +1,3 @@
1
+import { fetch, apis } from '@/utils/request'
2
+
3
+export const checkRaise = houseIdList => fetch({ url: `${apis.API_RAISE_CHECK}?houseIds=${houseIdList.join(',')}`, method: 'GET' })

+ 41
- 5
src/services/project.js Näytä tiedosto

@@ -2,12 +2,18 @@ import { fetch } from '@/utils/request'
2 2
 import {
3 3
   API_HOUSE_LIST,
4 4
   API_PRESELECTION_RECORD,
5
+  API_SALESBATCH_LIST,
6
+  API_RATSE_RECORD,
5 7
   API_HOUSE_DETAIL,
6 8
   API_ADD_PRESELECTION,
7 9
   API_CANCEL_PRESELECTION,
8 10
   API_APARTMENT_TYPE,
9 11
   API_NOTICE_INFO,
10
-  API_SALES_BATCH
12
+  API_SALES_BATCH,
13
+  API_RATSE_DETAIL,
14
+  API_RATSE_ORDER,
15
+  API_CANCEL_ORDER
16
+
11 17
 } from '@/constants/api'
12 18
 
13 19
 
@@ -21,12 +27,22 @@ export const queryHouseList = payload => fetch({ url: API_HOUSE_LIST, payload })
21 27
  * 获取房源分享信息
22 28
  * @param {*} id
23 29
  */
24
-export const querySalesInfo = id => fetch({ url: `${API_SALES_BATCH}/${id}`})
30
+export const querySalesInfo = id => fetch({ url: `${API_SALES_BATCH}/${id}` })
31
+/**
32
+ * 获取认筹单详情
33
+ * @param {*} id
34
+ */
35
+export const queryRaiseDetail = id => fetch({ url: `${API_RATSE_DETAIL}/${id}` })
36
+/**
37
+ * 认筹单线下缴费
38
+ * @param {*} id
39
+ */
40
+export const raiseOffline = id => fetch({ url: `${API_RATSE_DETAIL}/${id}`, method: 'PUT' })
25 41
 /**
26 42
  * 获取房源列表滚动提示
27 43
  * @param {*} id
28 44
  */
29
-export const queryNoticeInfo = id => fetch({ url: `${API_NOTICE_INFO}/${id}`})
45
+export const queryNoticeInfo = id => fetch({ url: `${API_NOTICE_INFO}/${id}` })
30 46
 
31 47
 /**
32 48
  * 预选房源
@@ -37,7 +53,7 @@ export const addPreselection = payload => fetch({ url: API_ADD_PRESELECTION, pay
37 53
  * 取消预选房源
38 54
  * @param {*} payload
39 55
  */
40
-export const cancelPreselection = payload => fetch({ url: `${API_CANCEL_PRESELECTION}?${'houseId='+payload.houseId}&${'personId='+payload.personId}`, method: 'DELETE' })
56
+export const cancelPreselection = payload => fetch({ url: `${API_CANCEL_PRESELECTION}?${'houseId=' + payload.houseId}&${'personId=' + payload.personId}`, method: 'DELETE' })
41 57
 /**
42 58
  * 获取房源详情
43 59
  * @param {*} payload
@@ -49,11 +65,31 @@ export const queryHouseDetail = payload => fetch({ url: API_HOUSE_DETAIL, payloa
49 65
  * @param {*} payload
50 66
  */
51 67
 export const queryPreselectionRecord = payload => fetch({ url: API_PRESELECTION_RECORD, payload })
68
+/**
69
+ * 获取认筹记录
70
+ * @param {*} payload
71
+ */
72
+export const queryRaiseRecord = payload => fetch({ url: API_RATSE_RECORD, payload })
73
+/**
74
+ * 获取销售批次列表
75
+ * @param {*} payload
76
+ */
77
+export const querySalesList = payload => fetch({ url: API_SALESBATCH_LIST, payload })
52 78
 /**
53 79
  * 获取某销售批次下所有房源户型
54 80
  * @param {*} payload
55 81
  */
56
-export const queryApartmentType= payload => fetch({ url: API_APARTMENT_TYPE, payload })
82
+export const queryApartmentType = payload => fetch({ url: API_APARTMENT_TYPE, payload })
83
+/**
84
+ *认筹下单接口
85
+ * @param {*} payload
86
+ */
87
+export const raiseOrder = payload => fetch({ url: API_RATSE_ORDER, payload, method: 'POST' })
88
+/**
89
+ *认筹单取消支付接口
90
+ * @param {*} payload
91
+ */
92
+export const cancelOrder = payload => fetch({ url: API_CANCEL_ORDER, payload, method: 'POST' })
57 93
 
58 94
 
59 95
 

+ 1
- 2
src/useless/pages/agent/recommend/index.js Näytä tiedosto

@@ -102,7 +102,6 @@ export default class Index extends Component {
102 102
       this.setState({
103 103
         recordId: res.recordId
104 104
       })
105
-      console.log('新增客户')
106 105
     })
107 106
   }
108 107
   componentWillUnmount() {
@@ -499,7 +498,7 @@ export default class Index extends Component {
499 498
     const visable = (!phone && !tel)
500 499
 
501 500
     return (
502
-      <View style="width:100%;height:100%">
501
+      <View style="width:100%;height:100vh">
503 502
         {visable ? this.renderLogin() : this.renderDetail()}
504 503
       </View>
505 504
     );

+ 1
- 0
src/useless/pages/person/customerAnalysis/followUpCustomer/index.js Näytä tiedosto

@@ -284,6 +284,7 @@ export default class followUpCustomer extends Taro.Component {
284 284
         <View style="padding:0 10px 10px 10px">
285 285
           <ListView
286 286
             className="wrap"
287
+            style="height: calc(100vh - 234rpx)"
287 288
             needInit
288 289
             isEmpty={isEmpty}
289 290
             emptyText="暂无跟进客户~"

+ 4
- 1
src/useless/pages/person/customerAnalysis/index.scss Näytä tiedosto

@@ -3,7 +3,7 @@
3 3
 .wrap {
4 4
   background: white;
5 5
   position: relative;
6
-  height:100vh;
6
+  // height:100vh;
7 7
 }
8 8
 .my-customer{
9 9
   flex: 0 0 50%;
@@ -55,6 +55,9 @@
55 55
   
56 56
   }
57 57
 }
58
+.at-tabs{
59
+  height: 100vh;
60
+}
58 61
 .tab-box{
59 62
   .at-tabs__header{
60 63
     width: 86%;

+ 1
- 0
src/useless/pages/person/customerAnalysis/transactionCustomer/index.js Näytä tiedosto

@@ -115,6 +115,7 @@ export default class transactionCustomer extends Taro.Component {
115 115
       <View style="padding:0 10px 10px 10px">
116 116
         <ListView
117 117
           className="wrap"
118
+          style="height: calc(100vh - 78rpx)"
118 119
           needInit
119 120
           isEmpty={isEmpty}
120 121
           emptyText="暂无成交客户~"

+ 0
- 0
src/utils/request.js Näytä tiedosto


Some files were not shown because too many files changed in this diff