GoodList.vue 18 KB

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