吉光研途前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.6 KiB

  1. <template>
  2. <view class="page__view">
  3. <!-- 导航栏 -->
  4. <navbar :title="title" leftClick @leftClick="$utils.navigateBack" />
  5. <view class="list">
  6. <view class="list-item"
  7. v-for="item in secondCategoryList"
  8. :key="item.id"
  9. @click="jumpToList(item.id, item.title)"
  10. >
  11. <image class="list-item-bg" :src="item.image" mode="scaleToFill"></image>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. pid: null,
  21. title: null,
  22. bannerList: [],
  23. secondCategoryList: [],
  24. }
  25. },
  26. onLoad(arg) {
  27. const { pid, title } = arg
  28. this.pid = pid
  29. this.title = title
  30. this.getData()
  31. },
  32. methods: {
  33. async getData() {
  34. try {
  35. this.secondCategoryList = (await this.$fetch('queryCategoryServiceModuleList', { pid: this.pid, pageNo: 1, pageSize: 1000 }))?.records
  36. } catch (err) {
  37. }
  38. },
  39. jumpToList(categoryId, title) {
  40. uni.navigateTo({
  41. url: `/pages_order/serve/search?categoryId=${categoryId}&title=${title}`
  42. })
  43. },
  44. },
  45. }
  46. </script>
  47. <style scoped lang="scss">
  48. .list {
  49. margin: 49rpx 18rpx 17rpx 18rpx;
  50. &-item {
  51. position: relative;
  52. font-size: 0;
  53. border-radius: 25rpx;
  54. overflow: hidden;
  55. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  56. & + & {
  57. margin-top: 32rpx;
  58. }
  59. &-bg {
  60. $w: calc(100vw - 18rpx*2);
  61. width: $w;
  62. height: calc(#{$w} * 179 / 714);
  63. }
  64. }
  65. }
  66. </style>