card-under.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  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="container-wrapper">
  12. <view class="pay-content">
  13. <view class="pay-p"><text>待付金额</text></view>
  14. <view class="pay-money">
  15. <text class="pay-sm">¥</text>
  16. <text class="pay-bg">{{payableAmount | NumFormat}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="pay-bring-wrapper clearfix">
  21. <view class="pay-bring-content">
  22. <view class="text-title">
  23. <image src="https://static.caimei365.com/app/img/icon/icon-vxkecode.png" mode="" @click="previewImg"></image>
  24. </view>
  25. <view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
  26. <view class="text-content">请点击上方二维码,长按保存后,使用微信扫码添加采美客服,将订单标识告知客服,客服会为您推荐最合适的线下转账方式。</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. const thorui = require('@/components/clipboard/clipboard.thorui.js')
  34. import bankMixins from '@/mixins/bankMixins.js'
  35. export default{
  36. mixins: [bankMixins],
  37. data(){
  38. return{
  39. orderId:'',
  40. payableAmount:0,
  41. payOrderId:'',
  42. isIphoneX:this.$store.state.isIphoneX,
  43. CustomBar:this.CustomBar,// 顶部导航栏高度
  44. skeletonShow:true,
  45. productImage:['https://static.caimei365.com/app/img/icon/icon-vxkecode.png'],
  46. }
  47. },
  48. onLoad(option) {
  49. this.initData(option)
  50. },
  51. filters: {
  52. NumFormat(value) {
  53. if(!value) return '0.00'
  54. /*原来用的是Number(value).toFixed(0),这样取整时有问题,例如0.51取整之后为1,感谢Nils指正*/
  55. /*后来改成了 Number(value)|0,但是输入超过十一位就为负数了,具体见评论 */
  56. var intPart = Number(value) - Number(value)%1 //获取整数部分(这里是windy93的方法)
  57. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
  58. var floatPart = '.00' //预定义小数部分
  59. var value2Array = value.toString().split('.')
  60. //=2表示数据有小数位
  61. if(value2Array.length == 2) {
  62. floatPart = value2Array[1].toString() //拿到小数部分
  63. if(floatPart.length == 1) { //补0,实际上用不着
  64. return intPartFormat + '.' + floatPart + '0'
  65. } else {
  66. return intPartFormat + '.' + floatPart
  67. }
  68. } else {
  69. return intPartFormat + floatPart
  70. }
  71. }
  72. },
  73. methods:{
  74. initData(e){
  75. console.log(e)
  76. this.orderId = e.orderId
  77. this.payOrderId ='#'+e.orderId+'#'
  78. this.cmGetBankTypeLists()
  79. this.PayOrderCheckoutCounter(this.orderId)
  80. },
  81. async PayOrderCheckoutCounter(orderId){
  82. try{
  83. const res = await this.PayService.PayOrderCheckoutCounter({orderId:orderId})
  84. const data = res.data.order
  85. this.payableAmount = data.payableAmount - data.receiptAmount //待付金额
  86. setTimeout(()=>{
  87. this.skeletonShow = false
  88. },500)
  89. }catch(error){
  90. console.log('error',error)
  91. }
  92. },
  93. clipboard(data) {
  94. thorui.getClipboardData(data, (res) => {
  95. if (res) {
  96. this.$util.msg('复制成功',2000,true,'success')
  97. } else {
  98. this.$util.msg('复制失败',2000,true,'none')
  99. }
  100. })
  101. },
  102. previewImg (index) {//顶部商品图片预览
  103. let previewUrls = this.productImage
  104. uni.previewImage({
  105. current: 0, //图片索引
  106. urls: previewUrls, //必须是http图片,本地图片无效
  107. longPressActions:''
  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://static.caimei365.com/app/mini-mcare/icon/icon_payUnd@2x.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: #4A4F58;
  362. line-height: 70rpx;
  363. text-align: left;
  364. &.bg-color{
  365. line-height: 44rpx;
  366. color: $color-system;
  367. }
  368. .clipboard{
  369. width: 84rpx;
  370. height: 36rpx;
  371. background:linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  372. text-align: center;
  373. font-size: $font-size-24;
  374. color: #FFFFFF;
  375. border-radius: 18rpx;
  376. line-height: 36rpx;
  377. display: inline-block;
  378. margin-left: 10rpx;
  379. }
  380. }
  381. }
  382. }
  383. .pay-bring-wrapper{
  384. width: 100%;
  385. padding: 24rpx 0;
  386. background-color: #FFFFFF;
  387. display: flex;
  388. align-items: center;
  389. flex-direction: column;
  390. .pay-bring-content{
  391. width: 654rpx;
  392. height: auto;
  393. padding: 0 24rpx;
  394. margin-top: 60rpx;
  395. .text-title{
  396. width: 100%;
  397. height: 320rpx;
  398. margin-bottom: 20rpx;
  399. image{
  400. width: 320rpx;
  401. height: 320rpx;
  402. display: block;
  403. margin: 0 auto;
  404. }
  405. }
  406. .text{
  407. font-size: $font-size-24;
  408. color: #666;
  409. line-height: 44rpx;
  410. text-align: center;
  411. &.bg-color{
  412. color: $color-system;
  413. line-height: 88rpx;
  414. }
  415. }
  416. .text-v{
  417. font-size: $font-size-32;
  418. color: #4A4F58;
  419. line-height: 70rpx;
  420. text-align: center;
  421. margin-bottom: 30rpx;
  422. &.bg-color{
  423. line-height: 44rpx;
  424. color: $color-system;
  425. }
  426. .clipboard{
  427. width: 128rpx;
  428. height: 48rpx;
  429. background:linear-gradient(34deg, #FF2929 0%, #FF6D1B 100%);
  430. text-align: center;
  431. font-size: $font-size-24;
  432. color: #FFFFFF;
  433. border-radius: 24rpx;
  434. line-height: 48rpx;
  435. display: inline-block;
  436. margin-left: 10rpx;
  437. }
  438. }
  439. .text-content{
  440. width: 100%;
  441. height: 160rpx;
  442. background-color: #F5F5F5;
  443. box-sizing: border-box;
  444. padding: 24rpx;
  445. line-height: 40rpx;
  446. font-size: $font-size-28;
  447. color: #666666;
  448. text-align: justify;
  449. margin-top: 60rpx;
  450. }
  451. }
  452. }
  453. }
  454. .freight-alert{
  455. width: 100%;
  456. height: 100%;
  457. background: rgba(0,0,0,.5);
  458. position: fixed;
  459. top: 0;
  460. left: 0;
  461. z-index: 8888;
  462. transition: all 0.4s;
  463. &.none{
  464. display: none;
  465. }
  466. &.show{
  467. display: block;
  468. }
  469. .content{
  470. width: 422rpx;
  471. height:434rpx;
  472. position: absolute;
  473. background: $bg-color;
  474. left: 0;
  475. right: 0;
  476. bottom: 0;
  477. top: 0;
  478. margin: auto;
  479. padding: 20rpx 32rpx;
  480. border-radius: 12rpx;
  481. .title{
  482. width: 100%;
  483. height: 68rpx;
  484. line-height: 68rpx;
  485. font-size: $font-size-28;
  486. color: $text-color;
  487. text-align: center;
  488. position: relative;
  489. .icon-iconfontguanbi{
  490. width: 68rpx;
  491. height: 68rpx;
  492. text-align: center;
  493. line-height: 68rpx;
  494. position: absolute;
  495. right: 0;
  496. top: 0;
  497. font-size: $font-size-36;
  498. color: #999999;
  499. }
  500. }
  501. .text-content{
  502. width: 100%;
  503. height: auto;
  504. .text{
  505. padding: 20rpx 0;
  506. line-height: 44rpx;
  507. font-size: $font-size-26;
  508. color:#666666;
  509. text-align: justify;
  510. }
  511. .text-p{
  512. line-height: 44rpx;
  513. font-size: $font-size-26;
  514. color:$color-system;
  515. text-align: left;
  516. }
  517. }
  518. }
  519. }
  520. </style>