_uuid.vue 15 KB

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