Parcourir la source

feats: add project vr info

yansen il y a 5 ans
Parent
révision
a13a05f845

+ 4
- 4
config/dev.js Voir le fichier

@@ -7,10 +7,10 @@ module.exports = {
7 7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8 8
     // HOST: '"https://dev.pawoma.cn"',//测试
9 9
     // WSS_HOST: '"wss://dev.pawoma.cn"',
10
-    HOST: '"https://lt.pawoma.cn"',
11
-    WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    // HOST: '"http://192.168.2.51:8080"',
13
-    // WSS_HOST: '"ws://192.168.2.51:8080"',
10
+    // HOST: '"https://lt.pawoma.cn"',
11
+    // WSS_HOST: '"wss://lt.pawoma.cn"',
12
+    HOST: '"http://127.0.0.1:8080"',
13
+    WSS_HOST: '"ws://127.0.0.1:8080"',
14 14
     Version: 'V3.5.6'
15 15
   },
16 16
   weapp: {},

+ 1
- 1
config/prod.js Voir le fichier

@@ -9,7 +9,7 @@ module.exports = {
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.6_2020-1-20'
12
+    Version:'V3.5.6_2020-1-30'
13 13
   },
14 14
   weapp: {},
15 15
   h5: {}

+ 15402
- 0
package-lock.json
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 2
- 2
project.config.json Voir le fichier

@@ -1,8 +1,8 @@
1 1
 {
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "mini-chengjiao",
4
-	"description": "知与行互动",
5
-	"appid": "wxd6f47a9bb3052175",
4
+	"description": "大营销云测试",
5
+	"appid": "wxda1f84b79b3edeb3",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,

+ 1
- 0
src/app.js Voir le fichier

@@ -92,6 +92,7 @@ class App extends Component {
92 92
       'pages/card/fans/index',
93 93
       'pages/checkin/index',
94 94
       'pages/checkin/checkinsuccess/index',
95
+      'pages/project/panorama/index',
95 96
     ],
96 97
     subPackages: [
97 98
       {

BIN
src/assets/vr.png Voir le fichier


+ 14
- 8
src/pages/card/fans/index.js Voir le fichier

@@ -120,6 +120,7 @@ export default class Index extends Component {
120 120
   render() {
121 121
     // const { hasMore, isEmpty, list, noReacord } = this.state
122 122
     const { hasMore, isEmpty, list } = this.state
123
+
123 124
     return (
124 125
       // <ListView
125 126
       //   needInit
@@ -132,15 +133,20 @@ export default class Index extends Component {
132 133
       // >
133 134
       //   {list.map(item => <FansItem key={item.uvId} data={item} />)}
134 135
       // </ListView>
135
-      <View>
136
-        {!noReacord ?
137
-          <View>
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>}
141
-          </View>
142
-          : <EmptyPage text="暂无围观记录哦~" />}
136
+      // <View>
137
+      //   {!noReacord ?
138
+      //     <View>
139
+      //       {list.map(item =>
140
+      //         <FansItem key={item.uvId} data={item} />)}
141
+      //       {list.length >= 50 && <View style="text-align:center;line-height:120rpx;font-size:24rpx;color:#999"> 仅展示最近50条围观记录</View>}
142
+      //     </View>
143
+      //     : <EmptyPage text="暂无围观记录哦~" />}
143 144
 
145
+      // </View>
146
+      <View>
147
+        {list.map(item =>
148
+          <FansItem key={item.uvId} data={item} />)}
149
+        {list.length >= 50 && <View style="text-align:center;line-height:120rpx;font-size:24rpx;color:#999"> 仅展示最近50条围观记录</View>}
144 150
       </View>
145 151
 
146 152
     );

+ 11
- 1
src/pages/project/banner/index.js Voir le fichier

@@ -57,11 +57,21 @@ export default class SwiperBanner extends Component {
57 57
                 mode="aspectFill"
58 58
                 style={style}
59 59
                 className='home-banner__swiper-item-img'
60
-                src={transferImage(item.image || item.url || item.img || emptyImg)}
60
+                src={transferImage(item.image || item.coverImg || item.url || item.img || emptyImg)}
61 61
               />
62 62
             </SwiperItem>
63 63
           ))}
64 64
         </Swiper>
65
+        {
66
+          this.props.logo &&
67
+          (
68
+            <Image
69
+              mode="aspectFill"
70
+              className='logo'
71
+              src={this.props.logo}
72
+            />
73
+          )
74
+        }
65 75
       </View>
66 76
     )
67 77
   }

+ 9
- 0
src/pages/project/banner/index.scss Voir le fichier

@@ -3,6 +3,15 @@
3 3
   width: 100%;
4 4
   overflow: hidden;
5 5
   height: 250px;
6
+  position: relative;
7
+
8
+  .logo {
9
+    position: absolute;
10
+    left: 0;
11
+    bottom: 0;
12
+    width: 64rpx;
13
+    height: 64rpx;
14
+  }
6 15
 }
