confirm-order.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. <template>
  2. <div class="submit-order">
  3. <div class="content">
  4. <div class="step-box">
  5. <div class="left">
  6. <span class="img"></span>
  7. <span class="text">{{$t('submitOrder.submitOrder')}}</span>
  8. </div>
  9. <div class="steps">
  10. <div class="item">
  11. <div class="number">step 01.</div>
  12. <div class="text">{{$t('submitOrder.selectProductToBuy')}}</div>
  13. </div>
  14. <div class="item active">
  15. <div class="number">step 02.</div>
  16. <div class="text">{{$t('submitOrder.confirmOrderInformation')}}</div>
  17. </div>
  18. <div class="item">
  19. <div class="number">step 03.</div>
  20. <div class="text">{{$t('submitOrder.payToCompleteTheOrder')}}</div>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="submit-con">
  25. <!-- 收货地址 -->
  26. <div v-if="orderInfo.mold !== 1" class="submit-box">
  27. <div class="tit">
  28. <span class="text">{{$t('address.receivingAddress')}}</span>
  29. <!-- <span class="action">显示全部地址</span> -->
  30. </div>
  31. <div class="con address-box">
  32. <div
  33. :class="['item', address.commonAddr?'default-address':'',selectedAddrId==address.addrId?'active':'']"
  34. v-for="address in addressList"
  35. :key="address.addrId"
  36. @click="changeAddress(address.addrId)"
  37. >
  38. <div class="name-phone">
  39. <span class="name">{{address.receiver}}</span>
  40. <span class="phone">{{address.mobile}}</span>
  41. <span
  42. class="set-default"
  43. v-if="!address.commonAddr"
  44. @click="setDefaultAddr(address.addrId)"
  45. >{{$t('address.setDefault')}}</span>
  46. <span class="default-tag" v-if="address.commonAddr">{{$t('address.default')}}</span>
  47. </div>
  48. <div
  49. class="address-detail"
  50. >{{address.province+address.city+address.area+address.addr}}</div>
  51. <div class="del-edit">
  52. <span class="edit" @click.stop="editAddr(address.addrId)"></span>
  53. <span class="del" @click.stop="toggleDelAddr(true,address.addrId)"></span>
  54. </div>
  55. </div>
  56. <div
  57. class="item add-address"
  58. @click="toggleAddrPop(true)"
  59. v-if="addressList.length < 10"
  60. >
  61. <div class="add-box">
  62. <div class="img">+</div>
  63. <div class="text">{{$t('address.addAddress')}}</div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="popup-mask" v-if="showDelAddr"></div>
  68. <div class="fix-transform-blur">
  69. <div class="popup-box" v-if="showDelAddr">
  70. <div class="tit" style="padding:10px;">
  71. <div class="text">{{$t('tips')}}</div>
  72. <div class="close" @click="toggleDelAddr(false)"></div>
  73. </div>
  74. <div class="con">
  75. <div class="tip">
  76. <div class="tip-icon warning"></div>
  77. <div class="tip-info">
  78. <div class="result">{{$t('address.deleteShippingAddress')}}</div>
  79. <div class="date">{{$t('address.deleteShippingTips')}}</div>
  80. <div class="btns">
  81. <a href="javascript:void(0);" @click="delAddr()" class="btn-r">{{$t('delete')}}</a>
  82. <a href="javascript:void(0);" @click="toggleDelAddr(flase)" class="btn-g">{{$t('cancel')}}</a>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <!-- 收货地址 -->
  91. <!-- 支付方式 -->
  92. <div class="submit-box">
  93. <div class="tit">
  94. <span class="text">{{$t('commonFoot.paymentMethod')}}</span>
  95. </div>
  96. <div class="con pay-way">
  97. <div class="item active">{{$t('submitOrder.payOnline')}}</div>
  98. <!-- <div class="item">货到付款</div>
  99. <div class="item">线下支付</div>-->
  100. </div>
  101. </div>
  102. <!-- 支付方式 -->
  103. <!-- 配送方式 -->
  104. <div v-if="orderInfo.mold !== 1" class="submit-box">
  105. <div class="tit">
  106. <span class="text">{{$t('submitOrder.deliveryMethod')}}</span>
  107. </div>
  108. <div class="con delivery-way">
  109. <div class="item active">{{$t('submitOrder.courierDelivery')}}</div>
  110. <!-- <div class="item">到店自提</div> -->
  111. <!-- <div class="description">(该商品不支持自提)</div> -->
  112. </div>
  113. </div>
  114. <!-- /配送方式 -->
  115. <!-- 全部留言(虚拟商品) -->
  116. <!-- <div v-if="orderInfo.mold === 1 && orderInfo.virtualRemarkList.length" class="submit-box all-msg-row">
  117. <div class="tit">
  118. <span class="text">{{$t('submitOrder.allMessages')}}</span>
  119. </div>
  120. <div class="con">
  121. <div v-for="(item,index) in orderInfo.virtualRemarkList" :key="index" class="msg-item">
  122. <span v-if="item.isRequired" class="red-stress">*</span>
  123. <input
  124. v-model="item.value"
  125. class="msg-int-item"
  126. type="text"
  127. :placeholder="$t('submitOrder.pleaseEnter') + `${item.name}`"
  128. @blur="handleInputBlur(item.value, index)"
  129. maxlength="20"
  130. >
  131. </div>
  132. </div>
  133. </div> -->
  134. <!-- 全部留言(虚拟商品)/ -->
  135. <!-- 商品信息 -->
  136. <div class="submit-box goods-info">
  137. <div class="tit">
  138. <span class="text">{{$t('applyReturn.productInformation')}}</span>
  139. </div>
  140. <div class="goods-msg">
  141. <div class="msg-tab">
  142. <div class="img">&nbsp;</div>
  143. <div class="info">{{$t('products')}}</div>
  144. <div class="unit-price">{{$t('priceOne')}}</div>
  145. <div class="freight">{{$t('submitOrder.shippingFee')}}</div>
  146. <div class="number">{{$t('quantity')}}</div>
  147. <div class="total">{{$t('subtotal')}}</div>
  148. </div>
  149. <div class="msg-con">
  150. <!-- 店铺 -->
  151. <div class="shop-msg">
  152. <nuxt-link
  153. :to="'/shopIndex?sid=' + shopCartItem.shopId"
  154. class="shop-name"
  155. >{{$t('index.shop')}}:{{ shopCartItem.shopName }}</nuxt-link
  156. >
  157. <span class="self" v-if="shopCartItem.shopId == 1">{{$t('prodDetail.selfEmployed')}}</span>
  158. </div>
  159. <!-- 店铺中的商品 -->
  160. <div class="goods-box">
  161. <div class="prod-row">
  162. <div class="img">
  163. <div class="img-box" @click="toProdDetail(shopCartItem.seckillId)">
  164. <img :src="shopCartItem.pic" alt />
  165. </div>
  166. </div>
  167. <div class="info">
  168. <div class="name" @click="toProdDetail(shopCartItem.seckillId)">{{shopCartItem.prodName}}</div>
  169. <span class="sku">{{shopCartItem.skuName}}</span>
  170. </div>
  171. <div
  172. class="unit-price"
  173. >¥{{parsePrice(shopCartItem.price)[0]}}.{{parsePrice(shopCartItem.price)[1]}}</div>
  174. <div
  175. class="freight"
  176. >¥{{parsePrice(orderInfo.transfee)[0]}}.{{parsePrice(orderInfo.transfee)[1]}}</div>
  177. <div class="number">{{shopCartItem.prodCount}}</div>
  178. <div
  179. class="total"
  180. >¥{{parsePrice(shopCartItem.productTotalAmount)[0]}}.{{parsePrice(shopCartItem.productTotalAmount)[1]}}</div>
  181. </div>
  182. <!-- 虚拟商品留言 start -->
  183. <div
  184. v-if="orderInfo.virtualRemarkList && orderInfo.virtualRemarkList.length"
  185. class="virtual-goods-msg"
  186. >
  187. <div :class="['msg-tit',$t('language')=='en' ? 'msg-tit-en' : '']">
  188. <span class="text">{{ $t('submitOrder.userMessage') }}:</span>
  189. </div>
  190. <div>
  191. <div v-for="(msgItem,msgIndex) in orderInfo.virtualRemarkList" :key="msgIndex" class="msg-item">
  192. <span v-if="msgItem.isRequired" class="red-stress">*</span>
  193. <input
  194. v-model="msgItem.value"
  195. class="msg-int-item"
  196. type="text"
  197. :placeholder="$t('submitOrder.pleaseEnter') + `${msgItem.name}`"
  198. @blur="handleInputBlur(msgItem.value, msgIndex)"
  199. maxlength="20"
  200. >
  201. </div>
  202. </div>
  203. </div>
  204. <!-- 虚拟商品留言 end -->
  205. </div>
  206. <div class="remake-box">
  207. {{$t('submitOrder.messageToMerchant')}}:
  208. <input type="text" maxlength="100" class="text" v-model="remarks" :placeholder="$t('submitOrder.numberLength100')" />
  209. <!-- 发票 -->
  210. <div class="invoice-title">{{ $t('invoice.invoiceInfo') }}</div>
  211. <div v-if="shopCartItem.invoiceDataFrom" class="invoice-box">
  212. <div v-if="shopCartItem.invoiceDataFrom.invoiceType === 1" class="invoice-box-item invoice-type">{{ $t('invoice.generalInvoice') }}</div>
  213. <div v-if="shopCartItem.invoiceDataFrom.invoiceType === 2 || !shopCartItem.invoiceDataFrom" class="invoice-box-item invoice-type">{{ $t('invoice.noInvoice') }}</div>
  214. <div v-if="shopCartItem.invoiceDataFrom.invoiceType === 1" class="invoice-box-item invoice-unit">{{ shopCartItem.invoiceDataFrom.headerName || $t('invoice.personal') }}</div>
  215. <div v-if="shopCartItem.invoiceDataFrom.invoiceType === 1" class="invoice-box-item invoice-contents">{{ $t('invoice.productDetails') }}</div>
  216. <div class="invoice-box-item invoice-operation" @click="showAddOrUpdateDialog(0,shopCartItem,shopCartItem.shopId)">{{ $t('invoice.update') }}</div>
  217. </div>
  218. <div v-else class="invoice-box">
  219. <div class="invoice-box-item invoice-type">{{ $t('invoice.noInvoice') }}</div>
  220. <div class="invoice-box-item invoice-operation" @click="showAddOrUpdateDialog(0,shopCartItem,shopCartItem.shopId)">{{ $t('invoice.update') }}</div>
  221. </div>
  222. <!-- 发票 -->
  223. </div>
  224. <!-- /留言 -->
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229. <div class="submit-bottom">
  230. <div class="statistic-box">
  231. <div class="item">
  232. <div class="tit">
  233. <span class="number">{{orderInfo.totalCount}}</span>{{$t('submitOrder.totalItems')}}:
  234. </div>
  235. <div class="con">¥{{parsePrice(orderInfo.total)[0]}}.{{parsePrice(orderInfo.total)[1]}}</div>
  236. </div>
  237. <!-- 应付运费 -->
  238. <div v-if="orderInfo.mold !== 1" class="item">
  239. <div class="tit">{{$t('submitOrder.freightPayable')}}:</div>
  240. <div
  241. class="con"
  242. >¥{{parsePrice(orderInfo.transfee)[0]}}.{{parsePrice(orderInfo.transfee)[1]}}</div>
  243. </div>
  244. <!-- 秒杀优惠 -->
  245. <div v-if="orderInfo.seckillReduce > 0" class="item">
  246. <div class="tit">{{$t('submitOrder.seckillReduce')}}:</div>
  247. <div
  248. class="con bright"
  249. >-¥{{parsePrice(orderInfo.seckillReduce)[0]}}.{{parsePrice(orderInfo.seckillReduce)[1]}}</div>
  250. </div>
  251. </div>
  252. <div class="detail-box">
  253. <div class="item">
  254. <div class="tit">{{$t('submitOrder.totalPayable')}}:</div>
  255. <div
  256. class="con"
  257. >¥{{parsePrice(orderInfo.actualTotal)[0]}}.{{parsePrice(orderInfo.actualTotal)[1]}}</div>
  258. </div>
  259. <div class="item" v-if="currentAddr.addrId">
  260. <span
  261. class="text"
  262. >{{$t('submitOrder.sendTo')}}:{{currentAddr.province+' '+currentAddr.city +' '+currentAddr.area+' '+currentAddr.addr}}</span>
  263. <span class="text">{{$t('submitOrder.consignee')}}:{{currentAddr.receiver}} {{currentAddr.mobile}}</span>
  264. </div>
  265. </div>
  266. <div class="btn-box">
  267. <a href="javascript:void(0)" class="btn" @click="submitOrder">{{$t('submitOrder.submitOrder')}}</a>
  268. </div>
  269. </div>
  270. </div>
  271. <!-- 地址弹窗 -->
  272. <AddressPop
  273. :editAddrId="editAddrId"
  274. v-if="showAddrPop"
  275. @getAddrList="getAddrList"
  276. @toggleAddrPop="toggleAddrPop"
  277. />
  278. <!-- /地址弹窗 -->
  279. <!-- 发票弹窗 -->
  280. <addOrEditInvoice
  281. v-if="showInvoiceAdd"
  282. ref="invoiceAddOrUpdate"
  283. @toggleAddrPop="refreshChange"
  284. @getInvoiceData="getInvoiceData"
  285. @hidePop="hideInvoicePop"
  286. />
  287. </div>
  288. </template>
  289. <script>
  290. import Cookie from 'js-cookie'
  291. import bus from '~/plugins/bus'
  292. import AddressPop from '~/components/add-or-edit-address'
  293. import addOrEditInvoice from '~/components/add-or-edit-invoice'
  294. import loginPopupVue from '../../components/login-popup.vue'
  295. export default {
  296. components: {
  297. AddressPop,
  298. addOrEditInvoice
  299. },
  300. data () {
  301. return {
  302. addressList: [],
  303. selectedAddrId: 0,
  304. orderInfo: {},
  305. shopCartItem: {},
  306. currentAddr: {}, // 当前选择的地址
  307. showAddrPop: false, // 地址弹窗显隐
  308. editAddrId: 0, // 要修改的地址id
  309. showDelAddr: false,
  310. orderPath: '', // 秒杀订单路径
  311. secKillObj: {}, // 秒杀订单数据
  312. remarks: '',
  313. loading: {},
  314. seckillOrderNumber: '',
  315. pollingTimes: 0,
  316. seckillOrderStsTimer: '',
  317. // 发票弹窗
  318. showInvoiceAdd: false,
  319. invoiceId: '',
  320. invoiceDataFrom: '',
  321. seckillId: this.$route.query.seckillId
  322. }
  323. },
  324. created () {
  325. this.getAddrList()
  326. },
  327. mounted () {
  328. this.secKillObj = JSON.parse(sessionStorage.getItem('secKillObj'))
  329. this.getSecOrderPath()
  330. },
  331. methods: {
  332. /**
  333. * 跳转商品详情
  334. */
  335. toProdDetail() {
  336. this.$axios.get('/seckill/prod', {
  337. params: {
  338. seckillId: this.seckillId
  339. }
  340. }).then(({ data }) => {
  341. if (data) {
  342. this.$router.push({ path: '/secdetail/' + this.seckillId })
  343. } else {
  344. this.$router.push({ path: '/detail/' + this.shopCartItem.prodId })
  345. }
  346. })
  347. },
  348. showAddOrUpdateDialog(st, shopCartItem, shopId) {
  349. this.showInvoiceAdd = true
  350. const param = shopCartItem.invoiceDataFrom ? shopCartItem.invoiceDataFrom : ''
  351. this.$nextTick(() => {
  352. this.$refs.invoiceAddOrUpdate.init(st, param, '', shopId)
  353. })
  354. },
  355. /**
  356. * 刷新回调
  357. */
  358. refreshChange(visible) {
  359. this.showInvoiceAdd = visible
  360. // this.getUserAddr()
  361. },
  362. /**
  363. * 发票信息
  364. */
  365. getInvoiceData(invoiceDataFrom) {
  366. if(invoiceDataFrom.headerType === 2) {
  367. delete invoiceDataFrom.invoiceTaxNumber
  368. }
  369. if (this.shopCartItem.shopId === invoiceDataFrom.shopId) {
  370. this.shopCartItem.invoiceDataFrom = invoiceDataFrom
  371. }
  372. this.showInvoiceAdd = false
  373. },
  374. hideInvoicePop(visible) {
  375. this.showInvoiceAdd = visible
  376. },
  377. /**
  378. * 获取地址列表
  379. */
  380. getAddrList () {
  381. this.$axios.get('/p/address/list').then(({ data }) => {
  382. this.addressList = data
  383. })
  384. if (this.orderPath && (this.selectedAddrId || this.selectedAddrId==0)) {
  385. this.confirmSecOrder(this.orderPath)
  386. }
  387. },
  388. /**
  389. * 选择地址
  390. */
  391. changeAddress (addrId) {
  392. this.addressList.forEach(element => {
  393. if (element.addrId == addrId) {
  394. this.currentAddr = element
  395. }
  396. });
  397. this.selectedAddrId = addrId
  398. this.confirmSecOrder(this.orderPath)
  399. },
  400. /**
  401. * 设置为默认地址
  402. */
  403. setDefaultAddr (addrId) {
  404. this.$axios.put('/p/address/defaultAddr/' + addrId).then(({ data }) => {
  405. this.$message({
  406. message: data,
  407. type: 'success',
  408. duration: 1000
  409. })
  410. this.getAddrList()
  411. })
  412. },
  413. /**
  414. * 显示/隐藏确认删除弹窗
  415. */
  416. toggleDelAddr (sts, addrId) {
  417. this.showDelAddr = sts
  418. this.editAddrId = addrId
  419. },
  420. /**
  421. * 显示/隐藏地址弹窗
  422. */
  423. toggleAddrPop (sts) {
  424. if (Cookie.get('token')) {
  425. this.showAddrPop = sts
  426. this.editAddrId = 0
  427. } else {
  428. bus.$emit("showLogin", true)
  429. this.showAddrPop = false
  430. }
  431. },
  432. /**
  433. * 修改地址 (弹窗传地址id)
  434. */
  435. editAddr (addrId) {
  436. if (Cookie.get('token')) {
  437. this.showAddrPop = true
  438. this.editAddrId = addrId
  439. } else {
  440. bus.$emit("showLogin", true)
  441. this.showAddrPop = false
  442. }
  443. },
  444. /**
  445. * 删除地址
  446. */
  447. delAddr () {
  448. if (this.editAddrId == this.selectedAddrId) {
  449. this.secKillObj.addrId = 0
  450. this.selectedAddrId = 0
  451. }
  452. this.$axios.delete('/p/address/deleteAddr/' + this.editAddrId).then(({ data }) => {
  453. this.$message({
  454. message: data,
  455. type: 'success',
  456. duration: 1000
  457. })
  458. this.toggleDelAddr(false)
  459. this.getAddrList()
  460. })
  461. },
  462. /**
  463. * 价格处理
  464. */
  465. parsePrice: (value) => {
  466. var val = Number(value)
  467. if (!val) {
  468. val = 0;
  469. }
  470. // 截取小数点后两位,并以小数点为切割点将val转化为数组
  471. return val.toFixed(2).split(".");
  472. },
  473. /**
  474. * 获取 orderPath
  475. */
  476. getSecOrderPath () {
  477. this.$axios.get('/p/seckill/orderPath').then(({ data }) => {
  478. this.orderPath = data
  479. this.confirmSecOrder(data)
  480. })
  481. },
  482. /**
  483. * 确认秒杀订单
  484. */
  485. confirmSecOrder (orderPath) {
  486. var confirmParam = this.secKillObj
  487. if (this.selectedAddrId || this.selectedAddrId == 0) {
  488. confirmParam.addrId = this.selectedAddrId
  489. }
  490. this.$axios.post(`/p/seckill/${orderPath}/confirm`, confirmParam).then(({ data }) => {
  491. this.orderInfo = data
  492. this.shopCartItem = data.shopCartItem
  493. if (data.userAddr) {
  494. this.currentAddr = data.userAddr
  495. this.selectedAddrId = data.userAddr.addrId
  496. }
  497. })
  498. },
  499. /**
  500. * 留言输入框失焦
  501. */
  502. handleInputBlur (value, index) {
  503. if (!value) {
  504. return
  505. }
  506. if (!value.trim()) {
  507. this.orderInfo.virtualRemarkList[index].value = value.trim()
  508. return
  509. }
  510. },
  511. /**
  512. * 提交订单
  513. */
  514. submitOrder () {
  515. if (this.orderInfo.mold !== 1 && !this.addressList.length) {
  516. this.$message({
  517. message: this.$t('submitOrder.pleaseAddTheAddressFirst'),
  518. type: 'warning',
  519. duration: 1000
  520. })
  521. this.showAddrPop = true
  522. return
  523. }
  524. if (this.orderInfo.mold !== 1 && this.selectedAddrId == 0) {
  525. this.$message({
  526. message: this.$t('submitOrder.pleaseAddTheAddressFirst'),
  527. type: 'warning',
  528. duration: 1000
  529. })
  530. document.body.scrollTop = document.documentElement.scrollTop = 0
  531. return
  532. }
  533. // 虚拟商品留言必填项校验
  534. if (
  535. this.orderInfo.mold === 1 &&
  536. this.orderInfo.virtualRemarkList.length &&
  537. this.orderInfo.virtualRemarkList.find(el => el.isRequired && !el.value)
  538. ) {
  539. this.$message({
  540. message: this.$t('submitOrder.messageCannotBeEmpty'),
  541. type: 'warning',
  542. duration: 2500
  543. })
  544. return
  545. }
  546. // 显示秒杀loading
  547. this.seckillLoading()
  548. // 提交秒杀订单
  549. var orderShopParam = {
  550. remarks: this.remarks,
  551. shopId: this.shopCartItem.shopId,
  552. orderInvoice: orderInvoiceDTO,
  553. virtualRemarkList: this.orderInfo.virtualRemarkList
  554. }
  555. let orderInvoiceDTO = null // invoiceDataFrom
  556. if (this.shopCartItem.invoiceDataFrom && this.shopCartItem.invoiceDataFrom.invoiceType === 1) {
  557. orderInvoiceDTO = this.shopCartItem.invoiceDataFrom
  558. }
  559. this.$axios.post(`/p/seckill/${this.orderPath}/submit`, orderShopParam).then(({data})=> {
  560. this.seckillOrderNumber = data.orderNumbers
  561. // 轮询秒杀订单提交状态
  562. setTimeout(this.checkSeckillOrderSubmitStatus,3000)
  563. }).catch(() => {
  564. // 关闭秒杀loading
  565. this.loading.close();
  566. this.$router.go(-1)
  567. })
  568. },
  569. /**
  570. * 轮询秒杀订单提交状态
  571. */
  572. checkSeckillOrderSubmitStatus() {
  573. if (this.pollingTimes < 10) {
  574. this.$axios.get('/p/seckill/createOrderStatus', {
  575. params : {
  576. orderNumber: this.seckillOrderNumber
  577. }
  578. }).then(({ data }) => {
  579. if (data) {
  580. clearTimeout(this.seckillOrderStsTimer)
  581. this.loading.close()
  582. sessionStorage.setItem("pay_total", this.shopCartItem.actualTotal)
  583. sessionStorage.setItem("pay_orderNumber", this.seckillOrderNumber)
  584. sessionStorage.setItem('pay_mold', this.orderInfo.mold)
  585. this.$router.push({
  586. path: '/payment'
  587. })
  588. } else {
  589. this.pollingTimes++
  590. this.seckillOrderStsTimer = setTimeout(this.checkSeckillOrderSubmitStatus, 3000)
  591. }
  592. })
  593. } else {
  594. this.loading.close()
  595. this.$message.warning(this.$t('submitOrder.secFailTips'))
  596. }
  597. },
  598. /**
  599. * 秒杀loading
  600. */
  601. seckillLoading () {
  602. const loading = this.$loading({
  603. lock: true,
  604. text: this.$t('submitOrder.inTheMadRushToBuy'),
  605. background: 'rgba(255, 255, 255, 0.8)'
  606. });
  607. this.loading = loading
  608. },
  609. },
  610. }
  611. </script>
  612. <style scoped src='~/assets/css/submit-order.css'></style>
  613. <style scoped>
  614. .fix-transform-blur {
  615. z-index: 10000;
  616. position: fixed;
  617. top: 40%;
  618. left: 50%;
  619. transform: translate(-50%, -40%);
  620. }
  621. .seckill-loading {
  622. color: #fff;
  623. }
  624. .submit-order .submit-box {
  625. border-bottom: 1px solid #eee !important;
  626. }
  627. </style>