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

95 lines
1.8 KiB

2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
  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 list"
  8. :key="item.id"
  9. @click="jumpToDetail(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. import mixinsList from '@/mixins/list.js'
  18. export default {
  19. mixins: [mixinsList],
  20. data() {
  21. return {
  22. title: '搜索',
  23. keyword: '',
  24. queryParams: {
  25. pageNo: 1,
  26. pageSize: 10,
  27. categoryId: '',
  28. title: '',
  29. },
  30. mixinsListApi: 'queryServiceArticleList',
  31. }
  32. },
  33. onLoad(arg) {
  34. const { categoryId, search, title } = arg
  35. if (title) {
  36. this.title = title
  37. }
  38. if (categoryId) {
  39. this.queryParams.categoryId = categoryId
  40. }
  41. if (search) {
  42. this.queryParams.title = search
  43. }
  44. this.getData()
  45. },
  46. methods: {
  47. search() {
  48. this.queryParams.pageNo = 1
  49. this.queryParams.pageSize = 10
  50. this.queryParams.title = this.keyword
  51. this.getData()
  52. },
  53. jumpToDetail(articleId) {
  54. uni.navigateTo({
  55. url: `/pages_order/serve/index?articleId=${articleId}`
  56. })
  57. },
  58. },
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .list {
  63. margin: 49rpx 18rpx 17rpx 18rpx;
  64. &-item {
  65. position: relative;
  66. font-size: 0;
  67. border-radius: 25rpx;
  68. overflow: hidden;
  69. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  70. & + & {
  71. margin-top: 32rpx;
  72. }
  73. &-bg {
  74. $w: calc(100vw - 18rpx*2);
  75. width: $w;
  76. height: calc(#{$w} * 179 / 714);
  77. }
  78. }
  79. }
  80. </style>