ApplyInfo.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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.offerAmount || 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 v-model="sayPriceObj.currency">
  53. <option value="RMB">¥</option>
  54. <option value="USD">$</option>
  55. </select>
  56. <input type="text" v-model="sayPriceObj.unitPrice" class="form-control">
  57. </div>
  58. <div>
  59. <i>*</i>交期&nbsp;
  60. <input type="number" v-model="sayPriceObj.minDay" @blur="onMinDayInput" class="form-control">&nbsp;-&nbsp;<input type="number" v-model="sayPriceObj.maxDay" @blur="onMaxDayInput" class="form-control">&nbsp;天
  61. </div>
  62. <div>
  63. 生产日期&nbsp;<input v-model="sayPriceObj.produceDate" type="text" class="form-control">
  64. </div>
  65. <div>
  66. <span @click="cancelSayPrice(purchaseMan)">取消</span>
  67. <span @click="commitSayPrice(purchaseMan)">提交</span>
  68. </div>
  69. </div>
  70. </li>
  71. </ul>
  72. </div>
  73. <!--提示框-->
  74. <div class="com-del-box" v-if="showRemindBox">
  75. <div class="title">
  76. <a @click="showRemindBox = false"><i class="fa fa-close fa-lg"></i></a>
  77. </div>
  78. <div class="content">
  79. <!--<p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>-->
  80. <!--<p style="line-height: 20px;">前往<a @click="goBrandApply()" target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>-->
  81. <p><img src="/images/applyPurchase/check.png" alt="">发布成功</p>
  82. <p>其中 <span>100</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
  83. <div>
  84. <a @click="showRemindBox = false">我知道了</a>
  85. <a href="javascript:void(0)">前往我的求购</a>
  86. </div>
  87. </div>
  88. </div>
  89. <page :total="totalCount" :page-size="pageSize"
  90. :current="nowPage" v-on:childEvent="listenPage"></page>
  91. </div>
  92. </template>
  93. <script>
  94. import Page from '~components/common/page/pageComponent.vue'
  95. export default {
  96. data () {
  97. return {
  98. pageSize: 10,
  99. nowPage: 1,
  100. sayPriceObj: {
  101. currency: 'RMB',
  102. unitPrice: '',
  103. minDay: '',
  104. maxDay: '',
  105. produceDate: '',
  106. spId: ''
  107. },
  108. showRemindBox: false
  109. }
  110. },
  111. components: {
  112. Page
  113. },
  114. filters: {
  115. date: function (date) {
  116. const d = new Date(Number(date))
  117. const year = d.getFullYear()
  118. const monthTemp = d.getMonth() + 1
  119. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  120. const hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours()
  121. const minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes() + ' '
  122. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
  123. return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
  124. },
  125. phone: function (str) {
  126. return str.substring(0, 3) + '****' + str.substring(7, 11)
  127. }
  128. },
  129. computed: {
  130. purchaseManList () {
  131. return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
  132. },
  133. totalCount () {
  134. return this.purchaseManList.totalElements
  135. }
  136. },
  137. methods: {
  138. getDay: function (timeStamp) {
  139. return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
  140. },
  141. getHours: function (timeStamp) {
  142. return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
  143. },
  144. listenPage: function (page) {
  145. this.nowPage = page
  146. this.resetList()
  147. },
  148. sayPrice: function (purchaseMan) {
  149. purchaseMan.active = true
  150. },
  151. cancelSayPrice: function (purchaseMan) {
  152. purchaseMan.active = false
  153. },
  154. commitSayPrice: function (purchaseMan) {
  155. let valid = this.sayPriceObj.currency && this.sayPriceObj.unitPrice && this.sayPriceObj.minDay && this.sayPriceObj.maxDay
  156. if (valid) {
  157. this.sayPriceObj.spId = purchaseMan.id
  158. this.$http.post('/seek/offer/saveOffer', this.sayPriceObj).then(response => {
  159. // this.$message.success('发布成功')
  160. this.showRemindBox = true
  161. this.nowPage = 1
  162. this.resetSayPrice()
  163. this.resetList()
  164. }, error => {
  165. console.log(error)
  166. this.$message.error('系统错误')
  167. })
  168. } else {
  169. this.$message.error('请填写正确的信息')
  170. }
  171. },
  172. resetList: function () {
  173. this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: this.nowPage, count: this.pageSize})
  174. },
  175. resetSayPrice: function () {
  176. this.sayPriceObj = {
  177. currency: 'RMB',
  178. unitPrice: '',
  179. minDay: '',
  180. maxDay: '',
  181. produceDate: '',
  182. spId: ''
  183. }
  184. },
  185. onMinDayInput: function () {
  186. this.sayPriceObj.minDay = Math.floor(this.sayPriceObj.minDay)
  187. if (this.sayPriceObj.maxDay) {
  188. if (this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  189. this.sayPriceObj.minDay = this.sayPriceObj.maxDay
  190. }
  191. } else if (this.sayPriceObj.minDay < 0) {
  192. this.sayPriceObj.minDay = 0
  193. }
  194. },
  195. onMaxDayInput: function () {
  196. this.sayPriceObj.maxDay = Math.floor(this.sayPriceObj.maxDay)
  197. if (this.sayPriceObj.minDay) {
  198. if (this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  199. this.sayPriceObj.maxDay = this.sayPriceObj.minDay
  200. }
  201. } else if (this.sayPriceObj.maxDay < 0) {
  202. this.sayPriceObj.maxDay = 0
  203. }
  204. }
  205. }
  206. }
  207. </script>
  208. <style lang="scss" scoped>
  209. .apply-info {
  210. width: 1190px;
  211. margin: 0 auto;
  212. .apply-info-title {
  213. border-bottom: 1px solid #3975f4;
  214. >p {
  215. display: inline-block;
  216. width: 156px;
  217. height: 33px;
  218. line-height: 33px;
  219. color: #fff;
  220. background: #3975f4;
  221. font-size: 18px;
  222. text-align: center;
  223. border: {
  224. top-left-radius: 3px;
  225. top-right-radius: 3px;
  226. }
  227. margin: 0;
  228. }
  229. >span {
  230. color: #999;
  231. margin-left: 16px;
  232. }
  233. >div {
  234. float: right;
  235. height: 25px;
  236. line-height: 25px;
  237. >input {
  238. width: 241px;
  239. height: 25px;
  240. line-height: 25px;
  241. font-size: 13px;
  242. border: {
  243. top-right-radius: 0;
  244. bottom-right-radius: 0;
  245. }
  246. }
  247. >span {
  248. display: inline-block;
  249. width: 69px;
  250. color: #fff;
  251. background: #3975f4;
  252. text-align: center;
  253. margin: 0 6px 0 -1px;
  254. border: {
  255. top-right-radius: 3px;
  256. bottom-right-radius: 3px;
  257. }
  258. cursor: pointer;
  259. }
  260. >a {
  261. background: #ffa200;
  262. color: #fff;
  263. width: 79px;
  264. border-radius: 3px;
  265. text-align: center;
  266. display: inline-block;
  267. }
  268. }
  269. }
  270. .apply-info-list {
  271. >p {
  272. background: #ededed;
  273. height: 40px;
  274. line-height: 40px;
  275. margin: 9px 0 0 0;
  276. span {
  277. display: inline-block;
  278. text-align: center;
  279. img {
  280. width: 15px;
  281. height: 14px;
  282. margin: 0 0 3px 5px;
  283. }
  284. &:nth-child(1) {
  285. width: 186px;
  286. }
  287. &:nth-child(2) {
  288. width: 160px;
  289. }
  290. &:nth-child(3) {
  291. width: 173px;
  292. }
  293. &:nth-child(4) {
  294. width: 147px;
  295. }
  296. &:nth-child(5) {
  297. width: 152px;
  298. }
  299. &:nth-child(6) {
  300. width: 158px;
  301. }
  302. &:nth-child(7) {
  303. width: 214px;
  304. }
  305. }
  306. }
  307. >ul {
  308. margin-bottom: 29px;
  309. li {
  310. min-height: 67px;
  311. line-height: 67px;
  312. border: 1px solid #ededed;
  313. >span {
  314. overflow: hidden;
  315. text-overflow: ellipsis;
  316. white-space: nowrap;
  317. display: inline-block;
  318. text-align: center;
  319. color: #3c3c3c;
  320. vertical-align: middle;
  321. &:nth-child(1) {
  322. width: 186px;
  323. }
  324. &:nth-child(2) {
  325. width: 160px;
  326. }
  327. &:nth-child(3) {
  328. width: 173px;
  329. }
  330. &:nth-child(4) {
  331. width: 147px;
  332. }
  333. &:nth-child(5) {
  334. width: 152px;
  335. }
  336. &:nth-child(6) {
  337. width: 158px;
  338. }
  339. &:nth-child(7) {
  340. width: 212px;
  341. }
  342. &.date-content {
  343. span {
  344. &:first-child {
  345. font-size: 12px;
  346. color: #666;
  347. }
  348. color: #f71026;
  349. }
  350. }
  351. &.number-content {
  352. span {
  353. color: #5392f9;
  354. &.active {
  355. color: #ff9a00;
  356. }
  357. }
  358. >img {
  359. margin-bottom: 5px;
  360. margin-right: 2px;
  361. }
  362. }
  363. &.btn-content {
  364. a {
  365. display: inline-block;
  366. width: 71px;
  367. height: 28px;
  368. line-height: 28px;
  369. color: #fff;
  370. background: #3c7cf5;
  371. border-radius: 3px;
  372. cursor: pointer;
  373. &:first-child {
  374. background: #ffa200;
  375. margin-right: 10px;
  376. }
  377. }
  378. }
  379. }
  380. .expand-content {
  381. display: none;
  382. justify-content: space-between;
  383. padding: 0 236px 0 36px;
  384. background: #fffbf0;
  385. box-shadow: 1.5px 3px 7px 0 rgb( 178, 178, 179 );
  386. div {
  387. display: inline-block;
  388. span {
  389. color: #f71026;
  390. }
  391. }
  392. }
  393. &:hover {
  394. .expand-content {
  395. display: flex;
  396. }
  397. }
  398. .say-price {
  399. background-color: #e7eef9;
  400. display: none;
  401. >div {
  402. display: inline-block;
  403. position: relative;
  404. height: 64px;
  405. line-height: 64px;
  406. &:nth-child(1) {
  407. width: 282px;
  408. background: url('/images/applyPurchase/say-price.png')no-repeat;
  409. text-align: center;
  410. margin-right: 44px;
  411. }
  412. &:nth-child(2) {
  413. margin-right: 39px;
  414. input {
  415. width: 118px;
  416. height: 26px;
  417. border: 1px solid #5392f9;
  418. }
  419. select {
  420. position: absolute;
  421. top: 19px;
  422. width: 32px;
  423. height: 26px;
  424. background: url('/images/applyPurchase/arrow-down.png')no-repeat right center;
  425. -webkit-box-shadow: none;
  426. -moz-box-shadow: none;
  427. box-shadow: none;
  428. border: {
  429. left: none;
  430. top: none;
  431. bottom: none;
  432. right: 1px solid #5392f9;
  433. bottom-left-radius: 4px;
  434. top-left-radius: 4px;
  435. }
  436. color: #5392f9;
  437. font: small-caption;
  438. padding-left: 3px;
  439. & + input {
  440. padding-left: 34px;
  441. }
  442. }
  443. }
  444. &:nth-child(3) {
  445. margin-right: 37px;
  446. input {
  447. width: 32px;
  448. height: 26px;
  449. }
  450. }
  451. &:nth-child(4) {
  452. margin-right: 132px;
  453. input {
  454. width: 118px;
  455. height: 26px;
  456. }
  457. }
  458. &:nth-child(5) {
  459. span {
  460. width: 71px;
  461. height: 28px;
  462. line-height: 28px;
  463. text-align: center;
  464. display: inline-block;
  465. cursor: pointer;
  466. &:first-child {
  467. background: #dedddd;
  468. margin-right: 10px;
  469. }
  470. &:last-child {
  471. background: #fa4701;
  472. color: #fff;
  473. }
  474. }
  475. }
  476. i {
  477. color: #e41515;
  478. position: relative;
  479. top: 2px;
  480. right: 3px;
  481. }
  482. }
  483. }
  484. &.active {
  485. border-color: #f71026;
  486. .expand-content {
  487. display: flex;
  488. -webkit-box-shadow: none;
  489. -moz-box-shadow: none;
  490. box-shadow: none;
  491. }
  492. .say-price {
  493. display: block;
  494. }
  495. }
  496. }
  497. }
  498. }
  499. .page-wrap {
  500. text-align: right;
  501. float: none;
  502. }
  503. .com-del-box{
  504. position: fixed;
  505. z-index: 1000;
  506. height: auto;
  507. opacity: 1;
  508. background-color: white;
  509. width: 310px;
  510. -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  511. -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  512. -o-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  513. box-shadow: 0 5px 15px rgba(0,0,0,.5);
  514. margin: -155px 0 0 -75px;
  515. top: 55%;
  516. left: 43%;
  517. .title{
  518. height: 24px;
  519. background-color: #007aff;
  520. text-align: right;
  521. padding-right: 15px;
  522. line-height: 24px;
  523. a{
  524. color: white;
  525. font-size: 12px;
  526. }
  527. }
  528. .content{
  529. width: 100%;
  530. text-align: center;
  531. margin: 0 auto;
  532. p{
  533. padding: 12px 31px;
  534. margin: 0;
  535. i{
  536. color: #5078cb;
  537. font-size: 16px;
  538. margin-right: 10px;
  539. }
  540. span {
  541. color: #007aff;
  542. }
  543. &:last-child {
  544. font-size: 12px;
  545. }
  546. }
  547. div{
  548. width: 100%;
  549. text-align: center;
  550. margin: 0 auto 20px;
  551. a{
  552. padding: 0 19px;
  553. height: 26px;
  554. line-height: 26px;
  555. display: inline-block;
  556. text-align: center;
  557. font-size: 14px;
  558. color: #fff;
  559. &:first-child{
  560. background: #c8c6c6;
  561. margin-right: 10px;
  562. }
  563. &:last-child{
  564. background: #007aff;
  565. }
  566. }
  567. }
  568. }
  569. }
  570. }
  571. </style>