houseDetail.vue 11 KB

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