_uuid.vue 16 KB

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