GoodList.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. <template>
  2. <div>
  3. <div>
  4. <div class="tab-filter" >
  5. <div class="fl">&nbsp;&nbsp;| 产品信息(<span class="text-num"></span><span class="text-num" v-text="good_list.total"></span>)</div>
  6. <div class="fr">
  7. <div @click="sortBy('normal1')" :class="activeTag==='normal1'?'active':''"><a >综合排序</a></div>
  8. <div @click="sortBy('normal2')" :class="activeTag==='normal2'?'active':''"><a >现货优选</a></div>
  9. <div @click="sortBy('type')" :class="activeTag==='type'?'active':''"><a >型号精确</a></div>
  10. <div style="display:none"><a href="">销量</a></div>
  11. <div style="display:none"><a href="">人气</a></div>
  12. <div style="display:none"><a href="">信用</a></div>
  13. <div @click="sortBy('price')" :class="activeTag==='price'?'active':''"><a>价格<i class="fa fa-long-arrow-down" v-show="price_asc"></i><i class="fa fa-long-arrow-up" v-show="!price_asc"></i></a></div>
  14. <div class="price-filter">
  15. <div class="price-input">
  16. <input type="number" min="0" step="0.01" v-model="min_price" class="form-control" placeholder="¥" onfocus="this.placeholder=''" onblur="this.placeholder='¥'" />
  17. <span>-</span>
  18. <input type="number" :min="min_price === ''?0:min_price" step="0.01" v-model="max_price" class="form-control" placeholder="¥" onfocus="this.placeholder=''" onblur="this.placeholder='¥'" />
  19. </div>
  20. <div class="price-hover">
  21. <a @click="clear_price">清空</a>
  22. <a @click="filter_price">确定</a>
  23. </div>
  24. </div>
  25. <div style="display:none;padding-top: 5px; margin-left: 0;">
  26. <select class="select-adder form-control" style="width: 120px;">
  27. <option value="1">发货地</option>
  28. </select>
  29. </div>
  30. </div>
  31. <div class="off">
  32. <a @click="list_open=!list_open">
  33. <span v-text="list_open?'收起':'展开'"></span>
  34. <i class="fa fa-angle-down" v-show="!list_open"></i>
  35. <i class="fa fa-angle-up"v-show="list_open"></i>
  36. </a>
  37. </div>
  38. </div>
  39. <div v-if="list_open">
  40. <table class="product-list" >
  41. <thead>
  42. <tr style="height: 40px;">
  43. <th width="80"></th>
  44. <th width="160">品牌/型号/类目</th>
  45. <th width="100">封装/生产日期</th>
  46. <th width="110">店铺名称</th>
  47. <th width="110">库存</th>
  48. <th width="90">阶梯</th>
  49. <!-- <th width="90" v-if="!crname_click_flag.rmb_click_flag">香港交货</th>
  50. <th width="110" v-if="!crname_click_flag.usd_click_flag">大陆交货<span style="font-size: 12px;">(含税)</span></th>-->
  51. <th width="110">单价</th>
  52. <th width="110">交期<span style="font-size: 12px;">(天)</span></th>
  53. <th width="100">操作</th>
  54. </tr>
  55. </thead>
  56. <tbody id="productList-content">
  57. <tr v-for="item in good_list.components"
  58. v-show="!(crname_click_flag.usd_click_flag && item.currencyName != 'USD') || !(crname_click_flag.rmb_click_flag && item.currencyName != 'RMB')">
  59. <td>
  60. <nuxt-link :to="`/product/component/${item.uuid}`">
  61. <img width="80px" height="80px" :src="item.img?item.img:'/images/component/default.png'">
  62. </nuxt-link>
  63. </td>
  64. <td class="brand-code">
  65. <div class="brand"><nuxt-link :to="`/product/brand/${item.brand.uuid}`" class="text-num" v-text="item.brand.nameEn"></nuxt-link></div>
  66. <div class="code"><nuxt-link :to="`/product/component/${item.uuid}`" class="f16 text-bold text-num" v-text="item.code"></nuxt-link></div>
  67. <div class="brand"><nuxt-link :to="`/product/kind/${item.kindid}`" v-text="item.kind.nameCn">
  68. </nuxt-link></div>
  69. </td>
  70. <td>
  71. <div class="package" v-text="item.packaging?item.packaging:'暂无包装方式信息'"></div>
  72. <div class="date" v-text="item.produceDate"></div>
  73. </td>
  74. <td>
  75. <div>
  76. <nuxt-link :to="'/store/' + item.storeId" v-text="item.storeName">
  77. </nuxt-link>
  78. <span v-if="!item.storeName">—</span>
  79. </div>
  80. </td>
  81. <td class="text-left">
  82. <div class="goods">
  83. 库存:<span v-text="item.reserve || '暂无库存'"></span>
  84. </div>
  85. <div class="from" v-if="item.reserve > 0">
  86. 起拍:<span v-text="item.minBuyQty"></span>
  87. </div>
  88. <!-- <div class="multiple" v-if="item.reserve > 0">
  89. 倍数:<span v-text="item.minPackQty"></span>
  90. </div>-->
  91. </td>
  92. <td>
  93. <div v-show="!item.prices">
  94. <span>—</span>
  95. </div>
  96. <div v-for="price in item.prices">
  97. <span v-text="price.start"></span> +
  98. </div>
  99. </td>
  100. <td>
  101. <div v-for="price in item.prices">
  102. <span v-show="item.currencyName == 'USD'">$</span>
  103. <span v-show="item.currencyName == 'RMB'">¥</span>
  104. <span>{{price.uSDPrice || price.rMBPrice | currency}}</span>
  105. </div>
  106. <div v-show="!item.currencyName">
  107. <span>—</span>
  108. </div>
  109. </td>
  110. <!-- <td v-if="!crname_click_flag.usd_click_flag">
  111. <div v-show="!(item.currencyName == 'RMB') || !item.prices">
  112. <span>—</span>
  113. </div>
  114. <div v-for="price in item.prices">
  115. <span>{{price.rMBPrice | currency}}</span>
  116. </div>
  117. </td>-->
  118. <td>
  119. <div v-show="!item.b2cMinDelivery">
  120. <span>—</span>
  121. </div>
  122. <div v-if="item.b2cMinDelivery">交期:
  123. <!--<span v-text="item.b2cMinDelivery + '-' + item.b2cMaxDelivery"></span>-->
  124. <span v-if="item.b2cMinDelivery != item.b2cMaxDelivery" v-text="item.b2cMinDelivery + '-' + item.b2cMaxDelivery"></span>
  125. <span v-if="item.b2cMinDelivery == item.b2cMaxDelivery" v-text="item.b2cMinDelivery"></span>
  126. </div>
  127. </td>
  128. <td>
  129. <div v-show="!item.reserve">
  130. <span>—</span>
  131. </div>
  132. <div v-if="item.reserve > 0">
  133. <buy :item="item" :isStoreStyle="false"></buy>
  134. </div>
  135. </td>
  136. </tr>
  137. <tr v-if="!good_list.components || good_list.components.length == 'undefined' ||good_list.components.length == 0">
  138. <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
  139. <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
  140. </td>
  141. </tr>
  142. </tbody>
  143. </table>
  144. </div>
  145. <page :total="total_count" :page-size="pageSize"
  146. :current="nowPage" @childEvent="listenPage"></page>
  147. </div>
  148. </div>
  149. </template>
  150. <script>
  151. import Page from '~components/common/page/pageComponent.vue'
  152. import Buy from '~components/common/buyOrCar/buyComponent.vue'
  153. export default {
  154. data () {
  155. return {
  156. list_open: true,
  157. nowPage: 1,
  158. pageSize: 15,
  159. sorting: {},
  160. price_asc: true,
  161. min_price: '',
  162. max_price: '',
  163. filter: {},
  164. activeTag: 'normal1'
  165. }
  166. },
  167. components: {
  168. Page,
  169. Buy
  170. },
  171. props: ['crname_click_flag'],
  172. filters: {
  173. currency: function (input) {
  174. if (typeof input === 'number') {
  175. if (input.toString().indexOf('.') === -1) {
  176. input = input + '.00'
  177. }
  178. }
  179. return input
  180. }
  181. },
  182. computed: {
  183. good_lists () {
  184. return this.$store.state.searchData.searchList.lists
  185. },
  186. good_list () {
  187. console.log(this.good_lists.data)
  188. return this.good_lists.data
  189. },
  190. total_count () {
  191. return Math.min(this.good_list.total, 100 * this.pageSize)
  192. },
  193. buy_info () {
  194. return this.$store.state.user.buy.buyInfo.data
  195. },
  196. car_info () {
  197. return this.$store.state.user.car.addCarInfo.data
  198. }
  199. },
  200. methods: {
  201. listenPage: function (changedPage) {
  202. this.nowPage = changedPage
  203. this.$emit('pageEvent', this.nowPage)
  204. },
  205. sortBy: function (param) {
  206. if (param === 'normal1') {
  207. this.sorting = {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}
  208. this.activeTag = 'normal1'
  209. } else if (param === 'normal2') {
  210. this.sorting = {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}
  211. this.activeTag = 'normal2'
  212. } else if (param === 'type') {
  213. this.sorting = {'GO_SEARCH': 'DESC', 'GO_RESERVE': 'DESC'}
  214. this.activeTag = 'type'
  215. } else if (param === 'price') {
  216. if (this.price_asc) {
  217. this.sorting = {'GO_MINPRICERMB': 'ASC', 'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}
  218. } else {
  219. this.sorting = {'GO_MINPRICERMB': 'DESC', 'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}
  220. }
  221. this.activeTag = 'price'
  222. this.price_asc = !this.price_asc
  223. }
  224. this.$emit('sortEvent', this.sorting)
  225. },
  226. filter_price: function () {
  227. if (this.min_price === '' && this.max_price !== '') {
  228. this.filter.goods_maxpricermb = this.max_price
  229. } else if (this.min_price !== '' && this.max_price === '') {
  230. this.filter.goods_minpricermb = this.min_price
  231. } else if (this.min_price !== '' && this.max_price !== '') {
  232. if (this.min_price <= this.max_price) {
  233. this.filter.goods_minpricermb = this.min_price
  234. this.filter.goods_maxpricermb = this.max_price
  235. }
  236. } else {
  237. delete this.filter.goods_minpricermb
  238. delete this.filter.goods_maxpricermb
  239. }
  240. this.$emit('filterPriceEvent', this.filter)
  241. },
  242. clear_price: function () {
  243. this.min_price = ''
  244. this.max_price = ''
  245. this.$emit('filterPriceEvent', this.filter)
  246. }
  247. }
  248. }
  249. </script>
  250. <style scoped>
  251. /* .tab-filter {
  252. width: 1190px;
  253. height: 40px;
  254. margin: 0 auto;
  255. line-height: 40px;
  256. margin-top: 20px;
  257. margin-bottom: 10px;
  258. background: #f1efef;
  259. }
  260. .tab-filter .fl {
  261. font-size: 14px;
  262. }
  263. .tab-filter .fl, .tab-filter .fr {
  264. float: left;
  265. }
  266. .tab-filter .fl span {
  267. font-size: 14px;
  268. }
  269. .text-num {
  270. font-style: normal;
  271. font-family: verdana;
  272. }
  273. .tab-filter .fr {
  274. max-width: 1050px;
  275. }
  276. .tab-filter .fr div {
  277. float: left;
  278. margin: 0 5px;
  279. }
  280. .tab-filter .fr a {
  281. display: inline-block;
  282. padding: 1px 10px;
  283. border: #ccc 1px solid;
  284. line-height: 26px;
  285. font-size: 14px;
  286. text-align: center;
  287. color: #333;
  288. max-height: 30px;
  289. background: #fff;
  290. }
  291. .tab-filter .fr .price-filter {
  292. padding-top: 5px;
  293. width: 176px;
  294. margin: 0;
  295. }
  296. .price-filter {
  297. position: relative;
  298. }*/
  299. .price-filter .price-input {
  300. position: relative;
  301. z-index: 10;
  302. margin: 0 10px !important;
  303. width: 180px;
  304. }
  305. .tab-filter .fr .price-filter input, .tab-filter .fr .price-filter span {
  306. float: left;
  307. }
  308. .tab-filter .fr .form-control {
  309. width: 70px;
  310. height: 30px;
  311. border-radius: 0;
  312. padding-left: 5px;
  313. }
  314. .tab-filter .fr .price-filter span {
  315. margin: 0 5px;
  316. line-height: 30px;
  317. }
  318. .price-filter .price-hover {
  319. display: none;
  320. width: 165px;
  321. height: 25px;
  322. padding: 60px 6px 6px;
  323. margin: 0 10px;
  324. border: 1px solid #999;
  325. position: absolute;
  326. background: #fff;
  327. top: 0;
  328. -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  329. -moz-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  330. box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  331. }
  332. .price-filter .price-hover a:first-child {
  333. position: absolute;
  334. top: 37px;
  335. left: 6px;
  336. width: 36px;
  337. height: 25px;
  338. line-height: 25px;
  339. text-align: center;
  340. color: #5078cb;
  341. display: inline-block;
  342. border: none;
  343. padding: 0;
  344. }
  345. .price-filter .price-hover a:last-child {
  346. position: absolute;
  347. top: 37px;
  348. right: 7px;
  349. width: 38px;
  350. height: 25px;
  351. line-height: 24px;
  352. border: 1px solid #ccc;
  353. text-align: center;
  354. background: #f7f7f7;
  355. color: #333;
  356. display: inline-block;
  357. padding: 0;
  358. }
  359. /* .tab-filter .fr .off {
  360. margin-left: 130px;
  361. float: right;
  362. }
  363. .tab-filter .fr .off a {
  364. border: none;
  365. text-align: right;
  366. padding-left: 360px;
  367. background: none;
  368. }
  369. .tab-filter .fr .off a i {
  370. font-size: 16px;
  371. }*/
  372. .product-list{
  373. width: 1190px;
  374. /*margin-bottom: 20px;*/
  375. }
  376. .product-list thead tr{
  377. /*border-top: #6493ff 2px solid;*/
  378. color: #323232;
  379. background: none;
  380. }
  381. /* 物品列表 */
  382. .product-list .brand-code {
  383. font-size: 14px;
  384. text-align: center;
  385. }
  386. .product-list .brand-code .brand{
  387. font-size: 12px;
  388. }
  389. .product-list .brand-code .code {
  390. font-weight: 600;
  391. }
  392. .product-list th {
  393. color: rgb(50,50,50);
  394. font-size: 14px;
  395. font-weight: 600;
  396. background-color: #f7f7f7;
  397. text-align: center;
  398. }
  399. .product-list tbody>tr {
  400. border: 1px solid #e8e8e8;
  401. }
  402. .product-list tbody>tr img {
  403. border: 1px solid #e8e8e8;
  404. margin: 10px 0 5px 0;
  405. width: 80px;
  406. height: 80px;
  407. }
  408. .product-list tbody>tr .contact{
  409. font-size: 14px;
  410. color: #5078cb;
  411. width: 90%;
  412. margin: 0 auto;
  413. display: inline-block;
  414. }
  415. .product-list tbody>tr .contact:hover{
  416. color: #d32526;
  417. }
  418. .product-list td {
  419. font-size: 12px;
  420. color: #333;
  421. text-align: center;
  422. line-height: 20px;
  423. }
  424. /* 物品列表按钮 */
  425. /* .product-list .btn-buy-now {
  426. background-color: #5078CB;
  427. color: #fff;
  428. width: 80px;
  429. height: 30px;
  430. font-size: 12px;
  431. border: 1px solid #5078cb;
  432. padding-top: 8px;
  433. }
  434. .product-list .btn-add-cart {
  435. margin-top: 10px;
  436. color: #214797;
  437. width: 80px;
  438. height: 30px;
  439. font-size: 12px;
  440. background-color: #fff;
  441. border: 1px solid #e8e8e8;
  442. padding-top: 8px;
  443. }
  444. .product-list .btn-buy-now:hover{
  445. background: #214797;
  446. }
  447. .product-list .btn-add-cart:hover{
  448. background-color: #5078CB;
  449. color: #fff;
  450. }*/
  451. .product-list .text-left{
  452. text-align: left;
  453. }
  454. .product-list .text-left div{
  455. margin-left: 30px;
  456. }
  457. .product-list tbody tr td{
  458. padding: 10px 0;
  459. }
  460. .search-record{
  461. width: 100%;
  462. margin: 0 auto;
  463. height: 40px;
  464. font-size: 16px;
  465. line-height: 40px;
  466. margin-top: 20px;
  467. }
  468. .search-record span.red{
  469. color: #ff0909;
  470. }
  471. .tab-filter{
  472. width: 1190px;
  473. height: 40px;
  474. margin: 0 auto;
  475. line-height: 40px;
  476. margin-bottom: 10px;
  477. background: #f1efef;
  478. }
  479. .tab-filter .fl,.tab-filter .fr{
  480. float: left;
  481. }
  482. .tab-filter .fl{
  483. font-size: 14px;
  484. }
  485. .tab-filter .fr{
  486. max-width: 1050px;
  487. }
  488. .tab-filter .fl span{
  489. font-size: 14px;
  490. }
  491. .tab-filter .fr div{
  492. float: left;
  493. margin: 0 5px;
  494. }
  495. .tab-filter .fr div.active a{
  496. border: #5078cb 1px solid;
  497. color: #5078cb;
  498. }
  499. .tab-filter .fr a{
  500. display: inline-block;
  501. padding: 1px 10px;
  502. border: #ccc 1px solid;
  503. line-height: 26px;
  504. font-size: 14px;
  505. text-align: center;
  506. color: #333;
  507. max-height: 30px;
  508. background: #fff;
  509. }
  510. .tab-filter .fr a i{
  511. /*margin-left: 5px;*/
  512. }
  513. .tab-filter .fr a:hover{
  514. border: #5078cb 1px solid;
  515. color: #5078cb;
  516. }
  517. .tab-filter .off{
  518. float: right;
  519. margin-right: 20px;
  520. color: black;
  521. }
  522. .tab-filter .off a:hover{
  523. border: none;
  524. color: #5078cb;
  525. }
  526. .tab-filter .off a{
  527. border: none;
  528. text-align: right;
  529. padding-left: 360px;
  530. background: none;
  531. color: #333;
  532. }
  533. .tab-filter .off a i{
  534. font-size: 16px;
  535. }
  536. .tab-filter .fr .form-control{
  537. width: 70px;
  538. height: 30px;
  539. border-radius: 0;
  540. padding-left: 5px;
  541. }
  542. .tab-filter .fr .price-filter input,.tab-filter .fr .price-filter span{
  543. float: left;
  544. }
  545. .tab-filter .fr select{
  546. -webkit-appearance: none;
  547. appearance: none;
  548. background: transparent;
  549. -o-appearance: none;
  550. -moz-appearance: none;
  551. -ms-appearance: none;
  552. width: 120px;
  553. }
  554. .tab-filter .fr .price-filter{
  555. padding-top: 5px;
  556. width: 176px;
  557. margin: 0;
  558. }
  559. .tab-filter .fr .price-filter span{
  560. margin: 0 5px;
  561. line-height: 30px;
  562. }
  563. .close{
  564. display: none;
  565. }
  566. .price-filter{
  567. position: relative;
  568. }
  569. .price-filter:hover .price-hover{
  570. display: block;
  571. }
  572. .price-filter .price-hover{
  573. background: transparent;
  574. }
  575. .price-filter .price-input{
  576. position: relative;
  577. z-index: 10;
  578. margin: 0 10px !important;
  579. }
  580. .price-filter .price-hover{
  581. display: none;
  582. width: 165px;
  583. height: 25px;
  584. padding: 60px 6px 6px;
  585. margin: 0 10px;
  586. border: 1px solid #999;
  587. position: absolute;
  588. background: #fff;
  589. top: 0;
  590. -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  591. -moz-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  592. box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  593. }
  594. .price-filter .price-hover a:first-child{
  595. position: absolute;
  596. top: 37px;
  597. left: 6px;
  598. width: 36px;
  599. height: 25px;
  600. line-height: 25px;
  601. text-align: center;
  602. color: #5078cb;
  603. display: inline-block;
  604. border: none;
  605. padding: 0;
  606. }
  607. .price-filter .price-hover a:last-child{
  608. position: absolute;
  609. top: 37px;
  610. right: 7px;
  611. width: 38px;
  612. height: 25px;
  613. line-height: 24px;
  614. border: 1px solid #ccc;
  615. text-align: center;
  616. background: #f7f7f7;
  617. color: #333;
  618. display: inline-block;
  619. padding: 0;
  620. }
  621. .price-filter .price-hover a:last-child:hover{
  622. background: #5078cb;
  623. color: #fff;
  624. }
  625. div.ng-table-pager input.page-number {
  626. vertical-align: inherit;
  627. display: inline-block;
  628. width: 40px;
  629. height: 31px;
  630. padding: 6px 6px;
  631. font-size: 14px;
  632. line-height: 1.42857143;
  633. color: #9B9792;
  634. text-align: center;
  635. background-color: #F6F5F4;
  636. background-image: none;
  637. border: 1px solid #ccc;
  638. border-top-left-radius: 4px;
  639. border-bottom-left-radius: 4px;
  640. box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
  641. transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
  642. }
  643. div.ng-table-pager a.page-a{
  644. background: #5078cb !important;
  645. color: #fff;
  646. float: right;
  647. }
  648. tbody a:hover{
  649. color: #f39801;
  650. }
  651. </style>