houseDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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(dataInfo)">
  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">邀请好友</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(item,type=2){
  211. uni.navigateTo({
  212. url:'../shareCardPage/shareCardPage?page='+item.xcxPage+"&projectId="+item.projectId+"&type="+type
  213. })
  214. },
  215. backAction() {
  216. uni.navigateBack({
  217. delta:1
  218. })
  219. }
  220. },
  221. watch: {
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. page {
  227. width: 100vw;
  228. height: 100vh;
  229. background-color: #FFFFFF;
  230. }
  231. .content {
  232. width: 100%;
  233. height: 100%;
  234. position: relative;
  235. .topImg {
  236. width: 100%;
  237. height: 480rpx;
  238. background-color: rgba($color: #000000, $alpha: 0.5);
  239. // 滤镜效果
  240. // -webkit-filter: grayscale(30%); /* Chrome, Safari, Opera */
  241. // filter: grayscale(30%);
  242. }
  243. .sectionA {
  244. padding: 0 30rpx;
  245. box-sizing: border-box;
  246. width: 100%;
  247. margin-top: 50rpx;
  248. .topSection {
  249. display: flex;
  250. justify-content: space-between;
  251. align-items: center;
  252. padding-left: 6rpx;
  253. box-sizing: border-box;
  254. .title {
  255. font-size: 44rpx;
  256. font-family: Verdana, Verdana-Bold;
  257. font-weight: 700;
  258. text-align: left;
  259. color: #262626;
  260. }
  261. .tags {
  262. margin-left: 8rpx;
  263. display: flex;
  264. justify-content: flex-start;
  265. align-items: center;
  266. flex-grow: 1;
  267. .item {
  268. padding: 0 18rpx;
  269. box-sizing: border-box;
  270. line-height: 40rpx;
  271. height: 40rpx;
  272. text-align: center;
  273. font-size: 20rpx;
  274. font-family: Verdana, Verdana-Regular;
  275. font-weight: 400;
  276. margin-left: 12rpx;
  277. }
  278. }
  279. .shareBtn {
  280. width: 140rpx;
  281. height: 52rpx;
  282. border-radius: 8px;
  283. box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.10);
  284. display: flex;
  285. align-items: center;
  286. font-size: 22rpx;
  287. font-family: Verdana, Verdana-Regular;
  288. font-weight: 400;
  289. text-align: left;
  290. color: #ffffff;
  291. .icon {
  292. width: 32rpx;
  293. height: 32rpx;
  294. margin-left: 10rpx;
  295. }
  296. }
  297. }
  298. .bottomSection {
  299. margin-top: 16rpx;
  300. display: flex;
  301. justify-content: flex-start;
  302. align-items: center;
  303. height: 80rpx;
  304. background: #f8f8f8;
  305. border-radius: 8rpx;
  306. .icon {
  307. width: 20rpx;
  308. height: 28rpx;
  309. margin-right: 14rpx;
  310. margin-left: 25rpx;
  311. }
  312. .name {
  313. font-size: 24rpx;
  314. font-family: Verdana, Verdana-Regular;
  315. font-weight: 400;
  316. text-align: left;
  317. color: #b1b1b1;
  318. }
  319. }
  320. }
  321. .sectionB {
  322. width: 100%;
  323. display: flex;
  324. align-items: center;
  325. padding: 40rpx 36rpx;
  326. box-sizing: border-box;
  327. flex-wrap: wrap;
  328. .item {
  329. width: calc((100% - 12rpx) / 3);
  330. min-width: calc((100% - 12rpx) / 3);
  331. max-width: calc((100% - 12rpx) / 3);
  332. .name {
  333. font-size: 24rpx;
  334. font-family: Verdana, Verdana-Regular;
  335. font-weight: 400;
  336. text-align: left;
  337. color: #b1b1b1;
  338. }
  339. .value {
  340. font-size: 32rpx;
  341. font-family: DIN Alternate, DIN Alternate-Bold;
  342. font-weight: 700;
  343. text-align: left;
  344. white-space: nowrap;
  345. color: #fd8f3c;
  346. }
  347. }
  348. }
  349. .sectionC {
  350. width: 100%;
  351. padding: 0 36rpx 76rpx 36rpx;
  352. box-sizing: border-box;
  353. display: flex;
  354. flex-wrap: wrap;
  355. .title {
  356. font-size: 28rpx;
  357. font-family: Verdana, Verdana-Bold;
  358. font-weight: 700;
  359. text-align: left;
  360. color: #171717;
  361. width: 100%;
  362. margin-bottom: 26rpx;
  363. }
  364. .line {
  365. width: 6rpx;
  366. height: 268rpx;
  367. background: linear-gradient(180deg, #ffd7b9, rgba(255, 215, 185, 0.00));
  368. border-radius: 4rpx;
  369. }
  370. .infos {
  371. margin-left: 30rpx;
  372. width: calc(100% - 36rpx);
  373. margin-top: -20rpx;
  374. display: flex;
  375. flex-wrap: wrap;
  376. align-items: center;
  377. justify-content: space-between;
  378. .item {
  379. width: 50%;
  380. .name {
  381. font-size: 24rpx;
  382. font-family: Verdana, Verdana-Regular;
  383. font-weight: 400;
  384. text-align: left;
  385. color: #b1b1b1;
  386. }
  387. .value {
  388. font-size: 24rpx;
  389. font-family: Verdana, Verdana-Regular;
  390. font-weight: 400;
  391. text-align: left;
  392. color: #262626;
  393. }
  394. }
  395. }
  396. }
  397. .sectionD {
  398. display: flex;
  399. justify-content: space-between;
  400. align-items: center;
  401. margin-left: 30rpx;
  402. width: calc(100% - 60rpx);
  403. height: 140rpx;
  404. background: linear-gradient(108deg, #ffb55f 9%, #f87523 96%);
  405. border-radius: 16rpx;
  406. padding: 0 20rpx 0 26rpx;
  407. box-sizing: border-box;
  408. .icon {
  409. width: 60rpx;
  410. height: 80rpx;
  411. margin-right: 20rpx;
  412. }
  413. .midSection {
  414. flex-grow: 1;
  415. .name {
  416. font-size: 30rpx;
  417. font-family: Verdana, Verdana-Bold;
  418. font-weight: 700;
  419. text-align: left;
  420. color: #ffffff;
  421. }
  422. .value {
  423. font-size: 24rpx;
  424. font-family: Verdana, Verdana-Regular;
  425. font-weight: 400;
  426. text-align: left;
  427. color: #ffead8;
  428. }
  429. }
  430. .invitationBtn {
  431. width: 140rpx;
  432. height: 56rpx;
  433. border-radius: 12rpx;
  434. background-color: #FFFFFF;
  435. font-size: 24rpx;
  436. font-family: Verdana, Verdana-Bold;
  437. font-weight: 700;
  438. text-align: center;
  439. color: #f07423;
  440. line-height: 56rpx;
  441. }
  442. }
  443. }
  444. </style>