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

87 lines
1.7 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 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, title } = arg
  35. this.title = title
  36. this.queryParams.categoryId = categoryId
  37. this.getData()
  38. },
  39. methods: {
  40. search() {
  41. this.queryParams.pageNo = 1
  42. this.queryParams.pageSize = 10
  43. this.queryParams.title = this.keyword
  44. this.getData()
  45. },
  46. jumpToDetail(articleId) {
  47. uni.navigateTo({
  48. url: `/pages_order/serve/index?articleId=${articleId}`
  49. })
  50. },
  51. },
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .list {
  56. margin: 49rpx 18rpx 17rpx 18rpx;
  57. &-item {
  58. position: relative;
  59. font-size: 0;
  60. border-radius: 25rpx;
  61. overflow: hidden;
  62. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  63. & + & {
  64. margin-top: 32rpx;
  65. }
  66. &-bg {
  67. $w: calc(100vw - 18rpx*2);
  68. width: $w;
  69. height: calc(#{$w} * 179 / 714);
  70. }
  71. }
  72. }
  73. </style>