金诚优选前端代码
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.

147 lines
3.0 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="输入金额" :showIcon="true" bgColor="#fff"></lf-nav>
  4. <view class="centent">
  5. <view class="card">
  6. <view class="lf-font-28 lf-color-222">输入金额</view>
  7. <view class="list money-list">
  8. <view class="lf-flex">
  9. <view class="symbol"></view>
  10. <input class="input" type="number" v-model="money" />
  11. </view>
  12. <view class="clear" v-if="money.length" @click="money = ''">
  13. <text class="lf-iconfont icon-cuo1"></text>
  14. </view>
  15. </view>
  16. </view>
  17. <button class="confirm" hover-class="lf-opacity" @click="confirm">确认</button>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data(){
  24. return {
  25. money: '',
  26. user_id: 0
  27. }
  28. },
  29. onLoad(options){
  30. if(options.user_id){
  31. this.user_id = options.user_id;
  32. }else{
  33. this.$msg('二维码错误', {icon: 'error'}).then(() => {
  34. this.$toBack();
  35. })
  36. }
  37. },
  38. methods: {
  39. confirm(){
  40. if(!this.money) return this.$msg('请输入金额');
  41. if(!this.$check(this.money, 'money')) return this.$msg('请输入正确的金额');
  42. let token = this.$cookieStorage.get('store_token');
  43. this.$http.post({
  44. api: 'api/supplier/offline/order',
  45. data: {
  46. user_id: this.user_id,
  47. amount: this.money
  48. },
  49. header: {
  50. token: token
  51. }
  52. }).then(res => {
  53. if(res.data.code == 200){
  54. this.$url('/pages/business/payment/wait', {type: 'redirect'})
  55. }else{
  56. let msg = res.data.msg || '网络错误';
  57. this.$msg(msg);
  58. }
  59. })
  60. }
  61. }
  62. }
  63. </script>
  64. <style>
  65. page{
  66. background-color: #F8F8F8;
  67. }
  68. </style>
  69. <style lang="scss" scoped="scoped">
  70. .centent{
  71. padding: 30rpx 32rpx;
  72. .card{
  73. padding: 30rpx;
  74. box-sizing: border-box;
  75. width: 686rpx;
  76. height: max-content;
  77. background: #FFFFFF;
  78. border-radius: 20rpx;
  79. .list{
  80. height: 90rpx;
  81. width: 100%;
  82. border-bottom: 1rpx solid #e5e5e5;
  83. display: flex;
  84. justify-content: space-between;
  85. align-items: center;
  86. margin-top: 10rpx;
  87. .input{
  88. width: 540rpx;
  89. height: 80rpx;
  90. font-size: 28rpx;
  91. }
  92. .input-code{
  93. width: 430rpx;
  94. }
  95. .clear{
  96. padding: 20rpx;
  97. }
  98. .code{
  99. min-width: 180rpx;
  100. max-width: 220rpx;
  101. height: 64rpx;
  102. padding: 0 4rpx;
  103. font-size: 24rpx;
  104. color: #15716E;
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. border-radius: 32rpx;
  109. border: 2rpx solid #15716E;
  110. }
  111. .active-bg{
  112. background: #efefef;
  113. }
  114. .symbol{
  115. width: 30rpx;
  116. height: 90rpx;
  117. font-size: 36rpx;
  118. color: #222222;
  119. display: flex;
  120. align-items: flex-end;
  121. }
  122. }
  123. .money-list{
  124. height: 140rpx;
  125. .input{
  126. width: 500rpx;
  127. height: 130rpx;
  128. font-size: 72rpx;
  129. font-weight: bold;
  130. margin-left: 20rpx;
  131. }
  132. }
  133. }
  134. .confirm{
  135. width: 550rpx;
  136. height: 100rpx;
  137. background: #0D2E9A;
  138. border-radius: 50rpx;
  139. color: #FFFFFF;
  140. line-height: 100rpx;
  141. margin-top: 60rpx;
  142. font-size: 32rpx;
  143. }
  144. }
  145. </style>