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

157 lines
3.4 KiB

3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
3 months ago
  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" :showAction="false" placeholder="输入关键词搜索" placeholderColor="#B2B2B2" bgColor="#FFFFFF" @custom="search" @search="search">
  9. <template #prefix>
  10. <view class="flex search-icon">
  11. <image class="img" src="@/static/image/icon-search.png" mode="widthFix"></image>
  12. </view>
  13. </template>
  14. </uv-search>
  15. </view>
  16. </view>
  17. <view class="main">
  18. <template v-if="total">
  19. <view class="card" v-for="item in list" :key="item.id">
  20. <thesisCard :data="item" @jumpToDetail="jumpToDetail(item.id)"></thesisCard>
  21. </view>
  22. </template>
  23. <template v-else>
  24. <view class="flex empty">
  25. <image class="empty-icon" src="@/static/image/icon-empty.png" mode="widthFix"></image>
  26. </view>
  27. </template>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import mixinsList from '@/mixins/list.js'
  33. import thesisCard from './thesisCard.vue'
  34. export default {
  35. mixins: [mixinsList],
  36. components: {
  37. thesisCard,
  38. },
  39. data() {
  40. return {
  41. title: '搜索',
  42. keyword: '',
  43. queryParams: {
  44. pageNo: 1,
  45. pageSize: 10,
  46. title: '',
  47. },
  48. mixinsListApi: 'queryThesisList',
  49. }
  50. },
  51. onLoad({ search, categoryOne, categoryTwo, title, api }) {
  52. if (search) {
  53. this.keyword = search
  54. this.queryParams.title = search
  55. }
  56. if (categoryTwo) {
  57. this.queryParams.categoryOne = categoryOne
  58. this.queryParams.categoryTwo = categoryTwo
  59. }
  60. if (title) {
  61. this.title = title
  62. }
  63. if (api) {
  64. this.mixinsListApi = api
  65. }
  66. this.getData()
  67. },
  68. methods: {
  69. search() {
  70. this.queryParams.pageNo = 1
  71. this.queryParams.pageSize = 10
  72. this.queryParams.title = this.keyword
  73. this.getData()
  74. },
  75. jumpToDetail(thesisId) {
  76. let path = this.mixinsListApi == 'queryThesisList' ? '/pages_order/thesis/index' : '/pages_order/thesis/indexTwo'
  77. uni.navigateTo({
  78. url: `${path}?thesisId=${thesisId}`
  79. })
  80. },
  81. },
  82. }
  83. </script>
  84. <style scoped lang="scss">
  85. .page__view {
  86. background: $uni-bg-color-grey;
  87. }
  88. .top {
  89. padding: 34rpx 38rpx 28rpx 38rpx;
  90. box-sizing: border-box;
  91. }
  92. .search {
  93. width: 100%;
  94. // width: calc(100% - 38rpx * 2);
  95. height: 48rpx;
  96. background-color: #FFFFFF;
  97. border-radius: 37rpx;
  98. box-sizing: border-box;
  99. display: flex;
  100. align-items: center;
  101. overflow: hidden;
  102. box-shadow: 2rpx 2rpx 9rpx 0 rgba($color: #C5C5C5, $alpha: 0.75);
  103. /deep/ .uv-search__content {
  104. padding: 0;
  105. border: none;
  106. }
  107. /deep/ .uv-search__content__input {
  108. margin-left: 18rpx;
  109. }
  110. &-icon {
  111. padding: 18rpx 10rpx 18rpx 18rpx;
  112. background: rgba($color: #E8DBF3, $alpha: 0.8);
  113. .img {
  114. width: 30rpx;
  115. height: auto;
  116. }
  117. }
  118. }
  119. .main {
  120. padding: 0 38rpx 38rpx 38rpx;
  121. box-sizing: border-box;
  122. }
  123. .card {
  124. background: #FFFFFF;
  125. border-radius: 10rpx;
  126. box-shadow: 4rpx 4rpx 6rpx 0rpx rgba(0,0,0,0.15);
  127. overflow: hidden;
  128. & + & {
  129. margin-top: 26rpx;
  130. }
  131. }
  132. .empty {
  133. margin-top: 165rpx;
  134. }
  135. </style>