kdzz.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view style="padding: 20rpx;font-size: 30rpx;">
  3. <view style="background: #fff;padding: 50rpx;border-radius:10rpx;">
  4. <view style="font-size: 30rpx;font-weight: bold;">转出金额</view>
  5. <view style="display: table;width: 100%;margin-top: 30rpx;border-bottom: #ececec solid 1rpx;padding-bottom: 30rpx;">
  6. <view style="float: left;font-size: 50rpx;">¥</view>
  7. <view><input class="srk" placeholder="输入转账金额" disabled="" v-model="data.price" style="background: #f6f6f6;"/></view>
  8. </view>
  9. <view style="padding-top: 20rpx;">可转出余额:¥{{userinfo.lzc}}</view>
  10. </view>
  11. <view style="background: #fff;padding: 50rpx;border-radius:10rpx;margin-top: 20rpx;">
  12. <input class="srk" placeholder="输入交易密码确认" password="true" v-model="data.jymm" style="background: #f6f6f6;margin-top: 20rpx;"/>
  13. </view>
  14. <button type="warn" style="margin-top: 40rpx;" @click="add">确认转出到卡单账户</button>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. data: {
  22. 'sjh': '',
  23. 'price': '1000',
  24. 'jymm':''
  25. },
  26. userinfo:[]
  27. }
  28. },
  29. methods: {
  30. MhMyInteger(){
  31. var data = this.data;
  32. data.uid=this.userinfo.id;
  33. this.$api
  34. .MhPostModel(data, 'user/lzc')
  35. .then(res => {
  36. //console.log(44)
  37. this.userinfo.lzc=res.data.lzc;
  38. this.userinfo.dsf=res.data.dsf;
  39. })
  40. .catch(err => {
  41. // console.log('request fail', JSON.stringify(err));
  42. });
  43. },
  44. add() {
  45. if(this.userinfo.lzc<this.data.price){
  46. uni.showToast({
  47. title:"账户余额不足",
  48. icon:"none"
  49. })
  50. return;
  51. }
  52. var data = this.data;
  53. data.uid=this.userinfo.id;
  54. this.$api
  55. .MhGetModel(data, 'ppb/paylzc_kd')
  56. .then(res => {
  57. if(res.data.code==1){
  58. uni.showToast({
  59. title:"转出成功",
  60. icon:"none"
  61. })
  62. uni.navigateTo({
  63. url:"/pages/my/index"
  64. })
  65. }else{
  66. uni.showModal({
  67. title: '提示',
  68. content: res.data.msg,
  69. showCancel:false,
  70. success: function (res) {
  71. if (res.confirm) {
  72. } else if (res.cancel) {
  73. console.log('用户点击取消');
  74. }
  75. }
  76. });
  77. }
  78. })
  79. .catch(err => {
  80. // console.log('request fail', JSON.stringify(err));
  81. });
  82. }
  83. },
  84. onLoad() {
  85. var user = this.$api.getUserinfo();
  86. this.userinfo = user;
  87. this.MhMyInteger();
  88. }
  89. }
  90. </script>
  91. <style>
  92. page {
  93. padding: 15rpx;
  94. background: #f2f2f6;
  95. background-attachment: fixed !important;
  96. background-repeat: no-repeat !important;
  97. }
  98. .srk {
  99. color: #000;
  100. height: 80rpx;
  101. line-height: 80rpx;
  102. background: #fff;
  103. border-radius: 10rpx;
  104. padding-left: 20rpx;
  105. font-size: 30rpx;
  106. }
  107. .tit {
  108. color: #333;
  109. height: 60rpx;
  110. line-height: 60rpx;
  111. margin-top: 30rpx;
  112. }
  113. </style>