recharge.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. },
  55. list:[
  56. ],
  57. }
  58. },
  59. mounted() {
  60. this.getRechargePage()
  61. this.getPayChannel()
  62. },
  63. methods:{
  64. getPayChannel(){
  65. getPayChannel().then((res)=>{
  66. if(res.code===0){
  67. // this.list=res.data
  68. }else {
  69. tools.error(res.msg)
  70. }
  71. })
  72. },
  73. getRechargePage(){
  74. getRechargePage().then((res)=>{
  75. if(res.code===0){
  76. this.list=res.data
  77. }else {
  78. tools.error(res.msg)
  79. }
  80. })
  81. },
  82. selectFun(type,item){
  83. if(type === 1){
  84. this.fromData.moneyId = item.id;
  85. }else if(type === 2){
  86. // 积且充值协议跳转
  87. }else if(type === 3){
  88. // 支付宝支付
  89. }else if(type === 4){
  90. // 微信支付
  91. }else if(type === 5){
  92. // 购买小纸条
  93. this.isOpen = true;
  94. }
  95. },
  96. close(e){
  97. this.isOpen = false;
  98. },
  99. },
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. .m-26{
  104. margin: 26rpx 0;
  105. }
  106. .index{
  107. width: 100%;
  108. height: 436rpx;
  109. position: relative;
  110. .index-bg{
  111. width: 100%;
  112. height: 436rpx;
  113. }
  114. .head-money{
  115. position: absolute;
  116. left: 54rpx;
  117. bottom: 76rpx;
  118. .head-mongy-1{
  119. display: flex;
  120. align-items: center;
  121. margin-top: 26rpx;
  122. image{
  123. width: 40rpx;
  124. height: 40rpx;
  125. border-radius: 50%;
  126. margin-right: 12rpx;
  127. }
  128. }
  129. }
  130. }
  131. .t-box{
  132. height: 30rpx;
  133. view{
  134. height: 30rpx;
  135. border-radius: 30rpx 30rpx 0rpx 0rpx;
  136. }
  137. }
  138. .box-card{
  139. min-height: 100rpx;
  140. padding: 70rpx 32rpx 10rpx 32rpx;
  141. .card-list{
  142. display: flex;
  143. flex-flow: row wrap;
  144. justify-content: space-between;
  145. .card-list-nav{
  146. width: 220rpx;
  147. height: 132rpx;
  148. border-radius: 12rpx;
  149. margin-bottom: 14rpx;
  150. text-align: center;
  151. .list-top{
  152. display: flex;
  153. align-items: center;
  154. justify-content: center;
  155. margin: 20rpx 0 4rpx 0;
  156. image{
  157. width: 24rpx;
  158. height: 24rpx;
  159. margin-right: 4rpx;
  160. }
  161. }
  162. }
  163. .s-view{
  164. border: 2rpx solid #FE6915;
  165. }
  166. .n-view{
  167. border: 2rpx solid #F2F2F2;
  168. }
  169. }
  170. .card-button{
  171. width: 686rpx;
  172. height: 88rpx;
  173. border-radius: 16rpx;
  174. line-height: 88rpx;
  175. display: flex;
  176. align-items: center;
  177. justify-content: center;
  178. margin-bottom: 24rpx;
  179. image{
  180. width: 32rpx;
  181. height: 32rpx;
  182. margin-right: 8rpx;
  183. }
  184. }
  185. .crad-f{
  186. width: 100%;
  187. height: 160rpx;
  188. border-radius: 20rpx;
  189. margin-top: 34rpx;
  190. box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.1);
  191. }
  192. }
  193. </style>