set_money.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="page">
  3. <view class="content">
  4. <view class="content-main">
  5. <view class="content-main-icon">
  6. <text class="icon-msg">¥</text>
  7. <input class="uni-input" @input="getAmount" type="text" placeholder=""/>
  8. </view>
  9. <view class="footer-msg">
  10. <view class="footer-msg-main" v-if="pagaParams.info">
  11. <text class="info">{{pagaParams.info}}</text>
  12. <text class="footer-msg-do" @tap="editShuoming">修改</text>
  13. </view>
  14. <view class="footer-msg-main" v-else>
  15. <text class="footer-msg-do" @tap="editShuoming">添加说明</text>
  16. </view>
  17. </view>
  18. <view class="footer-button">
  19. <button class="withdraw" type="submit" @tap="setAmount">确定</button>
  20. </view>
  21. </view>
  22. <uni-popup ref="popup" type="dialog">
  23. <uni-popup-confirm
  24. mode="input"
  25. type="input"
  26. :value="pagaParams.info"
  27. placeholder="最多输入10个字"
  28. title="添加收钱说明"
  29. :duration="2000"
  30. :before-close="true"
  31. @close="close"
  32. @confirm="confirm">
  33. </uni-popup-confirm>
  34. </uni-popup>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import uniPopup from '../../../components/uni-popup/uni-popup'
  40. import uniPopupConfirm from '../../../components/uni-popup/uni-popup-confirm'
  41. import _page from '../../../common/common'
  42. import _hook from '../../../common/_hook'
  43. export default {
  44. data() {
  45. return {
  46. pagaParams:{
  47. amount:'',
  48. info:''
  49. }
  50. }
  51. },
  52. components:{
  53. uniPopup,
  54. uniPopupConfirm
  55. },
  56. onShow() {
  57. _hook.routeSonHook();
  58. },
  59. methods: {
  60. editShuoming(){
  61. this.$refs.popup.open();
  62. },
  63. getAmount(e){
  64. return this.pagaParams.amount = e.detail.value;
  65. },
  66. close(){
  67. this.$refs.popup.close()
  68. },
  69. confirm(val,value){
  70. val();
  71. this.pagaParams.info = value;
  72. },
  73. setAmount(){
  74. let _this =this;
  75. console.log(_this.pagaParams);
  76. if(!_this.pagaParams.amount.trim()){
  77. uni.showToast({title:'请输入金额!',icon:'none'});
  78. return false;
  79. }
  80. uni.$emit('update_money_info',{amount:_this.pagaParams.amount,info:_this.pagaParams.info});
  81. uni.navigateBack();
  82. }
  83. }
  84. }
  85. </script>
  86. <style>
  87. .footer-msg-do{
  88. color: #a1a3b0;
  89. margin-left: 20upx;
  90. }
  91. .content .withdraw{
  92. width: 90%;
  93. background-color: #51a938;
  94. color: white;
  95. height: 90upx;
  96. line-height: 90upx !important;
  97. border-radius: 15upx;
  98. font-size: 36upx;
  99. cursor: pointer;
  100. }
  101. .footer-button{
  102. margin-bottom: 50upx;
  103. }
  104. .page{
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. }
  109. .footer-msg .footer-msg-main{
  110. margin: 30upx 0 30upx 12px;
  111. font-size: 14px;
  112. }
  113. .content{
  114. margin-top: 10upx;
  115. width: 95%;
  116. background-color: white;
  117. border-radius: 10upx;
  118. }
  119. .icon-msg{
  120. margin-bottom: 17px;
  121. font-weight: 600;
  122. font-size: 22px;
  123. }
  124. .content-main-icon{
  125. display: flex;
  126. justify-content: center;
  127. flex-direction: row;
  128. align-items: center;
  129. margin-top: 100upx;
  130. margin-left: 30upx;
  131. border-bottom: 1px solid #f3f3f3;
  132. }
  133. .content-main-icon input{
  134. font-size: 30px;
  135. padding: 10upx;
  136. margin-left: 8px;
  137. font-weight: 600;
  138. }
  139. </style>