ApplyInfo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <div class="apply-info">
  3. <div class="apply-info-title">
  4. <p>最新求购信息</p>
  5. <span>海量求购,一网打尽</span>
  6. <div>
  7. <input type="text" class="form-control" placeholder="请输入要查找的内容" />
  8. <span>查询</span>
  9. <a>展开筛选</a>
  10. </div>
  11. </div>
  12. <div class="apply-info-list">
  13. <p>
  14. <span>发布时间<img src="/images/applyPurchase/sort-arrow.png" alt=""></span>
  15. <span>买家</span>
  16. <span>型号</span>
  17. <span>品牌</span>
  18. <span>截止时间<img src="/images/applyPurchase/sort-arrow.png" alt=""></span>
  19. <span>已报价<img src="/images/applyPurchase/sort-arrow.png" alt=""></span>
  20. <span>操作</span>
  21. </p>
  22. <ul>
  23. <li v-for="purchaseMan in purchaseManList.content" :class="{'active': purchaseMan.active}">
  24. <span>{{purchaseMan.releaseDate | date}}</span>
  25. <span>{{purchaseMan.tel | phone}}</span>
  26. <span>{{purchaseMan.code}}</span>
  27. <span>{{purchaseMan.brand}}</span>
  28. <span class="date-content"><span>剩余&nbsp;</span><span v-text="getDay(purchaseMan.deadline - purchaseMan.releaseDate)"></span>&nbsp;天&nbsp;<span v-text="getHours(purchaseMan.deadline - purchaseMan.releaseDate)"></span>&nbsp;小时</span>
  29. <span class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.amount || 0}}</span>&nbsp;条</span>
  30. <span class="btn-content">
  31. <a>联系买家</a>
  32. <a @click="sayPrice(purchaseMan)">我要报价</a>
  33. </span>
  34. <div class="expand-content">
  35. <div>
  36. 生产日期:{{purchaseMan.produceDate}}
  37. </div>
  38. <div>
  39. 封装:{{purchaseMan.encapsulation}}
  40. </div>
  41. <div>
  42. 采购数量:<span>{{purchaseMan.amount}}</span>个
  43. </div>
  44. <div>
  45. 单价预算:<span>¥{{purchaseMan.unitPrice}}</span>
  46. </div>
  47. </div>
  48. <div class="say-price">
  49. <div>报价</div>
  50. <div>
  51. <i>*</i>单价
  52. <select>
  53. <option value="RMB">$</option>
  54. <option value="USD">¥</option>
  55. </select>
  56. <input type="text" class="form-control">
  57. </div>
  58. <div>
  59. <i>*</i>交期&nbsp;
  60. <input type="text" class="form-control">&nbsp;-&nbsp;<input type="text" class="form-control">&nbsp;天
  61. </div>
  62. <div>
  63. 生产日期&nbsp;<input type="text" class="form-control">
  64. </div>
  65. <div>
  66. <span @click="cancelSayPrice(purchaseMan)">取消</span>
  67. <span>提交</span>
  68. </div>
  69. </div>
  70. </li>
  71. </ul>
  72. </div>
  73. <page :total="totalCount" :page-size="pageSize"
  74. :current="nowPage" v-on:childEvent="listenPage"></page>
  75. </div>
  76. </template>
  77. <script>
  78. import Page from '~components/common/page/pageComponent.vue'
  79. export default {
  80. data () {
  81. return {
  82. pageSize: 10,
  83. nowPage: 1
  84. }
  85. },
  86. components: {
  87. Page
  88. },
  89. filters: {
  90. date: function (date) {
  91. const d = new Date(Number(date))
  92. const year = d.getFullYear()
  93. const monthTemp = d.getMonth() + 1
  94. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  95. const hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours() + ' '
  96. const minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes() + ' '
  97. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
  98. return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
  99. },
  100. phone: function (str) {
  101. return str.substring(0, 3) + '****' + str.substring(7, 11)
  102. }
  103. },
  104. computed: {
  105. purchaseManList () {
  106. return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
  107. },
  108. totalCount () {
  109. return this.purchaseManList.totalElements
  110. }
  111. },
  112. methods: {
  113. getDay: function (timeStamp) {
  114. return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
  115. },
  116. getHours: function (timeStamp) {
  117. return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
  118. },
  119. listenPage: function (page) {
  120. this.nowPage = page
  121. this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: this.nowPage, count: this.pageSize})
  122. },
  123. sayPrice: function (purchaseMan) {
  124. purchaseMan.active = true
  125. },
  126. cancelSayPrice: function (purchaseMan) {
  127. purchaseMan.active = false
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. .apply-info {
  134. width: 1190px;
  135. margin: 0 auto;
  136. .apply-info-title {
  137. border-bottom: 1px solid #3975f4;
  138. >p {
  139. display: inline-block;
  140. width: 156px;
  141. height: 33px;
  142. line-height: 33px;
  143. color: #fff;
  144. background: #3975f4;
  145. font-size: 18px;
  146. text-align: center;
  147. border: {
  148. top-left-radius: 3px;
  149. top-right-radius: 3px;
  150. }
  151. margin: 0;
  152. }
  153. >span {
  154. color: #999;
  155. margin-left: 16px;
  156. }
  157. >div {
  158. float: right;
  159. height: 25px;
  160. line-height: 25px;
  161. >input {
  162. width: 241px;
  163. height: 25px;
  164. line-height: 25px;
  165. font-size: 13px;
  166. border: {
  167. top-right-radius: 0;
  168. bottom-right-radius: 0;
  169. }
  170. }
  171. >span {
  172. display: inline-block;
  173. width: 69px;
  174. color: #fff;
  175. background: #3975f4;
  176. text-align: center;
  177. margin: 0 6px 0 -1px;
  178. border: {
  179. top-right-radius: 3px;
  180. bottom-right-radius: 3px;
  181. }
  182. cursor: pointer;
  183. }
  184. >a {
  185. background: #ffa200;
  186. color: #fff;
  187. width: 79px;
  188. border-radius: 3px;
  189. text-align: center;
  190. display: inline-block;
  191. }
  192. }
  193. }
  194. .apply-info-list {
  195. >p {
  196. background: #ededed;
  197. height: 40px;
  198. line-height: 40px;
  199. margin: 9px 0 0 0;
  200. span {
  201. display: inline-block;
  202. text-align: center;
  203. img {
  204. width: 15px;
  205. height: 14px;
  206. margin: 0 0 3px 5px;
  207. }
  208. &:nth-child(1) {
  209. width: 186px;
  210. }
  211. &:nth-child(2) {
  212. width: 160px;
  213. }
  214. &:nth-child(3) {
  215. width: 173px;
  216. }
  217. &:nth-child(4) {
  218. width: 147px;
  219. }
  220. &:nth-child(5) {
  221. width: 152px;
  222. }
  223. &:nth-child(6) {
  224. width: 158px;
  225. }
  226. &:nth-child(7) {
  227. width: 214px;
  228. }
  229. }
  230. }
  231. >ul {
  232. margin-bottom: 29px;
  233. li {
  234. min-height: 67px;
  235. line-height: 67px;
  236. border: 1px solid #ededed;
  237. >span {
  238. overflow: hidden;
  239. text-overflow: ellipsis;
  240. white-space: nowrap;
  241. display: inline-block;
  242. text-align: center;
  243. color: #3c3c3c;
  244. vertical-align: middle;
  245. &:nth-child(1) {
  246. width: 186px;
  247. }
  248. &:nth-child(2) {
  249. width: 160px;
  250. }
  251. &:nth-child(3) {
  252. width: 173px;
  253. }
  254. &:nth-child(4) {
  255. width: 147px;
  256. }
  257. &:nth-child(5) {
  258. width: 152px;
  259. }
  260. &:nth-child(6) {
  261. width: 158px;
  262. }
  263. &:nth-child(7) {
  264. width: 212px;
  265. }
  266. &.date-content {
  267. span {
  268. &:first-child {
  269. font-size: 12px;
  270. color: #666;
  271. }
  272. color: #f71026;
  273. }
  274. }
  275. &.number-content {
  276. span {
  277. color: #5392f9;
  278. &.active {
  279. color: #ff9a00;
  280. }
  281. }
  282. >img {
  283. margin-bottom: 5px;
  284. margin-right: 2px;
  285. }
  286. }
  287. &.btn-content {
  288. a {
  289. display: inline-block;
  290. width: 71px;
  291. height: 28px;
  292. line-height: 28px;
  293. color: #fff;
  294. background: #3c7cf5;
  295. border-radius: 3px;
  296. cursor: pointer;
  297. &:first-child {
  298. background: #ffa200;
  299. margin-right: 10px;
  300. }
  301. }
  302. }
  303. }
  304. .expand-content {
  305. display: none;
  306. justify-content: space-between;
  307. padding: 0 236px 0 36px;
  308. background: #fffbf0;
  309. box-shadow: 1.5px 3px 7px 0 rgb( 178, 178, 179 );
  310. div {
  311. display: inline-block;
  312. span {
  313. color: #f71026;
  314. }
  315. }
  316. }
  317. &:hover {
  318. .expand-content {
  319. display: flex;
  320. }
  321. }
  322. .say-price {
  323. background-color: #e7eef9;
  324. display: none;
  325. >div {
  326. display: inline-block;
  327. position: relative;
  328. height: 64px;
  329. line-height: 64px;
  330. &:nth-child(1) {
  331. width: 282px;
  332. background: url('/images/applyPurchase/say-price.png')no-repeat;
  333. text-align: center;
  334. margin-right: 44px;
  335. }
  336. &:nth-child(2) {
  337. margin-right: 39px;
  338. input {
  339. width: 118px;
  340. height: 26px;
  341. border: 1px solid #5392f9;
  342. }
  343. select {
  344. position: absolute;
  345. top: 19px;
  346. width: 32px;
  347. height: 26px;
  348. background: url('/images/applyPurchase/arrow-down.png')no-repeat right center;
  349. -webkit-box-shadow: none;
  350. -moz-box-shadow: none;
  351. box-shadow: none;
  352. border: {
  353. left: none;
  354. top: none;
  355. bottom: none;
  356. right: 1px solid #5392f9;
  357. bottom-left-radius: 4px;
  358. top-left-radius: 4px;
  359. }
  360. color: #5392f9;
  361. & + input {
  362. padding-left: 34px;
  363. }
  364. }
  365. }
  366. &:nth-child(3) {
  367. margin-right: 37px;
  368. input {
  369. width: 32px;
  370. height: 26px;
  371. }
  372. }
  373. &:nth-child(4) {
  374. margin-right: 132px;
  375. input {
  376. width: 118px;
  377. height: 26px;
  378. }
  379. }
  380. &:nth-child(5) {
  381. span {
  382. width: 71px;
  383. height: 28px;
  384. line-height: 28px;
  385. text-align: center;
  386. display: inline-block;
  387. cursor: pointer;
  388. &:first-child {
  389. background: #dedddd;
  390. margin-right: 10px;
  391. }
  392. &:last-child {
  393. background: #fa4701;
  394. color: #fff;
  395. }
  396. }
  397. }
  398. i {
  399. color: #e41515;
  400. position: relative;
  401. top: 2px;
  402. right: 3px;
  403. }
  404. }
  405. }
  406. &.active {
  407. border-color: #f71026;
  408. .expand-content {
  409. display: flex;
  410. -webkit-box-shadow: none;
  411. -moz-box-shadow: none;
  412. box-shadow: none;
  413. }
  414. .say-price {
  415. display: block;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. .page-wrap {
  422. text-align: right;
  423. float: none;
  424. }
  425. }
  426. </style>