GoodList.vue 19 KB

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