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

104 lines
2.3 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, search } = arg
  51. if (title) {
  52. this.title = title
  53. }
  54. this.queryParams.type = type
  55. if (search) {
  56. this.keyword = search
  57. }
  58. this.search()
  59. },
  60. methods: {
  61. search() {
  62. this.queryParams.pageNo = 1
  63. this.queryParams.pageSize = 10
  64. if (this.keyword) {
  65. this.queryParams.keyword = this.keyword
  66. } else {
  67. delete this.queryParams.keyword
  68. }
  69. this.getData()
  70. },
  71. onCategoryChange(e) {
  72. const { classId } = e || {}
  73. if (classId) {
  74. this.queryParams.classId = classId
  75. } else {
  76. delete this.queryParams.classId
  77. }
  78. this.queryParams.pageNo = 1
  79. this.queryParams.pageSize = 10
  80. this.getData()
  81. },
  82. },
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. @import './styles/tab.scss';
  87. .content {
  88. margin-top: 24rpx;
  89. }
  90. </style>