order-payunder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  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="" @click="previewImg"></image>
  25. </view>
  26. <view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
  27. <view class="text-content">请点击上方二维码,长按保存后,使用微信扫码添加采美客服,将订单标识告知客服,客服会为您推荐最合适的线下转账方式。</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. const thorui = require('@/components/clipboard/clipboard.thorui.js')
  35. import bankMixins from '@/mixins/bankMixins.js'
  36. export default{
  37. mixins: [bankMixins],
  38. data(){
  39. return{
  40. orderId:'',
  41. payableAmount:0,
  42. emptyWrapperH: '',
  43. bankNumber:'6230 2100 9221 2400',
  44. payOrderId:'',
  45. isIphoneX:this.$store.state.isIphoneX,
  46. CustomBar:this.CustomBar,// 顶部导航栏高度
  47. tabCurrentIndex:0,
  48. isReceiptStatus:false,
  49. buttonText:'使用微信支付',
  50. btnColor:'#09BB07',
  51. receiptStatus:'',
  52. onlinePay:1,
  53. optionType:'',
  54. onlinePayFlag:'',
  55. payBringTitle:'本次交易暂不支持线上支付,请使用线下转账方式付款',
  56. payStatusText:'使用任何一种线上支付方式支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。',
  57. pageType:'',
  58. skeletonShow:true,
  59. productImage:['https://static.caimei365.com/app/img/icon/icon-vxkecode.png'],
  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. previewImg (index) {//顶部商品图片预览
  124. let previewUrls = this.productImage
  125. uni.previewImage({
  126. current: 0, //图片索引
  127. urls: previewUrls, //必须是http图片,本地图片无效
  128. longPressActions:''
  129. })
  130. }
  131. },
  132. onShow() {
  133. }
  134. }
  135. </script>
  136. <style lang="scss">
  137. page{
  138. height: auto !important;
  139. background-color: #FFFFFF;
  140. }
  141. .container-cash{
  142. width: 100%;
  143. padding-bottom: 250rpx;
  144. .pay-bring-title{
  145. box-sizing: border-box;
  146. width: 100%;
  147. min-height: 96rpx;
  148. padding: 20rpx 24rpx;
  149. line-height: 48rpx;
  150. text-align: left;
  151. font-size: $font-size-24;
  152. background:rgba(255,234,221,1);
  153. color: $color-system;
  154. }
  155. .container-wrapper{
  156. width:662rpx;
  157. margin: 0 auto;
  158. .pay-title{
  159. font-size: $font-size-32;
  160. line-height: 44rpx;
  161. text-align: center;
  162. color: #2A86FF;
  163. margin: 40rpx 0 0 0;
  164. width: 100%;
  165. float: left;
  166. }
  167. .pay-content{
  168. width: 574rpx;
  169. height: 136rpx;
  170. padding: 52rpx 44rpx;
  171. background: url(https://static.caimei365.com/app/img/icon/icon-paybg.png) no-repeat;
  172. background-size: cover;
  173. float: left;
  174. margin-top: 40rpx;
  175. .pay-p{
  176. font-size: $font-size-26;
  177. color: #FFFFFF;
  178. line-height: 36rpx;
  179. }
  180. .pay-money{
  181. color: #FFFFFF;
  182. line-height: 84rpx;
  183. font-weight: bold;
  184. .pay-sm{
  185. font-size: $font-size-26;
  186. }
  187. .pay-bg{
  188. font-size: 50rpx;
  189. }
  190. }
  191. }
  192. .pay-check{
  193. width: 100%;
  194. height: auto;
  195. float: left;
  196. .check-title{
  197. width: 622rpx;
  198. height: 40rpx;
  199. line-height: 40rpx;
  200. padding: 0 20rpx;
  201. margin-top: 24rpx;
  202. .text{
  203. font-size: $font-size-28;
  204. color: $text-color;
  205. text-align: left;
  206. float: left;
  207. }
  208. .icon{
  209. width: 40rpx;
  210. height: 40rpx;
  211. border-radius: 50%;
  212. line-height: 40rpx;
  213. text-align: center;
  214. color: #FFFFFF;
  215. font-size: $font-size-24;
  216. background: radial-gradient(circle,rgba(225,86,22,1) 0%,rgba(255,170,0,1) 67%,rgba(249,185,156,1) 100%);
  217. float: right;
  218. }
  219. }
  220. .pay-checked{
  221. width: 100%;
  222. height: auto;
  223. .pay-item{
  224. width: 618rpx;
  225. height: 96rpx;
  226. border: 2px solid #F5F5F5;
  227. border-radius: 30rpx;
  228. padding: 20rpx;
  229. margin: 24rpx 0;
  230. display: flex;
  231. background-color: #FFFFFF;
  232. &.current{
  233. border-color:$color-system;
  234. .item-r{
  235. .icon-duigou{
  236. color: $color-system;
  237. }
  238. }
  239. }
  240. .item-l{
  241. flex: 8;
  242. .item-icon{
  243. width: 96rpx;
  244. height: 96rpx;
  245. float: left;
  246. text-align: center;
  247. line-height: 96rpx;
  248. margin-right: 20rpx;
  249. .iconfont{
  250. font-size:88rpx;
  251. }
  252. .icon-weixinzhifu{
  253. color: #09BB07;
  254. }
  255. .icon-gerenwangyinzhifu{
  256. color: #034582;
  257. }
  258. .icon-daewangyinzhuanzhang{
  259. font-size: 68rpx;
  260. color: #034582;
  261. }
  262. .icon-qiyewangyinzhifu{
  263. color: #004889;
  264. }
  265. }
  266. .item-texts{
  267. line-height: 96rpx;
  268. font-size:$font-size-26;
  269. color: $text-color;
  270. }
  271. .item-text{
  272. line-height: 48rpx;
  273. font-size:$font-size-26;
  274. .txt-p{
  275. color: $text-color;
  276. }
  277. .txt-t{
  278. font-size: $font-size-24;
  279. color: #999999;
  280. }
  281. }
  282. }
  283. .item-r{
  284. flex: 2;
  285. text-align: center;
  286. line-height: 96rpx;
  287. .icon-duigou{
  288. font-size: 60rpx;
  289. color: #FFFFFF;
  290. }
  291. }
  292. }
  293. }
  294. }
  295. }
  296. .pay-button{
  297. width: 100%;
  298. float: left;
  299. margin-top:30rpx;
  300. .btn{
  301. width: 662rpx;
  302. height: 88rpx;
  303. border-radius: 44rpx;
  304. font-size: $font-size-28;
  305. line-height: 88rpx;
  306. color: #FFFFFF;
  307. margin: 0 auto;
  308. text-align: center;
  309. background:$btn-confirm;
  310. }
  311. }
  312. .pay-statustext{
  313. width: 100%;
  314. height: auto;
  315. float: left;
  316. margin-top:40rpx;
  317. .pay-statustext-inner{
  318. width: 662rpx;
  319. height: 100%;
  320. margin: 0 auto;
  321. .pay-icon{
  322. width: 62rpx;
  323. height: 100%;
  324. float: left;
  325. text-align: center;
  326. .iconfont{
  327. color: #FF2A2A;
  328. font-size:$font-size-36;
  329. line-height: 20rpx;
  330. }
  331. }
  332. .pay-text{
  333. width: 560rpx;
  334. height: 100%;
  335. float: left;
  336. line-height: 40rpx;
  337. font-size: $font-size-24;
  338. color: #FF2A2A;
  339. text-align: justify;
  340. }
  341. }
  342. }
  343. .pay-bring{
  344. width: 100%;
  345. min-height: 190rpx;
  346. padding: 24rpx 0;
  347. background-color: #FFFFFF;
  348. box-shadow:0px 3px 6px rgba(0,0,0,0.16);
  349. position: fixed;
  350. bottom: 0;
  351. left: 0;
  352. border-radius: 30rpx 30rpx 0 0;
  353. display: flex;
  354. align-items: center;
  355. flex-direction: column;
  356. .pay-bring-line{
  357. display: flex;
  358. align-items: center;
  359. .line{
  360. display: inline-block;
  361. width: 48rpx;
  362. height: 2px;
  363. background-color: #707070;
  364. }
  365. }
  366. .pay-bring-content{
  367. width: 654rpx;
  368. height: auto;
  369. padding: 0 24rpx;
  370. .text{
  371. font-size: $font-size-24;
  372. color: #666;
  373. line-height: 44rpx;
  374. text-align: center;
  375. &.bg-color{
  376. color: $color-system;
  377. line-height: 88rpx;
  378. }
  379. }
  380. .text-v{
  381. font-size: $font-size-28;
  382. color: #4A4F58;
  383. line-height: 70rpx;
  384. text-align: left;
  385. &.bg-color{
  386. line-height: 44rpx;
  387. color: $color-system;
  388. }
  389. .clipboard{
  390. width: 84rpx;
  391. height: 36rpx;
  392. background:linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  393. text-align: center;
  394. font-size: $font-size-24;
  395. color: #FFFFFF;
  396. border-radius: 18rpx;
  397. line-height: 36rpx;
  398. display: inline-block;
  399. margin-left: 10rpx;
  400. }
  401. }
  402. }
  403. }
  404. .pay-bring-wrapper{
  405. width: 100%;
  406. padding: 24rpx 0;
  407. background-color: #FFFFFF;
  408. display: flex;
  409. align-items: center;
  410. flex-direction: column;
  411. .pay-bring-content{
  412. width: 654rpx;
  413. height: auto;
  414. padding: 0 24rpx;
  415. margin-top: 60rpx;
  416. .text-title{
  417. width: 100%;
  418. height: 320rpx;
  419. margin-bottom: 20rpx;
  420. image{
  421. width: 320rpx;
  422. height: 320rpx;
  423. display: block;
  424. margin: 0 auto;
  425. }
  426. }
  427. .text{
  428. font-size: $font-size-24;
  429. color: #666;
  430. line-height: 44rpx;
  431. text-align: center;
  432. &.bg-color{
  433. color: $color-system;
  434. line-height: 88rpx;
  435. }
  436. }
  437. .text-v{
  438. font-size: $font-size-32;
  439. color: #4A4F58;
  440. line-height: 70rpx;
  441. text-align: center;
  442. margin-bottom: 30rpx;
  443. &.bg-color{
  444. line-height: 44rpx;
  445. color: $color-system;
  446. }
  447. .clipboard{
  448. width: 128rpx;
  449. height: 48rpx;
  450. background:linear-gradient(34deg, #FF2929 0%, #FF6D1B 100%);
  451. text-align: center;
  452. font-size: $font-size-24;
  453. color: #FFFFFF;
  454. border-radius: 24rpx;
  455. line-height: 48rpx;
  456. display: inline-block;
  457. margin-left: 10rpx;
  458. }
  459. }
  460. .text-content{
  461. width: 100%;
  462. height: 160rpx;
  463. background-color: #F5F5F5;
  464. box-sizing: border-box;
  465. padding: 24rpx;
  466. line-height: 40rpx;
  467. font-size: $font-size-28;
  468. color: #666666;
  469. text-align: justify;
  470. margin-top: 60rpx;
  471. }
  472. }
  473. }
  474. }
  475. .freight-alert{
  476. width: 100%;
  477. height: 100%;
  478. background: rgba(0,0,0,.5);
  479. position: fixed;
  480. top: 0;
  481. left: 0;
  482. z-index: 8888;
  483. transition: all 0.4s;
  484. &.none{
  485. display: none;
  486. }
  487. &.show{
  488. display: block;
  489. }
  490. .content{
  491. width: 422rpx;
  492. height:434rpx;
  493. position: absolute;
  494. background: $bg-color;
  495. left: 0;
  496. right: 0;
  497. bottom: 0;
  498. top: 0;
  499. margin: auto;
  500. padding: 20rpx 32rpx;
  501. border-radius: 12rpx;
  502. .title{
  503. width: 100%;
  504. height: 68rpx;
  505. line-height: 68rpx;
  506. font-size: $font-size-28;
  507. color: $text-color;
  508. text-align: center;
  509. position: relative;
  510. .icon-iconfontguanbi{
  511. width: 68rpx;
  512. height: 68rpx;
  513. text-align: center;
  514. line-height: 68rpx;
  515. position: absolute;
  516. right: 0;
  517. top: 0;
  518. font-size: $font-size-36;
  519. color: #999999;
  520. }
  521. }
  522. .text-content{
  523. width: 100%;
  524. height: auto;
  525. .text{
  526. padding: 20rpx 0;
  527. line-height: 44rpx;
  528. font-size: $font-size-26;
  529. color:#666666;
  530. text-align: justify;
  531. }
  532. .text-p{
  533. line-height: 44rpx;
  534. font-size: $font-size-26;
  535. color:$color-system;
  536. text-align: left;
  537. }
  538. }
  539. }
  540. }
  541. </style>