GoodList.vue 18 KB

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