houseDetail.vue 11 KB

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