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

157 lines
3.2 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. rand: 0,
  28. time: 0
  29. }
  30. },
  31. onLoad(options){
  32. if(options.u_id){
  33. this.user_id = options.u_id;
  34. this.time = options.time;
  35. this.rand = options.rand;
  36. }else{
  37. this.$msg('二维码错误', {icon: 'error'}).then(() => {
  38. this.$toBack();
  39. })
  40. }
  41. },
  42. methods: {
  43. confirm(){
  44. if(!this.money) return this.$msg('请输入金额');
  45. if(!this.$check(this.money, 'money')) return this.$msg('请输入正确的金额');
  46. let token = this.$cookieStorage.get('store_token');
  47. this.$http.post({
  48. api: 'api/supplier/offline/order',
  49. data: {
  50. user_id: this.user_id,
  51. time: this.time,
  52. rand: this.rand,
  53. amount: this.money
  54. },
  55. header: {
  56. token: token
  57. }
  58. }).then(res => {
  59. if(res.data.code == 200){
  60. let url = '/pages/business/payment/wait?user_id='+ this.user_id;
  61. url += '&amount='+ this.amount;
  62. this.$url(url, {type: 'redirect'});
  63. }else{
  64. let message = res.data.message || '网络错误';
  65. this.$msg(message).then(() => {
  66. this.$toBack();
  67. })
  68. }
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style>
  75. page{
  76. background-color: #F8F8F8;
  77. }
  78. </style>
  79. <style lang="scss" scoped="scoped">
  80. .centent{
  81. padding: 30rpx 32rpx;
  82. .card{
  83. padding: 30rpx;
  84. box-sizing: border-box;
  85. width: 686rpx;
  86. height: max-content;
  87. background: #FFFFFF;
  88. border-radius: 20rpx;
  89. .list{
  90. height: 90rpx;
  91. width: 100%;
  92. border-bottom: 1rpx solid #e5e5e5;
  93. display: flex;
  94. justify-content: space-between;
  95. align-items: center;
  96. margin-top: 10rpx;
  97. .input{
  98. width: 540rpx;
  99. height: 80rpx;
  100. font-size: 28rpx;
  101. }
  102. .input-code{
  103. width: 430rpx;
  104. }
  105. .clear{
  106. padding: 20rpx;
  107. }
  108. .code{
  109. min-width: 180rpx;
  110. max-width: 220rpx;
  111. height: 64rpx;
  112. padding: 0 4rpx;
  113. font-size: 24rpx;
  114. color: #15716E;
  115. display: flex;
  116. justify-content: center;
  117. align-items: center;
  118. border-radius: 32rpx;
  119. border: 2rpx solid #15716E;
  120. }
  121. .active-bg{
  122. background: #efefef;
  123. }
  124. .symbol{
  125. width: 30rpx;
  126. height: 90rpx;
  127. font-size: 36rpx;
  128. color: #222222;
  129. display: flex;
  130. align-items: flex-end;
  131. }
  132. }
  133. .money-list{
  134. height: 140rpx;
  135. .input{
  136. width: 500rpx;
  137. height: 130rpx;
  138. font-size: 72rpx;
  139. font-weight: bold;
  140. margin-left: 20rpx;
  141. }
  142. }
  143. }
  144. .confirm{
  145. width: 550rpx;
  146. height: 100rpx;
  147. background: #0D2E9A;
  148. border-radius: 50rpx;
  149. color: #FFFFFF;
  150. line-height: 100rpx;
  151. margin-top: 60rpx;
  152. font-size: 32rpx;
  153. }
  154. }
  155. </style>