order-payunder.vue 12 KB

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