cashPay.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="cash-pay">
  3. <view class="deposit_main">
  4. <view class="deposit_main_name">选择支付方式</view>
  5. <view class="deposit_main_ul">
  6. <view class="deposit_main_li flex" v-for="(item, index) in payList" :key="index" @click="payIndex = item.type">
  7. <view class="deposit_main_img flexs">
  8. <image :src="item.image" mode=""></image>
  9. <text>{{ item.name }}</text>
  10. </view>
  11. <view class="deposit_main_li_select">
  12. <image :src="item.type == payIndex ? '/static/image/publice/xuanzhong1@2x.png' : '/static/image/publice/weixuanzhong@2x.png'" mode=""></image>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="deposit_main_txt"><u-parse :content="message"></u-parse></view>
  17. </view>
  18. <button class="recharge_btn" hover-class="hover-view" @click="submitPay">支付</button>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. payIndex: 1,
  26. message: '',
  27. payList: [
  28. {
  29. name: '微信支付',
  30. type: '0',
  31. key: 'wechat',
  32. image: '/static/image/me/weixin@2x.png'
  33. }
  34. // {
  35. // name:'支付宝支付',
  36. // type:'1',
  37. // key: 'alipay',
  38. // image:'/static/image/me/zhifubao@2x.png'
  39. // },
  40. ],
  41. params: {}
  42. };
  43. },
  44. computed: {
  45. currPayType() {
  46. let currPayType = this.payList.find(item => item.type == this.payIndex);
  47. return currPayType;
  48. }
  49. },
  50. onLoad(params) {
  51. this.params = params;
  52. },
  53. methods: {
  54. submitPay() {
  55. let payUrl = `${this.params[this.currPayType.key]}?token=${uni.getStorageSync('token')}&payPage=${this.params.payPage}`;
  56. location.href = payUrl;
  57. }
  58. }
  59. };
  60. </script>
  61. <style lang="scss">
  62. .cash-pay {
  63. padding: 0 30rpx;
  64. }
  65. .deposit_main {
  66. padding-bottom: 30rpx;
  67. .deposit_main_name {
  68. font-size: 32rpx;
  69. font-weight: bold;
  70. padding: 40rpx 0 30rpx 20rpx;
  71. }
  72. .deposit_main_ul {
  73. background: #ffffff;
  74. .deposit_main_li {
  75. padding: 30rpx 20rpx;
  76. .deposit_main_img {
  77. image {
  78. width: 50rpx;
  79. height: 50rpx;
  80. margin-right: 20rpx;
  81. }
  82. text {
  83. font-size: 28rpx;
  84. }
  85. }
  86. .deposit_main_li_select {
  87. width: 32rpx;
  88. height: 32rpx;
  89. }
  90. }
  91. }
  92. .deposit_main_txt {
  93. padding: 30rpx 0;
  94. }
  95. }
  96. .recharge_btn {
  97. /*position: absolute;
  98. left: 50%;
  99. transform: translateX(-50%);
  100. */
  101. width: 690rpx;
  102. bottom: 34rpx;
  103. color: #fff;
  104. height: 88rpx;
  105. background: -webkit-linear-gradient(0deg, #89f7fe 0%, #66a6ff 100%);
  106. box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(220, 220, 220, 0.2);
  107. border-radius: 8rpx;
  108. }
  109. </style>