recharge.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view>
  3. <view class="index">
  4. <image class="index-bg" src="@/static/img/wallet/bg.png" mode="scaleToFill"></image>
  5. <view class="head-money">
  6. <view class="sys-color-794B06 sys-size-28">我的JM币</view>
  7. <view class="head-mongy-1">
  8. <image src="@/static/img/wallet/j.png" mode=""></image>
  9. <view class="sys-size-52 sys-color-362100 sys-weight-600">138</view>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="t-box sys-background-FFDFC3">
  14. <view class="sys-background-gray-f"></view>
  15. </view>
  16. <view class="box-sizing-border box-card">
  17. <view class="card-list">
  18. <view class="card-list-nav box-sizing-border"
  19. :class="fromData.moneyId===item.id?'s-view':'n-view'"
  20. @click="selectFun(1,item)"
  21. v-for="(item,i) in list" :key="i">
  22. <view class="list-top">
  23. <image src="@/static/img/wallet/b.png" mode=""></image>
  24. <view class="sys-size-40 sys-color-gray-3 sys-weight-600">{{item.shell}}</view>
  25. </view>
  26. <view class="sys-size-24 sys-color-gray-6">¥{{item.amount}}</view>
  27. </view>
  28. <view class="card-list-nav" v-if="list.length>3&&list.length%3!=0"></view>
  29. </view>
  30. <view class="m-26 sys-size-24 sys-color-gray-9" @click="selectFun(2)">充值即代表同意《积且充值协议》</view>
  31. <view class="card-button sys-background-41AAEE sys-size-32 sys-color-white" @click="selectFun(3)">
  32. <image src="@/static/img/wallet/zfb-logo.png" mode="scaleToFill"></image>支付宝支付
  33. </view>
  34. <view class="card-button sys-background-6DCF06 sys-size-32 sys-color-white" @click="selectFun(4)">
  35. <image src="@/static/img/wallet/wx-logo.png" mode="scaleToFill"></image>微信支付
  36. </view>
  37. <view class="sys-size-32 sys-color-gray-3 sys-weight-600">我的道具</view>
  38. <image class="crad-f" src="@/static/img/wallet/ad-2.png" mode="scaleToFill" @click="selectFun(5)"></image>
  39. </view>
  40. <SmallPaper v-if="isOpen" @close='close'></SmallPaper>
  41. </view>
  42. </template>
  43. <script>
  44. import SmallPaper from './small-paper.vue';
  45. import {getPayChannel, getRechargePage} from "@/api/my";
  46. import tools from "@/service/tools";
  47. export default {
  48. components:{SmallPaper},
  49. data(){
  50. return{
  51. isOpen:false,
  52. fromData:{
  53. moneyId:1,
  54. shell:'',
  55. amount:'',
  56. paymentMethod:'',
  57. },
  58. list:[],
  59. pay:[],
  60. }
  61. },
  62. mounted() {
  63. this.getRechargePage()
  64. this.getPayChannel()
  65. },
  66. methods:{
  67. getPayChannel(){
  68. getPayChannel().then((res)=>{
  69. if(res.code===0){
  70. this.pay=res.data
  71. }else {
  72. tools.error(res.msg)
  73. }
  74. })
  75. },
  76. getRechargePage(){
  77. getRechargePage().then((res)=>{
  78. if(res.code===0){
  79. this.list=res.data
  80. }else {
  81. tools.error(res.msg)
  82. }
  83. })
  84. },
  85. selectFun(type,item){
  86. if(type === 1){
  87. this.fromData.moneyId = item.id;
  88. this.fromData.shell = item.shell;
  89. this.fromData.amount = item.amount;
  90. }else if(type === 2){
  91. // 积且充值协议跳转
  92. }else if(type === 3){
  93. // 支付宝支付
  94. }else if(type === 4){
  95. // 微信支付
  96. }else if(type === 5){
  97. // 购买小纸条
  98. this.isOpen = true;
  99. }
  100. },
  101. payFun(type){
  102. if(type === 3){
  103. this.fromData.paymentMethod = "alipay";
  104. }else{
  105. this.fromData.paymentMethod = "wechat";
  106. }
  107. },
  108. close(e){
  109. this.isOpen = false;
  110. },
  111. },
  112. }
  113. </script>
  114. <style scoped lang="scss">
  115. .m-26{
  116. margin: 26rpx 0;
  117. }
  118. .index{
  119. width: 100%;
  120. height: 436rpx;
  121. position: relative;
  122. .index-bg{
  123. width: 100%;
  124. height: 436rpx;
  125. }
  126. .head-money{
  127. position: absolute;
  128. left: 54rpx;
  129. bottom: 76rpx;
  130. .head-mongy-1{
  131. display: flex;
  132. align-items: center;
  133. margin-top: 26rpx;
  134. image{
  135. width: 40rpx;
  136. height: 40rpx;
  137. border-radius: 50%;
  138. margin-right: 12rpx;
  139. }
  140. }
  141. }
  142. }
  143. .t-box{
  144. height: 30rpx;
  145. view{
  146. height: 30rpx;
  147. border-radius: 30rpx 30rpx 0rpx 0rpx;
  148. }
  149. }
  150. .box-card{
  151. min-height: 100rpx;
  152. padding: 70rpx 32rpx 10rpx 32rpx;
  153. .card-list{
  154. display: flex;
  155. flex-flow: row wrap;
  156. justify-content: space-between;
  157. .card-list-nav{
  158. width: 220rpx;
  159. height: 132rpx;
  160. border-radius: 12rpx;
  161. margin-bottom: 14rpx;
  162. text-align: center;
  163. .list-top{
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. margin: 20rpx 0 4rpx 0;
  168. image{
  169. width: 24rpx;
  170. height: 24rpx;
  171. margin-right: 4rpx;
  172. }
  173. }
  174. }
  175. .s-view{
  176. border: 2rpx solid #FE6915;
  177. }
  178. .n-view{
  179. border: 2rpx solid #F2F2F2;
  180. }
  181. }
  182. .card-button{
  183. width: 686rpx;
  184. height: 88rpx;
  185. border-radius: 16rpx;
  186. line-height: 88rpx;
  187. display: flex;
  188. align-items: center;
  189. justify-content: center;
  190. margin-bottom: 24rpx;
  191. image{
  192. width: 32rpx;
  193. height: 32rpx;
  194. margin-right: 8rpx;
  195. }
  196. }
  197. .crad-f{
  198. width: 100%;
  199. height: 160rpx;
  200. border-radius: 20rpx;
  201. margin-top: 34rpx;
  202. box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.1);
  203. }
  204. }
  205. </style>