GoodList.vue 18 KB

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