houseDetail.vue 11 KB

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