reportHome.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <view class="container">
  3. <view v-show="menuCurrent === 0">
  4. <view class="menus-box">
  5. <view class="menus-item-box">
  6. <view class="icon-box">
  7. <view class="iconfont icon-hetong"></view>
  8. </view>
  9. <view class="text-box">
  10. 二手住宅市场
  11. </view>
  12. </view>
  13. <view class="menus-item-box">
  14. <view class="icon-box">
  15. <view class="iconfont icon-chengshi"></view>
  16. </view>
  17. <view class="text-box">
  18. 住宅租赁市场
  19. </view>
  20. </view>
  21. <view class="menus-item-box">
  22. <view class="icon-box">
  23. <view class="iconfont icon-zhongjie"></view>
  24. </view>
  25. <view class="text-box">
  26. 房地产中介行业
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view v-show="menuCurrent === 1">
  32. <view class="header-box">
  33. <view class="search-box">
  34. <u-search
  35. v-model="searchForm.keyword"
  36. :clearabled="true"
  37. bg-color="#E5E5E5"
  38. :input-style="searchInputStyle"
  39. placeholder="搜索您想要的内容"
  40. ></u-search>
  41. </view>
  42. </view>
  43. <view class="list-box">
  44. <view class="list-item-box" v-for="item in list" :key="item.id" @click="onClickReport(item)">
  45. <view class="image-box">
  46. <image :src="item.image" mode="aspectFill"></image>
  47. </view>
  48. <view class="info-box">
  49. <view class="title">
  50. {{item.title}}
  51. </view>
  52. <view class="time">
  53. <span class="iconfont icon-time"></span>
  54. <span>{{item.time}}</span>
  55. </view>
  56. <view class="func">
  57. <view v-if="item.free > 0" class="button free">免费</view>
  58. <view v-else-if="item.memberFree > 0" class="button member-free">会员免费</view>
  59. <view v-else :class="['button', item.status > 0 ? 'free' : 'buy']">{{item.status > 0 ? '已购买' : '立即购买'}}</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view v-show="menuCurrent === 2">
  66. <view class="header-box">
  67. <view class="search-box">
  68. <u-search
  69. v-model="searchForm.keyword"
  70. :clearabled="true"
  71. bg-color="#E5E5E5"
  72. :input-style="searchInputStyle"
  73. placeholder="搜索您想要的内容"
  74. ></u-search>
  75. </view>
  76. </view>
  77. <view class="list-box">
  78. <view class="list-item-box" v-for="item in list2" :key="item.id" @click="onClickReport(item)">
  79. <view class="image-box">
  80. <image :src="item.image" mode="aspectFill"></image>
  81. </view>
  82. <view class="info-box">
  83. <view class="title">
  84. {{item.title}}
  85. </view>
  86. <view class="time">
  87. <span>购买时间:&nbsp;{{item.time}}</span>
  88. </view>
  89. <view class="func">
  90. <view class="price">实付款:{{item.price}}元</view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="bottom-block"></view>
  97. <view class="bottom-box">
  98. <view class="menu-box">
  99. <view class="menu-item-box" :class="{'is-active': menuCurrent === 0}" @click="onMenuClick(0)">
  100. <view class="iconfont icon-home"></view>
  101. <view class="text">首页</view>
  102. </view>
  103. <view class="menu-item-box" :class="{'is-active': menuCurrent === 1}" @click="onMenuClick(1)">
  104. <view class="iconfont icon-time"></view>
  105. <view class="text">我的浏览</view>
  106. </view>
  107. <view class="menu-item-box" :class="{'is-active': menuCurrent === 2}" @click="onMenuClick(2)">
  108. <view class="iconfont icon-baogao"></view>
  109. <view class="text">我的报告</view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </template>
  115. <script setup>
  116. import { ref, computed } from 'vue'
  117. import { onLoad } from '@dcloudio/uni-app'
  118. const customButtonStyle = {
  119. height: '40rpx',
  120. lineHeight: '40rpx',
  121. padding: '0 30rpx'
  122. }
  123. const searchInputStyle = {
  124. backgroundColor: '#E5E5E5'
  125. }
  126. const searchForm = ref({
  127. keyword: '',
  128. type: 0
  129. })
  130. const menuCurrent = ref(0)
  131. function onMenuClick(index) {
  132. menuCurrent.value = index
  133. }
  134. const list = [
  135. {
  136. id: '01',
  137. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  138. time: '2023年8月8日',
  139. image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
  140. free: 0, // 是否免费
  141. memberFree: 0, // 是否会员免费
  142. status: 0, // 是否购买
  143. },
  144. {
  145. id: '02',
  146. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  147. time: '2023年8月8日',
  148. image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
  149. free: 0, // 是否免费
  150. memberFree: 0, // 是否会员免费
  151. status: 1, // 是否购买
  152. },
  153. {
  154. id: '03',
  155. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  156. time: '2023年8月8日',
  157. image: 'https://img.shetu66.com/2023/10/16/1697397333933789.png',
  158. free: 1, // 是否免费
  159. memberFree: 0, // 是否会员免费
  160. status: 0, // 是否购买
  161. },
  162. {
  163. id: '04',
  164. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  165. time: '2023年8月8日',
  166. image: 'https://img.shetu66.com/2023/10/24/1698106006242859.png',
  167. free: 0, // 是否免费
  168. memberFree: 1, // 是否会员免费
  169. status: 0, // 是否购买
  170. },
  171. {
  172. id: '05',
  173. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  174. time: '2023年8月8日',
  175. image: 'https://static.fxbaogao.com/subject/cover/prod/361.jpg',
  176. free: 0, // 是否免费
  177. memberFree: 1, // 是否会员免费
  178. status: 0, // 是否购买
  179. },
  180. {
  181. id: '06',
  182. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  183. time: '2023年8月8日',
  184. image: 'https://img.shetu66.com/2023/10/16/1697387221220874.png',
  185. free: 0, // 是否免费
  186. memberFree: 1, // 是否会员免费
  187. status: 1, // 是否购买
  188. },
  189. {
  190. id: '07',
  191. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  192. time: '2023年8月8日',
  193. image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
  194. free: 0, // 是否免费
  195. memberFree: 0, // 是否会员免费
  196. status: 0, // 是否购买
  197. },
  198. {
  199. id: '08',
  200. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  201. time: '2023年8月8日',
  202. image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
  203. free: 0, // 是否免费
  204. memberFree: 0, // 是否会员免费
  205. status: 0, // 是否购买
  206. },
  207. ]
  208. const list2 = [
  209. {
  210. id: '01',
  211. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  212. time: '2023年8月8日',
  213. image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
  214. price: '9.9'
  215. },
  216. {
  217. id: '02',
  218. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  219. time: '2023年8月8日',
  220. image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
  221. price: '9.9'
  222. },
  223. {
  224. id: '03',
  225. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  226. time: '2023年8月8日',
  227. image: 'https://img.shetu66.com/2023/10/16/1697397333933789.png',
  228. price: '9.9'
  229. },
  230. {
  231. id: '04',
  232. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  233. time: '2023年8月8日',
  234. image: 'https://img.shetu66.com/2023/10/24/1698106006242859.png',
  235. price: '9.9'
  236. },
  237. {
  238. id: '05',
  239. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  240. time: '2023年8月8日',
  241. image: 'https://static.fxbaogao.com/subject/cover/prod/361.jpg',
  242. price: '9.9'
  243. },
  244. {
  245. id: '06',
  246. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  247. time: '2023年8月8日',
  248. image: 'https://img.shetu66.com/2023/10/16/1697387221220874.png',
  249. price: '9.9'
  250. },
  251. {
  252. id: '07',
  253. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  254. time: '2023年8月8日',
  255. image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
  256. price: '9.9'
  257. },
  258. {
  259. id: '08',
  260. title: '2024年11月广州市中介促成二手住宅市场交易简报',
  261. time: '2023年8月8日',
  262. image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
  263. price: '9.9'
  264. },
  265. ]
  266. function onClickReport(report) {
  267. uni.navigateTo({
  268. url: `/pages/reportDetail/reportDetail?id=${report.id}&title=${report.title}`
  269. })
  270. }
  271. onLoad((load) => {
  272. if (load.menuCurrent) {
  273. menuCurrent.value = Number(load.menuCurrent)
  274. }
  275. })
  276. </script>
  277. <style lang="scss" scoped>
  278. $image-width: 230rpx;
  279. .container {
  280. height: 100vh;
  281. width: 100vw;
  282. background-color: $uni-text-color-inverse;
  283. .header-box {
  284. padding: 0 20rpx;
  285. background-color: $uni-text-color-inverse;
  286. @include topMagnet();
  287. }
  288. .search-box {
  289. margin-bottom: 20rpx;
  290. ::v-deep(.u-search) {
  291. background-color: #e5e5e5;
  292. border-radius: 50rpx;
  293. .u-action {
  294. width: 18%;
  295. background-color: $uni-color-primary;
  296. border-radius: 50rpx;
  297. color: $uni-text-color-inverse;
  298. margin-right: 8rpx;
  299. font-size: 28rpx;
  300. line-height: 50rpx;
  301. letter-spacing: 3rpx;
  302. text-align: center;
  303. }
  304. }
  305. }
  306. .list-box {
  307. padding: 0 20rpx;
  308. .list-item-box {
  309. padding: 30rpx 20rpx;
  310. display: flex;
  311. gap: 20rpx;
  312. height: 210rpx;
  313. border-bottom: 5rpx solid #E6E6E6;
  314. &:active {
  315. background-color: $uni-bg-color-hover;
  316. }
  317. .image-box {
  318. width: $image-width;
  319. image {
  320. width: $image-width;
  321. flex: 0 0 $image-width;
  322. height: 100%;
  323. border-radius: $uni-card-border-radius;
  324. }
  325. }
  326. .info-box {
  327. .title {
  328. font-size: $uni-title-font-size-2;
  329. font-weight: bold;
  330. line-height: 40rpx;
  331. margin-bottom: 15rpx;
  332. @include text-line-overflow(2);
  333. }
  334. .time {
  335. font-size: $uni-font-size-2;
  336. color: $uni-text-color-grey;
  337. .iconfont {
  338. font-size: $uni-font-size-2;
  339. padding-right: 10rpx;
  340. }
  341. }
  342. .func {
  343. display: flex;
  344. justify-content: flex-end;
  345. font-size: $uni-font-size-2;
  346. font-weight: bold;
  347. .button {
  348. text-align: center;
  349. width: 130rpx;
  350. }
  351. .price {
  352. color: $uni-color-error;
  353. font-size: $uni-title-font-size-2;
  354. }
  355. .buy {
  356. padding: 6rpx 25rpx;
  357. background-color: $uni-color-error;
  358. border-radius: $uni-card-border-radius;
  359. color: $uni-text-color-inverse;
  360. }
  361. .free {
  362. padding: 6rpx 25rpx;
  363. background-color: $uni-color-primary;
  364. border-radius: $uni-card-border-radius;
  365. color: $uni-text-color-inverse;
  366. }
  367. .member-free {
  368. padding: 10rpx 20rpx;
  369. @include backgroundImg('@/static/images/bg-label.png');
  370. color: $uni-text-color;
  371. }
  372. }
  373. }
  374. }
  375. }
  376. .menus-box {
  377. padding: 0 20rpx;
  378. .menus-item-box {
  379. width: 100%;
  380. padding: 35rpx 50rpx;
  381. margin-bottom: 35rpx;
  382. display: flex;
  383. gap: 30rpx;
  384. align-items: center;
  385. background-color: #006AF4;
  386. border-radius: $uni-card-border-radius;
  387. &:active {
  388. background-color: #005AF4;
  389. }
  390. .icon-box {
  391. width: 40%;
  392. text-align: center;
  393. width: 100rpx;
  394. height: 100rpx;
  395. line-height: 100rpx;
  396. text-align: center;
  397. border-radius: 50%;
  398. border: 3rpx solid $uni-text-color-inverse;
  399. background-color: #004DC9;
  400. .iconfont {
  401. font-size: 60rpx;
  402. color: $uni-text-color-inverse;
  403. }
  404. }
  405. .text-box {
  406. font-size: 50rpx;
  407. font-weight: bold;
  408. color: $uni-text-color-inverse;
  409. }
  410. }
  411. }
  412. .bottom-block {
  413. height: 112rpx;
  414. }
  415. .bottom-box {
  416. padding: 5rpx 20rpx;
  417. background-color: $uni-bg-color-grey;
  418. border: 1rpx solid #E9E9E9;
  419. @include bottomMagnet();
  420. .menu-box {
  421. height: 100rpx;
  422. display: flex;
  423. align-items: center;
  424. .menu-item-box {
  425. width: calc(100% / 3);
  426. text-align: center;
  427. .iconfont {
  428. font-size: 55rpx;
  429. }
  430. .text {
  431. font-size: $uni-font-size-2;
  432. }
  433. }
  434. .is-active {
  435. color: $uni-color-primary;
  436. }
  437. }
  438. }
  439. }
  440. </style>