_uuid.vue 16 KB

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