houseDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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. var parmas = {
  140. projectId: this.projectId
  141. }
  142. this.createUserProjectRlat();
  143. let res = await this.$myRequest({
  144. url: '/project/queryProjectByH5',
  145. data: parmas
  146. })
  147. if (res && res.data.success) {
  148. console.log('详情res:', res)
  149. this.dataInfo = res.data.single
  150. this.reloadCategoryList()
  151. this.reloadInfos()
  152. }
  153. },
  154. async createUserProjectRlat() {
  155. if(getApp().globalData.userId){
  156. var parmas = {
  157. projectId: this.projectId,
  158. shareToken:getApp().globalData.shareToken
  159. }
  160. let res = await this.$myRequest({
  161. url: '/user/createUserProjectRlat',
  162. data: parmas
  163. })
  164. if (res && res.data.success) {
  165. }
  166. }
  167. },
  168. reloadCategoryList() {
  169. var tempList = JSON.parse(JSON.stringify(this.dataInfo.categoryList || []))
  170. tempList.forEach((item, idx) => {
  171. item.value = '¥' + (parseFloat(item.amount || 0.00).toFixed(2)) + '/个'
  172. })
  173. this.categoryList = tempList
  174. this.categoryList.push({categoryName: '可获收益', value: this.dataInfo.availableIncome + '元'})
  175. },
  176. reloadInfos() {
  177. this.infos[0].value = this.timeFilterAction(this.dataInfo.openTime)
  178. this.infos[1].value = this.dataInfo.bizFormat
  179. if (this.dataInfo.maxPrice > 0) {
  180. this.infos[2].value = this.priceReload(this.dataInfo.minPrice) + '~' + this.priceReload(this.dataInfo.maxPrice) + '/m²'
  181. }
  182. else {
  183. this.infos[2].value = this.priceReload(this.dataInfo.minPrice) + '/m²'
  184. }
  185. if (this.dataInfo.maxTotalPrice > 0) {
  186. this.infos[3].value = this.priceReload(this.dataInfo.minTotalPrice) + '~' + this.priceReload(this.dataInfo.maxTotalPrice) + '/套'
  187. }
  188. else {
  189. this.infos[3].value = this.priceReload(this.dataInfo.minTotalPrice) + '/套'
  190. }
  191. this.infos[4].value = this.dataInfo.mainHouseType
  192. // this.infos[5].value = this.dataInfo.cusGroup
  193. this.infos.forEach((item, idx) => {
  194. if (!item.value) {
  195. item.value = '暂无'
  196. }
  197. })
  198. },
  199. timeFilterAction(val) {
  200. if (val) {
  201. return displayDateFormatChi(val * 1000)
  202. }
  203. else {
  204. return ''
  205. }
  206. },
  207. priceReload(val) {
  208. return parseFloat(val / 10000).toFixed(2) + '万'
  209. },
  210. toShareCard(type){
  211. if(getApp().globalData.userId){
  212. let href = location.origin+location.pathname;
  213. uni.navigateTo({
  214. url:'../shareCardPage/shareCardPage?page='+href+"&projectId="+this.projectId+"&type="+type
  215. })
  216. }else{
  217. uni.$emit('unLogin')
  218. }
  219. },
  220. backAction() {
  221. uni.navigateBack({
  222. delta:1
  223. })
  224. }
  225. },
  226. watch: {
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. page {
  232. width: 100vw;
  233. height: 100vh;
  234. background-color: #FFFFFF;
  235. }
  236. .content {
  237. width: 100%;
  238. height: 100%;
  239. position: relative;
  240. .topImg {
  241. width: 100%;
  242. height: 480rpx;
  243. background-color: rgba($color: #000000, $alpha: 0.5);
  244. // 滤镜效果
  245. // -webkit-filter: grayscale(30%); /* Chrome, Safari, Opera */
  246. // filter: grayscale(30%);
  247. }
  248. .sectionA {
  249. padding: 0 30rpx;
  250. box-sizing: border-box;
  251. width: 100%;
  252. margin-top: 50rpx;
  253. .topSection {
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. padding-left: 6rpx;
  258. box-sizing: border-box;
  259. .title {
  260. font-size: 44rpx;
  261. font-family: Verdana, Verdana-Bold;
  262. font-weight: 700;
  263. text-align: left;
  264. color: #262626;
  265. }
  266. .tags {
  267. margin-left: 8rpx;
  268. display: flex;
  269. justify-content: flex-start;
  270. align-items: center;
  271. flex-grow: 1;
  272. .item {
  273. padding: 0 18rpx;
  274. box-sizing: border-box;
  275. line-height: 40rpx;
  276. height: 40rpx;
  277. text-align: center;
  278. font-size: 20rpx;
  279. font-family: Verdana, Verdana-Regular;
  280. font-weight: 400;
  281. margin-left: 12rpx;
  282. }
  283. }
  284. .shareBtn {
  285. width: 140rpx;
  286. height: 52rpx;
  287. border-radius: 8px;
  288. box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.10);
  289. display: flex;
  290. align-items: center;
  291. font-size: 22rpx;
  292. font-family: Verdana, Verdana-Regular;
  293. font-weight: 400;
  294. text-align: left;
  295. color: #ffffff;
  296. .icon {
  297. width: 32rpx;
  298. height: 32rpx;
  299. margin-left: 10rpx;
  300. }
  301. }
  302. }
  303. .bottomSection {
  304. margin-top: 16rpx;
  305. display: flex;
  306. justify-content: flex-start;
  307. align-items: center;
  308. height: 80rpx;
  309. background: #f8f8f8;
  310. border-radius: 8rpx;
  311. .icon {
  312. width: 20rpx;
  313. height: 28rpx;
  314. margin-right: 14rpx;
  315. margin-left: 25rpx;
  316. }
  317. .name {
  318. font-size: 24rpx;
  319. font-family: Verdana, Verdana-Regular;
  320. font-weight: 400;
  321. text-align: left;
  322. color: #b1b1b1;
  323. }
  324. }
  325. }
  326. .sectionB {
  327. width: 100%;
  328. display: flex;
  329. align-items: center;
  330. padding: 40rpx 36rpx;
  331. box-sizing: border-box;
  332. flex-wrap: wrap;
  333. .item {
  334. width: calc((100% - 12rpx) / 3);
  335. min-width: calc((100% - 12rpx) / 3);
  336. max-width: calc((100% - 12rpx) / 3);
  337. .name {
  338. font-size: 24rpx;
  339. font-family: Verdana, Verdana-Regular;
  340. font-weight: 400;
  341. text-align: left;
  342. color: #b1b1b1;
  343. }
  344. .value {
  345. font-size: 32rpx;
  346. font-family: DIN Alternate, DIN Alternate-Bold;
  347. font-weight: 700;
  348. text-align: left;
  349. white-space: nowrap;
  350. color: #fd8f3c;
  351. }
  352. }
  353. }
  354. .sectionC {
  355. width: 100%;
  356. padding: 0 36rpx 76rpx 36rpx;
  357. box-sizing: border-box;
  358. display: flex;
  359. flex-wrap: wrap;
  360. .title {
  361. font-size: 28rpx;
  362. font-family: Verdana, Verdana-Bold;
  363. font-weight: 700;
  364. text-align: left;
  365. color: #171717;
  366. width: 100%;
  367. margin-bottom: 26rpx;
  368. }
  369. .line {
  370. width: 6rpx;
  371. height: 268rpx;
  372. background: linear-gradient(180deg, #ffd7b9, rgba(255, 215, 185, 0.00));
  373. border-radius: 4rpx;
  374. }
  375. .infos {
  376. margin-left: 30rpx;
  377. width: calc(100% - 36rpx);
  378. margin-top: -20rpx;
  379. display: flex;
  380. flex-wrap: wrap;
  381. align-items: center;
  382. justify-content: space-between;
  383. .item {
  384. width: 50%;
  385. .name {
  386. font-size: 24rpx;
  387. font-family: Verdana, Verdana-Regular;
  388. font-weight: 400;
  389. text-align: left;
  390. color: #b1b1b1;
  391. }
  392. .value {
  393. font-size: 24rpx;
  394. font-family: Verdana, Verdana-Regular;
  395. font-weight: 400;
  396. text-align: left;
  397. color: #262626;
  398. }
  399. }
  400. }
  401. }
  402. .sectionD {
  403. display: flex;
  404. justify-content: space-between;
  405. align-items: center;
  406. margin-left: 30rpx;
  407. width: calc(100% - 60rpx);
  408. height: 140rpx;
  409. background: linear-gradient(108deg, #ffb55f 9%, #f87523 96%);
  410. border-radius: 16rpx;
  411. padding: 0 20rpx 0 26rpx;
  412. box-sizing: border-box;
  413. .icon {
  414. width: 60rpx;
  415. height: 80rpx;
  416. margin-right: 20rpx;
  417. }
  418. .midSection {
  419. flex-grow: 1;
  420. .name {
  421. font-size: 30rpx;
  422. font-family: Verdana, Verdana-Bold;
  423. font-weight: 700;
  424. text-align: left;
  425. color: #ffffff;
  426. }
  427. .value {
  428. font-size: 24rpx;
  429. font-family: Verdana, Verdana-Regular;
  430. font-weight: 400;
  431. text-align: left;
  432. color: #ffead8;
  433. }
  434. }
  435. .invitationBtn {
  436. width: 140rpx;
  437. height: 56rpx;
  438. border-radius: 12rpx;
  439. background-color: #FFFFFF;
  440. font-size: 24rpx;
  441. font-family: Verdana, Verdana-Bold;
  442. font-weight: 700;
  443. text-align: center;
  444. color: #f07423;
  445. line-height: 56rpx;
  446. }
  447. }
  448. }
  449. </style>