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

244 lines
5.6 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="main">
  16. <template v-if="total">
  17. <view class="flex card" v-for="item in list" :key="item.id" @click="jumpToDetail(item.id)">
  18. <view class="left">
  19. <view class="title-box" v-if="item.title">
  20. <view class="title">{{ item.title }}</view>
  21. </view>
  22. <view class="content-box" v-if="item.shortTitle">
  23. <view class="content">
  24. {{ item.shortTitle || '' }}
  25. </view>
  26. <view class="dot bottom-left"></view>
  27. <view class="dot top-right"></view>
  28. </view>
  29. </view>
  30. <view class="right">
  31. <image class="img" :src="item.paperImage" mode="aspectFill"></image>
  32. </view>
  33. </view>
  34. </template>
  35. <template v-else>
  36. <view class="flex empty">
  37. <image class="empty-icon" src="@/static/image/icon-empty.png" mode="widthFix"></image>
  38. </view>
  39. </template>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import mixinsList from '@/mixins/list.js'
  45. export default {
  46. mixins: [mixinsList],
  47. data() {
  48. return {
  49. title: '搜索',
  50. keyword: '',
  51. queryParams: {
  52. pageNo: 1,
  53. pageSize: 10,
  54. title: '',
  55. },
  56. mixinsListApi: 'queryThesisList',
  57. }
  58. },
  59. onLoad({ search, categoryOne, categoryTwo, title, api }) {
  60. if (search) {
  61. this.keyword = search
  62. this.queryParams.title = search
  63. }
  64. if (categoryTwo) {
  65. this.queryParams.categoryOne = categoryOne
  66. this.queryParams.categoryTwo = categoryTwo
  67. }
  68. if (title) {
  69. this.title = title
  70. }
  71. if (api) {
  72. this.mixinsListApi = api
  73. }
  74. this.getData()
  75. },
  76. methods: {
  77. search() {
  78. this.queryParams.pageNo = 1
  79. this.queryParams.pageSize = 10
  80. this.queryParams.title = this.keyword
  81. this.getData()
  82. },
  83. jumpToDetail(thesisId) {
  84. let path = this.mixinsListApi == 'queryThesisList' ? '/pages_order/thesis/index' : '/pages_order/thesis/indexTwo'
  85. uni.navigateTo({
  86. url: `${path}?thesisId=${thesisId}`
  87. })
  88. },
  89. },
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. .page__view {
  94. background: $uni-bg-color-grey;
  95. }
  96. .top {
  97. padding: 49rpx 0 17rpx 0;
  98. box-sizing: border-box;
  99. }
  100. .search {
  101. margin: 0 19rpx;
  102. width: calc(100% - 20rpx * 2);
  103. background-color: #FFFFFF;
  104. border-radius: 37rpx;
  105. padding: 13rpx 0 13rpx 18rpx;
  106. box-sizing: border-box;
  107. display: flex;
  108. align-items: center;
  109. /deep/ .uv-search__action {
  110. color: $uni-color;
  111. padding: 10rpx 18rpx;
  112. }
  113. &-icon {
  114. width: 26rpx;
  115. height: auto;
  116. }
  117. }
  118. .main {
  119. padding: 17rpx;
  120. box-sizing: border-box;
  121. }
  122. .card {
  123. align-items: flex-start;
  124. background: #ffffff;
  125. border-radius: 20rpx;
  126. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  127. & + & {
  128. margin-top: 27rpx;
  129. }
  130. .left {
  131. flex: 1;
  132. position: relative;
  133. // padding: 13rpx 32rpx 35rpx 20rpx;
  134. padding: 13rpx 70rpx 35rpx 20rpx;
  135. box-sizing: border-box;
  136. .title {
  137. font-size: 32rpx;
  138. font-weight: 700;
  139. color: $uni-color;
  140. padding: 4rpx 16rpx;
  141. background: #FFFFFF;
  142. border-radius: 12rpx;
  143. &-box {
  144. position: absolute;
  145. top: 0;
  146. z-index: 1;
  147. display: inline-block;
  148. padding: 4rpx;
  149. background: linear-gradient(to right, $uni-color, #FFFFFF);
  150. border-radius: 14rpx;
  151. transform: translateY(50%);
  152. }
  153. }
  154. .content {
  155. font-size: 24rpx;
  156. font-weight: 400;
  157. color: #000000;
  158. white-space: pre-wrap;
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. display:-webkit-box; //作为弹性伸缩盒子模型显示。
  162. -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
  163. -webkit-line-clamp:7; //显示的行
  164. &-box {
  165. margin-top: 40rpx;
  166. position: relative;
  167. padding: 40rpx 16rpx;
  168. border: 4rpx solid $uni-color;
  169. border-radius: 20rpx;
  170. &:after {
  171. content: ' ';
  172. position: absolute;
  173. bottom: 0;
  174. right: 0;
  175. width: 20rpx;
  176. height: 40rpx;
  177. background: #FFFFFF;
  178. transform: translate(4rpx, 4rpx);
  179. }
  180. .dot {
  181. position: absolute;
  182. z-index: 2;
  183. width: 8rpx;
  184. height: 8rpx;
  185. background: $uni-color;
  186. border-radius: 50%;
  187. &.bottom-left {
  188. bottom: 0;
  189. right: 16rpx;
  190. transform: translateY(6rpx);
  191. }
  192. &.top-right {
  193. bottom: 36rpx;
  194. right: 0;
  195. transform: translateX(6rpx);
  196. }
  197. }
  198. }
  199. }
  200. }
  201. .right {
  202. padding: 23rpx 17rpx 23rpx 0;
  203. box-sizing: border-box;
  204. .img {
  205. $w: 225rpx;
  206. width: 225rpx;
  207. height: calc(#{$w} * 1184 / 750);
  208. }
  209. }
  210. }
  211. .empty {
  212. margin-top: 165rpx;
  213. }
  214. </style>