xujing 5 years ago
parent
commit
05e507d826
4 changed files with 140 additions and 10 deletions
  1. 4
    4
      config/dev.js
  2. 99
    5
      src/pages/project/detail/index.js
  3. 36
    0
      src/pages/project/detail/index.scss
  4. 1
    1
      src/pages/project/index.js

+ 4
- 4
config/dev.js View File

@@ -3,10 +3,10 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"https://dev.fangdeal.cn"', //测试
7
-    WSS_HOST: '"wss://dev.fangdeal.cn"',
8
-    // HOST: '"http://192.168.2.43:8080"',
9
-    // WSS_HOST: '"ws://192.168.2.43:8080"',
6
+    // HOST: '"https://dev.fangdeal.cn"', //测试
7
+    // WSS_HOST: '"wss://dev.fangdeal.cn"',
8
+    HOST: '"http://192.168.2.43:8080"',
9
+    WSS_HOST: '"ws://192.168.2.43:8080"',
10 10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
11 11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
12 12
     Version: "V3.5.28"

+ 99
- 5
src/pages/project/detail/index.js View File

@@ -84,6 +84,8 @@ export default class Index extends Component {
84 84
     qrcodeParams: '',
85 85
     grantPhoneVisible: false, // 授权电话
86 86
     grantAvatarVisible: false, // 授权头像
87
+    maskVisible: false,
88
+    extendContent: []
87 89
   }
88 90
 
