GoodList.vue 19 KB

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