houseDetail.vue 11 KB

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