gs.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="content">
  3. <view class="flex gs-item">
  4. <view class="item-name">
  5. 参考价格
  6. </view>
  7. <input type="text" class="item-val val-red" disabled v-model="pUser.points_transaction"/>
  8. </view>
  9. <!-- //挂售价格(元) -->
  10. <view class="flex gs-item">
  11. <view class="item-name">
  12. 挂售价格(元)
  13. </view>
  14. <input type="text" class="item-val" placeholder="请输入您的挂售价(单价)" v-model="total_price"/>
  15. </view>
  16. <view class="flex gs-item">
  17. <view class="item-name">
  18. 挂售数量
  19. </view>
  20. <input type="text" class="item-val" placeholder="请输入挂售数量" v-model="amount"/>
  21. </view>
  22. <view class="flex gs-item">
  23. <view class="item-name">
  24. 联系方式
  25. </view>
  26. <input type="text" class="item-val" placeholder="请输入联系方式" v-model="phone"/>
  27. </view>
  28. <view class="fwf">
  29. 服务费:<text>{{(total_price * amount * pUser.fee_ratio / 100).toFixed(2) || 0}} 阅读积分</text>
  30. </view>
  31. <view class="btn" @click="createGs">
  32. 确认
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import { createGs,passUser } from '@/api/zero.js'
  38. export default {
  39. data() {
  40. return {
  41. total_price: '',
  42. amount: '',
  43. phone: '',
  44. pUser: {}
  45. }
  46. },
  47. onLoad() {
  48. },
  49. onShow() {
  50. this.passUser()
  51. },
  52. onReachBottom() {
  53. },
  54. onReady() {
  55. },
  56. methods: {
  57. passUser() {
  58. passUser().then(res => {
  59. this.pUser = res.data
  60. })
  61. },
  62. createGs() {
  63. let that = this
  64. createGs({
  65. total_price: that.total_price * that.amount,
  66. amount: that.amount,
  67. phone: that.phone,
  68. type: 0
  69. }).then(res => {
  70. uni.showToast({
  71. title:'挂售成功',
  72. duration:2000
  73. });
  74. setTimeout(()=> {
  75. uni.navigateBack()
  76. },1500)
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .gs-item {
  84. height: 135rpx;
  85. background-color: #fff;
  86. padding: 0 65rpx;
  87. .item-val {
  88. width: 405rpx;
  89. height: 87rpx;
  90. background: #F4F4F4;
  91. border-radius: 10rpx;
  92. text-align: center;
  93. font-size: 36rpx;
  94. font-weight: bold;
  95. }
  96. .val-red {
  97. color: #FD3B39;
  98. }
  99. }
  100. .fwf {
  101. font-size: 30rpx;
  102. font-weight: bold;
  103. color: #333333;
  104. text-align: right;
  105. padding-right: 65rpx;
  106. background-color: #fff;
  107. padding-bottom: 62rpx;
  108. text {
  109. color: #FD3B39;
  110. }
  111. }
  112. .btn {
  113. width: 616rpx;
  114. height: 88rpx;
  115. background: #ff4c4c;
  116. border-radius: 10rpx;
  117. font-size: 36rpx;
  118. font-weight: bold;
  119. color: #FFFFFF;
  120. line-height: 88rpx;
  121. text-align: center;
  122. margin: 60rpx auto ;
  123. }
  124. </style>