7 16
 
8 17
 .home-banner__swiper {

+ 111
- 34
src/pages/project/detail/index.js Voir le fichier

@@ -36,6 +36,7 @@ import { share as shareSavePoint } from '@/utils/shareSavePoint'
36 36
 
37 37
 const buildBg = 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/images/buildbg.png'
38 38
 const dotImg = require('@/assets/dot.png')
39
+const vrLogo = require('@/assets/vr.png');
39 40
 
40 41
 @connect(
41 42
   ({ user, project }) => ({ ...user, ...project }),
@@ -72,7 +73,7 @@ export default class Index extends Component {
72 73
     recordId: null,
73 74
     posterShow: 'none',
74 75
     current: 1,
75
-    btnstate: 0,// 1显示视频 0显示图片
76
+    btnstate: 0,// 1显示视频 0显示图片 2显示全景
76 77
     albumCurrent: 0,
77 78
     videoPlayShow: 'flex',
78 79
     consultData: {}, // 分享的置业顾问信息
@@ -1042,6 +1043,15 @@ export default class Index extends Component {
1042 1043
       url: '/pages/activity/detail/assemble?id=' + item.activityId
1043 1044
     })
1044 1045
   }
1046
+
1047
+  handleHouseTypePosterClick(apartment, imgList) {
1048
+    if (apartment.panoramaArr) {
1049
+      this.goToPanorama(apartment.panoramaArr[0])
1050
+    } else {
1051
+      this.handlePreviewHxImage(apartment.buildingImgList[0].url, imgList)
1052
+    }
1053
+  }
1054
+
1045 1055
   renderGroup() {
1046 1056
     const { groupList } = this.state
1047 1057
     return (
@@ -1066,13 +1076,23 @@ export default class Index extends Component {
1066 1076
 
1067 1077
   renderHouseTypeList() {
1068 1078
     const { statusOpts, statusBgColors } = this.state
1069
-    const { projectDetail: { buildingApartment } } = this.props
1079
+    const { projectDetail: { buildingApartment, panoramaList } } = this.props
1070 1080
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
1081
+
1082
+    // 挂载全景图设置
1083
+    list.forEach(apartment => {
1084
+      const panoramaArr = (panoramaList || []).filter(x => x.buildingId === apartment.buildingId && x.apartmentId === apartment.apartmentId )
1085
+      if (panoramaArr.length) {
1086
+        apartment.panoramaArr = panoramaArr
1087
+      }
1088
+    })
1089
+
1071 1090
     let imgUrls = list.reduce((prev, cur) => {
1072 1091
       prev = prev.concat(cur.buildingImgList)
1073 1092
       return prev
1074 1093
     }, [])
1075 1094
     imgUrls = imgUrls.map(item => item.url)
1095
+
1076 1096
     return (
1077 1097
       <Block>
1078 1098
         {
@@ -1086,10 +1106,17 @@ export default class Index extends Component {
1086 1106
                     <View className='item' key={item.apartmentId}>
1087 1107
                       {
1088 1108
                         item && (
1089
-                          <View className='house__img-info'>
1090
-                            <Image className='house__img' src={transferImage(item.buildingImgList[0].url)} mode="widthFix" onClick={this.handlePreviewHxImage.bind(this, item.buildingImgList[0].url, imgUrls)}></Image>
1109
+                          <Block>
1091 1110
                             <View className='house-type__state' style={`background-color: ${statusBgColors[item.marketStatus - 1]}`}>{statusOpts[item.marketStatus - 1]}</View>
1092
-                          </View>
1111
+                            <View className='house__img-info'>
1112
+                              <Image className='house__img' src={transferImage(item.buildingImgList[0].url)} mode="widthFix" onClick={this.handleHouseTypePosterClick.bind(this, item, imgUrls)}></Image>
1113
+                              {item.panoramaArr && (
1114
+                                <View className='house-type__panorama'>
1115
+                                  <Image mode="aspectFill" src={vrLogo} style={{ width: '100%', height: '100%' }} />
1116
+                                </View>
1117
+                              )}
1118
+                            </View>
1119
+                          </Block>
1093 1120
                         )
1094 1121
                       }
1095 1122
                       <View className="rest-info">
@@ -1232,7 +1259,6 @@ export default class Index extends Component {
1232 1259
       <View
1233 1260
         className="pro__banner"
1234 1261
       >
1235
-        {console.log(projectDetail)}
1236 1262
         <Video
1237 1263
           src={projectDetail.videoUrl}
1238 1264
           // src='http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
@@ -1281,6 +1307,69 @@ export default class Index extends Component {
1281 1307
     })
1282 1308
   }
1283 1309
 
1310
+  handleBannerBtnClick(btnstate) {
1311
+    this.setState({ btnstate, current: 1 })
1312
+  }
1313
+
1314
+  goToPanorama(panorama) {    
1315
+    const url = (panorama || {}).panoramaLink
1316
+
1317
+    if (!url) return;
1318
+
1319
+    this.navigateTo(`/pages/project/panorama/index?url=${encodeURIComponent(url)}`)
1320
+  }
1321
+
1322
+  handlePanoramaClick(panorama) {
1323
+    this.goToPanorama(panorama)
1324
+  }
1325
+
1326
+  renderBannerImages() {
1327
+    const { projectDetail } = this.props
1328
+    const { current = 1 } = this.state
1329
+
1330
+    return (
1331
+      <View
1332
+        className="pro__banner"
1333
+        onClick={this.previewImage.bind(this, projectDetail.buildingImg)}>
1334
+        <Banner
1335
+          list={projectDetail.buildingImg}
1336
+          indicatorDots={false}
1337
+          // current
1338
+          // isChange = {true}
1339
+          onChange={this.changeCurrent.bind(this)}
1340
+          style={{
1341
+            height: '600rpx'
1342
+          }}
1343
+
1344
+        ></Banner>
1345
+        <Text className="pro__banner-text">{current}/{(projectDetail.buildingImg && projectDetail.buildingImg.length) || 0}</Text>
1346
+      </View>
1347
+    );
1348
+  }
1349
+
1350
+  renderBannerPanorama() {
1351
+    const { projectDetail } = this.props
1352
+    const { current = 1 } = this.state
1353
+
1354
+    return (
1355
+      <View className="pro__banner">
1356
+        <Banner
1357
+          list={projectDetail.panoramaList || []}
1358
+          indicatorDots={false}
1359
+          // current
1360
+          // isChange = {true}
1361
+          onChange={this.changeCurrent.bind(this)}
1362
+          onClick={this.handlePanoramaClick.bind(this)}
1363
+          style={{
1364
+            height: '600rpx'
1365
+          }}
1366
+          logo={vrLogo}
1367
+        ></Banner>
1368
+        <Text className="pro__banner-text">{current}/{(projectDetail.panoramaList && projectDetail.panoramaList.length) || 0}</Text>
1369
+      </View>
1370
+    );
1371
+  }
1372
+
1284 1373
   render() {
1285 1374
     const { grantPhoneVisible, grantAvatarVisible, posterStatus, posterData, loaded, btnstate, consultData, consultShow } = this.state
1286 1375
     const { projectDetail, userInfo = { person: {} } } = this.props
@@ -1305,36 +1394,24 @@ export default class Index extends Component {
1305 1394
           loaded && (
1306 1395
             <View className='detail'>
1307 1396
               <Notice></Notice>
1308
-              {/* {(projectDetail.videoUrl == null || btnstate === 0) && ( */}
1309
-              <View
1310
-                className="pro__banner"
1311
-                onClick={this.previewImage.bind(this, projectDetail.buildingImg)}>
1312
-                <Banner
1313
-                  list={projectDetail.buildingImg}
1314
-                  indicatorDots={false}
1315
-                  // current
1316
-                  // isChange = {true}
1317
-                  onChange={this.changeCurrent.bind(this)}
1318
-                  style={{
1319
-                    height: '600rpx'
1320
-                  }}
1321
-
1322
-                ></Banner>
1323
-                <Text className="pro__banner-text">{this.current}/{(projectDetail.buildingImg && projectDetail.buildingImg.length) || 0}</Text>
1324
-              </View>
1325
-              {/* )} */}
1326
-
1327
-              {/* {btnstate === 1 && projectDetail.videoUrl != null && this.renderVideo()} */}
1328 1397
 
1329
-              {/* {btnstate === 1 && projectDetail.videoUrl != null && (<View className='media-btn'>
1330
-                <View className='video-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }} >视频</View>
1331
-                <View className='img-btn' onClick={() => this.setState({ btnstate: 0 })}>图片</View>
1332
-              </View>)} */}
1398
+              { !btnstate && this.renderBannerImages() }
1399
+              
1400
+              { btnstate === 1 && this.renderVideo() }
1401
+              
1402
+              { btnstate === 2 && this.renderBannerPanorama() }
1333 1403
 
1334
-              {/* {btnstate === 0 && projectDetail.videoUrl != null && (<View className='media-btn'>
1335
-                <View className='video-btn' onClick={() => this.setState({ btnstate: 1 })} >视频</View>
1336
-                <View className='img-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }}>图片</View>
1337
-              </View>)} */}
1404
+              {
1405
+                projectDetail.buildingImg && projectDetail.buildingImg.length &&
1406
+                projectDetail.panoramaList && projectDetail.panoramaList.length &&
1407
+                (
1408
+                  <View className="media-btn">
1409
+                    {/* <View className={`btn ${btnstate === 1 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 1)}>视频</View> */}
1410
+                    <View className={`btn ${btnstate === 2 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 2)}>全景</View>
1411
+                    <View className={`btn ${!btnstate && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 0)}>图片</View>
1412
+                  </View>
1413
+                )
1414
+              }
1338 1415
 
1339 1416
               <ScrollView
1340 1417
                 enableBackToTop

+ 19
- 11
src/pages/project/detail/index.scss Voir le fichier

@@ -17,8 +17,6 @@
17 17
     position: absolute;
18 18
     width: 184px;
19 19
     height: 64px;
20
-    background: rgba(255, 255, 255, 1);
21
-    border-radius: 12px;
22 20
     top: 440px;
23 21
     left: 284px;
24 22
     font-size: 30px;
@@ -30,18 +28,20 @@
30 28
     display: flex;
31 29
     position: fixed;
32 30
 
33
-    .video-btn {
31
+    .btn {
34 32
       width: 92px;
35 33
       height: 64px;
36
-      border-radius: 12px 0px 0px 12px;
37
-
34
+      border-radius: 12px;
35
+      background: rgba(255, 255, 255, 1);
38 36
 
37
+      & + .btn {
38
+        margin-left: 24px;
39
+      }
39 40
     }
40 41
 
41
-    .img-btn {
42
-      width: 92px;
43
-      height: 64px;
44
-      border-radius: 0px 12px 12px 0px;
42
+    .active {
43
+      background: rgba(187, 156, 121, 1);
44
+      color: rgba(255, 255, 255, 1);
45 45
     }
46 46
 
47 47
   }
@@ -891,9 +891,17 @@
891 891
       border-radius: 16px;
892 892
 
893 893
       .house__img-info {
894
-        padding: 70px 30px 80px 30px;
894
+        position: relative;
895
+        padding: 70px 30px;
895 896
         border-bottom: 1px solid rgba(232, 232, 232, 1);
896
-
897
+      
898
+        .house-type__panorama {
899
+          position: absolute;
900
+          left: 30px;
901
+          bottom: 70px;
902
+          width: 64px;
903
+          height: 64px;
904
+        }
897 905
 
898 906
         .house__img {
899 907
           width: 100%;

+ 16
- 0
src/pages/project/panorama/index.js Voir le fichier

@@ -0,0 +1,16 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { WebView } from '@tarojs/components'
3
+
4
+export default class Panorama extends Component {
5
+  state = {}
6
+
7
+  componentWillMount() {}
8
+
9
+  render () {
10
+    const url = decodeURIComponent(this.$router.params.url)
11
+
12
+    return (
13
+      <WebView src={url} />
14
+    )
15
+  }
16
+}