吉光研途前端代码仓库
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.

43 lines
843 B

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="flex card" @click="jumpToList(data.id, data.title)">
  3. <image class="card-bg" :src="data.image" mode="scaleToFill"></image>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. data: {
  10. type: Object,
  11. default() {
  12. return {}
  13. }
  14. }
  15. },
  16. methods: {
  17. jumpToList(categoryId, title) {
  18. uni.navigateTo({
  19. url: `/pages_order/serve/search?categoryId=${categoryId}&title=${title}`
  20. })
  21. },
  22. },
  23. }
  24. </script>
  25. <style scoped lang="scss">
  26. $w: calc(100vw - 50rpx*2);
  27. .card {
  28. position: relative;
  29. width: $w;
  30. height: auto;
  31. font-size: 0;
  32. border-radius: 25rpx;
  33. overflow: hidden;
  34. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  35. &-bg {
  36. width: $w;
  37. height: calc(#{$w} * 179 / 714);
  38. }
  39. }
  40. </style>