houseDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <view class="content">
  3. <image class="topImg" :src="dataInfo.image" mode="aspectFill"></image>
  4. <view class="sectionA">
  5. <view class="topSection">
  6. <view class="title">{{dataInfo.name}}</view>
  7. <view class="tags">
  8. <view class="item" v-for="(item, idx) in dataInfo.categoryList" :key="idx"
  9. :style="`color: ${color2}; background-color: ${color6};`">{{item.categoryName}}</view>
  10. </view>
  11. <view class="shareBtn" :style="`background-color: ${color1};`" @click="toShareCard(2)">
  12. <image class="icon" src="https://dm.static.elab-plus.com/yezhu/h5/icon_share.png" mode="aspectFit"></image>
  13. <text>分享项目</text>
  14. </view>
  15. </view>
  16. <view class="bottomSection">
  17. <image class="icon" src="https://dm.static.elab-plus.com/yezhu/h5/icon_dingweiY.png" mode=""></image>
  18. <view class="name">{{dataInfo.province + dataInfo.city + dataInfo.district + dataInfo.address}}</view>
  19. </view>
  20. </view>
  21. <view class="sectionB">
  22. <view class="item" v-for="(item, idx) in categoryList" :key="idx">
  23. <view class="name">{{item.categoryName}}收益</view>
  24. <view class="value">{{item.value}}</view>
  25. </view>
  26. </view>
  27. <view class="sectionC">
  28. <view class="title">基本信息</view>
  29. <view class="line"></view>
  30. <view class="infos">
  31. <view class="item" v-for="(item, idx) in infos" :key="idx">
  32. <view class="name">{{item.title}}</view>
  33. <view class="value">{{item.value}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="sectionD" >
  38. <image class="icon" src="https://dm.static.elab-plus.com/yezhu/icon_hongbao.png" mode="aspectFit"></image>
  39. <view class="midSection">
  40. <view class="name">邀请好友注册</view>
  41. <view class="value">完成邀请,可获得¥{{dataInfo.registAmount}}/人</view>
  42. </view>
  43. <view class="invitationBtn" @click="toShareCard(1)">邀请好友</view>
  44. </view>
  45. <backHome></backHome>
  46. <login-notice></login-notice>
  47. <login></login>
  48. </view>
  49. </template>
  50. <script>
  51. import moment from '../../static/moment.min.js'
  52. import {
  53. displayDateFormatChi
  54. } from '../../static/format.js'
  55. let app = getApp();
  56. import backHome from "@/components/backHome/backHome.vue"
  57. export default {
  58. data() {
  59. return {
  60. color1: '',
  61. color2: '',
  62. color3: '',
  63. color6: '',
  64. infos: [{
  65. title: '开盘时间',
  66. value: ''
  67. },
  68. {
  69. title: '项目业态',
  70. value: ''
  71. },
  72. {
  73. title: '均价',
  74. value: ''
  75. },
  76. {
  77. title: '总价',
  78. value: ''
  79. },
  80. {
  81. title: '主力户型',
  82. value: ''
  83. }
  84. // {
  85. // title: '目标人群',
  86. // value: ''
  87. // }
  88. ],
  89. projectId: '',
  90. dataInfo: {
  91. "address": "",
  92. "availableIncome": "",
  93. "bizFormat": "",
  94. "categoryList": [],
  95. "city": "",
  96. "cusGroup": "",
  97. "district": "",
  98. "id": 0,
  99. "image": "",
  100. "mainHouseType": "",
  101. "maxPrice": 0,
  102. "maxTotalPrice": 0,
  103. "minPrice": 0,
  104. "minTotalPrice": 0,
  105. "name": "",
  106. "onlineStatus": 0,
  107. "openTime": 0,
  108. "otherPage": "",
  109. "projectFocusImage": "",
  110. "projectId": "",
  111. "province": "",
  112. "registAmount": "",
  113. "revision": "",
  114. "shareImg": "",
  115. "shareRemark": "",
  116. "xcxPage": ""
  117. },
  118. categoryList: []
  119. }
  120. },
  121. onLoad(param) {
  122. this.projectId = param.projectId;
  123. },
  124. components:{
  125. backHome
  126. },
  127. mounted() {
  128. this.color1 = app.globalData.color1;
  129. this.color2 = app.globalData.color2;
  130. this.color3 = app.globalData.color3;
  131. this.color6 = app.globalData.color6;
  132. this.detailDatahandle()
  133. uni.$on("request",()=>{
  134. this.detailDatahandle()
  135. })
  136. },
  137. methods: {
  138. async detailDatahandle() {
  139. if(getApp().globalData.userId){
  140. var parmas = {
  141. projectId: this.projectId,
  142. userId:getApp().globalData.userId
  143. }
  144. this.createUserProjectRlat();
  145. let res = await this.$myRequest({
  146. url: '/project/queryProjectByH5',
  147. data: parmas
  148. })
  149. if (res && res.data.success) {
  150. console.log('详情res:', res)
  151. this.dataInfo = res.data.single
  152. this.reloadCategoryList()
  153. this.reloadInfos()
  154. }
  155. }
  156. },
  157. async createUserProjectRlat() {
  158. if(getApp().globalData.userId){
  159. var parmas = {
  160. projectId: this.projectId,
  161. shareToken:getApp().globalData.shareToken
  162. }
  163. let res = await this.$myRequest({
  164. url: '/user/createUserProjectRlat',
  165. data: parmas
  166. })
  167. if (res && res.data.success) {
  168. }
  169. }
  170. },
  171. reloadCategoryList() {
  172. var tempList = JSON.parse(JSON.stringify(this.dataInfo.categoryList || []))
  173. tempList.forEach((item, idx) => {
  174. item.value = '¥' + (parseFloat(item.amount || 0.00).toFixed(2)) + '/个'
  175. })
  176. this.categoryList = tempList
  177. this.categoryList.push({categoryName: '可获收益', value: this.dataInfo.availableIncome + '元'})
  178. },
  179. reloadInfos() {
  180. this.infos[0].value = this.timeFilterAction(this.dataInfo.openTime)
  181. this.infos[1].value = this.dataInfo.bizFormat
  182. if (this.dataInfo.maxPrice > 0) {
  183. this.infos[2].value = this.priceReload(this.dataInfo.minPrice) + '~' + this.priceReload(this.dataInfo.maxPrice) + '/m²'
  184. }
  185. else {
  186. this.infos[2].value = this.priceReload(this.dataInfo.minPrice) + '/m²'
  187. }
  188. if (this.dataInfo.maxTotalPrice > 0) {
  189. this.infos[3].value = this.priceReload(this.dataInfo.minTotalPrice) + '~' + this.priceReload(this.dataInfo.maxTotalPrice) + '/套'
  190. }
  191. else {
  192. this.infos[3].value = this.priceReload(this.dataInfo.minTotalPrice) + '/套'
  193. }
  194. this.infos[4].value = this.dataInfo.mainHouseType
  195. // this.infos[5].value = this.dataInfo.cusGroup
  196. this.infos.forEach((item, idx) => {
  197. if (!item.value) {
  198. item.value = '暂无'
  199. }
  200. })
  201. },
  202. timeFilterAction(val) {
  203. if (val) {
  204. return displayDateFormatChi(val * 1000)
  205. }
  206. else {
  207. return ''
  208. }
  209. },
  210. priceReload(val) {
  211. return parseFloat(val / 10000).toFixed(2) + '万'
  212. },
  213. toShareCard(type){
  214. if(getApp().globalData.userId){
  215. let href = location.origin+location.pathname;
  216. uni.navigateTo({
  217. url:'../shareCardPage/shareCardPage?page='+href+"&projectId="+this.projectId+"&type="+type
  218. })
  219. }else{
  220. uni.$emit('unLogin')
  221. }
  222. },
  223. backAction() {
  224. uni.navigateBack({
  225. delta:1
  226. })
  227. }
  228. },
  229. watch: {
  230. }
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. page {
  235. width: 100vw;
  236. height: 100vh;
  237. background-color: #FFFFFF;
  238. }
  239. .content {
  240. width: 100%;
  241. height: 100%;
  242. position: relative;
  243. .topImg {
  244. width: 100%;
  245. height: 480rpx;
  246. background-color: rgba($color: #000000, $alpha: 0.5);
  247. // 滤镜效果
  248. // -webkit-filter: grayscale(30%); /* Chrome, Safari, Opera */
  249. // filter: grayscale(30%);
  250. }
  251. .sectionA {
  252. padding: 0 30rpx;
  253. box-sizing: border-box;
  254. width: 100%;
  255. margin-top: 50rpx;
  256. .topSection {
  257. display: flex;
  258. justify-content: space-between;
  259. align-items: center;
  260. padding-left: 6rpx;
  261. box-sizing: border-box;
  262. .title {
  263. font-size: 44rpx;
  264. font-family: Verdana, Verdana-Bold;
  265. font-weight: 700;
  266. text-align: left;
  267. color: #262626;
  268. }
  269. .tags {
  270. margin-left: 8rpx;
  271. display: flex;
  272. justify-content: flex-start;
  273. align-items: center;
  274. flex-grow: 1;
  275. .item {
  276. padding: 0 18rpx;
  277. box-sizing: border-box;
  278. line-height: 40rpx;
  279. height: 40rpx;
  280. text-align: center;
  281. font-size: 20rpx;
  282. font-family: Verdana, Verdana-Regular;
  283. font-weight: 400;
  284. margin-left: 12rpx;
  285. }
  286. }
  287. .shareBtn {
  288. width: 140rpx;
  289. height: 52rpx;
  290. border-radius: 8px;
  291. box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.10);
  292. display: flex;
  293. align-items: center;
  294. font-size: 22rpx;
  295. font-family: Verdana, Verdana-Regular;
  296. font-weight: 400;
  297. text-align: left;
  298. color: #ffffff;
  299. .icon {
  300. width: 32rpx;
  301. height: 32rpx;
  302. margin-left: 10rpx;
  303. }
  304. }
  305. }
  306. .bottomSection {
  307. margin-top: 16rpx;
  308. display: flex;
  309. justify-content: flex-start;
  310. align-items: center;
  311. height: 80rpx;
  312. background: #f8f8f8;
  313. border-radius: 8rpx;
  314. .icon {
  315. width: 20rpx;
  316. height: 28rpx;
  317. margin-right: 14rpx;
  318. margin-left: 25rpx;
  319. }
  320. .name {
  321. font-size: 24rpx;
  322. font-family: Verdana, Verdana-Regular;
  323. font-weight: 400;
  324. text-align: left;
  325. color: #b1b1b1;
  326. }
  327. }
  328. }
  329. .sectionB {
  330. width: 100%;
  331. display: flex;
  332. align-items: center;
  333. padding: 40rpx 36rpx;
  334. box-sizing: border-box;
  335. flex-wrap: wrap;
  336. .item {
  337. width: calc((100% - 12rpx) / 3);
  338. min-width: calc((100% - 12rpx) / 3);
  339. max-width: calc((100% - 12rpx) / 3);
  340. .name {
  341. font-size: 24rpx;
  342. font-family: Verdana, Verdana-Regular;
  343. font-weight: 400;
  344. text-align: left;
  345. color: #b1b1b1;
  346. }
  347. .value {
  348. font-size: 32rpx;
  349. font-family: DIN Alternate, DIN Alternate-Bold;
  350. font-weight: 700;
  351. text-align: left;
  352. white-space: nowrap;
  353. color: #fd8f3c;
  354. }
  355. }
  356. }
  357. .sectionC {
  358. width: 100%;
  359. padding: 0 36rpx 76rpx 36rpx;
  360. box-sizing: border-box;
  361. display: flex;
  362. flex-wrap: wrap;
  363. .title {
  364. font-size: 28rpx;
  365. font-family: Verdana, Verdana-Bold;
  366. font-weight: 700;
  367. text-align: left;
  368. color: #171717;
  369. width: 100%;
  370. margin-bottom: 26rpx;
  371. }
  372. .line {
  373. width: 6rpx;
  374. height: 268rpx;
  375. background: linear-gradient(180deg, #ffd7b9, rgba(255, 215, 185, 0.00));
  376. border-radius: 4rpx;
  377. }
  378. .infos {
  379. margin-left: 30rpx;
  380. width: calc(100% - 36rpx);
  381. margin-top: -20rpx;
  382. display: flex;
  383. flex-wrap: wrap;
  384. align-items: center;
  385. justify-content: space-between;
  386. .item {
  387. width: 50%;
  388. .name {
  389. font-size: 24rpx;
  390. font-family: Verdana, Verdana-Regular;
  391. font-weight: 400;
  392. text-align: left;
  393. color: #b1b1b1;
  394. }
  395. .value {
  396. font-size: 24rpx;
  397. font-family: Verdana, Verdana-Regular;
  398. font-weight: 400;
  399. text-align: left;
  400. color: #262626;
  401. }
  402. }
  403. }
  404. }
  405. .sectionD {
  406. display: flex;
  407. justify-content: space-between;
  408. align-items: center;
  409. margin-left: 30rpx;
  410. width: calc(100% - 60rpx);
  411. height: 140rpx;
  412. background: linear-gradient(108deg, #ffb55f 9%, #f87523 96%);
  413. border-radius: 16rpx;
  414. padding: 0 20rpx 0 26rpx;
  415. box-sizing: border-box;
  416. .icon {
  417. width: 60rpx;
  418. height: 80rpx;
  419. margin-right: 20rpx;
  420. }
  421. .midSection {
  422. flex-grow: 1;
  423. .name {
  424. font-size: 30rpx;
  425. font-family: Verdana, Verdana-Bold;
  426. font-weight: 700;
  427. text-align: left;
  428. color: #ffffff;
  429. }
  430. .value {
  431. font-size: 24rpx;
  432. font-family: Verdana, Verdana-Regular;
  433. font-weight: 400;
  434. text-align: left;
  435. color: #ffead8;
  436. }
  437. }
  438. .invitationBtn {
  439. width: 140rpx;
  440. height: 56rpx;
  441. border-radius: 12rpx;
  442. background-color: #FFFFFF;
  443. font-size: 24rpx;
  444. font-family: Verdana, Verdana-Bold;
  445. font-weight: 700;
  446. text-align: center;
  447. color: #f07423;
  448. line-height: 56rpx;
  449. }
  450. }
  451. }
  452. </style>