小程序端工程代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
5.0 KiB

  1. <template>
  2. <view>
  3. <view class="payment" :class="value === true ? 'on' : ''">
  4. <view class="title acea-row row-center-wrapper">
  5. 选择付款方式<text class="iconfont icon-guanbi" @click="close"></text>
  6. </view>
  7. <view
  8. class="item acea-row row-between-wrapper"
  9. v-if="types.indexOf('weixin') !== -1"
  10. @click="checked('weixin')"
  11. >
  12. <view class="left acea-row row-between-wrapper">
  13. <view class="iconfont icon-weixinzhifu"></view>
  14. <view class="text">
  15. <view class="name">微信支付</view>
  16. <view class="info">使用微信快捷支付</view>
  17. </view>
  18. </view>
  19. <view class="iconfont icon-xiangyou"></view>
  20. </view>
  21. <!-- <view
  22. class="item acea-row row-between-wrapper"
  23. v-if="types.indexOf('alipay') !== -1"
  24. @click="checked('alipay')"
  25. >
  26. <view class="left acea-row row-between-wrapper">
  27. <view class="iconfont icon-zhifubao"></view>
  28. <view class="text">
  29. <view class="name">支付宝支付</view>
  30. <view class="info">使用线上支付宝支付</view>
  31. </view>
  32. </view>
  33. <view class="iconfont icon-xiangyou"></view>
  34. </view> -->
  35. <view
  36. class="item acea-row row-between-wrapper"
  37. v-if="types.indexOf('yue') !== -1"
  38. @click="checked('yue')"
  39. >
  40. <view class="left acea-row row-between-wrapper">
  41. <view class="iconfont icon-yuezhifu"></view>
  42. <view class="text">
  43. <view class="name">余额支付</view>
  44. <view class="info">
  45. 当前可用余额<text class="money">{{ balance }}</text>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="iconfont icon-xiangyou"></view>
  50. </view>
  51. <!-- <view
  52. class="item acea-row row-between-wrapper"
  53. v-if="types.indexOf('offline') !== -1"
  54. @click="checked('offline')"
  55. >
  56. <view class="left acea-row row-between-wrapper">
  57. <view class="iconfont icon-yuezhifu1"></view>
  58. <view class="text">
  59. <view class="name">线下支付</view>
  60. <view class="info">选择线下付款方式</view>
  61. </view>
  62. </view>
  63. <view class="iconfont icon-xiangyou"></view>
  64. </view> -->
  65. </view>
  66. <view class="mask" v-show="value" @click="close"></view>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. name: "Payment",
  72. props: {
  73. value: {
  74. type: Boolean,
  75. default: false
  76. },
  77. balance: {
  78. type: [Number, String],
  79. default: 0
  80. },
  81. types: {
  82. type: Array,
  83. default: () => ["weixin", "alipay", "yue", "offline"]
  84. }
  85. },
  86. data: function() {
  87. return {};
  88. },
  89. mounted: function() {},
  90. methods: {
  91. checked: function(type) {
  92. this.$emit("checked", type);
  93. this.close();
  94. },
  95. close: function() {
  96. this.$emit("input", false);
  97. }
  98. }
  99. };
  100. </script>
  101. <style scoped lang="less" lang="less">
  102. .payment {
  103. position: fixed;
  104. bottom: 0;
  105. left: 0;
  106. width: 100%;
  107. border-radius: 0.16*100rpx 0.16*100rpx 0 0;
  108. background-color: #fff;
  109. padding-bottom: 0.6*100rpx;
  110. z-index: 99;
  111. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  112. -webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  113. -moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  114. -o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  115. transform: translate3d(0, 100%, 0);
  116. -webkit-transform: translate3d(0, 100%, 0);
  117. -ms-transform: translate3d(0, 100%, 0);
  118. -moz-transform: translate3d(0, 100%, 0);
  119. -o-transform: translate3d(0, 100%, 0);
  120. }
  121. .payment.on {
  122. transform: translate3d(0, 0, 0);
  123. -webkit-transform: translate3d(0, 0, 0);
  124. -ms-transform: translate3d(0, 0, 0);
  125. -moz-transform: translate3d(0, 0, 0);
  126. -o-transform: translate3d(0, 0, 0);
  127. }
  128. .payment .title {
  129. text-align: center;
  130. height: 1.23*100rpx;
  131. font-size: 0.32*100rpx;
  132. color: #282828;
  133. font-weight: bold;
  134. padding-right: 0.3*100rpx;
  135. margin-left: 0.3*100rpx;
  136. position: relative;
  137. border-bottom: 0.01*100rpx solid #eee;
  138. }
  139. .payment .title .iconfont {
  140. position: absolute;
  141. right: 0.3*100rpx;
  142. top: 50%;
  143. transform: translateY(-50%);
  144. font-size: 0.43*100rpx;
  145. color: #8a8a8a;
  146. font-weight: normal;
  147. }
  148. .payment .item {
  149. border-bottom: 0.01*100rpx solid #eee;
  150. height: 1.3*100rpx;
  151. margin-left: 0.3*100rpx;
  152. padding-right: 0.3*100rpx;
  153. }
  154. .payment .item .left {
  155. width: 6.1*100rpx;
  156. }
  157. .payment .item .left .text {
  158. width: 5.4*100rpx;
  159. }
  160. .payment .item .left .text .name {
  161. font-size: 0.32*100rpx;
  162. color: #282828;
  163. }
  164. .payment .item .left .text .info {
  165. font-size: 0.24*100rpx;
  166. color: #999;
  167. }
  168. .payment .item .left .text .info .money {
  169. color: #ff9900;
  170. }
  171. .payment .item .left .iconfont {
  172. font-size: 0.45*100rpx;
  173. color: #09bb07;
  174. }
  175. .payment .item .left .iconfont.icon-zhifubao {
  176. color: #00aaea;
  177. }
  178. .payment .item .left .iconfont.icon-yuezhifu {
  179. color: #ff9900;
  180. }
  181. .payment .item .left .iconfont.icon-yuezhifu1 {
  182. color: #eb6623;
  183. }
  184. .payment .item .iconfont {
  185. font-size: 0.3*100rpx;
  186. color: #999;
  187. }
  188. </style>