houseDetail.vue 12 KB

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