89 91
   componentWillPreload(params) {
@@ -125,11 +127,11 @@ export default class Index extends Component {
125 127
   componentDidShow() {
126 128
     console.log('3366633', this.$router.params)
127 129
 
128
-      const fromCard = !!wx.getStorageSync('from-card')
130
+    const fromCard = !!wx.getStorageSync('from-card')
129 131
 
130
-      if (fromCard) {
131
-        this.loadData()
132
-      }
132
+    if (fromCard) {
133
+      this.loadData()
134
+    }
133 135
   }
134 136
 
135 137
   componentWillUnmount() {
@@ -336,8 +338,11 @@ export default class Index extends Component {
336 338
     })
337 339
 
338 340
     dispatchProjectDetail(buildingId).then(res => {
341
+      const maskVisible = (res.extendContent || []).length
339 342
       this.setState({
340 343
         loaded: true,
344
+        maskVisible,
345
+        extendContent: res.extendContent[0],
341 346
         // circumOpts: newCircumOpts,
342 347
         isSaved: res.isSave
343 348
       }, () => {
@@ -1504,9 +1509,95 @@ export default class Index extends Component {
1504 1509
       </View>
1505 1510
     );
1506 1511
   }
1512
+  handleMaskBannerClick(data) {
1513
+    this.redirectTo(data)
1514
+  }
1515
+  redirectTo({ targetId, contentType, buildingId } = {}) {
1516
+    switch (contentType) {
1517
+      // 项目
1518
+      case 'project':
1519
+        Taro.navigateTo({
1520
+          url: '/pages/project/detail/index?id=' + buildingId
1521
+        })
1522
+        return;
1507 1523
 
1524
+      // 活动
1525
+      case 'activity':
1526
+        Taro.navigateTo({
1527
+          url: '/pages/activity/detail/index?id=' + targetId
1528
+        })
1529
+        return;
1530
+
1531
+      // 助力
1532
+      case 'help':
1533
+        Taro.navigateTo({
1534
+          url: '/pages/activity/detail/assistance?id=' + targetId
1535
+        })
1536
+        return;
1537
+
1538
+      // 拼团
1539
+      case 'group':
1540
+        Taro.navigateTo({
1541
+          url: '/pages/activity/detail/assemble?id=' + targetId
1542
+        })
1543
+        return;
1544
+
1545
+      // 资讯
1546
+      case 'news':
1547
+        Taro.navigateTo({
1548
+          url: '/pages/news/detail/index?id=' + targetId
1549
+        })
1550
+        return;
1551
+      // h5
1552
+      case 'h5':
1553
+        Taro.navigateTo({
1554
+          url: '/pages/project/h5Page?id=' + targetId
1555
+        })
1556
+        return;
1557
+      // live
1558
+      case 'live':
1559
+        Taro.navigateTo({
1560
+          url: '/onlineSelling/pages/live/index?id=' + targetId
1561
+        })
1562
+        return;
1563
+      // salesBatch
1564
+      case 'salesBatch':
1565
+        Taro.navigateTo({
1566
+          url: `/onlineSelling/pages/houseList/index?id=${targetId}`
1567
+        })
1568
+        return;
1569
+
1570
+      // 其他
1571
+      case 'others':
1572
+      default:
1573
+        this.handleMaskClose()
1574
+        return;
1575
+    }
1576
+  }
1577
+  handleMaskClose() {
1578
+    this.setState({
1579
+      maskVisible: false
1580
+    })
1581
+  }
1582
+  renderMaskBanner() {
1583
+
1584
+    const { extendContent = [] } = this.state
1585
+    return (
1586
+      <View className="mask-banner">
1587
+        <View className="content">
1588
+          <Image
1589
+            mode="widthFix"
1590
+            className="img"
1591
+            src={transferImage(extendContent.image)}
1592
+            onClick={this.handleMaskBannerClick.bind(this, extendContent)}>
1593
+          </Image>
1594
+          <Icon className="iconfont close icon-buoumaotubiao20" onClick={this.handleMaskClose}></Icon>
1595
+        </View>
1596
+      </View>
1597
+    )
1598
+  }
1508 1599
   render() {
1509
-    const { grantPhoneVisible, grantAvatarVisible, posterStatus, posterData, loaded, btnstate, consultData, consultShow } = this.state
1600
+    const { grantPhoneVisible, grantAvatarVisible, maskVisible, posterStatus, posterData, loaded, btnstate, consultData, consultShow } = this.state
1510 1601
     const { projectDetail, userInfo = { person: {} } } = this.props
1511 1602
     const { uvList = {} } = projectDetail
1512 1603
     const { total = 0, records = [] } = uvList
@@ -1533,6 +1624,9 @@ export default class Index extends Component {
1533 1624
           grantAvatarVisible &&
1534 1625
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
1535 1626
         }
1627
+
1628
+        {maskVisible && this.renderMaskBanner()}
1629
+
1536 1630
         {
1537 1631
           loaded && (
1538 1632
             <View className='detail'>

+ 36
- 0
src/pages/project/detail/index.scss View File

@@ -200,6 +200,42 @@
200 200
   }
201 201
 }
202 202
 
203
+.mask-banner {
204
+  position: fixed;
205
+  width: 100vw;
206
+  height: 100vh;
207
+  left: 0;
208
+  top: 0;
209
+  z-index: 9999;
210
+  background: rgba(0, 0, 0, 0.8);
211
+  display: flex;
212
+  flex-direction: column;
213
+  justify-content: center;
214
+  align-items: center;
215
+
216
+  .content {
217
+    width: 500px;
218
+    height: 600px;
219
+    position: absolute;
220
+    left: 50%;
221
+    top: 40%;
222
+    margin-left: -250px;
223
+    transform: translateY(-50%);
224
+    text-align: center;
225
+
226
+    .img {
227
+      width: 100%;
228
+      height: 600px;
229
+      border-radius: 30px;
230
+    }
231
+
232
+    .close {
233
+      font-size: 48px;
234
+      color: white;
235
+    }
236
+  }
237
+}
238
+
203 239
 .bt-nav {
204 240
   position: fixed;
205 241
   width: 100%;

+ 1
- 1
src/pages/project/index.js View File

@@ -141,7 +141,7 @@ export default class Index extends Component {
141 141
 
142 142
     queryExtContents({ cityId: curCity.id }).then(res => {
143 143
       // 开屏广告
144
-      const maskBanner = (res || []).filter(x => x.showType === 'screen')[0] || {}
144
+      const maskBanner = (res || []).filter(x => x.showType === 'screen' && x.showPosition === 'index')[0] || {}
145 145
       const maskVisible = maskBanner.contentId && this.props.screenShow !== maskBanner.contentId
146 146
 
147 147
       // 首页 banner