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

118 lines
2.3 KiB

  1. <template>
  2. <view class="page__view">
  3. <!-- 导航栏 -->
  4. <navbar :title="title" leftClick @leftClick="$utils.navigateBack" />
  5. <view class="top">
  6. <!-- 搜索栏 -->
  7. <view class="search">
  8. <uv-search v-model="keyword" placeholder="输入关键词搜索" bgColor="#FBFBFB" @custom="search" @search="search">
  9. <template #prefix>
  10. <image class="search-icon" src="@/static/image/icon-search.png" mode="widthFix"></image>
  11. </template>
  12. </uv-search>
  13. </view>
  14. </view>
  15. <view class="list">
  16. <view class="list-item"
  17. v-for="item in list"
  18. :key="item.id"
  19. @click="jumpToDetail(item.id, item.title)"
  20. >
  21. <image class="list-item-bg" :src="item.image" mode="scaleToFill"></image>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import mixinsList from '@/mixins/list.js'
  28. export default {
  29. mixins: [mixinsList],
  30. data() {
  31. return {
  32. title: '搜索',
  33. keyword: '',
  34. queryParams: {
  35. pageNo: 1,
  36. pageSize: 10,
  37. categoryId: '',
  38. title: '',
  39. },
  40. mixinsListApi: 'queryServiceArticleList',
  41. }
  42. },
  43. onLoad(arg) {
  44. const { categoryId, title } = arg
  45. this.title = title
  46. this.queryParams.categoryId = categoryId
  47. this.getData()
  48. },
  49. methods: {
  50. jumpToDetail(articleId) {
  51. uni.navigateTo({
  52. url: `/pages_order/serve/index?articleId=${articleId}`
  53. })
  54. },
  55. },
  56. }
  57. </script>
  58. <style scoped lang="scss">
  59. .top {
  60. padding: 49rpx 0 17rpx 0;
  61. box-sizing: border-box;
  62. }
  63. .search {
  64. margin: 0 19rpx;
  65. width: calc(100% - 20rpx * 2);
  66. background-color: #FFFFFF;
  67. border-radius: 37rpx;
  68. padding: 13rpx 0 13rpx 18rpx;
  69. box-sizing: border-box;
  70. display: flex;
  71. align-items: center;
  72. /deep/ .uv-search__action {
  73. color: $uni-color;
  74. padding: 10rpx 18rpx;
  75. }
  76. &-icon {
  77. width: 26rpx;
  78. height: auto;
  79. }
  80. }
  81. .list {
  82. margin: 0 18rpx;
  83. &-item {
  84. position: relative;
  85. font-size: 0;
  86. border-radius: 25rpx;
  87. overflow: hidden;
  88. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  89. & + & {
  90. margin-top: 32rpx;
  91. }
  92. &-bg {
  93. $w: calc(100vw - 18rpx*2);
  94. width: $w;
  95. height: calc(#{$w} * 179 / 714);
  96. }
  97. }
  98. }
  99. </style>