Browse Source

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

张延森 5 years ago
parent
commit
aaced47939

BIN
src/assets/rulebg.png View File


+ 1
- 0
src/components/empty-page/index.scss View File

@@ -13,5 +13,6 @@
13 13
   &__text{
14 14
     font-size:30px;
15 15
     color: $text-color-light;
16
+    line-height: 3;
16 17
   }
17 18
 }

+ 6
- 5
src/pages/activity/detail/assemble.js View File

@@ -75,6 +75,7 @@ export default class Detail extends Component {
75 75
     consultData: {}, // 分享的置业顾问信息
76 76
     consultShow: false,  // 置业顾问悬浮框显示隐藏
77 77
     reportedCustomer: false,
78
+    qrcodeParams: '',
78 79
   }
79 80
 
80 81
   componentWillMount() {
@@ -122,7 +123,7 @@ export default class Detail extends Component {
122 123
 
123 124
       if (!id) {
124 125
         getQrCodeParams(this.$router.params.scene).then(res => {
125
-          this.setState({ id: res.id, recordId: res.recordId }, () => {
126
+          this.setState({ id: res.id, recordId: res.recordId, qrcodeParams: res }, () => {
126 127
             this.loadDetail()
127 128
           })
128 129
         }).catch(err => {
@@ -264,14 +265,14 @@ export default class Detail extends Component {
264 265
   }
265 266
 
266 267
   loadDetail() {
267
-    let { id, recordId, ltTicker } = this.state
268
+    let { id, recordId, ltTicker, qrcodeParams } = this.state
268 269
     const { userInfo } = this.props
269 270
 
270 271
     Taro.showLoading()
271 272
     const router = Taro.getStorageSync('router') || { query: {} }
272
-    const consultant = this.$router.params.consultant || router.query.consultant
273
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
274
-    const recommender = this.$router.params.recommender || router.query.recommender || ""
273
+    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
274
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
275
+    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
275 276
     getGroupDetail(id, recordId).then(res => {
276 277
       this.stopTicker()
277 278
 

+ 15
- 14
src/pages/activity/detail/assistance.js View File

@@ -75,6 +75,7 @@ export default class Detail extends Component {
75 75
     consultData: {}, // 分享的置业顾问信息
76 76
     consultShow: false,  // 置业顾问悬浮框显示隐藏
77 77
     reportedCustomer: false,
78
+    qrcodeParams: '',
78 79
   }
79 80
 
80 81
   componentWillMount() {
@@ -124,7 +125,7 @@ export default class Detail extends Component {
124 125
 
125 126
       if (!id) {
126 127
         getQrCodeParams(this.$router.params.scene).then(res => {
127
-          this.setState({ id: res.id, initiateId: res.initiateId }, () => {
128
+          this.setState({ id: res.id, initiateId: res.initiateId, qrcodeParams: res, }, () => {
128 129
             this.loadDetail()
129 130
           })
130 131
         }).catch(err => {
@@ -267,14 +268,14 @@ export default class Detail extends Component {
267 268
 
268 269
   // 请求详情
269 270
   loadDetail() {
270
-    let { id, initiateId, ltTicker } = this.state
271
+    let { id, initiateId, ltTicker, qrcodeParams } = this.state
271 272
     const { userInfo } = this.props
272 273
 
273 274
     Taro.showLoading()
274 275
     const router = Taro.getStorageSync('router') || { query: {} }
275
-    const consultant = this.$router.params.consultant || router.query.consultant
276
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
277
-    const recommender = this.$router.params.recommender || router.query.recommender || ""
276
+    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
277
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
278
+    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
278 279
     getHelpDetail(id, initiateId).then(res => {
279 280
       this.stopTicker()
280 281
 
@@ -482,7 +483,7 @@ export default class Detail extends Component {
482 483
       if (this.toggleGrantAvatar()) {
483 484
         const detail = this.state.detail
484 485
         const person = this.props.userInfo.person
485
-  
486
+
486 487
         createHelpActivity({
487 488
           buildingId: detail.buildingId,
488 489
           helpActivityId: detail.helpActivityId,
@@ -508,19 +509,19 @@ export default class Detail extends Component {
508 509
         })
509 510
       } else {
510 511
         reject()
511
-      }  
512
+      }
512 513
     }
513 514
 
514 515
     return new Promise((resolve, reject) => {
515 516
       const { userInfo: { miniApp: { tpls } } } = this.props
516 517
       const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
517
-      
518
+
518 519
       wx.requestSubscribeMessage({
519 520
         tmplIds: [tplId],
520
-        success(res) {},
521
-        fail(res) {},
521
+        success(res) { },
522
+        fail(res) { },
522 523
         complete() {
523
-          makeHelp(resolve, reject)  
524
+          makeHelp(resolve, reject)
524 525
         }
525 526
       })
526 527
     });
@@ -543,12 +544,12 @@ export default class Detail extends Component {
543 544
         const that = this
544 545
         wx.requestSubscribeMessage({
545 546
           tmplIds: [tplId],
546
-          success(res) {},
547
-          fail(res) {},
547
+          success(res) { },
548
+          fail(res) { },
548 549
           complete() {
549 550
             that.toggleActionVisible()
550 551
           }
551
-        })        
552
+        })
552 553
       }
553 554
     }
554 555
   }

+ 6
- 5
src/pages/activity/detail/index.js View File

@@ -51,6 +51,7 @@ export default class Detail extends Component {
51 51
     consultData: {}, // 分享的置业顾问信息
52 52
     consultShow: false,  // 置业顾问悬浮框显示隐藏
53 53
     reportedCustomer: false,
54
+    qrcodeParams: '',
54 55
   }
55 56
 
56 57
   componentWillMount() {
@@ -59,7 +60,7 @@ export default class Detail extends Component {
59 60
       const id = this.$router.params.id || router.query.id
60 61
       if (!id) {
61 62
         getQrCodeParams(this.$router.params.scene).then(res => {
62
-          this.setState({ id: res.id }, () => {
63
+          this.setState({ id: res.id, qrcodeParams: res }, () => {
63 64
             this.loadDetail()
64 65
           })
65 66
         }).catch(err => {
@@ -94,12 +95,12 @@ export default class Detail extends Component {
94 95
   }
95 96
 
96 97
   loadDetail() {
97
-    const { id } = this.state
98
+    const { id, qrcodeParams } = this.state
98 99
     Taro.showLoading()
99 100
     const router = Taro.getStorageSync('router') || { query: {} }
100
-    const consultant = this.$router.params.consultant || router.query.consultant
101
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
102
-    const recommender = this.$router.params.recommender || router.query.recommender || ""
101
+    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
102
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
103
+    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
103 104
 
104 105
     queryActivityDetail(id).then(res => {
105 106
       Taro.hideLoading()

+ 26
- 23
src/pages/card/fans/index.js View File

@@ -1,12 +1,10 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2
-import './index.scss'
3 2
 import { queryCardFansList } from '@services/card'
4 3
 import { queryItemFansList } from '@services/item'
5
-
4
+import EmptyPage from '@components/empty-page'
6 5
 import FansItem from './item'
7 6
 import ListView from '@components/ListView'
8 7
 import { savePoint, updatePoint } from '@services/common'
9
-import emptyImg from '@assets/empty.png'
10 8
 let pageIndex = 1
11 9
 export default class Index extends Component {
12 10
   config = {
@@ -17,9 +15,11 @@ export default class Index extends Component {
17 15
     hasMore: true,
18 16
     isEmpty: false,
19 17
     recordId: null,
20
-    pageIndex: 1
18
+    pageIndex: 1,
19
+    noReacord: false,
21 20
   }
22 21
   componentDidMount() {
22
+    Taro.showLoading()
23 23
     this.loadList();
24 24
 
25 25
     // App.zhuge.track('查看粉丝页面')
@@ -63,15 +63,28 @@ export default class Index extends Component {
63 63
     }
64 64
     if (type === "card") {
65 65
       queryCardFansList(id, payload).then(res => {
66
+        const { records } = res
67
+
66 68
         this.setState({
67
-          list: res.records
69
+          list: records,
70
+          noReacord: records.length ? false : true
68 71
         })
72
+        Taro.hideLoading()
73
+      }).catch(err => {
74
+        Taro.hideLoading()
75
+        console.log(err, '我的主页')
69 76
       })
70 77
     } else {
71 78
       queryItemFansList(id, payload).then(res => {
79
+        const { records } = res
72 80
         this.setState({
73
-          list: res.records
81
+          list: records,
82
+          noReacord: records.length ? false : true
74 83
         })
84
+        Taro.hideLoading()
85
+      }).catch(err => {
86
+        Taro.hideLoading()
87
+        console.log(err, '我的主页')
75 88
       })
76 89
     }
77 90
     // return type === "card" ? queryCardFansList(id, payload) : queryItemFansList(id, payload)
@@ -106,7 +119,7 @@ export default class Index extends Component {
106 119
   // }
107 120
 
108 121
   render() {
109
-    const { hasMore, isEmpty, list } = this.state
122
+    const { hasMore, isEmpty, list, noReacord } = this.state
110 123
     return (
111 124
       // <ListView
112 125
       //   needInit
@@ -120,24 +133,14 @@ export default class Index extends Component {
120 133
       //   {list.map(item => <FansItem key={item.uvId} data={item} />)}
121 134
       // </ListView>
122 135
       <View>
123
-        {/* {
124
-          list.length &&
136
+        {!noReacord ?
125 137
           <View>
126
-
127
-            {list.map(item => <FansItem key={item.uvId} data={item} />)}
128
-            <View style="text-align:center;line-height:160rpx;font-size:28rpx;color:#999">
129
-              仅展示最近N条记录~
130
-
138
+            {list.map(item =>
139
+              <FansItem key={item.uvId} data={item} />)}
140
+            {list.length >= 50 && <View style="text-align:center;line-height:120rpx;font-size:24rpx;color:#999"> 仅展示最近50条围观记录</View>}
131 141
           </View>
132
-          </View>
133
-        } */}
134
-        {
135
-          list.length == 1 &&
136
-          <View >
137
-            <Image  mode="widthFix" src={emptyImg}></Image>
138
-            <View >暂无访问记录~</View>
139
-          </View>
140
-        }
142
+          : <EmptyPage text="暂无围观记录哦~" />}
143
+
141 144
       </View>
142 145
 
143 146
     );

+ 0
- 0
src/pages/card/fans/index.scss View File


+ 4
- 4
src/pages/card/fans/item.scss View File

@@ -9,21 +9,21 @@
9 9
 
10 10
   &-info {
11 11
     .avatar {
12
-      width: 120px;
13
-      height: 120px;
12
+      width: 124px;
13
+      height: 124px;
14 14
       border-radius: 50%;
15 15
       vertical-align: middle;
16 16
     }
17 17
 
18 18
     .name {
19 19
       font-size: 32px;
20
-      margin-left: 30px;
20
+      margin-left: 26px;
21 21
       vertical-align: middle;
22 22
     }
23 23
   }
24 24
 
25 25
   &-time {
26 26
     color: $text-color-lighter;
27
-    font-size:26px;
27
+    font-size:24px;
28 28
   }
29 29
 }

+ 6
- 5
src/pages/news/detail/index.js View File

@@ -45,6 +45,7 @@ export default class NewsDetail extends Component {
45 45
     consultData: {}, // 分享的置业顾问信息
46 46
     consultShow: false,  // 置业顾问悬浮框显示隐藏
47 47
     reportedCustomer: false,
48
+    qrcodeParams: '',
48 49
   }
49 50
 
50 51
   componentWillMount(options) {
@@ -65,7 +66,7 @@ export default class NewsDetail extends Component {
65 66
 
66 67
       if (!newsId) {
67 68
         getQrCodeParams(this.$router.params.scene).then(res => {
68
-          this.setState({ newsId: res.id }, () => {
69
+          this.setState({ newsId: res.id, qrcodeParams: res }, () => {
69 70
             this.loadDetail()
70 71
             addNewsUv(res.id)
71 72
           })
@@ -220,11 +221,11 @@ export default class NewsDetail extends Component {
220 221
   }
221 222
 
222 223
   loadDetail() {
223
-    const { newsId } = this.state
224
+    const { newsId, qrcodeParams } = this.state
224 225
     const router = Taro.getStorageSync('router') || { query: {} }
225
-    const consultant = this.$router.params.consultant || router.query.consultant
226
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
227
-    const recommender = this.$router.params.recommender || router.query.recommender || ""
226
+    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
227
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
228
+    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
228 229
     Taro.showLoading()
229 230
     queryNewsDetail(newsId).then(res => {
230 231
       Taro.hideLoading()

+ 16
- 16
src/pages/person/index.js View File

@@ -22,7 +22,7 @@ export default class Person extends Component {
22 22
 
23 23
   state = {
24 24
     isLogin: false,
25
-    user: {},
25
+    users: {},
26 26
     isAgent: false,//经纪人
27 27
     consultant: false,//置业顾问
28 28
     tourist: false,//普通用户,
@@ -38,13 +38,13 @@ export default class Person extends Component {
38 38
   }
39 39
 
40 40
   loadUserInfo() {
41
-    queryUserInfo().then(user => {
42
-      const [roleSetting, roleName] = this.getRoleName(user.personType)
41
+    queryUserInfo().then(users => {
42
+      const [roleSetting, roleName] = this.getRoleName(users.personType)
43 43
 
44 44
       this.setState({
45
-        user,
46
-        phone: user.phone,
47
-        menus: menus.map(group => group.filter(x => x.userTypes.indexOf(user.personType) > -1)),
45
+        users,
46
+        phone: users.phone,
47
+        menus: menus.map(group => group.filter(x => x.userTypes.indexOf(users.personType) > -1)),
48 48
         roleName,
49 49
         ...roleSetting,
50 50
       })
@@ -52,7 +52,7 @@ export default class Person extends Component {
52 52
   }
53 53
 
54 54
   doSign() {
55
-    const { user: { id, havaSigned } } = this.state
55
+    const { users: { id, havaSigned } } = this.state
56 56
     if (havaSigned) {
57 57
       return
58 58
     }
@@ -87,7 +87,7 @@ export default class Person extends Component {
87 87
   redirectTo = (url) => {
88 88
     if (url) {
89 89
       if (typeof url === 'function') {
90
-        Taro.navigateTo({ url: url(this.state.user) })
90
+        Taro.navigateTo({ url: url(this.state.users) })
91 91
       } else {
92 92
         Taro.navigateTo({ url })
93 93
       }
@@ -169,7 +169,7 @@ export default class Person extends Component {
169 169
 
170 170
   goPersonDetail() {
171 171
 
172
-    const { user: { personType } } = this.state
172
+    const { users: { personType } } = this.state
173 173
 
174 174
     // if (personType == ROLE_CODE['CHANNEL_AGENT'] || personType == ROLE_CODE['ESTATE_AGENT']) {
175 175
     Taro.navigateTo({
@@ -184,7 +184,7 @@ export default class Person extends Component {
184 184
   }
185 185
 
186 186
   renderDetail() {
187
-    const { user, menus, roleName } = this.state
187
+    const { users, menus, roleName } = this.state
188 188
     const { user: { userInfo: { miniApp: { name } } } } = this.props
189 189
     // const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
190 190
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
@@ -197,16 +197,16 @@ export default class Person extends Component {
197 197
           <View className="content">
198 198
             <View className="info-block">
199 199
               <View className="avatar" onClick={this.goPersonDetail}>
200
-                <Image className="info__headimg" src={user.avatar} />
200
+                <Image className="info__headimg" src={users.avatar} />
201 201
                 <View className="info-intro">{roleName}</View>
202 202
               </View>
203 203
 
204 204
               <View className="info-text" onClick={this.goPersonDetail}>
205
-                <View className="info-text__name">{user.name ? user.name : user.nickname}</View>
206
-                <View className="info-text__intro">积分 {user.points || 0}</View>
205
+                <View className="info-text__name">{users.name ? users.name : users.nickname}</View>
206
+                <View className="info-text__intro">积分 {users.points || 0}</View>
207 207
               </View>
208 208
               {
209
-                user.personType == 'Realty Consultant' && (
209
+                users.personType == 'Realty Consultant' && (
210 210
                   <Navigator url={`/pages/person/spread/index`} className="tuiguang">
211 211
 
212 212
                     <Image style="width:40px;height:36px" src={require('@assets/mine/tuiguangma.png')} ></Image>
@@ -223,7 +223,7 @@ export default class Person extends Component {
223 223
           </View>
224 224
           <View className='qiandao-con'>
225 225
             <Text className='qiandao-text'>签到得积分,积分兑好礼,马上去签到吧!</Text>
226
-            <View className={user.havaSigned ? 'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{user.havaSigned ? '已签到' : '签到'}</View>
226
+            <View className={users.havaSigned ? 'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{users.havaSigned ? '已签到' : '签到'}</View>
227 227
             {/* {
228 228
               user.havaSigned ?
229 229
                 (<View className='reday-qiandao-btn' onClick={this.doSign}> 已签到</View>) :
@@ -268,7 +268,7 @@ export default class Person extends Component {
268 268
   }
269 269
 
270 270
   render() {
271
-    const { phone, tel } = this.state.user
271
+    const { phone, tel } = this.state.users
272 272
     return (
273 273
       <View className='wrap'>
274 274
         {(phone || tel) && this.renderDetail()}

+ 3
- 2
src/pages/project/detail/Around/around.js View File

@@ -62,7 +62,7 @@ export default function Around(props) {
62 62
             props.onAction()
63 63
         }
64 64
     }
65
-    const tomapDetail = (e) => {     
65
+    const tomapDetail = (e) => {
66 66
         const { buildingId } = this.props
67 67
         Taro.navigateTo({
68 68
             url: `/pages/project/detail/map?id=` + buildingId
@@ -71,7 +71,8 @@ export default function Around(props) {
71 71
     return (
72 72
         <View className="around-box">
73 73
             <View className="around-header">
74
-                <PoiAround mapClick={tomapDetail} style="width: 100vw; height: 500rpx;" current={curMarker} coverShow={true} markers={markers} longitude={lng} latitude={lat} onMarkerClick={handleMarkerTap} />
74
+                <PoiAround mapClick={tomapDetail} style="width:100%;height:100%" current={curMarker} coverShow={true} longitude={lng} latitude={lat} onMarkerClick={handleMarkerTap} />
75
+                {/* <PoiAround mapClick={tomapDetail} style="width:100%;height:100%"  current={curMarker} coverShow={true} markers={markers} longitude={lng} latitude={lat} onMarkerClick={handleMarkerTap} /> */}
75 76
             </View>
76 77
             <View className="around-body">
77 78
                 <Tab dataset={dataList} className="around-project" onChange={handleTabChange} />

+ 3
- 2
src/pages/project/detail/Around/around.scss View File

@@ -6,8 +6,9 @@
6 6
   background-color: #fff;
7 7
     
8 8
   .around-header {
9
-    width: 100%;
10
-    height: 500px;
9
+    width: 690px;
10
+    margin:  0 auto;
11
+    height: 346px;
11 12
   }
12 13
   .around-body {
13 14
     padding: 0 30px;

+ 9
- 6
src/pages/project/detail/index.js View File

@@ -67,6 +67,7 @@ export default class Index extends Component {
67 67
     consultData: {}, // 分享的置业顾问信息
68 68
     consultShow: false,  // 置业顾问悬浮框显示隐藏
69 69
     reportedCustomer: false,
70
+    qrcodeParams: ''
70 71
   }
71 72
 
72 73
   componentWillMount() {
@@ -88,6 +89,10 @@ export default class Index extends Component {
88 89
       // 没有找到 id , 再重新找一次
89 90
       if (!id) {
90 91
         getQrCodeParams(this.$router.params.scene).then(res => {
92
+          console.log(res,"扫码参数")
93
+          this.setState({
94
+            qrcodeParams: res
95
+          })
91 96
           this.initPageData(res.id)
92 97
         }).catch(err => {
93 98
           Taro.showToast({
@@ -199,11 +204,12 @@ export default class Index extends Component {
199 204
       this.loadHelpGroupList()
200 205
 
201 206
       addItemUv(id)
207
+      const { qrcodeParams } = this.state
202 208
       // 埋点
203 209
       const router = Taro.getStorageSync('router') || { query: {} }
204
-      const consultant = this.$router.params.consultant || router.query.consultant
205
-      const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
206
-      const recommender = this.$router.params.recommender || router.query.recommender || ""
210
+      const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
211
+      const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
212
+      const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
207 213
       savePoint({
208 214
         event: 'detail',
209 215
         eventType: 'building',
@@ -839,9 +845,6 @@ export default class Index extends Component {
839 845
               更多<Text className="iconfont icon-more"></Text>
840 846
             </View>
841 847
           </View>
842
-          {/* <View className="section-head">
843
-            <Text className="section-head__title">位置及周边配套</Text>
844
-          </View> */}
845 848
         </View>
846 849
         <Around building={building} buildingId={this.state.buildingId} ></Around>
847 850
       </View>

+ 12
- 0
src/pages/project/floor/index.js View File

@@ -33,6 +33,10 @@ export default class Index extends Component {
33 33
             <Text className='txt left-txt'>项目名称</Text>
34 34
             <Text className='txt right-txt'>{projectDetail.buildingName}</Text>
35 35
           </View>
36
+          {/* <View className='item'>
37
+            <Text className='txt left-txt'>开发商</Text>
38
+            <Text className='txt right-txt'>{projectDetail.price ? projectDetail.price : '暂无'}</Text>
39
+          </View> */}
36 40
           <View className='item'>
37 41
             <Text className='txt left-txt'>均价</Text>
38 42
             <Text className='txt right-txt'>{projectDetail.price ? projectDetail.price : '待定'}</Text>
@@ -77,6 +81,10 @@ export default class Index extends Component {
77 81
             <Text className='txt left-txt'>规划户数</Text>
78 82
             <Text className='txt right-txt'>{projectDetail.familyNum || '暂无'}</Text>
79 83
           </View>
84
+          {/* <View className='item'>
85
+            <Text className='txt left-txt'>楼栋总数</Text>
86
+            <Text className='txt right-txt'>{projectDetail.familyNum || '暂无'}</Text>
87
+          </View> */}
80 88
           <View className='item'>
81 89
             <Text className='txt left-txt'>绿化率</Text>
82 90
             <Text className='txt right-txt'>{projectDetail.greeningRate || '暂无'}</Text>
@@ -85,6 +93,10 @@ export default class Index extends Component {
85 93
             <Text className='txt left-txt'>项目说明</Text>
86 94
             <Text className='txt right-txt'>{projectDetail.dynamic || '暂无'}</Text>
87 95
           </View>
96
+          {/* <View className='item'>
97
+            <Text className='txt left-txt'>备案名</Text>
98
+            <Text className='txt right-txt'>{projectDetail.dynamic || '暂无'}</Text>
99
+          </View> */}
88 100
         </View>
89 101
       </View >
90 102
     );

+ 5
- 6
src/pages/project/floor/index.scss View File

@@ -6,25 +6,24 @@
6 6
   padding: 5px 0 20px;
7 7
   background:rgba(245,245,245,1);
8 8
   .more-info{
9
-    // padding: 40px 0;
10 9
     background: #fff;
11 10
     margin-top: 20px;
12 11
   }
13 12
   .item{
14
-    padding: 40px;
13
+    padding: 30px 40px;
15 14
     border-bottom: 1px solid rgba(240, 238, 238,0.8);
16 15
     display: flex;
17 16
     .left-txt{
18 17
       font-size: 30px;
19
-      color: rgba(0,0,0,0.4);
18
+      color: #999;
20 19
       width: 30%;
21 20
       @include text-ellipsis;
22 21
     }
23 22
     .right-txt{
24
-      font-size: 30px;
25
-      color: #000;
23
+      font-size: 32px;
24
+      color: #333;
26 25
       width: 70%;
27
-      @include text-ellipsis;
26
+      // @include text-ellipsis;
28 27
     }
29 28
   }
30 29
   .item:last-child{

+ 34
- 21
src/pages/project/list/filter/index.js View File

@@ -15,17 +15,29 @@ export default class Index extends Component {
15 15
     visible: false,
16 16
     tabIndex: null,
17 17
     priceTypeIndex: 0,
18
-    selectedIndex: new Array(3).fill([0]),
18
+    selectedIndex: new Array(4).fill([0]),
19 19
     tabs: [
20
-      // {
21
-      //   name: '户型',
22
-      //   id: 'huxing',
23
-      //   list: ['不限', '一室', '两室', '三室', '四室', '五室以上']
24
-      // },
20
+      {
21
+        name: '户型',
22
+        id: 'huxing',
23
+        list: ['不限', '一室', '两室', '三室', '四室', '五室以上']
24
+      },
25 25
       {
26 26
         name: '价格',
27 27
         id: 'price',
28 28
         list: ['不限', '10000元/㎡以下', '10000-20000元/㎡', '20000-30000元/㎡', '30000-50000元/㎡', '50000-70000元/㎡', '70000-100000元/㎡', '100000元/㎡以上']
29
+        // list: [
30
+        //   {
31
+        //     name: '总价',
32
+        //     id: 'totalPrice',
33
+        //     list: ['不限', '100万以下', '100-150万', '150-200万', '200-500万', '500-1000万', '1000万以上']
34
+        //   },
35
+        //   {
36
+        //     name: '单价',
37
+        //     id: 'unitPrice ',
38
+        //     list: ['不限', '10000/㎡以下', '10000-20000元/㎡', '20000-30000元/㎡', '30000-50000元/㎡', '50000-70000元/㎡', '70000-100000元/㎡', '100000元/㎡以上']
39
+        //   }
40
+        // ]
29 41
       },
30 42
       {
31 43
         name: '面积',
@@ -47,7 +59,7 @@ export default class Index extends Component {
47 59
     queryItemTypeList().then(res => {
48 60
       let houseTypeList = res.records
49 61
       houseTypeList.unshift('不限')
50
-      tabs[2].list = houseTypeList
62
+      tabs[3].list = houseTypeList
51 63
       this.setState({ tabs })
52 64
     })
53 65
   }
@@ -107,6 +119,7 @@ export default class Index extends Component {
107 119
 
108 120
   handleFilter() {
109 121
 
122
+    console.log("111")
110 123
     const { tabs, keywords, selectedIndex } = this.state
111 124
     console.log(this.state)
112 125
     let values = selectedIndex.map((selectedList, tabIndex) => {
@@ -118,13 +131,13 @@ export default class Index extends Component {
118 131
       }
119 132
 
120 133
       // 类型
121
-      // if (tabIndex === 0) {
122
-      //   let val = selectedList.map(index => curTabList[index])
123
-      //   return val.join(',')
124
-      // }
134
+      if (tabIndex === 0) {
135
+        let val = selectedList.map(index => curTabList[index])
136
+        return val.join(',')
137
+      }
125 138
 
126 139
       // 价格 面积
127
-      if (tabIndex === 0 || tabIndex === 1) {
140
+      if (tabIndex === 1 || tabIndex === 2) {
128 141
         let val = selectedList.map(index => {
129 142
           let value = curTabList[index]
130 143
           let regVal = value.match(/\d*([-\d]*)?/)
@@ -147,7 +160,7 @@ export default class Index extends Component {
147 160
       }
148 161
 
149 162
       // 类型
150
-      if (tabIndex === 2) {
163
+      if (tabIndex === 3) {
151 164
         let val = selectedList.map(index => curTabList[index].buildingTypeId)
152 165
         return val.join(',')
153 166
       }
@@ -155,10 +168,10 @@ export default class Index extends Component {
155 168
     console.log(values)
156 169
     let params = {
157 170
       name: keywords,
158
-      // houseType: values[0],
159
-      price: values[0],
160
-      area: values[1],
161
-      buildingType: values[2],
171
+      houseType: values[0],
172
+      price: values[1],
173
+      area: values[2],
174
+      buildingType: values[3],
162 175
     }
163 176
     console.log(params)
164 177
     this.props.onFilter(params, () => {
@@ -205,7 +218,7 @@ export default class Index extends Component {
205 218
         {
206 219
           tabs[tabIndex].list.map((item, index) => (
207 220
             <View
208
-              key={index+'tab'}
221
+              key={index + 'tab'}
209 222
               className={`row ${selectedIndex[tabIndex].includes(index) ? 'active' : ''}`}
210 223
               onClick={this.handleFilterItemClick.bind(this, index)}>
211 224
               {item.name || item.buildingTypeName || item}
@@ -223,7 +236,7 @@ export default class Index extends Component {
223 236
 
224 237
   renderPrice() {
225 238
     const { priceTypeIndex, tabs, tabIndex, selectedIndex } = this.state
226
-    const priceArr = tabs[0].list
239
+    const priceArr = tabs[1].list
227 240
     const list = priceArr[priceTypeIndex].list
228 241
     return (
229 242
       <View className="price">
@@ -242,7 +255,7 @@ export default class Index extends Component {
242 255
           {
243 256
             list.map((text, index) => (
244 257
               <View
245
-                key={index+'list'}
258
+                key={index + 'list'}
246 259
                 className={`price-item ${selectedIndex[tabIndex].includes(index) ? 'selected' : ''}`}
247 260
                 onClick={this.handleFilterItemClick.bind(this, index)}>
248 261
                 {text}
@@ -285,7 +298,7 @@ export default class Index extends Component {
285 298
         <View className="search-box">
286 299
           <View className="search">
287 300
             <Text className="search-icon icon-sousuo iconfont"></Text>
288
-            <Input className="search-input" type="text" confirm-type="搜索" onConfirm={this.handleFilter} value={keywords} onInput={this.onInputText.bind(this)} placeholder="请输入你想查询的楼盘"></Input>
301
+            <Input className="search-input" type="text" focus confirm-type="搜索" onConfirm={this.handleFilter} value={keywords} onInput={this.onInputText.bind(this)} placeholder="请输入你想查询的楼盘"></Input>
289 302
           </View>
290 303
           <View className="location" onClick={this.handleLocationClick}>
291 304
             <Text className="location-icon iconfont icon-daohangdizhi"></Text>

+ 2
- 2
src/pages/project/list/filter/index.scss View File

@@ -80,8 +80,8 @@
80 80
     background: #F9F9F9;
81 81
 
82 82
     &-item {
83
-      width: 33.33%;
84
-      // width: 25%;
83
+      // width: 33.33%;
84
+      width: 25%;
85 85
       height: 100px;
86 86
       display: flex;
87 87
       justify-content: center;

+ 96
- 16
src/pages/shop/rule/index.js View File

@@ -1,24 +1,29 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2
-import { getWindowHeight } from '@utils/style'
3 2
 import './index.scss'
4
-
3
+import { transferImage } from '@utils/tools'
5 4
 import ready from '@utils/ready'
6 5
 import { connect } from '@tarojs/redux'
7 6
 import * as actions from '@actions/shop'
8
-import dayjs from 'dayjs'
7
+import { View } from '@tarojs/components';
8
+import { queryUserInfo, doUserSignin } from '@services/user'
9
+const ruleBg = require('@assets/rulebg.png')
10
+
11
+@connect(state => ({ ...state.shop, ...state.user, ...state.city, }), { ...actions })
9 12
 
10
-@connect(state => ({ ...state.shop, ...state.user }), { ...actions })
11 13
 export default class Shop extends Component {
12 14
   config = {
13 15
     navigationBarTitleText: '积分规则'
14 16
   }
15 17
 
16 18
   state = {
17
-    pointRule: []
19
+    pointRule: [],
20
+    user: {},
18 21
   }
19 22
 
20 23
   componentWillMount() {
24
+    this.loadUserInfo()
21 25
     this.loadRecords()
26
+
22 27
   }
23 28
 
24 29
   loadRecords() {
@@ -29,6 +34,85 @@ export default class Shop extends Component {
29 34
       })
30 35
       Taro.hideLoading()
31 36
     })
37
+
38
+  }
39
+  loadUserInfo() {
40
+    queryUserInfo().then(user => {
41
+      this.setState({
42
+        user,
43
+      })
44
+    })
45
+  }
46
+  getBtnName(code) {
47
+    const { user: { havaSigned } } = this.state
48
+    switch (code) {
49
+      case 'checkin':
50
+        return havaSigned ? '已签到' : '签到'
51
+      case 'share-poster':
52
+        return '去分享'
53
+      case 'recommend-customer':
54
+        return '去推荐'
55
+      case 'signup-agent':
56
+        return '去授权'
57
+      case 'document_verify':
58
+        return '去提交'
59
+      default:
60
+        return '立即参与'
61
+    }
62
+  }
63
+  // 签到
64
+  doSign(pointsAmount) {
65
+    const { user: { id, havaSigned } } = this.state
66
+
67
+
68
+    if (havaSigned) {
69
+      return
70
+    }
71
+    doUserSignin({ id }).then(res => {
72
+      Taro.showToast({
73
+        title: `签到成功,获取${pointsAmount}积分`,
74
+        icon: 'none'
75
+      })
76
+      this.loadUserInfo()
77
+
78
+    })
79
+  }
80
+  handleItemClick(item) {
81
+    switch (item.code) {
82
+      case 'checkin':
83
+        this.doSign(item.pointsAmount)
84
+        return
85
+      case 'share-poster':
86
+        Taro.switchTab({
87
+          url: '/pages/project/index'
88
+        })
89
+        return
90
+      case 'recommend-customer':
91
+        Taro.navigateTo({
92
+          url: `/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
93
+        })
94
+        return
95
+      case 'signup-agent':
96
+        Taro.navigateTo({
97
+          url: '/pages/person/personDetail/index'
98
+        })
99
+        return
100
+      case 'document_verify':
101
+        Taro.navigateTo({
102
+          url: '/pages/person/profile/index'
103
+        })
104
+        return
105
+      default:
106
+        Taro.getApp().props.projectIndex = 2
107
+        Taro.switchTab({
108
+          url: `/pages/activity/activity`,
109
+          fail: res => {
110
+            Taro.getApp().props.projectIndex = 0
111
+          }
112
+        })
113
+        return
114
+    }
115
+
32 116
   }
33 117
 
34 118
   render() {
@@ -36,28 +120,24 @@ export default class Shop extends Component {
36 120
     const { pointRule } = this.state
37 121
 
38 122
     return (
39
-      <View className="page">
40
-        <View className='rule_title'>
41
-          <Text>积分项</Text>
42
-          <Text>奖励积分</Text>
43
-          <Text>说明</Text>
44
-        </View>
123
+      // <View className="page" style={`background: url(${transferImage(buildBg)}) no-repeat center;background-size: 100% 100%;`}>
124
+      <View className="page" >
125
+        <Image className="bg-img" src={transferImage(ruleBg)} mode='widthFix'></Image>
45 126
         <ScrollView
46 127
           scrollY
47 128
           scroll-with-animation
48 129
           enable-back-to-top
49 130
           className="list"
50 131
           style={{
51
-            height: '65vh'
132
+            maxHeight: '78vh'
52 133
           }}>
53 134
           {
54 135
             pointRule.length === 0 ? '' : (
55 136
               pointRule.map(item => (
56 137
                 <View className='rule_item' key={item.ruleId}>
57
-                  <Text>{item.ruleName}</Text>
58
-                  <Text>+{item.pointsAmount}</Text>
59
-                  <Text>{item.remark}</Text>
60
-                  {/* <Text>{dayjs(item.updateDate).format('YYYY-MM-DD HH:mm:ss')}</Text> */}
138
+                  <View className="item-name">{item.ruleName}<Text className="item-num">+{item.pointsAmount}</Text><Text className="jifen">积分</Text></View>
139
+                  <View className="item-rule">{item.remark}</View>
140
+                  <View className={this.getBtnName(item.code)=='已签到'?'yiqiandao':"item-btn"} onClick={this.handleItemClick.bind(this, item)}>{this.getBtnName(item.code)}</View>
61 141
                 </View>
62 142
               ))
63 143
             )

+ 89
- 36
src/pages/shop/rule/index.scss View File

@@ -1,54 +1,107 @@
1 1
 @import "@styles/theme.scss";
2 2
 .page {
3 3
   position: relative;
4
-  background: #F2F2F2;
5 4
   width: 100%;
6 5
   height: 100%;
7
-  .rule_title {
8
-    position: fixed;
9
-    width: 100%;
10
-    left: 0%;
11
-    background: #fff;
12
-    color: #fd8000;
13
-    font-size: 28px;
14
-    display: flex;
15
-    justify-content: space-between;
16
-    align-items: center;
17
-    padding: 30px 90px;
18
-    box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.05);
19
-    font-weight:500;
6
+  .bg-img{
7
+    width: 100vw;
8
+    display: block;
20 9
   }
10
+  // .rule_title {
11
+  //   position: fixed;
12
+  //   width: 100%;
13
+  //   left: 0%;
14
+  //   background: #fff;
15
+  //   color: #fd8000;
16
+  //   font-size: 28px;
17
+  //   display: flex;
18
+  //   justify-content: space-between;
19
+  //   align-items: center;
20
+  //   padding: 30px 90px;
21
+  //   box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.05);
22
+  //   font-weight:500;
23
+  // }
21 24
   .list {
22 25
     position: absolute;
23
-    width: 100%;
24
-    top: 100px;
26
+    width: 690px;
27
+    left: 30px;
28
+    top: 560px;
29
+    background: #fff;
30
+    border-radius: 12px;
25 31
     .rule_item {
26 32
       position: relative;
27 33
       width: 100%;
28
-      text-align: center;
29
-      border-bottom: 2px solid rgba(151, 151, 151, 0.0865);
30
-      padding: 40px 12px;
31
-      display: inline-flex;
32
-      background: #fff;
33
-      Text {
34
-        width: 33.33%;
35
-        text-align: center;
36
-        float: left;
34
+      box-shadow:0px 1px 0px 0px rgba(0,0,0,0.08);
35
+      padding: 24px 20px 28px 20px;
36
+      .item-name{
37
+        font-size: 34px;
38
+        color: #333;
39
+        display: flex;
40
+        align-items: center;
41
+        margin-bottom: 16px;
42
+        .item-num{
43
+          font-size: 36px;
44
+          color: #FF8203;
45
+          margin: 0 6px 0 10px;
46
+        }
47
+        .jifen{
48
+          font-size: 24px;
49
+          color: #666;
50
+        }
37 51
       }
38
-      Text:nth-of-type(1){
39
-        color:rgba(0,0,0,1);
40
-        font-size: 30px;
41
-        font-weight:500;
52
+      .item-rule{
53
+        font-size: 24px;
54
+        color: #999;
55
+        width: 500px;
42 56
       }
43
-      Text:nth-of-type(2){
44
-        color:rgba(255,59,51,1);
45
-        font-size: 32px;
46
-        font-weight: 500;
57
+      .yiqiandao{
58
+        width:120px;
59
+        height:60px;
60
+        background:#d8d8d8;
61
+        border-radius:30px;
62
+        position: absolute;
63
+        right: 20px;
64
+        top: 24px;
65
+        color: #fff;
66
+        font-size: 26px;
67
+        text-align: center;
68
+        line-height: 60px;
69
+
47 70
       }
48
-      Text:nth-of-type(3){
49
-        color:rgba(0,0,0,0.33);
50
-        font-size: 24px;
71
+      .item-btn{
72
+        width:120px;
73
+        height:60px;
74
+        background:linear-gradient(180deg,rgba(255,222,131,1) 0%,rgba(255,129,2,1) 100%);
75
+        box-shadow:0px 12px 30px -8px rgba(255,131,5,0.5);
76
+        border-radius:30px;
77
+        position: absolute;
78
+        right: 20px;
79
+        top: 24px;
80
+        color: #fff;
81
+        font-size: 26px;
82
+        text-align: center;
83
+        line-height: 60px;
51 84
       }
85
+      // display: inline-flex;
86
+      // Text {
87
+      //   width: 33.33%;
88
+      //   text-align: center;
89
+      //   float: left;
90
+      // }
91
+      // Text:nth-of-type(1){
92
+      //   color:rgba(0,0,0,1);
93
+      //   font-size: 30px;
94
+      //   font-weight:500;
95
+      // }
96
+      // Text:nth-of-type(2){
97
+      //   color:rgba(255,59,51,1);
98
+      //   font-size: 32px;
99
+      //   font-weight: 500;
100
+      // }
101
+      // Text:nth-of-type(3){
102
+      //   color:rgba(0,0,0,0.33);
103
+      //   font-size: 24px;
104
+      // }
52 105
     }
53 106
   }
54 107
 }