OemSearch.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="box">
  3. <view class="brand">当前品牌:{{brand}}</view>
  4. <!-- <view class="tab">
  5. <view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">品牌下搜索</view>
  6. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">车型下搜索</view>
  7. </view> -->
  8. <!-- 搜索 -->
  9. <view class="searchBoxBg">
  10. <searchBox placeholder="配件名称/原厂OEM" @search='search($event)'></searchBox>
  11. </view>
  12. <!-- <view class="history" v-if="searchValue.length==0">
  13. <view class="historyTop">
  14. <view class="historyTopTxt">历史搜索</view>
  15. <image src="../../static/img/icon_delete.png" mode="" class="historyDelImg"></image>
  16. </view>
  17. <view v-for="(item,index) in historyList" class="historyLIneBox">
  18. <view class="historyLIne" @click="gogroup">前刹车片</view>
  19. </view>
  20. </view> -->
  21. <view class="commentBox" v-for="(item,index) in itemData.list" :key="index">
  22. <view class="name">{{item.caption}}</view>
  23. <view class="comment">{{item.description}}</view>
  24. <view @click="goCarModelList(item.partnum)" class="code">{{item.extened}}</view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import searchBox from '@/components/searchBox/searchBox.vue'
  30. export default {
  31. components: {
  32. searchBox
  33. },
  34. data() {
  35. return {
  36. tabIndex: 0,
  37. searchValue: '',
  38. historyList: [1, 2, 3, 4, 5],
  39. itemData: {},
  40. brandList: [],
  41. brand:'本田',
  42. epc_id:'1014',
  43. }
  44. },
  45. onLoad() {
  46. this.getBrandData();
  47. this.getItemData();
  48. },
  49. methods: {
  50. goCarModelList(partnum) {
  51. uni.navigateTo({
  52. url: 'CarModelList?epc_id=' + this.epc_id + '&partnum=' + partnum
  53. })
  54. },
  55. tabClick(num) {
  56. this.tabIndex = num;
  57. },
  58. search(val) {
  59. // console.log(val);
  60. this.searchValue = val
  61. this.getItemData();
  62. },
  63. getBrandData() {
  64. uni.showLoading({
  65. title: '加载中'
  66. });
  67. this.$http('advancedEpc/getBrandsPc', {
  68. }, 'GET').then(res => {
  69. uni.hideLoading();
  70. this.brandList = res.data.result.list;
  71. console.log(this.brandList);
  72. });
  73. },
  74. // 配件查询
  75. getItemData() {
  76. uni.showLoading({
  77. title: '加载中'
  78. });
  79. this.$http('advancedEpc/findPartsPc', {
  80. epc_id:this.epc_id,
  81. keyword:this.searchValue,
  82. cur_page:'2',
  83. }, 'GET').then(res => {
  84. uni.hideLoading();
  85. this.itemData = res.data.result;
  86. });
  87. },
  88. }
  89. }
  90. </script>
  91. <style>
  92. .box {
  93. min-height: 100vh;
  94. background: #FFFFFF;
  95. }
  96. .brand {
  97. background: linear-gradient(110deg, #48B9F9 0%, #3F90F7 100%);
  98. padding: 24rpx;
  99. color: #FFFFFF;
  100. font-size: 28rpx;
  101. }
  102. .tab {
  103. background: #FFFFFF;
  104. display: flex;
  105. justify-content: space-around;
  106. line-height: 87rpx;
  107. /* position: fixed; */
  108. width: calc(100vw - 100rpx);
  109. padding-left: 50rpx;
  110. padding-right: 50rpx;
  111. height: 87rpx;
  112. /* z-index: 11; */
  113. }
  114. .tabLine {
  115. font-size: 32rpx;
  116. color: #999999;
  117. text-align: center;
  118. }
  119. .tabActive {
  120. color: #3F90F7;
  121. font-weight: bold;
  122. border-bottom: 4rpx solid #3F90F7;
  123. }
  124. .searchBoxBg {
  125. width: 100%;
  126. background-color: #FFFFFF;
  127. border-top: 1rpx solid #EEEEEE;
  128. border-bottom: 1rpx solid #EEEEEE;
  129. }
  130. .searchBox {
  131. display: flex;
  132. height: 72rpx;
  133. margin: 24rpx;
  134. background-color: #F4F5F7;
  135. border-radius: 36rpx;
  136. }
  137. .history {
  138. padding: 24rpx;
  139. }
  140. .historyTop {
  141. display: flex;
  142. justify-content: space-between;
  143. }
  144. .historyDelImg {
  145. width: 34rpx;
  146. height: 34rpx;
  147. }
  148. .historyTopTxt {
  149. font-size: 28rpx;
  150. font-weight: 400;
  151. color: #666666;
  152. line-height: 34rpx;
  153. }
  154. .historyLIneBox {
  155. display: inline-flex;
  156. flex-wrap: wrap;
  157. }
  158. .historyLIne {
  159. color: #333333;
  160. font-size: 24rpx;
  161. height: 64rpx;
  162. background: #F4F5F7;
  163. border-radius: 32rpx;
  164. line-height: 64rpx;
  165. padding: 0 24rpx;
  166. margin-top: 20rpx;
  167. margin-right: 24rpx;
  168. }
  169. .commentBox {
  170. padding: 20rpx 24rpx;
  171. border-bottom: 1rpx solid #EEEEEE;
  172. }
  173. .name {
  174. color: #333333;
  175. font-size: 26rpx;
  176. font-weight: bold;
  177. padding-top: 16rpx;
  178. padding-bottom: 10rpx;
  179. }
  180. .comment {
  181. color: #999999;
  182. font-size: 24rpx;
  183. padding-bottom: 14rpx;
  184. }
  185. .code {
  186. color: #3F90F7;
  187. font-size: 24rpx;
  188. }
  189. </style>