_uuid.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  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. })
  200. this.agreed = agreed
  201. this.showSayPriceInfoBox = true
  202. },
  203. goSayPrice(id) {
  204. if (this.user.logged) {
  205. if (this.user.data.enterprise.uu) {
  206. if (
  207. this.user.data.enterprise.isVendor &&
  208. this.user.data.enterprise.isVendor !== '1690'
  209. ) {
  210. this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {
  211. itemId: id,
  212. enuu: this.$store.state.option.user.data.enterprise
  213. ? this.$store.state.option.user.data.enterprise.uu
  214. : null
  215. })
  216. this.showSayPriceBox = true
  217. // this.activeIndex = index
  218. } else {
  219. this.onRemind('抱歉,您需开通卖家功能才可报价')
  220. }
  221. } else {
  222. this.onRemind('个人账户暂不可报价')
  223. }
  224. } else {
  225. this.showLoginBox = true
  226. }
  227. return false
  228. // if (this.user.logged) {
  229. // this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {
  230. // itemId: id,
  231. // enuu: this.$store.state.option.user.data.enterprise
  232. // ? this.$store.state.option.user.data.enterprise.uu
  233. // : null
  234. // })
  235. // this.showSayPriceBox = true
  236. // } else {
  237. // this.showLoginBox = true
  238. // }
  239. },
  240. sendApplyPurchase() {
  241. if (this.user.logged) {
  242. this.showsendApplyBox = true
  243. } else {
  244. this.showLoginBox = true
  245. }
  246. },
  247. onReload() {
  248. // const path = this.$route.path
  249. // if (path === '/') {
  250. // this.$store.dispatch('applyPurchase/loadMobileHomeList', {
  251. // pageNumber: 1,
  252. // pageSize: 5,
  253. // enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null
  254. // })
  255. // } else if (path === '/mobile/share/purChase') {
  256. this.$store.dispatch('applyPurchase/loadPurchaseManList', {
  257. pageNumber: 1,
  258. pageSize: 10,
  259. enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null
  260. })
  261. // }
  262. }
  263. }
  264. }
  265. </script>
  266. <style scoped lang="scss">
  267. .clearfix {
  268. &::after {
  269. clear: both;
  270. visibility: hidden;
  271. zoom: 1;
  272. display: block;
  273. content: ' ';
  274. }
  275. }
  276. .purchase {
  277. background: rgb(246, 245, 248);
  278. .purchase-top {
  279. background: #fff;
  280. padding: 0.28rem 0.32rem 0.28rem 0.32rem;
  281. margin-bottom: 0.18rem;
  282. .purchase-top-bg {
  283. background: url('/images/mobile/@2x/purChase/purChase_bg.png');
  284. background-size: 100%;
  285. width: 6.82rem;
  286. height: 3rem;
  287. margin: 0 auto;
  288. position: relative;
  289. color: #fff;
  290. padding-left: 0.35rem;
  291. padding-top: 0.32rem;
  292. padding-bottom: 0.32rem;
  293. .title {
  294. font-size: 0.3rem;
  295. max-width: 4.6rem;
  296. overflow: hidden;
  297. text-overflow: ellipsis;
  298. white-space: nowrap;
  299. }
  300. .time {
  301. font-size: 0.26rem;
  302. margin-right: 0.2rem;
  303. margin-top: 0.05rem;
  304. }
  305. .desc {
  306. font-size: 0.4rem;
  307. margin: 0.2rem 0;
  308. overflow: hidden;
  309. text-overflow: ellipsis;
  310. white-space: nowrap;
  311. }
  312. .brand,
  313. .size {
  314. font-size: 0.3rem;
  315. margin-bottom: 0.14rem;
  316. overflow: hidden;
  317. text-overflow: ellipsis;
  318. white-space: nowrap;
  319. width: 4.5rem;
  320. }
  321. .pmg-icon {
  322. position: absolute;
  323. right: 0.36rem;
  324. bottom: 0.17rem;
  325. img {
  326. width: 1.28rem;
  327. height: 1.33rem;
  328. }
  329. }
  330. }
  331. .purchase-top-control {
  332. max-width: 520px;
  333. margin: 0 auto;
  334. margin-top: 0.32rem;
  335. .time {
  336. margin-top: 0.2rem;
  337. margin-left: 0.38rem;
  338. .icon {
  339. background-image: url('/images/mobile/@2x/purChase/time.png');
  340. background-size: 100%;
  341. width: 0.28rem;
  342. height: 0.28rem;
  343. display: inline-block;
  344. vertical-align: middle;
  345. margin-right: 0.05rem;
  346. }
  347. .timetext {
  348. color: #09061e;
  349. font-size: 0.24rem;
  350. margin-left: 0.1rem;
  351. a {
  352. font-size: 0.24rem;
  353. color: #fa7701;
  354. &.number {
  355. font-size: 0.36rem;
  356. }
  357. }
  358. }
  359. }
  360. .goprice {
  361. font-size: 0.28rem;
  362. width: 1.78rem;
  363. height: 0.68rem;
  364. background: linear-gradient(to right, #fb9400, #fb6d03);
  365. color: #fff;
  366. line-height: 0.68rem;
  367. text-align: center;
  368. border-radius: 4px;
  369. }
  370. }
  371. }
  372. .purcharse_banner {
  373. background: #fff;
  374. margin: 0 auto;
  375. text-align: center;
  376. padding: 0.24rem 0 0.36rem 0;
  377. margin-bottom: 0.18rem;
  378. .banner {
  379. background: url('/images/mobile/@2x/purChase/banner.png');
  380. background-size: 100%;
  381. width: 6.8rem;
  382. margin: 0 auto;
  383. height: 0.84rem;
  384. }
  385. }
  386. .purcharse_kong {
  387. width: 100%;
  388. height: 1rem;
  389. position: relative;
  390. }
  391. .purcharse_fixed {
  392. background: linear-gradient(
  393. to right,
  394. rgba(113, 136, 255, 0.97),
  395. rgba(79, 68, 253, 0.97)
  396. );
  397. width: 100%;
  398. height: 0.88rem;
  399. line-height: 0.88rem;
  400. text-align: center;
  401. color: #fff;
  402. font-size: 0.32rem;
  403. position: fixed;
  404. bottom: 0px;
  405. .money_icon {
  406. background: url('/images/mobile/@2x/purChase/money_icon.png');
  407. width: 0.39rem;
  408. height: 0.39rem;
  409. background-size: 100%;
  410. margin-top: 0.26rem;
  411. margin-right: 0.2rem;
  412. // margin-left: 2.8rem;
  413. }
  414. .clearfix {
  415. transform: translate3d(-50%, -50%, 0);
  416. left: 50%;
  417. top: 50%;
  418. position: absolute;
  419. }
  420. }
  421. .purcharseListContent {
  422. padding-top: 0.3rem;
  423. padding-bottom: 0.37rem;
  424. background: #fff;
  425. .seek-title {
  426. background: #fff;
  427. }
  428. .purchase_btn_look {
  429. font-size: 0.26rem;
  430. color: #6a63ea;
  431. width: 1.37rem;
  432. height: 0.48rem;
  433. text-align: center;
  434. border-radius: 4px;
  435. text-align: center;
  436. border: 1px solid #6a63ea;
  437. line-height: 0.48rem;
  438. margin: 0.31rem auto;
  439. }
  440. .purchse_btn_more_title {
  441. font-size: 0.22rem;
  442. color: #6a63ea;
  443. text-align: center;
  444. a {
  445. color: #6a63ea;
  446. }
  447. }
  448. }
  449. .company {
  450. position: relative;
  451. height: 1.36rem;
  452. background: #f4f4f4;
  453. text-align: center;
  454. img {
  455. width: 1.15rem;
  456. height: 0.23rem;
  457. margin-top: 0.24rem;
  458. }
  459. p {
  460. font-size: 0.21rem;
  461. color: #aaa;
  462. margin: 0.13rem 0 0 0;
  463. }
  464. a {
  465. margin-top: 0.12rem;
  466. font-size: 0.18rem;
  467. color: #bbb;
  468. }
  469. .hr {
  470. width: 1.09rem;
  471. height: 0.02rem;
  472. background: #d9d9d9;
  473. position: absolute;
  474. left: 1.94rem;
  475. top: 0.35rem;
  476. &.right {
  477. right: 1.94rem;
  478. left: auto;
  479. }
  480. }
  481. }
  482. }
  483. </style>