index-search.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="tap">
  3. <view class="">
  4. <u-navbar :placeholder='true' :fixed='true'>
  5. <u-search placeholder="请输入书名、作者搜索" v-model="keyword1" :show-action="false"
  6. @search="tosearch(1)"></u-search>
  7. </u-navbar>
  8. </view>
  9. <view class="u-flex u-row-between top" v-if="positionlist.length == 0">
  10. <view class="his">
  11. 搜索历史
  12. </view>
  13. <view class="" @click="clear">
  14. <u-icon name="trash" color="rgba(0,0,0,.7)" size="14"></u-icon>
  15. </view>
  16. </view>
  17. <view class="u-flex" style="flex-wrap: wrap;margin-top: 24rpx;" v-if="positionlist.length == 0">
  18. <view class="item" style="margin-right: 16rpx;" v-for="(item,index) in search" :key="index">
  19. {{item}}
  20. </view>
  21. </view>
  22. <view class="u-flex u-row-between pad" style="margin-top:30rpx ;">
  23. <view class="" v-for="(item,index) in list" :key="index" @click="onchange(index)">
  24. <text :class="curret==index?'one':'two' ">{{item}}</text>
  25. <view v-if="curret==index" class="bottom">
  26. </view>
  27. </view>
  28. </view>
  29. <view class="sou">
  30. <text>共32条“</text>
  31. <text style="color: #0ED4AA;">{{keyword1}}</text>
  32. <text>”相关的搜素结果</text>
  33. </view>
  34. <view class="list1">
  35. <view class="u-flex" style="margin-top: 28rpx;" v-if="curret==0">
  36. <image src="/static/logo.png" style="width: 239rpx;height: 240rpx;" mode=""></image>
  37. <view class="u-flex-col " style="margin-left: 20rpx;height: 240rpx;padding: 12rpx 0;
  38. justify-content: space-between;">
  39. <view class="">
  40. <view class="title">ERP财务管理系统教程(用友U8V10.111111111)</view>
  41. <view class="writer">陆培中,刘亚男</view>
  42. </view>
  43. <view class="">
  44. <text class="ding">定价</text>
  45. <text class="yang">¥</text>
  46. <text class="money">38.5</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="top" v-if="curret==2">
  51. <view class="flex">
  52. <image src="/static/logo.png" style="width: 212rpx;height: 128rpx;" mode=""></image>
  53. <view class="" style="margin-left: 20rpx;">
  54. <view class="title1">ERP财务管理系统教程(用友U8V10.11111111)</view>
  55. <view class="writer">陆培中,刘亚男</view>
  56. </view>
  57. </view>
  58. <view class="money1">
  59. ¥158.0
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. keyword1: '',
  70. search: [],
  71. positionlist: [1],
  72. list: [
  73. '纸质书', '电子书', '名师教学视频'
  74. ],
  75. curret: 0,
  76. };
  77. },
  78. onLoad() {
  79. if (uni.getStorageSync('searchdata')) {
  80. this.search = uni.getStorageSync('searchdata')
  81. }
  82. },
  83. methods: {
  84. onchange(index) {
  85. this.curret = index
  86. },
  87. clear() {
  88. uni.removeStorageSync('searchdata')
  89. this.search = []
  90. },
  91. tosearch(type) {
  92. // this.positionlist = []
  93. // if (type == 1) {
  94. // this.keyword = this.keyword1
  95. // }
  96. // this.page = 1
  97. // this.total = 0
  98. // this.getlist()
  99. if (this.keyword1 != '') {
  100. this.search.push(this.keyword1)
  101. }
  102. uni.setStorageSync('searchdata', this.search)
  103. },
  104. }
  105. }
  106. </script>
  107. <style lang="scss">
  108. .title1 {
  109. font-size: 28rpx;
  110. font-family: SFPro, SFPro;
  111. font-weight: 400;
  112. color: #333333;
  113. }
  114. .title {
  115. font-size: 28rpx;
  116. font-family: SFPro, SFPro;
  117. font-weight: 400;
  118. color: #333333;
  119. }
  120. .top {
  121. margin-top: 26rpx;
  122. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  123. }
  124. .money1 {
  125. font-size: 32rpx;
  126. font-family: SFPro, SFPro;
  127. font-weight: 500;
  128. color: #CC3300;
  129. margin-top: 16rpx;
  130. padding: 0 0 24rpx 0;
  131. margin-left: 232rpx;
  132. }
  133. .one {
  134. font-size: 32rpx;
  135. font-family: PingFangSC, PingFang SC;
  136. font-weight: 500;
  137. color: #222222;
  138. }
  139. .flex {
  140. display: flex;
  141. }
  142. .list1 {
  143. margin-top: 4rpx;
  144. }
  145. .writer {
  146. font-size: 24rpx;
  147. font-family: PingFangSC, PingFang SC;
  148. font-weight: 400;
  149. color: #666666;
  150. margin-top: 20rpx;
  151. }
  152. .yang {
  153. font-size: 24rpx;
  154. font-family: SFPro, SFPro;
  155. font-weight: 400;
  156. color: #CC3300;
  157. }
  158. .money {
  159. font-size: 32rpx;
  160. font-family: SFPro, SFPro;
  161. font-weight: 400;
  162. color: #CC3300;
  163. }
  164. .ding {
  165. font-size: 24rpx;
  166. font-family: PingFangSC, PingFang SC;
  167. font-weight: 400;
  168. color: #555555;
  169. }
  170. .sou {
  171. margin-top: 18rpx;
  172. border-top: 2rpx solid rgba(0, 0, 0, 0.10);
  173. padding: 28rpx 0 0 0;
  174. font-size: 24rpx;
  175. font-family: SFPro, SFPro;
  176. font-weight: 400;
  177. color: #333333;
  178. }
  179. .bottom {
  180. width: 64rpx;
  181. height: 12rpx;
  182. background: linear-gradient(270deg, rgba(6, 169, 113, 0) 0%, #0ED4AA 100%);
  183. margin-top: -15rpx;
  184. }
  185. .two {
  186. font-size: 30rpx;
  187. font-family: PingFangSC, PingFang SC;
  188. font-weight: 400;
  189. color: #555555;
  190. }
  191. .tap {
  192. padding: 0 28rpx 18rpx;
  193. }
  194. .top {
  195. margin-top: 38rpx;
  196. }
  197. .item {
  198. height: 54rpx;
  199. background: #F3F3F3;
  200. border-radius: 6rpx;
  201. line-height: 54rpx;
  202. text-align: center;
  203. font-size: 24rpx;
  204. font-family: PingFangSC, PingFang SC;
  205. font-weight: 400;
  206. color: #222222;
  207. padding: 0 18rpx;
  208. }
  209. .his {
  210. font-size: 28rpx;
  211. font-family: PingFangSC, PingFang SC;
  212. font-weight: 500;
  213. color: #222222;
  214. }
  215. ::v-deep .u-content {
  216. // padding: 0 0 0 106rpx;
  217. }
  218. </style>