order-payunder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <template>
  2. <view class="container cashier">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="container-cash clearfix" v-else>
  11. <view class="pay-bring-title" v-if="onlinePay == 2">{{payBringTitle}}</view>
  12. <view class="container-wrapper">
  13. <view class="pay-content">
  14. <view class="pay-p"><text>待付金额</text></view>
  15. <view class="pay-money">
  16. <text class="pay-sm">¥</text>
  17. <text class="pay-bg">{{payableAmount | NumFormat}}</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="pay-bring-wrapper clearfix">
  22. <view class="pay-bring-content">
  23. <view class="text-title">
  24. <image src="https://static.caimei365.com/app/img/icon/icon-vxkecode.png" mode=""></image>
  25. </view>
  26. <view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
  27. <view class="text-content">请将上方二维码截图保存,微信扫码添加采美客服,将订单
  28. 标识告知客服,客服会为您推荐最合适的线下转账方式。</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. const thorui = require('@/components/clipboard/clipboard.thorui.js')
  36. import bankMixins from '@/mixins/bankMixins.js'
  37. export default{
  38. mixins: [bankMixins],
  39. data(){
  40. return{
  41. orderId:'',
  42. payableAmount:0,
  43. emptyWrapperH: '',
  44. bankNumber:'6230 2100 9221 2400',
  45. payOrderId:'',
  46. isIphoneX:this.$store.state.isIphoneX,
  47. CustomBar:this.CustomBar,// 顶部导航栏高度
  48. tabCurrentIndex:0,
  49. isReceiptStatus:false,
  50. buttonText:'使用微信支付',
  51. btnColor:'#09BB07',
  52. receiptStatus:'',
  53. onlinePay:1,
  54. optionType:'',
  55. onlinePayFlag:'',
  56. payBringTitle:'本次交易暂不支持线上支付,请使用线下转账方式付款',
  57. payStatusText:'使用任何一种线上支付方式支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。',
  58. pageType:'',
  59. skeletonShow:true
  60. }
  61. },
  62. onLoad(option) {
  63. this.initData(option)
  64. },
  65. filters: {
  66. NumFormat(value) {
  67. if(!value) return '0.00'
  68. /*原来用的是Number(value).toFixed(0),这样取整时有问题,例如0.51取整之后为1,感谢Nils指正*/
  69. /*后来改成了 Number(value)|0,但是输入超过十一位就为负数了,具体见评论 */
  70. var intPart = Number(value) - Number(value)%1 //获取整数部分(这里是windy93的方法)
  71. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
  72. var floatPart = '.00' //预定义小数部分
  73. var value2Array = value.toString().split('.')
  74. //=2表示数据有小数位
  75. if(value2Array.length == 2) {
  76. floatPart = value2Array[1].toString() //拿到小数部分
  77. if(floatPart.length == 1) { //补0,实际上用不着
  78. return intPartFormat + '.' + floatPart + '0'
  79. } else {
  80. return intPartFormat + '.' + floatPart
  81. }
  82. } else {
  83. return intPartFormat + floatPart
  84. }
  85. }
  86. },
  87. methods:{
  88. initData(e){
  89. console.log(e)
  90. this.orderId = e.orderId
  91. this.payOrderId ='#'+e.orderId+'#'
  92. this.cmGetBankTypeLists()
  93. this.PayOrderCheckoutCounter(this.orderId)
  94. },
  95. PayOrderCheckoutCounter(orderId){
  96. this.PayService.PayOrderCheckoutCounter({orderId:orderId}).then(response =>{
  97. let data = response.data.order
  98. this.payableAmount = data.payableAmount - data.receiptAmount //待付金额
  99. this.receiptStatus = data.receiptStatus
  100. this.onlinePayFlag = data.onlinePayFlag
  101. //判断线上线下显示
  102. if(this.optionType == 'onlinePay'){
  103. this.onlinePay = 2
  104. }else{
  105. this.onlinePay = response.data.onlinePay
  106. }
  107. setTimeout(()=>{
  108. this.skeletonShow = false
  109. },500)
  110. }).catch(error =>{
  111. this.$util.msg(error.msg,2000)
  112. })
  113. },
  114. clipboard(data) {
  115. thorui.getClipboardData(data, (res) => {
  116. if (res) {
  117. this.$util.msg('复制成功',2000,true,'success')
  118. } else {
  119. this.$util.msg('复制失败',2000,true,'none')
  120. }
  121. })
  122. },
  123. },
  124. onShow() {
  125. }
  126. }
  127. </script>
  128. <style lang="scss">
  129. page{
  130. height: auto !important;
  131. background-color: #FFFFFF;
  132. }
  133. .container-cash{
  134. width: 100%;
  135. padding-bottom: 250rpx;
  136. .pay-bring-title{
  137. box-sizing: border-box;
  138. width: 100%;
  139. min-height: 96rpx;
  140. padding: 20rpx 24rpx;
  141. line-height: 48rpx;
  142. text-align: left;
  143. font-size: $font-size-24;
  144. background:rgba(255,234,221,1);
  145. color: $color-system;
  146. }
  147. .container-wrapper{
  148. width:662rpx;
  149. margin: 0 auto;
  150. .pay-title{
  151. font-size: $font-size-32;
  152. line-height: 44rpx;
  153. text-align: center;
  154. color: #2A86FF;
  155. margin: 40rpx 0 0 0;
  156. width: 100%;
  157. float: left;
  158. }
  159. .pay-content{
  160. width: 574rpx;
  161. height: 136rpx;
  162. padding: 52rpx 44rpx;
  163. background: url(https://static.caimei365.com/app/img/icon/icon-paybg.png) no-repeat;
  164. background-size: cover;
  165. float: left;
  166. margin-top: 40rpx;
  167. .pay-p{
  168. font-size: $font-size-26;
  169. color: #FFFFFF;
  170. line-height: 36rpx;
  171. }
  172. .pay-money{
  173. color: #FFFFFF;
  174. line-height: 84rpx;
  175. font-weight: bold;
  176. .pay-sm{
  177. font-size: $font-size-26;
  178. }
  179. .pay-bg{
  180. font-size: 50rpx;
  181. }
  182. }
  183. }
  184. .pay-check{
  185. width: 100%;
  186. height: auto;
  187. float: left;
  188. .check-title{
  189. width: 622rpx;
  190. height: 40rpx;
  191. line-height: 40rpx;
  192. padding: 0 20rpx;
  193. margin-top: 24rpx;
  194. .text{
  195. font-size: $font-size-28;
  196. color: $text-color;
  197. text-align: left;
  198. float: left;
  199. }
  200. .icon{
  201. width: 40rpx;
  202. height: 40rpx;
  203. border-radius: 50%;
  204. line-height: 40rpx;
  205. text-align: center;
  206. color: #FFFFFF;
  207. font-size: $font-size-24;
  208. background: radial-gradient(circle,rgba(225,86,22,1) 0%,rgba(255,170,0,1) 67%,rgba(249,185,156,1) 100%);
  209. float: right;
  210. }
  211. }
  212. .pay-checked{
  213. width: 100%;
  214. height: auto;
  215. .pay-item{
  216. width: 618rpx;
  217. height: 96rpx;
  218. border: 2px solid #F5F5F5;
  219. border-radius: 30rpx;
  220. padding: 20rpx;
  221. margin: 24rpx 0;
  222. display: flex;
  223. background-color: #FFFFFF;
  224. &.current{
  225. border-color:$color-system;
  226. .item-r{
  227. .icon-duigou{
  228. color: $color-system;
  229. }
  230. }
  231. }
  232. .item-l{
  233. flex: 8;
  234. .item-icon{
  235. width: 96rpx;
  236. height: 96rpx;
  237. float: left;
  238. text-align: center;
  239. line-height: 96rpx;
  240. margin-right: 20rpx;
  241. .iconfont{
  242. font-size:88rpx;
  243. }
  244. .icon-weixinzhifu{
  245. color: #09BB07;
  246. }
  247. .icon-gerenwangyinzhifu{
  248. color: #034582;
  249. }
  250. .icon-daewangyinzhuanzhang{
  251. font-size: 68rpx;
  252. color: #034582;
  253. }
  254. .icon-qiyewangyinzhifu{
  255. color: #004889;
  256. }
  257. }
  258. .item-texts{
  259. line-height: 96rpx;
  260. font-size:$font-size-26;
  261. color: $text-color;
  262. }
  263. .item-text{
  264. line-height: 48rpx;
  265. font-size:$font-size-26;
  266. .txt-p{
  267. color: $text-color;
  268. }
  269. .txt-t{
  270. font-size: $font-size-24;
  271. color: #999999;
  272. }
  273. }
  274. }
  275. .item-r{
  276. flex: 2;
  277. text-align: center;
  278. line-height: 96rpx;
  279. .icon-duigou{
  280. font-size: 60rpx;
  281. color: #FFFFFF;
  282. }
  283. }
  284. }
  285. }
  286. }
  287. }
  288. .pay-button{
  289. width: 100%;
  290. float: left;
  291. margin-top:30rpx;
  292. .btn{
  293. width: 662rpx;
  294. height: 88rpx;
  295. border-radius: 44rpx;
  296. font-size: $font-size-28;
  297. line-height: 88rpx;
  298. color: #FFFFFF;
  299. margin: 0 auto;
  300. text-align: center;
  301. background:$btn-confirm;
  302. }
  303. }
  304. .pay-statustext{
  305. width: 100%;
  306. height: auto;
  307. float: left;
  308. margin-top:40rpx;
  309. .pay-statustext-inner{
  310. width: 662rpx;
  311. height: 100%;
  312. margin: 0 auto;
  313. .pay-icon{
  314. width: 62rpx;
  315. height: 100%;
  316. float: left;
  317. text-align: center;
  318. .iconfont{
  319. color: #FF2A2A;
  320. font-size:$font-size-36;
  321. line-height: 20rpx;
  322. }
  323. }
  324. .pay-text{
  325. width: 560rpx;
  326. height: 100%;
  327. float: left;
  328. line-height: 40rpx;
  329. font-size: $font-size-24;
  330. color: #FF2A2A;
  331. text-align: justify;
  332. }
  333. }
  334. }
  335. .pay-bring{
  336. width: 100%;
  337. min-height: 190rpx;
  338. padding: 24rpx 0;
  339. background-color: #FFFFFF;
  340. box-shadow:0px 3px 6px rgba(0,0,0,0.16);
  341. position: fixed;
  342. bottom: 0;
  343. left: 0;
  344. border-radius: 30rpx 30rpx 0 0;
  345. display: flex;
  346. align-items: center;
  347. flex-direction: column;
  348. .pay-bring-line{
  349. display: flex;
  350. align-items: center;
  351. .line{
  352. display: inline-block;
  353. width: 48rpx;
  354. height: 2px;
  355. background-color: #707070;
  356. }
  357. }
  358. .pay-bring-content{
  359. width: 654rpx;
  360. height: auto;
  361. padding: 0 24rpx;
  362. .text{
  363. font-size: $font-size-24;
  364. color: #666;
  365. line-height: 44rpx;
  366. text-align: center;
  367. &.bg-color{
  368. color: $color-system;
  369. line-height: 88rpx;
  370. }
  371. }
  372. .text-v{
  373. font-size: $font-size-28;
  374. color: #4A4F58;
  375. line-height: 70rpx;
  376. text-align: left;
  377. &.bg-color{
  378. line-height: 44rpx;
  379. color: $color-system;
  380. }
  381. .clipboard{
  382. width: 84rpx;
  383. height: 36rpx;
  384. background:linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  385. text-align: center;
  386. font-size: $font-size-24;
  387. color: #FFFFFF;
  388. border-radius: 18rpx;
  389. line-height: 36rpx;
  390. display: inline-block;
  391. margin-left: 10rpx;
  392. }
  393. }
  394. }
  395. }
  396. .pay-bring-wrapper{
  397. width: 100%;
  398. padding: 24rpx 0;
  399. background-color: #FFFFFF;
  400. display: flex;
  401. align-items: center;
  402. flex-direction: column;
  403. .pay-bring-content{
  404. width: 654rpx;
  405. height: auto;
  406. padding: 0 24rpx;
  407. margin-top: 60rpx;
  408. .text-title{
  409. width: 100%;
  410. height: 320rpx;
  411. margin-bottom: 20rpx;
  412. image{
  413. width: 320rpx;
  414. height: 320rpx;
  415. display: block;
  416. margin: 0 auto;
  417. }
  418. }
  419. .text{
  420. font-size: $font-size-24;
  421. color: #666;
  422. line-height: 44rpx;
  423. text-align: center;
  424. &.bg-color{
  425. color: $color-system;
  426. line-height: 88rpx;
  427. }
  428. }
  429. .text-v{
  430. font-size: $font-size-32;
  431. color: #4A4F58;
  432. line-height: 70rpx;
  433. text-align: center;
  434. margin-bottom: 30rpx;
  435. &.bg-color{
  436. line-height: 44rpx;
  437. color: $color-system;
  438. }
  439. .clipboard{
  440. width: 128rpx;
  441. height: 48rpx;
  442. background:linear-gradient(34deg, #FF2929 0%, #FF6D1B 100%);
  443. text-align: center;
  444. font-size: $font-size-24;
  445. color: #FFFFFF;
  446. border-radius: 24rpx;
  447. line-height: 48rpx;
  448. display: inline-block;
  449. margin-left: 10rpx;
  450. }
  451. }
  452. .text-content{
  453. width: 100%;
  454. height: 160rpx;
  455. background-color: #F5F5F5;
  456. box-sizing: border-box;
  457. padding: 24rpx;
  458. line-height: 40rpx;
  459. font-size: $font-size-28;
  460. color: #666666;
  461. text-align: justify;
  462. margin-top: 60rpx;
  463. }
  464. }
  465. }
  466. }
  467. .freight-alert{
  468. width: 100%;
  469. height: 100%;
  470. background: rgba(0,0,0,.5);
  471. position: fixed;
  472. top: 0;
  473. left: 0;
  474. z-index: 8888;
  475. transition: all 0.4s;
  476. &.none{
  477. display: none;
  478. }
  479. &.show{
  480. display: block;
  481. }
  482. .content{
  483. width: 422rpx;
  484. height:434rpx;
  485. position: absolute;
  486. background: $bg-color;
  487. left: 0;
  488. right: 0;
  489. bottom: 0;
  490. top: 0;
  491. margin: auto;
  492. padding: 20rpx 32rpx;
  493. border-radius: 12rpx;
  494. .title{
  495. width: 100%;
  496. height: 68rpx;
  497. line-height: 68rpx;
  498. font-size: $font-size-28;
  499. color: $text-color;
  500. text-align: center;
  501. position: relative;
  502. .icon-iconfontguanbi{
  503. width: 68rpx;
  504. height: 68rpx;
  505. text-align: center;
  506. line-height: 68rpx;
  507. position: absolute;
  508. right: 0;
  509. top: 0;
  510. font-size: $font-size-36;
  511. color: #999999;
  512. }
  513. }
  514. .text-content{
  515. width: 100%;
  516. height: auto;
  517. .text{
  518. padding: 20rpx 0;
  519. line-height: 44rpx;
  520. font-size: $font-size-26;
  521. color:#666666;
  522. text-align: justify;
  523. }
  524. .text-p{
  525. line-height: 44rpx;
  526. font-size: $font-size-26;
  527. color:$color-system;
  528. text-align: left;
  529. }
  530. }
  531. }
  532. }
  533. </style>