houseDetail.vue 11 KB

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