普兆健康管家前端代码仓库
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.

108 lines
2.4 KiB

  1. <template>
  2. <view>
  3. <navbar :title="title" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
  4. <!-- 搜索栏 -->
  5. <view class="search">
  6. <uv-search
  7. v-model="keyword"
  8. placeholder="请输入要查询的内容"
  9. placeholderColor="#C6C6C6"
  10. searchIconColor="#8B8B8B"
  11. :searchIconSize="40"
  12. :inputStyle="{
  13. 'font-family': 'PingFang SC',
  14. 'font-weight': 400,
  15. 'font-size': '28rpx',
  16. 'line-height': 1.4,
  17. 'padding': '12rpx 0',
  18. }"
  19. bgColor="#fff"
  20. :showAction="false"
  21. @search="search"
  22. ></uv-search>
  23. </view>
  24. <view class="content">
  25. <productCustomView :type="queryParams.type" :list="list" @categoryChange="onCategoryChange"></productCustomView>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import mixinsList from '@/mixins/list.js'
  31. import productCustomView from './productCustomView.vue'
  32. export default {
  33. mixins: [mixinsList],
  34. components: {
  35. productCustomView,
  36. },
  37. data() {
  38. return {
  39. title: '',
  40. keyword: '',
  41. mixinsListApi: 'getProductList',
  42. queryParams: {
  43. pageNo: 1,
  44. pageSize: 10,
  45. type: 0, // 产品类型(0营养剂,1预约,2课程)
  46. },
  47. }
  48. },
  49. onLoad(arg) {
  50. const { title, type, homeRecommend, search } = arg
  51. if (title) {
  52. this.title = title
  53. }
  54. this.queryParams.type = type
  55. if (search) {
  56. this.keyword = search
  57. }
  58. if (homeRecommend) {
  59. this.queryParams.homeRecommend = homeRecommend
  60. }
  61. this.search()
  62. },
  63. methods: {
  64. search() {
  65. this.queryParams.pageNo = 1
  66. this.queryParams.pageSize = 10
  67. if (this.keyword) {
  68. this.queryParams.keyword = this.keyword
  69. } else {
  70. delete this.queryParams.keyword
  71. }
  72. this.getData()
  73. },
  74. onCategoryChange(e) {
  75. const { classId } = e || {}
  76. if (classId) {
  77. this.queryParams.classId = classId
  78. } else {
  79. delete this.queryParams.classId
  80. }
  81. this.queryParams.pageNo = 1
  82. this.queryParams.pageSize = 10
  83. this.getData()
  84. },
  85. },
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. @import './styles/tab.scss';
  90. .content {
  91. margin-top: 24rpx;
  92. }
  93. </style>