houseDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  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(2)">
  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" v-if="registAmount">
  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">完成邀请,可获得¥{{registAmount}}/人</view>
  42. </view>
  43. <view class="invitationBtn" @click="toShareCard(1)">邀请好友</view>
  44. </view>
  45. <backHome></backHome>
  46. <login-notice></login-notice>
  47. <login></login>
  48. </view>
  49. </template>
  50. <script>
  51. import moment from '../../static/moment.min.js'
  52. import {
  53. displayDateFormatChi
  54. } from '../../static/format.js'
  55. let app = getApp();
  56. import backHome from "@/components/backHome/backHome.vue"
  57. export default {
  58. data() {
  59. return {
  60. color1: '',
  61. color2: '',
  62. color3: '',
  63. color6: '',
  64. infos: [{
  65. title: '开盘时间',
  66. value: ''
  67. },
  68. {
  69. title: '项目业态',
  70. value: ''
  71. },
  72. {
  73. title: '均价',
  74. value: ''
  75. },
  76. {
  77. title: '总价',
  78. value: ''
  79. },
  80. {
  81. title: '主力户型',
  82. value: ''
  83. }
  84. // {
  85. // title: '目标人群',
  86. // value: ''
  87. // }
  88. ],
  89. projectId: '',
  90. dataInfo: {
  91. "address": "",
  92. "availableIncome": "",
  93. "bizFormat": "",
  94. "categoryList": [],
  95. "city": "",
  96. "cusGroup": "",
  97. "district": "",
  98. "id": 0,
  99. "image": "",
  100. "mainHouseType": "",
  101. "maxPrice": 0,
  102. "maxTotalPrice": 0,
  103. "minPrice": 0,
  104. "minTotalPrice": 0,
  105. "name": "",
  106. "onlineStatus": 0,
  107. "openTime": 0,
  108. "otherPage": "",
  109. "projectFocusImage": "",
  110. "projectId": "",
  111. "province": "",
  112. "registAmount": "",
  113. "revision": "",
  114. "shareImg": "",
  115. "shareRemark": "",
  116. "xcxPage": ""
  117. },
  118. categoryList: [],
  119. registAmount:null,
  120. }
  121. },
  122. onLoad(param) {
  123. this.projectId = param.projectId;
  124. },
  125. components:{
  126. backHome
  127. },
  128. mounted() {
  129. this.color1 = app.globalData.color1;
  130. this.color2 = app.globalData.color2;
  131. this.color3 = app.globalData.color3;
  132. this.color6 = app.globalData.color6;
  133. this.detailDatahandle()
  134. uni.$on("request",()=>{
  135. this.detailDatahandle()
  136. })
  137. },
  138. methods: {
  139. async detailDatahandle() {
  140. if(getApp().globalData.userId){
  141. var parmas = {
  142. projectId: this.projectId,
  143. userId:getApp().globalData.userId
  144. }
  145. this.createUserProjectRlat();
  146. this.getRegistTask();
  147. let res = await this.$myRequest({
  148. url: '/project/queryProjectByH5',
  149. data: parmas
  150. })
  151. if (res && res.data.success) {
  152. console.log('详情res:', res)
  153. this.dataInfo = res.data.single
  154. this.reloadCategoryList()
  155. this.reloadInfos()
  156. }
  157. }
  158. },
  159. async getRegistTask(){
  160. if(app.globalData.userId){
  161. let res = await this.$myRequest({
  162. url: "/task/registTask",
  163. data: {
  164. userId:getApp().globalData.userId
  165. }
  166. })
  167. if(res.data.success){
  168. this.registAmount = res.data.single.amount||null
  169. }else{
  170. this.registAmount = null;
  171. }
  172. }
  173. },
  174. async createUserProjectRlat() {
  175. if(getApp().globalData.userId){
  176. var parmas = {
  177. projectId: this.projectId,
  178. shareToken:getApp().globalData.shareToken
  179. }
  180. let res = await this.$myRequest({
  181. url: '/user/createUserProjectRlat',
  182. data: parmas
  183. })
  184. if (res && res.data.success) {
  185. }
  186. }
  187. },
  188. reloadCategoryList() {
  189. var tempList = JSON.parse(JSON.stringify(this.dataInfo.categoryList || []))
  190. tempList.forEach((item, idx) => {
  191. item.value = '¥' + (parseFloat(item.amount || 0.00).toFixed(2)) + '/个'
  192. })
  193. this.categoryList = tempList
  194. this.categoryList.push({categoryName: '可获收益', value: this.dataInfo.availableIncome + '元'})
  195. },
  196. reloadInfos() {
  197. this.infos[0].value = this.timeFilterAction(this.dataInfo.openTime)
  198. this.infos[1].value = this.dataInfo.bizFormat
  199. if (this.dataInfo.maxPrice > 0) {
  200. this.infos[2].value = this.priceReload(this.dataInfo.minPrice) + '~' + this.priceReload(this.dataInfo.maxPrice) + '/m²'
  201. }
  202. else {
  203. this.infos[2].value = this.priceReload(this.dataInfo.minPrice) + '/m²'
  204. }
  205. if (this.dataInfo.maxTotalPrice > 0) {
  206. this.infos[3].value = this.priceReload(this.dataInfo.minTotalPrice) + '~' + this.priceReload(this.dataInfo.maxTotalPrice) + '/套'
  207. }
  208. else {
  209. this.infos[3].value = this.priceReload(this.dataInfo.minTotalPrice) + '/套'
  210. }
  211. this.infos[4].value = this.dataInfo.mainHouseType
  212. // this.infos[5].value = this.dataInfo.cusGroup
  213. this.infos.forEach((item, idx) => {
  214. if (!item.value) {
  215. item.value = '暂无'
  216. }
  217. })
  218. },
  219. timeFilterAction(val) {
  220. if (val) {
  221. return displayDateFormatChi(val * 1000)
  222. }
  223. else {
  224. return ''
  225. }
  226. },
  227. priceReload(val) {
  228. return parseFloat(val / 10000).toFixed(2) + '万'
  229. },
  230. toShareCard(type){
  231. if(getApp().globalData.userId){
  232. let href = location.origin+location.pathname;
  233. uni.navigateTo({
  234. url:'../shareCardPage/shareCardPage?page='+href+"&projectId="+this.projectId+"&type="+type
  235. })
  236. }else{
  237. uni.$emit('unLogin')
  238. }
  239. },
  240. backAction() {
  241. uni.navigateBack({
  242. delta:1
  243. })
  244. }
  245. },
  246. watch: {
  247. }
  248. }
  249. </script>
  250. <style lang="scss" scoped>
  251. page {
  252. width: 100vw;
  253. height: 100vh;
  254. background-color: #FFFFFF;
  255. }
  256. .content {
  257. width: 100%;
  258. height: 100%;
  259. position: relative;
  260. .topImg {
  261. width: 100%;
  262. height: 480rpx;
  263. background-color: rgba($color: #000000, $alpha: 0.5);
  264. // 滤镜效果
  265. // -webkit-filter: grayscale(30%); /* Chrome, Safari, Opera */
  266. // filter: grayscale(30%);
  267. }
  268. .sectionA {
  269. padding: 0 30rpx;
  270. box-sizing: border-box;
  271. width: 100%;
  272. margin-top: 50rpx;
  273. .topSection {
  274. display: flex;
  275. justify-content: space-between;
  276. align-items: center;
  277. padding-left: 6rpx;
  278. box-sizing: border-box;
  279. .title {
  280. font-size: 44rpx;
  281. font-family: Verdana, Verdana-Bold;
  282. font-weight: 700;
  283. text-align: left;
  284. color: #262626;
  285. }
  286. .tags {
  287. margin-left: 8rpx;
  288. display: flex;
  289. justify-content: flex-start;
  290. align-items: center;
  291. flex-grow: 1;
  292. .item {
  293. padding: 0 18rpx;
  294. box-sizing: border-box;
  295. line-height: 40rpx;
  296. height: 40rpx;
  297. text-align: center;
  298. font-size: 20rpx;
  299. font-family: Verdana, Verdana-Regular;
  300. font-weight: 400;
  301. margin-left: 12rpx;
  302. }
  303. }
  304. .shareBtn {
  305. width: 140rpx;
  306. height: 52rpx;
  307. border-radius: 8px;
  308. box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.10);
  309. display: flex;
  310. align-items: center;
  311. font-size: 22rpx;
  312. font-family: Verdana, Verdana-Regular;
  313. font-weight: 400;
  314. text-align: left;
  315. color: #ffffff;
  316. .icon {
  317. width: 32rpx;
  318. height: 32rpx;
  319. margin-left: 10rpx;
  320. }
  321. }
  322. }
  323. .bottomSection {
  324. margin-top: 16rpx;
  325. display: flex;
  326. justify-content: flex-start;
  327. align-items: center;
  328. height: 80rpx;
  329. background: #f8f8f8;
  330. border-radius: 8rpx;
  331. .icon {
  332. width: 20rpx;
  333. height: 28rpx;
  334. margin-right: 14rpx;
  335. margin-left: 25rpx;
  336. }
  337. .name {
  338. font-size: 24rpx;
  339. font-family: Verdana, Verdana-Regular;
  340. font-weight: 400;
  341. text-align: left;
  342. color: #b1b1b1;
  343. }
  344. }
  345. }
  346. .sectionB {
  347. width: 100%;
  348. display: flex;
  349. align-items: center;
  350. padding: 40rpx 36rpx;
  351. box-sizing: border-box;
  352. flex-wrap: wrap;
  353. .item {
  354. width: calc((100% - 12rpx) / 3);
  355. min-width: calc((100% - 12rpx) / 3);
  356. max-width: calc((100% - 12rpx) / 3);
  357. .name {
  358. font-size: 24rpx;
  359. font-family: Verdana, Verdana-Regular;
  360. font-weight: 400;
  361. text-align: left;
  362. color: #b1b1b1;
  363. }
  364. .value {
  365. font-size: 32rpx;
  366. font-family: DIN Alternate, DIN Alternate-Bold;
  367. font-weight: 700;
  368. text-align: left;
  369. white-space: nowrap;
  370. color: #fd8f3c;
  371. }
  372. }
  373. }
  374. .sectionC {
  375. width: 100%;
  376. padding: 0 36rpx 76rpx 36rpx;
  377. box-sizing: border-box;
  378. display: flex;
  379. flex-wrap: wrap;
  380. .title {
  381. font-size: 28rpx;
  382. font-family: Verdana, Verdana-Bold;
  383. font-weight: 700;
  384. text-align: left;
  385. color: #171717;
  386. width: 100%;
  387. margin-bottom: 26rpx;
  388. }
  389. .line {
  390. width: 6rpx;
  391. height: 268rpx;
  392. background: linear-gradient(180deg, #ffd7b9, rgba(255, 215, 185, 0.00));
  393. border-radius: 4rpx;
  394. }
  395. .infos {
  396. margin-left: 30rpx;
  397. width: calc(100% - 36rpx);
  398. margin-top: -20rpx;
  399. display: flex;
  400. flex-wrap: wrap;
  401. align-items: center;
  402. justify-content: space-between;
  403. .item {
  404. width: 50%;
  405. .name {
  406. font-size: 24rpx;
  407. font-family: Verdana, Verdana-Regular;
  408. font-weight: 400;
  409. text-align: left;
  410. color: #b1b1b1;
  411. }
  412. .value {
  413. font-size: 24rpx;
  414. font-family: Verdana, Verdana-Regular;
  415. font-weight: 400;
  416. text-align: left;
  417. color: #262626;
  418. }
  419. }
  420. }
  421. }
  422. .sectionD {
  423. display: flex;
  424. justify-content: space-between;
  425. align-items: center;
  426. margin-left: 30rpx;
  427. width: calc(100% - 60rpx);
  428. height: 140rpx;
  429. background: linear-gradient(108deg, #ffb55f 9%, #f87523 96%);
  430. border-radius: 16rpx;
  431. padding: 0 20rpx 0 26rpx;
  432. box-sizing: border-box;
  433. .icon {
  434. width: 60rpx;
  435. height: 80rpx;
  436. margin-right: 20rpx;
  437. }
  438. .midSection {
  439. flex-grow: 1;
  440. .name {
  441. font-size: 30rpx;
  442. font-family: Verdana, Verdana-Bold;
  443. font-weight: 700;
  444. text-align: left;
  445. color: #ffffff;
  446. }
  447. .value {
  448. font-size: 24rpx;
  449. font-family: Verdana, Verdana-Regular;
  450. font-weight: 400;
  451. text-align: left;
  452. color: #ffead8;
  453. }
  454. }
  455. .invitationBtn {
  456. width: 140rpx;
  457. height: 56rpx;
  458. border-radius: 12rpx;
  459. background-color: #FFFFFF;
  460. font-size: 24rpx;
  461. font-family: Verdana, Verdana-Bold;
  462. font-weight: 700;
  463. text-align: center;
  464. color: #f07423;
  465. line-height: 56rpx;
  466. }
  467. }
  468. }
  469. </style>