bid.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="cu-modal" :class="{'show': visible}">
  3. <view class="cu-dialog wrapper">
  4. <view class="content">
  5. <view class="flex-align-center">
  6. <image :src="resource.sell_bid_title" webp style="width: 274rpx; height: 46rpx" />
  7. </view>
  8. <view class="input-wrapper marginY20 flex-align paddingX10">
  9. <input v-model.trim="price" class="flex1 color-white" />
  10. <image v-if="price" @click="price = ''" :src="resource.weal_cancel" webp style="width: 32rpx;height: 32rpx" />
  11. </view>
  12. <view class="flex-align-between">
  13. <image :src="resource.modal_cancel" webp style="width: 254rpx;height:92rpx" @click="close" />
  14. <image :src="resource.modal_ok" webp style="width: 254rpx;height:92rpx" @click="apply" />
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import { throttle } from '@/utils'
  22. import resource from '@/utils/resource'
  23. export default {
  24. props: {
  25. tradeGoodsId: Number
  26. },
  27. data() {
  28. return {
  29. resource,
  30. visible: false,
  31. price: ''
  32. }
  33. },
  34. computed: {},
  35. methods: {
  36. show() {
  37. this.price = ''
  38. this.visible = true
  39. },
  40. async apply() {
  41. if (!this.price) return
  42. throttle.call(this.realApply)
  43. },
  44. async realApply() {
  45. const res = await this.$service.sell.bid(this.tradeGoodsId, this.price)
  46. if (res) {
  47. this.$emit('success')
  48. this.close()
  49. } else {
  50. this.price = ''
  51. }
  52. },
  53. close() {
  54. this.visible = false
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .mask {
  61. position: absolute;
  62. left: 0;
  63. right: 0;
  64. top: 0;
  65. bottom: 0;
  66. }
  67. .wrapper {
  68. width: 100%;
  69. margin-top: -100px;
  70. background: transparent;
  71. .content {
  72. padding: 40rpx 60rpx;
  73. margin: 0 20px;
  74. background: #000000;
  75. border-radius: 16px;
  76. border: 4px solid;
  77. border-image: linear-gradient(180deg, rgba(89, 55, 195, 1), rgba(169, 27, 136, 1)) 2 2;
  78. .input-wrapper {
  79. height: 100rpx;
  80. background: rgba(0, 0, 0, 0.5);
  81. box-shadow: 0px 0px 8rpx 4rpx rgba(147, 67, 255, 0.3);
  82. border-radius: 8rpx;
  83. border: 2rpx solid rgba(174, 231, 255, 0.5);
  84. }
  85. }
  86. }
  87. </style>