houseDetail.vue 12 KB

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