ソースを参照

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into dev

张延森 5 年 前
コミット
8fd1da8a58

+ 2
- 1
src/constants/api.js ファイルの表示

@@ -108,7 +108,8 @@ export const API_HELP_SHARE = resolvePath('help/share')
108 108
 export const API_GROUP_SHARE = resolvePath('group/share')
109 109
 export const API_HFIVE_SHARE = resolvePath('h5/share')
110 110
 export const API_NEWS_SHARE = resolvePath('news/share')
111
-export const API_HOUSE_SHARE = resolvePath('house/share')
111
+export const API_HOUSE_SHARE = resolvePath('houseApp/share')
112
+export const API_HOUSE_POSTER = resolvePath('housePost/share')
112 113
 
113 114
 export const API_ACTIVITY_FAVOR = resolvePath('activity/save')
114 115
 export const API_NEWS_FAVOR = resolvePath('news/save')

+ 2
- 4
src/onlineSelling/components/HotBlock/index.js ファイルの表示

@@ -3,7 +3,7 @@ import './index.scss'
3 3
 
4 4
 function computeLevel (num) {
5 5
   switch (true) {
6
-    case num >= 200:
6
+    case num > 200:
7 7
       return 13;
8 8
     case num > 100:
9 9
       return 12;
@@ -12,9 +12,7 @@ function computeLevel (num) {
12 12
     case num > 40:
13 13
       return 10;
14 14
     case num > 30:
15
-      return 9;
16
-    case num > 20:
17
-      return 8;
15
+      return 9;    
18 16
     case num > 20:
19 17
       return 8;
20 18
     case num > 10:

+ 2
- 2
src/onlineSelling/components/HouseCard/index.js ファイルの表示

@@ -21,7 +21,7 @@ export default function HouseCard(props) {
21 21
   const thumb = (buildingImgList || []).length
22 22
   // const thumb = (buildingImgList || []).length ? transferImage((buildingImgList)[0].url) : emptyImg
23 23
   const showDT = dayjs(createDate).format('YYYY/MM/DD')
24
-  const wanY = Number(price / 10000).toFixed(0)
24
+  const wanY = Number(price).toFixed(0)
25 25
 
26 26
   return (
27 27
     <View className="housecard">
@@ -36,7 +36,7 @@ export default function HouseCard(props) {
36 36
         <View className="title">{title}</View>
37 37
         <View className="subtitle">
38 38
           <Text>现价</Text>
39
-          <Text className="red">{wanY+'万' || '待定'}</Text>
39
+          <Text className="red">{wanY + '万' || '待定'}</Text>
40 40
         </View>
41 41
         <View className="meta">{showDT}预选</View>
42 42
         <View className="sign bg-success"></View>

+ 6
- 5
src/onlineSelling/components/HouseGrid/Room.js ファイルの表示

@@ -3,7 +3,7 @@ import HotBlock from "../HotBlock";
3 3
 import './room.scss'
4 4
 
5 5
 export default function Room(props) {
6
-  const { roomName, heat, realHeat, price, apartmentName } = props.dataset || {}
6
+  const { roomName, heat, realHeat, price, apartmentName, status } = props.dataset || {}
7 7
   const personNum = `(${realHeat + heat + 0}人)`
8 8
 
9 9
   const handleClick = () => {
@@ -12,16 +12,17 @@ export default function Room(props) {
12 12
     }
13 13
   }
14 14
 
15
-  const wanY = Number(price / 10000).toFixed(0)
15
+  const wanY = Number(price).toFixed(0)
16 16
 
17 17
   return (
18 18
     <HotBlock number={heat + realHeat + 0}>
19
-      <View className="room" onClick={handleClick}>
19
+      {status == '1' && <View className="room" onClick={handleClick}>
20 20
         <View className="warn">{roomName || ''}</View>
21 21
         <View className="warn">{personNum || ''}</View>
22
-        <View className="info">{wanY}万</View>
22
+        <View className="info">{wanY}万</View>
23 23
         <View className="info">{apartmentName || ''}</View>
24
-      </View>
24
+      </View>}
25
+
25 26
     </HotBlock>
26 27
   )
27 28
 }

+ 6
- 4
src/onlineSelling/components/ScrollMessage/index.js ファイルの表示

@@ -45,8 +45,10 @@ export default class ScrollMessage extends Component {
45 45
 
46 46
   render() {
47 47
     const [start, end] = this.computeDate()
48
-    const { salesNumber, preselectionNumber } = this.props.summary || {}
49
-    const notice = `当前 ${salesNumber} 套房源已有 ${preselectionNumber} 人成功预选`
48
+    const { salesNumber, preselectionNumber, heatNumber } = this.props.summary || {}
49
+    const personNum = heatNumber + preselectionNumber + 0
50
+  
51
+    const notice = `当前 ${salesNumber} 套房源已有 ${personNum} 人成功预选`
50 52
 
51 53
     return (
52 54
       <View className="scrollmessage">
@@ -59,9 +61,9 @@ export default class ScrollMessage extends Component {
59 61
             <SwiperItem>
60 62
               <TimeTicker startTime={start} endTime={end} translate={this.formateTM} />
61 63
             </SwiperItem>
62
-            <SwiperItem>
64
+            {personNum > 0 && <SwiperItem>
63 65
               <View>{notice}</View>
64
-            </SwiperItem>
66
+            </SwiperItem>}
65 67
           </Swiper>
66 68
         </View>
67 69
       </View>

+ 10
- 10
src/onlineSelling/pages/detail/index.js ファイルの表示

@@ -95,9 +95,9 @@ export default class Index extends Component {
95 95
 
96 96
 
97 97
   render() {
98
-    const { grantPhoneVisible, grantAvatarVisible, houseDetail,buildingImgList } = this.state
98
+    const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList } = this.state
99 99
     const { userInfo = { person: {} } } = this.props
100
-    const address = `${houseDetail.buildingName}${houseDetail.blockName}${houseDetail.unitName}${houseDetail.floorName}${houseDetail.roomName}`
100
+    const address = `${houseDetail.buildingName || ''}${houseDetail.termName || ''}${houseDetail.blockName || ''}${houseDetail.unitName || ''}${houseDetail.floorName || ''}${houseDetail.roomName || ''}`
101 101
 
102 102
     return (
103 103
       <Block>
@@ -124,17 +124,17 @@ export default class Index extends Component {
124 124
             scrollY>
125 125
             <View className='detail__main'>
126 126
               <View style="padding: 0 30rpx;">
127
-                <View className="title">
128
-                  <View className="name">{houseDetail.apartmentName || ''}</View>
129
-                  <View className="btn" onClick={() => this.handleChat(houseDetail.buildingId)}>询问优惠</View>
130
-                </View>
127
+                <View className="name">{houseDetail.apartmentName || ''}</View>
128
+                <View className="btn" onClick={() => this.handleChat(houseDetail.buildingId)}>询问优惠</View>
131 129
                 <View className="price">
132 130
                   现价:{houseDetail.price}万
133 131
               </View>
134
-                <View className="area">
135
-                  {houseDetail.buildingArea ? <Text>建筑面积约<Text style="color:#FE1C1C">{houseDetail.buildingArea}</Text>m² </Text> : '建筑面积待定'}
136
-                  <Text style="margin-left:20rpx">{houseDetail.insideArea ? <Text>使用面积约<Text style="color:#FE1C1C">{houseDetail.insideArea}</Text>m² </Text> : '使用面积待定'}</Text>
137
-                </View>
132
+                {houseDetail.apartmentName &&
133
+                  <View className="area">
134
+                    {houseDetail.buildingArea ? <Text>建筑面积约<Text style="color:#FE1C1C">{houseDetail.buildingArea}</Text>m² </Text> : '建筑面积待定'}
135
+                    <Text style="margin-left:20rpx">{houseDetail.insideArea ? <Text>使用面积约<Text style="color:#FE1C1C">{houseDetail.insideArea}</Text>m² </Text> : '使用面积待定'}</Text>
136
+                  </View>
137
+                }
138 138
                 <View className="address">
139 139
                   <Image className="location-icon" src={require('../../assets/location.png')}></Image>{address || ''}
140 140
                 </View>

+ 18
- 17
src/onlineSelling/pages/detail/index.scss ファイルの表示

@@ -29,30 +29,31 @@
29 29
   .wrap {
30 30
     padding-top: 570px;
31 31
     background: transparent;
32
+    position: relative;
32 33
   }
33 34
 
34 35
   &__main {
35 36
     background: #fff;
36 37
     border-radius: 40px 40px 0 0;
37 38
     padding: 60px 0;
38
-    .title{
39
-      display: flex;
40
-      align-items: center;
41
-      justify-content: space-between;
42
-      .name{
43
-        font-size: 44px;
44
-        color: #333333;
45
-        font-weight: 600;
46
-      }
47
-      .btn{
48
-        background-color: #F3B82E;
49
-        font-size: 30px;
50
-        color: #fff;
51
-        padding: 14px 28px;
52
-        font-weight: 300;
53
-        border-radius: 36px;
54
-      }
39
+   
40
+    .name{
41
+      font-size: 44px;
42
+      color: #333333;
43
+      font-weight: 600;
44
+    }
45
+    .btn{
46
+      background-color: #F3B82E;
47
+      font-size: 30px;
48
+      color: #fff;
49
+      padding: 14px 28px;
50
+      font-weight: 300;
51
+      border-radius: 36px;
52
+      position: absolute;
53
+      right: 30px;
54
+      top: 48px;
55 55
     }
56
+    
56 57
     .price{
57 58
       color: #FE1C1C;
58 59
       font-size: 38px;

+ 42
- 34
src/onlineSelling/pages/houseList/index.js ファイルの表示

@@ -36,7 +36,7 @@ export default class HouseList extends Component {
36 36
     id: null,
37 37
     qrcodeParams: {},
38 38
     current: 0,
39
-    priceCurrent: 0,
39
+    priceCurrent: -1,
40 40
     apartmentList: [],
41 41
     conditionVisible: false,
42 42
     startPrice: '',
@@ -45,22 +45,23 @@ export default class HouseList extends Component {
45 45
     reportedCustomer: false,
46 46
     posterShow: false,
47 47
     posterData: {},
48
-    shareContents: [],
49 48
     buildingId: null,
49
+    salesBatchDetail: {},
50 50
     posterConfig: [],
51 51
   }
52 52
 
53
-  componentWillMount() {
53
+  componentDidShow() {
54 54
 
55 55
     ready.queue(() => {
56 56
 
57 57
       this.initPageData()
58 58
     })
59 59
   }
60
+
60 61
   componentWillReceiveProps() {
61 62
     this.reportClientFn()
62 63
   }
63
-  
64
+
64 65
   transTPLs2Configs(tpls, params) {
65 66
     return tpls.map((tpl) => {
66 67
       const conf = getCanvasConfig(tpl.configs, params)
@@ -126,14 +127,15 @@ export default class HouseList extends Component {
126 127
       })
127 128
     })
128 129
     querySalesInfo(id).then(res => {
130
+      this.setState({
131
+        buildingId: res.buildingId,
132
+        salesBatchDetail: res || {},
133
+      })
129 134
       const { templates = [], posterImg = '' } = (res.posters || [])[0]
130 135
 
131 136
       this.setState({
132
-        buildingId: res.buildingId,
133 137
         posterData: { poster: posterImg },
134
-        shareContents: res.shareContents || [],
135 138
       }, () => {
136
-        // debugger
137 139
         this.getPosterData().then(posterData => {
138 140
           const posterConfig = this.transTPLs2Configs(templates, posterData)
139 141
           this.setState({ posterConfig, posterData })
@@ -234,7 +236,7 @@ export default class HouseList extends Component {
234 236
 
235 237
     const queryParams = [
236 238
       `id=${id}`,
237
-      'from=building_share',
239
+      'from=house_share',
238 240
       `recommender=${personId}`,
239 241
       `consultant=${consultant}`,
240 242
       `consultantId=${consultantId}`,
@@ -251,7 +253,7 @@ export default class HouseList extends Component {
251 253
     const id = this.$router.params.id || this.state.id
252 254
     const { userInfo: { person: { personId, personType, userId } } } = this.props
253 255
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
254
-    const { shareContents } = this.state
256
+    const { salesBatchDetail: { shareContents } } = this.state
255 257
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: '房源列表', shareContentImg: null };
256 258
     // 分享埋点
257 259
     shareSavePoint({
@@ -262,7 +264,7 @@ export default class HouseList extends Component {
262 264
       sharePersonId: personId,
263 265
       targetId: id,
264 266
       data: '{}'
265
-    }, 'house')
267
+    }, 'houseApp')
266 268
 
267 269
     const [page, params] = this.currentPageAndParams()
268 270
 
@@ -290,9 +292,9 @@ export default class HouseList extends Component {
290 292
           propertyName: '生成房源列表海报',
291 293
           targetId: id,
292 294
           data: '{}'
293
-        }, 'house')
295
+        }, 'housePoster')
294 296
       })
295
-    
297
+
296 298
 
297 299
     } else {
298 300
       this.setState({
@@ -300,7 +302,7 @@ export default class HouseList extends Component {
300 302
         showShareMenu: false
301 303
       })
302 304
     }
303
-   
305
+
304 306
 
305 307
   }
306 308
   getPosterData = () => {
@@ -345,7 +347,7 @@ export default class HouseList extends Component {
345 347
             <Image style="width:50rpx;height:50rpx" src={require('../../assets/explain.png')}></Image>
346 348
           </View>
347 349
           <View onClick={this.handleSearchClick}>
348
-          <Image style="width:50rpx;height:50rpx" src={require('../../assets/screen.png')}></Image>
350
+            <Image style="width:50rpx;height:50rpx" src={require('../../assets/screen.png')}></Image>
349 351
             {/* <NamedIcon name="screen" size={50} /> */}
350 352
           </View>
351 353
         </View>
@@ -402,7 +404,6 @@ export default class HouseList extends Component {
402 404
       endPrice: item.endPrice,
403 405
       conditionVisible: false
404 406
     }, () => {
405
-      // Taro.setNavigationBarTitle({ title: '房源' })
406 407
       const id = this.$router.params.id || this.state.id
407 408
       this.getInfo(id)
408 409
     })
@@ -462,7 +463,7 @@ export default class HouseList extends Component {
462 463
           <Text style="margin:0 8rpx;color:#999;font-size:28rpx">-</Text>
463 464
           <Input
464 465
             type="number"
465
-            placeholder="最价"
466
+            placeholder="最价"
466 467
             class="search-input"
467 468
             placeholder-style="color:#dcdcdc;font-size:28rpx"
468 469
             maxlength="6"
@@ -537,11 +538,11 @@ export default class HouseList extends Component {
537 538
   }
538 539
 
539 540
   render() {
540
-    const { showShareMenu, showPoster, houseList, conditionVisible, posterData, posterShow, posterConfig } = this.state
541
+    const { salesBatchDetail, showShareMenu, showPoster, houseList, conditionVisible, posterData, posterShow, posterConfig } = this.state
541 542
     const { userInfo: { person } } = this.props
542 543
 
543 544
     const showCircleBtn = posterData && posterData.qrcode
544
-console.log('==============>', posterData, showPoster, posterConfig)
545
+    console.log('==============>', posterData, showPoster, posterConfig)
545 546
     return (
546 547
       <Block>
547 548
         {conditionVisible && this.renderCondition()}
@@ -550,23 +551,30 @@ console.log('==============>', posterData, showPoster, posterConfig)
550 551
 
551 552
         {/* 生成海报 */}
552 553
         {showPoster && <Poster data={posterData} configs={posterConfig} onCancel={this.togglePosterStatus} onFinish={this.togglePosterStatus} ></Poster>}
553
-        {!conditionVisible && <Block>
554
-          <View className="houselist">
555
-            {this.renderBar()}
556
-            {!houseList.length ? this.renderBlank() : this.renderHouses()}
557
-            {this.renderBottom()}
558
-          </View>
559
-          {/* 分享按钮 */}
560
-          <ActSheet show={showShareMenu}>
561
-            <ShareButtons
562
-              circleBtn={showCircleBtn}
563
-              onShareFrineds={this.handleShareFrineds}
564
-              onSharingCircleOfFriends={() => this.togglePosterStatus(true)}
565
-            // onSharingCircleOfFriends={this.handleSharingCircleOfFriends}
566
-            />
567
-          </ActSheet>
568
-        </Block>
554
+        {salesBatchDetail.status == "1" ?
555
+          <Block>
556
+            {!conditionVisible && <Block>
557
+              <View className="houselist">
558
+                {this.renderBar()}
559
+                {!houseList.length ? this.renderBlank() : this.renderHouses()}
560
+                {this.renderBottom()}
561
+              </View>
562
+              {/* 分享按钮 */}
563
+              <ActSheet show={showShareMenu}>
564
+                <ShareButtons
565
+                  circleBtn={showCircleBtn}
566
+                  onShareFrineds={this.handleShareFrineds}
567
+                  onSharingCircleOfFriends={() => this.togglePosterStatus(true)}
568
+                // onSharingCircleOfFriends={this.handleSharingCircleOfFriends}
569
+                />
570
+              </ActSheet>
571
+            </Block>
572
+            }
573
+          </Block>
574
+          :
575
+          <View style="text-align: center;margin-top: 30vh;font-size: 28rpx;color: #999;">当前销售批次已被取消发布,请在发布后再试。</View>
569 576
         }
577
+
570 578
       </Block>
571 579
     )
572 580
   }

+ 1
- 0
src/onlineSelling/pages/houseList/index.scss ファイルの表示

@@ -124,6 +124,7 @@
124 124
         border-radius:6px;
125 125
         font-size: 28px;
126 126
         color: #999;
127
+        border:1px solid #bb9c79;
127 128
       }
128 129
     }
129 130
   }

+ 17
- 5
src/onlineSelling/pages/records/index.js ファイルの表示

@@ -1,5 +1,5 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2
-import { View, ScrollView } from '@tarojs/components'
2
+import { View, ScrollView, Block } from '@tarojs/components'
3 3
 import HouseCard from '../../components/HouseCard'
4 4
 import { queryPreselectionRecord } from '@/services/project'
5 5
 import { connect } from '@tarojs/redux'
@@ -21,7 +21,7 @@ export default class Records extends Component {
21 21
   }
22 22
   componentWillMount() {
23 23
     ready.queue(() => {
24
-      console.log(this.props, "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh")
24
+  
25 25
       const { userInfo: { person: { personId } } } = this.props
26 26
       const params = {
27 27
         personId,
@@ -35,6 +35,16 @@ export default class Records extends Component {
35 35
       })
36 36
     })
37 37
 
38
+  }
39
+  toHouseDetail(item) {
40
+    if (item.housingStatus == '0' || item.saleBatchStatus == '0') {
41
+      Taro.showToast({ title: '当前销售批次或该房源已被取消发布', icon: 'none', duration: 2000 })
42
+    } else {
43
+      Taro.navigateTo({
44
+        url: `/onlineSelling/pages/detail/index?id=${item.houseId}`
45
+      })
46
+    }
47
+
38 48
   }
39 49
 
40 50
   render() {
@@ -49,9 +59,11 @@ export default class Records extends Component {
49 59
               {
50 60
                 recordList.map((item) => {
51 61
                   return (
52
-                    <View className="carditem" key={item.preselectionRecordId}>
53
-                      <HouseCard summary={item} />
54
-                    </View>
62
+                    <Block>
63
+                      {item.status == '1' && <View className="carditem" key={item.preselectionRecordId} onClick={() => this.toHouseDetail(item)}>
64
+                        <HouseCard summary={item} />
65
+                      </View>}
66
+                    </Block>
55 67
                   )
56 68
                 })
57 69
               }

+ 1
- 1
src/pages/card/index.js ファイルの表示

@@ -620,7 +620,7 @@ export default class Index extends Component {
620 620
 
621 621
               {buildingId && (
622 622
                 <View className="pro__info">
623
-                  <View className='project__title'>为您推荐</View>
623
+                  <View className='project__title'>{person.personId != cardInfo.id?'为您推荐':'项目信息'}</View>
624 624
                   <ProjectItem data={projectDetail} onClick={this.toProjectDetail.bind(this)} />
625 625
                 </View>
626 626
               )}

+ 4
- 3
src/pages/project/detail/index.js ファイルの表示

@@ -1079,7 +1079,7 @@ export default class Index extends Component {
1079 1079
     const { projectDetail: { salesBatch } } = this.props
1080 1080
     return (
1081 1081
       <Block>
1082
-        <View className="activity" style="padding:40rpx 0 20rpx 0 ">
1082
+        {salesBatch.length && <View className="activity" style="padding:40rpx 0 20rpx 0 ">
1083 1083
           <View className="title">在线选房</View>
1084 1084
           {salesBatch.map((item, index) => (
1085 1085
             <View style={{ position: 'relative', padding: '0 30rpx' }} key={index + 'salesBatch'} >
@@ -1087,7 +1087,8 @@ export default class Index extends Component {
1087 1087
             </View>
1088 1088
           ))}
1089 1089
 
1090
-        </View>
1090
+        </View>}
1091
+
1091 1092
       </Block>
1092 1093
     )
1093 1094
   }
@@ -1553,7 +1554,7 @@ export default class Index extends Component {
1553 1554
                   {/* 户型介绍 */}
1554 1555
                   {this.renderHouseTypeList()}
1555 1556
                   {/* 在线选房 */}
1556
-                  {projectDetail.salesBatch && this.renderChooseHouse()}
1557
+                  {this.renderChooseHouse()}
1557 1558
                   {/* 助力活动 */}
1558 1559
                   {this.renderHelp()}
1559 1560
                   {/* 拼团活动 */}

+ 7
- 1
src/services/news.js ファイルの表示

@@ -5,6 +5,7 @@ import {
5 5
   API_NEWS_UV,
6 6
   API_NEWS_SHARE,
7 7
   API_HOUSE_SHARE,
8
+  API_HOUSE_POSTER,
8 9
   API_ACTIVITY_GROUP
9 10
 } from '@/constants/api'
10 11
 
@@ -21,7 +22,12 @@ export const addNewsUv = id => fetch({ url: `${API_NEWS_UV}/${id}`, method: 'PUT
21 22
 export const addNewsShareNum = id => fetch({ url: `${API_NEWS_SHARE}/${id}`, method: 'POST' })
22 23
 
23 24
 /**
24
- * 房源列表分享埋点
25
+ * 房源列表分享埋点(海报)
26
+ * @param {*} id  id
27
+ */
28
+export const addHousePosterNum = id => fetch({ url: `${API_HOUSE_POSTER}/${id}`, method: 'POST' })
29
+/**
30
+ * 房源列表分享埋点(小程序)
25 31
  * @param {*} id  id
26 32
  */
27 33
 export const addHouseShareNum = id => fetch({ url: `${API_HOUSE_SHARE}/${id}`, method: 'POST' })

+ 7
- 3
src/utils/shareSavePoint.js ファイルの表示

@@ -2,8 +2,8 @@ import { savePoint } from '@/services/common'
2 2
 import { addItemShareNum } from '@/services/item'
3 3
 import { addActivityShareNum, addHelpShareNum, addGroupShareNum, addHFiveShareNum } from '@/services/activity'
4 4
 import { addCardShareNum } from '@/services/card'
5
-import { addNewsShareNum } from '@/services/news'
6
-import { addHouseShareNum } from '@/services/news'
5
+import { addNewsShareNum, addHousePosterNum, addHouseShareNum } from '@/services/news'
6
+
7 7
 /**
8 8
  * 积分提示
9 9
  * @param {*} options
@@ -29,10 +29,14 @@ export function share(options, type) {
29 29
                 addNewsShareNum(options.targetId)
30 30
                 savePoint(options)
31 31
                 break;
32
-            case 'house':
32
+            case 'houseApp':
33 33
                 addHouseShareNum(options.targetId)
34 34
                 savePoint(options)
35 35
                 break;
36
+            case 'housePoster':
37
+                addHousePosterNum(options.targetId)
38
+                savePoint(options)
39
+                break;
36 40
             case 'help':
37 41
                 addHelpShareNum(options.targetId)
38 42
                 savePoint(options)