houseDetail.vue 12 KB

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