GoodList.vue 17 KB

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