_uuid.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <div class="purchase">
  3. <div class="purchase-top">
  4. <div class="purchase-top-bg">
  5. <div class="clearfix">
  6. <div class="title fl">{{purchaseDetail.inquiry.enName}}</div>
  7. <div class="time fr">{{purchaseDetail.endDate | date}}</div>
  8. </div>
  9. <div class="desc">{{purchaseDetail.prodTitle}}</div>
  10. <div class="brand">品牌:
  11. <span>{{purchaseDetail.inbrand || '-'}}</span>
  12. </div>
  13. <div class="size">规格:
  14. <span>{{purchaseDetail.spec || '-'}}</span>
  15. </div>
  16. <div class="pmg-icon">
  17. <div class="Isend" v-if="purchaseDetail.remainingTime < 0">
  18. <img src="/images/mobile/@2x/purChase/Isend.png" />
  19. </div>
  20. <div class="Issend" v-if="((!userType || userType == 'buyer') && (seekType && seekType != 'wait')) || (userType == 'saler' && seekType && seekType != 'wait') || purchaseDetail.quoted == 1">
  21. <img src="/images/mobile/@2x/purChase/Issend.png" />
  22. </div>
  23. </div>
  24. </div>
  25. <div class="purchase-top-control clearfix" v-if="purchaseDetail.remainingTime > 0 || (((!userType || userType == 'buyer') && (seekType && seekType != 'wait')) || (userType == 'saler' && seekType && seekType != 'wait') || purchaseDetail.quoted == 1)">
  26. <div class="time fl">
  27. <template v-if="purchaseDetail.remainingTime > 0">
  28. <span class="icon"></span>剩余时间:
  29. <span class="timetext" v-if="getDay(purchaseDetail.remainingTime) > 0">
  30. <a class="number">{{getDay(purchaseDetail.remainingTime)}}</a>
  31. <a>天</a>
  32. </span>
  33. <span class="timetext" v-if="getDay(purchaseDetail.remainingTime) <= 0">
  34. <a class="number">{{getHours(purchaseDetail.remainingTime)}}</a>
  35. <a>小时</a>
  36. </span>
  37. </template>
  38. <!-- <span class="timetext" v-else>已截止</span> -->
  39. <!-- <span class="timetext">剩余时间:<a class="number">8</a><a>小时</a></span> -->
  40. </div>
  41. <div v-if="!userType && purchaseDetail.remainingTime > 0 && (!purchaseDetail.quoted || purchaseDetail.quoted != 1) && (user.logged && ((purchaseDetail.inquiry.enterprise && user.data.enterprise && (purchaseDetail.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseDetail.userUU == user.data.userUU && !purchaseDetail.inquiry.enterprise)))" class="goprice fr" @click="onRemind('此为贵公司的求购')">我要报价</div>
  42. <div class="goprice fr" v-if="!(userType == 'saler' && seekType && seekType != 'wait') && (purchaseDetail.remainingTime > 0 && (!purchaseDetail.quoted || purchaseDetail.quoted != 1) && !(user.logged && ((purchaseDetail.inquiry.enterprise && user.data.enterprise && (purchaseDetail.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseDetail.userUU == user.data.userUU && !purchaseDetail.inquiry.enterprise))))" @click="goSayPrice(purchaseDetail.id)">我要报价</div>
  43. <div class="goprice fr" v-if="((!userType || userType == 'buyer') && (seekType && seekType != 'wait')) || (userType == 'saler' && seekType && seekType != 'wait') || purchaseDetail.quoted == 1" @click="goSayPriceInfo(purchaseDetail.quteId || purchaseDetail.id, purchaseDetail.agreed)">查看报价</div>
  44. </div>
  45. </div>
  46. <div class="purcharse_banner">
  47. <div class="banner"></div>
  48. </div>
  49. <div class="seek-title">
  50. <img src="/images/mobile/@2x/applyPurchase/home/seek-title.png" alt="">
  51. <span>最新求购信息</span>
  52. </div>
  53. <div class="purcharseListContent">
  54. <seek-list :purchaseManList="purchaseManListData" :isDataChange="true"></seek-list>
  55. <nuxt-link to="/mobile/applyPurchase/list" class="purchase_btn_look" tag="div">查看更多</nuxt-link>
  56. <div class="purchse_btn_more_title">
  57. <a href="https://www.usoftmall.com">优软商城首页</a>
  58. </div>
  59. </div>
  60. <div class="mobile_footer company">
  61. <div class="hr"></div>
  62. <img src="/images/mobile/@2x/shareStore/logo.png" alt="">
  63. <div class="hr right"></div>
  64. <p>此页面由深圳市优软商城科技有限公司提供</p>
  65. <a href="https://www.usoftmall.com">www.usoftmall.com</a>
  66. </div>
  67. <div class="purcharse_kong"></div>
  68. <div class="purcharse_fixed " @click="sendApplyPurchase()">
  69. <div class="clearfix">
  70. <div class="money_icon fl"></div>
  71. <span class="fl">发布求购</span>
  72. </div>
  73. </div>
  74. <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
  75. <say-price :showSayPriceBox="showSayPriceBox" @cancelSayPriceAction="onSayPriceCancel"></say-price>
  76. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  77. <say-price-info v-if="showSayPriceInfoBox" :agreed="agreed" @cancelSayPriceInfoAction="onSayPriceInfoCancel"></say-price-info>
  78. <publish-seek :showSayPriceBox="showsendApplyBox" @cancelAction="showsendApplyBox = false" @reloadAction="onReload" @remindAction="onRemind"></publish-seek>
  79. </div>
  80. </template>
  81. <script>
  82. import { SayPrice, SayPriceInfo } from '~components/mobile/applyPurchase'
  83. import { LoginBox, RemindBox } from '~components/mobile/common'
  84. import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
  85. import PublishSeek from '~components/mobile/applyPurchase/PublishSeek.vue'
  86. export default {
  87. layout: 'mobileStore',
  88. props: ['userType', 'seekType', 'purchaseManList'],
  89. fetch({ store, params, redirect }) {
  90. if (!params.uuid) {
  91. return redirect('/error')
  92. }
  93. return Promise.all([
  94. store.dispatch('applyPurchase/loadPurchaseManDetail', {
  95. itemId: params.uuid,
  96. enuu: store.state.option.user.data.enterprise
  97. ? store.state.option.user.data.enterprise.uu
  98. : null
  99. }),
  100. store.dispatch('applyPurchase/loadPurchaseManList', {
  101. pageNumber: 1,
  102. pageSize: 10,
  103. sorting: { releaseDate: 'DESC' },
  104. keyword: '',
  105. enUU: store.state.option.user.data.enterprise
  106. ? store.state.option.user.data.enterprise.uu
  107. : null
  108. })
  109. ])
  110. },
  111. data() {
  112. return {
  113. showLoginBox: false,
  114. showSayPriceBox: false,
  115. showSayPriceInfoBox: false,
  116. remindText: '',
  117. timeoutCount: 0,
  118. agreed: 0,
  119. showsendApplyBox: false
  120. }
  121. },
  122. components: {
  123. SayPrice,
  124. SayPriceInfo,
  125. LoginBox,
  126. RemindBox,
  127. SeekList,
  128. PublishSeek
  129. },
  130. computed: {
  131. purchaseDetail() {
  132. return this.$store.state.applyPurchase.purchaseManList.purchaseManDetail
  133. .data
  134. },
  135. purchaseManListData() {
  136. return this.$store.state.applyPurchase.purchaseManList.purchaseManList
  137. .data.content
  138. }
  139. },
  140. methods: {
  141. getDay(timeStamp) {
  142. return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
  143. },
  144. getHours(timeStamp) {
  145. return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
  146. },
  147. onSayPriceCancel(flag, quteId) {
  148. if (flag) {
  149. this.purchaseDetail.quoted = 1
  150. this.purchaseDetail.quteId = quteId
  151. this.onRemind('报价成功')
  152. }
  153. this.showSayPriceBox = false
  154. },
  155. onRemind(str) {
  156. this.remindText = str
  157. this.timeoutCount++
  158. },
  159. onSayPriceInfoCancel(flag) {
  160. flag && ((this.purchaseDetail.agreed = 1), this.onRemind('采纳成功'))
  161. this.showSayPriceInfoBox = false
  162. },
  163. goSayPriceInfo(id, agreed) {
  164. this.userType === 'buyer'
  165. ? this.$store.dispatch('applyPurchase/loadBuyerInquiryDetail', {
  166. id: id
  167. })
  168. : this.$store.dispatch('applyPurchase/loadVendorInquiryDetail', {
  169. id: id
  170. })
  171. this.agreed = agreed
  172. this.showSayPriceInfoBox = true
  173. },
  174. goSayPrice(id) {
  175. if (this.user.logged) {
  176. this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {
  177. itemId: id,
  178. enuu: this.$store.state.option.user.data.enterprise
  179. ? this.$store.state.option.user.data.enterprise.uu
  180. : null
  181. })
  182. this.showSayPriceBox = true
  183. } else {
  184. this.showLoginBox = true
  185. }
  186. },
  187. sendApplyPurchase() {
  188. console.log(this.user)
  189. if (this.user.logged) {
  190. this.showsendApplyBox = true
  191. } else {
  192. this.showLoginBox = true
  193. }
  194. },
  195. onReload() {
  196. // const path = this.$route.path
  197. // if (path === '/') {
  198. // this.$store.dispatch('applyPurchase/loadMobileHomeList', {
  199. // pageNumber: 1,
  200. // pageSize: 5,
  201. // enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null
  202. // })
  203. // } else if (path === '/mobile/share/purChase') {
  204. this.$store.dispatch('applyPurchase/loadPurchaseManList', {
  205. pageNumber: 1,
  206. pageSize: 10,
  207. enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null
  208. })
  209. // }
  210. }
  211. }
  212. }
  213. </script>
  214. <style scoped lang="scss">
  215. .clearfix {
  216. &::after {
  217. clear: both;
  218. visibility: hidden;
  219. zoom: 1;
  220. display: block;
  221. content: ' ';
  222. }
  223. }
  224. .purchase {
  225. background: rgb(246, 245, 248);
  226. .purchase-top {
  227. background: #fff;
  228. padding: 0.28rem 0.32rem 0.28rem 0.32rem;
  229. margin-bottom: 0.18rem;
  230. .purchase-top-bg {
  231. background: url('/images/mobile/@2x/purChase/purChase_bg.png');
  232. background-size: 100%;
  233. width: 6.82rem;
  234. height: 3rem;
  235. margin: 0 auto;
  236. position: relative;
  237. color: #fff;
  238. padding-left: 0.35rem;
  239. padding-top: 0.32rem;
  240. padding-bottom: 0.32rem;
  241. .title {
  242. font-size: 0.3rem;
  243. max-width: 4.6rem;
  244. overflow: hidden;
  245. text-overflow: ellipsis;
  246. white-space: nowrap;
  247. }
  248. .time {
  249. font-size: 0.26rem;
  250. margin-right: 0.2rem;
  251. margin-top: 0.05rem;
  252. }
  253. .desc {
  254. font-size: 0.4rem;
  255. margin: 0.35rem 0;
  256. overflow: hidden;
  257. text-overflow: ellipsis;
  258. white-space: nowrap;
  259. }
  260. .brand,
  261. .size {
  262. font-size: 0.3rem;
  263. margin-bottom: 0.14rem;
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. white-space: nowrap;
  267. width: 4.5rem;
  268. }
  269. .pmg-icon {
  270. position: absolute;
  271. right: 0.36rem;
  272. bottom: 0.17rem;
  273. img {
  274. width: 1.28rem;
  275. height: 1.33rem;
  276. }
  277. }
  278. }
  279. .purchase-top-control {
  280. margin-top: 0.32rem;
  281. .time {
  282. margin-top: 0.2rem;
  283. margin-left: 0.38rem;
  284. .icon {
  285. background-image: url('/images/mobile/@2x/purChase/time.png');
  286. background-size: 100%;
  287. width: 0.28rem;
  288. height: 0.28rem;
  289. display: inline-block;
  290. vertical-align: middle;
  291. margin-right: 0.05rem;
  292. }
  293. .timetext {
  294. color: #09061e;
  295. font-size: 0.24rem;
  296. margin-left: 0.1rem;
  297. a {
  298. font-size: 0.24rem;
  299. color: #fa7701;
  300. &.number {
  301. font-size: 0.36rem;
  302. }
  303. }
  304. }
  305. }
  306. .goprice {
  307. font-size: 0.28rem;
  308. width: 1.78rem;
  309. height: 0.68rem;
  310. background: linear-gradient(to right, #fb9400, #fb6d03);
  311. color: #fff;
  312. line-height: 0.68rem;
  313. text-align: center;
  314. border-radius: 4px;
  315. }
  316. }
  317. }
  318. .purcharse_banner {
  319. background: #fff;
  320. margin: 0 auto;
  321. text-align: center;
  322. padding: 0.24rem 0 0.36rem 0;
  323. margin-bottom: 0.18rem;
  324. .banner {
  325. background: url('/images/mobile/@2x/purChase/banner.png');
  326. background-size: 100%;
  327. width: 6.8rem;
  328. margin: 0 auto;
  329. height: 0.84rem;
  330. }
  331. }
  332. .purcharse_kong {
  333. width: 100%;
  334. height: 1rem;
  335. position: relative;
  336. }
  337. .purcharse_fixed {
  338. background: linear-gradient(
  339. to right,
  340. rgba(113, 136, 255, 0.97),
  341. rgba(79, 68, 253, 0.97)
  342. );
  343. width: 100%;
  344. height: 0.88rem;
  345. line-height: 0.88rem;
  346. text-align: center;
  347. color: #fff;
  348. font-size: 0.32rem;
  349. position: fixed;
  350. bottom: 0px;
  351. .money_icon {
  352. background: url('/images/mobile/@2x/purChase/money_icon.png');
  353. width: 0.39rem;
  354. height: 0.39rem;
  355. background-size: 100%;
  356. margin-top: 0.26rem;
  357. margin-right: 0.2rem;
  358. // margin-left: 2.8rem;
  359. }
  360. .clearfix {
  361. transform: translate3d(-50%, -50%, 0);
  362. left: 50%;
  363. top: 50%;
  364. position: absolute;
  365. }
  366. }
  367. .purcharseListContent {
  368. padding-top: 0.3rem;
  369. padding-bottom: 0.37rem;
  370. background: #fff;
  371. .seek-title {
  372. background: #fff;
  373. }
  374. .purchase_btn_look {
  375. font-size: 0.26rem;
  376. color: #6a63ea;
  377. width: 1.37rem;
  378. height: 0.48rem;
  379. text-align: center;
  380. border-radius: 4px;
  381. text-align: center;
  382. border: 1px solid #6a63ea;
  383. line-height: 0.48rem;
  384. margin: 0.31rem auto;
  385. }
  386. .purchse_btn_more_title {
  387. font-size: 0.22rem;
  388. color: #6a63ea;
  389. text-align: center;
  390. a {
  391. color: #6a63ea;
  392. }
  393. }
  394. }
  395. .company {
  396. position: relative;
  397. height: 1.36rem;
  398. background: #f4f4f4;
  399. text-align: center;
  400. img {
  401. width: 1.15rem;
  402. height: 0.23rem;
  403. margin-top: 0.24rem;
  404. }
  405. p {
  406. font-size: 0.21rem;
  407. color: #aaa;
  408. margin: 0.13rem 0 0 0;
  409. }
  410. a {
  411. margin-top: 0.12rem;
  412. font-size: 0.18rem;
  413. color: #bbb;
  414. }
  415. .hr {
  416. width: 1.09rem;
  417. height: 0.02rem;
  418. background: #d9d9d9;
  419. position: absolute;
  420. left: 1.94rem;
  421. top: 0.35rem;
  422. &.right {
  423. right: 1.94rem;
  424. left: auto;
  425. }
  426. }
  427. }
  428. }
  429. </style>