houseDetail.vue 11 KB

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