_uuid.vue 15 KB

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