GoodList.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  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="'/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">交期: <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. this.$emit('filterPriceEvent', this.filter)
  232. }
  233. }
  234. }
  235. </script>
  236. <style scoped>
  237. /* .tab-filter {
  238. width: 1190px;
  239. height: 40px;
  240. margin: 0 auto;
  241. line-height: 40px;
  242. margin-top: 20px;
  243. margin-bottom: 10px;
  244. background: #f1efef;
  245. }
  246. .tab-filter .fl {
  247. font-size: 14px;
  248. }
  249. .tab-filter .fl, .tab-filter .fr {
  250. float: left;
  251. }
  252. .tab-filter .fl span {
  253. font-size: 14px;
  254. }
  255. .text-num {
  256. font-style: normal;
  257. font-family: verdana;
  258. }
  259. .tab-filter .fr {
  260. max-width: 1050px;
  261. }
  262. .tab-filter .fr div {
  263. float: left;
  264. margin: 0 5px;
  265. }
  266. .tab-filter .fr a {
  267. display: inline-block;
  268. padding: 1px 10px;
  269. border: #ccc 1px solid;
  270. line-height: 26px;
  271. font-size: 14px;
  272. text-align: center;
  273. color: #333;
  274. max-height: 30px;
  275. background: #fff;
  276. }
  277. .tab-filter .fr .price-filter {
  278. padding-top: 5px;
  279. width: 176px;
  280. margin: 0;
  281. }
  282. .price-filter {
  283. position: relative;
  284. }*/
  285. .price-filter .price-input {
  286. position: relative;
  287. z-index: 10;
  288. margin: 0 10px !important;
  289. width: 180px;
  290. }
  291. .tab-filter .fr .price-filter input, .tab-filter .fr .price-filter span {
  292. float: left;
  293. }
  294. .tab-filter .fr .form-control {
  295. width: 70px;
  296. height: 30px;
  297. border-radius: 0;
  298. padding-left: 5px;
  299. }
  300. .tab-filter .fr .price-filter span {
  301. margin: 0 5px;
  302. line-height: 30px;
  303. }
  304. .price-filter .price-hover {
  305. display: none;
  306. width: 165px;
  307. height: 25px;
  308. padding: 60px 6px 6px;
  309. margin: 0 10px;
  310. border: 1px solid #999;
  311. position: absolute;
  312. background: #fff;
  313. top: 0;
  314. -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  315. -moz-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  316. box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  317. }
  318. .price-filter .price-hover a:first-child {
  319. position: absolute;
  320. top: 37px;
  321. left: 6px;
  322. width: 36px;
  323. height: 25px;
  324. line-height: 25px;
  325. text-align: center;
  326. color: #5078cb;
  327. display: inline-block;
  328. border: none;
  329. padding: 0;
  330. }
  331. .price-filter .price-hover a:last-child {
  332. position: absolute;
  333. top: 37px;
  334. right: 7px;
  335. width: 38px;
  336. height: 25px;
  337. line-height: 24px;
  338. border: 1px solid #ccc;
  339. text-align: center;
  340. background: #f7f7f7;
  341. color: #333;
  342. display: inline-block;
  343. padding: 0;
  344. }
  345. /* .tab-filter .fr .off {
  346. margin-left: 130px;
  347. float: right;
  348. }
  349. .tab-filter .fr .off a {
  350. border: none;
  351. text-align: right;
  352. padding-left: 360px;
  353. background: none;
  354. }
  355. .tab-filter .fr .off a i {
  356. font-size: 16px;
  357. }*/
  358. .product-list{
  359. width: 1190px;
  360. /*margin-bottom: 20px;*/
  361. }
  362. .product-list thead tr{
  363. /*border-top: #6493ff 2px solid;*/
  364. color: #323232;
  365. background: none;
  366. }
  367. /* 物品列表 */
  368. .product-list .brand-code {
  369. font-size: 14px;
  370. text-align: center;
  371. }
  372. .product-list .brand-code .brand{
  373. font-size: 12px;
  374. }
  375. .product-list .brand-code .code {
  376. font-weight: 600;
  377. }
  378. .product-list th {
  379. color: rgb(50,50,50);
  380. font-size: 14px;
  381. font-weight: 600;
  382. background-color: #f7f7f7;
  383. text-align: center;
  384. }
  385. .product-list tbody>tr {
  386. border: 1px solid #e8e8e8;
  387. }
  388. .product-list tbody>tr img {
  389. border: 1px solid #e8e8e8;
  390. margin: 10px 0 5px 0;
  391. width: 80px;
  392. height: 80px;
  393. }
  394. .product-list tbody>tr .contact{
  395. font-size: 14px;
  396. color: #5078cb;
  397. width: 90%;
  398. margin: 0 auto;
  399. display: inline-block;
  400. }
  401. .product-list tbody>tr .contact:hover{
  402. color: #d32526;
  403. }
  404. .product-list td {
  405. font-size: 12px;
  406. color: #333;
  407. text-align: center;
  408. line-height: 20px;
  409. }
  410. /* 物品列表按钮 */
  411. .product-list .btn-buy-now {
  412. background-color: #5078CB;
  413. color: #fff;
  414. width: 80px;
  415. height: 30px;
  416. font-size: 12px;
  417. border: 1px solid #5078cb;
  418. }
  419. .product-list .btn-add-cart {
  420. margin-top: 10px;
  421. color: #214797;
  422. width: 80px;
  423. height: 30px;
  424. font-size: 12px;
  425. background-color: #fff;
  426. border: 1px solid #e8e8e8;
  427. }
  428. .product-list .btn-buy-now:hover{
  429. background: #214797;
  430. }
  431. .product-list .btn-add-cart:hover{
  432. background-color: #5078CB;
  433. color: #fff;
  434. }
  435. .product-list .text-left{
  436. text-align: left;
  437. }
  438. .product-list .text-left div{
  439. margin-left: 30px;
  440. }
  441. .product-list tbody tr td{
  442. padding: 10px 0;
  443. }
  444. .search-record{
  445. width: 100%;
  446. margin: 0 auto;
  447. height: 40px;
  448. font-size: 16px;
  449. line-height: 40px;
  450. margin-top: 20px;
  451. }
  452. .search-record span.red{
  453. color: #ff0909;
  454. }
  455. .tab-filter{
  456. width: 1190px;
  457. height: 40px;
  458. margin: 0 auto;
  459. line-height: 40px;
  460. margin-bottom: 10px;
  461. background: #f1efef;
  462. }
  463. .tab-filter .fl,.tab-filter .fr{
  464. float: left;
  465. }
  466. .tab-filter .fl{
  467. font-size: 14px;
  468. }
  469. .tab-filter .fr{
  470. max-width: 1050px;
  471. }
  472. .tab-filter .fl span{
  473. font-size: 14px;
  474. }
  475. .tab-filter .fr div{
  476. float: left;
  477. margin: 0 5px;
  478. }
  479. .tab-filter .fr div.active a{
  480. border: #5078cb 1px solid;
  481. color: #5078cb;
  482. }
  483. .tab-filter .fr a{
  484. display: inline-block;
  485. padding: 1px 10px;
  486. border: #ccc 1px solid;
  487. line-height: 26px;
  488. font-size: 14px;
  489. text-align: center;
  490. color: #333;
  491. max-height: 30px;
  492. background: #fff;
  493. }
  494. .tab-filter .fr a i{
  495. /*margin-left: 5px;*/
  496. }
  497. .tab-filter .fr a:hover{
  498. border: #5078cb 1px solid;
  499. color: #5078cb;
  500. }
  501. .tab-filter .fr .off{
  502. margin-left : 129px;
  503. float: right;
  504. }
  505. .tab-filter .fr .off a:hover{
  506. border: none;
  507. color: #5078cb;
  508. }
  509. .tab-filter .fr .off a{
  510. border: none;
  511. text-align: right;
  512. padding-left: 360px;
  513. background: none;
  514. }
  515. .tab-filter .fr .off a i{
  516. font-size: 16px;
  517. }
  518. .tab-filter .fr .form-control{
  519. width: 70px;
  520. height: 30px;
  521. border-radius: 0;
  522. padding-left: 5px;
  523. }
  524. .tab-filter .fr .price-filter input,.tab-filter .fr .price-filter span{
  525. float: left;
  526. }
  527. .tab-filter .fr select{
  528. -webkit-appearance: none;
  529. appearance: none;
  530. background: transparent;
  531. -o-appearance: none;
  532. -moz-appearance: none;
  533. -ms-appearance: none;
  534. width: 120px;
  535. }
  536. .tab-filter .fr .price-filter{
  537. padding-top: 5px;
  538. width: 176px;
  539. margin: 0;
  540. }
  541. .tab-filter .fr .price-filter span{
  542. margin: 0 5px;
  543. line-height: 30px;
  544. }
  545. .close{
  546. display: none;
  547. }
  548. .price-filter{
  549. position: relative;
  550. }
  551. .price-filter:hover .price-hover{
  552. display: block;
  553. }
  554. .price-filter .price-hover{
  555. background: transparent;
  556. }
  557. .price-filter .price-input{
  558. position: relative;
  559. z-index: 10;
  560. margin: 0 10px !important;
  561. }
  562. .price-filter .price-hover{
  563. display: none;
  564. width: 165px;
  565. height: 25px;
  566. padding: 60px 6px 6px;
  567. margin: 0 10px;
  568. border: 1px solid #999;
  569. position: absolute;
  570. background: #fff;
  571. top: 0;
  572. -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  573. -moz-box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  574. box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  575. }
  576. .price-filter .price-hover a:first-child{
  577. position: absolute;
  578. top: 37px;
  579. left: 6px;
  580. width: 36px;
  581. height: 25px;
  582. line-height: 25px;
  583. text-align: center;
  584. color: #5078cb;
  585. display: inline-block;
  586. border: none;
  587. padding: 0;
  588. }
  589. .price-filter .price-hover a:last-child{
  590. position: absolute;
  591. top: 37px;
  592. right: 7px;
  593. width: 38px;
  594. height: 25px;
  595. line-height: 24px;
  596. border: 1px solid #ccc;
  597. text-align: center;
  598. background: #f7f7f7;
  599. color: #333;
  600. display: inline-block;
  601. padding: 0;
  602. }
  603. .price-filter .price-hover a:last-child:hover{
  604. background: #5078cb;
  605. color: #fff;
  606. }
  607. div.ng-table-pager input.page-number {
  608. vertical-align: inherit;
  609. display: inline-block;
  610. width: 40px;
  611. height: 31px;
  612. padding: 6px 6px;
  613. font-size: 14px;
  614. line-height: 1.42857143;
  615. color: #9B9792;
  616. text-align: center;
  617. background-color: #F6F5F4;
  618. background-image: none;
  619. border: 1px solid #ccc;
  620. border-top-left-radius: 4px;
  621. border-bottom-left-radius: 4px;
  622. box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
  623. transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
  624. }
  625. div.ng-table-pager a.page-a{
  626. background: #5078cb !important;
  627. color: #fff;
  628. float: right;
  629. }
  630. tbody a:hover{
  631. color: #f39801;
  632. }
  633. </style>