bid_goods_record.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="cu-modal bottom-modal" :class="{'show': visible}">
  3. <view class="mask" @click="close"></view>
  4. <view class="cu-dialog wrapper">
  5. <view class="paddingY25 flex-align-center relative">
  6. <image :src="resource.sell_bid_recrod_title" class="title" />
  7. <image :src="resource.icon_x" class="x" @click="close" />
  8. </view>
  9. <scroll-view style="height: 750rpx" scroll-y v-if="tableData && tableData.length > 0">
  10. <view v-for="(item, index) in tableData" :key="index" class="cell flex-align paddingX6 paddingY10">
  11. <image :src="item.avatar" class="avatar" />
  12. <view class="flex1 marginX10 color-2">{{item.nickname}}</view>
  13. <view class="color-money">出价 ¥{{item.bidPrice}}</view>
  14. <button class="btn marginL15" @click.stop="changePrice(item)">改价</button>
  15. </view>
  16. </scroll-view>
  17. <view v-if="!tableData || tableData.length === 0" style="height: 750rpx">
  18. <empty :top="0" />
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import resource from '@/utils/resource'
  25. import { LEVEL_MAP } from '@/utils/config'
  26. import empty from '@/components/empty'
  27. export default {
  28. components: { empty },
  29. data() {
  30. return {
  31. tableData: null,
  32. LEVEL_MAP,
  33. resource,
  34. visible: false
  35. }
  36. },
  37. methods: {
  38. show(index, goodsId) {
  39. this.$parent.$parent.$parent.lock = true
  40. this.index = index
  41. this.goodsId = goodsId
  42. this.visible = true
  43. this.refresh()
  44. },
  45. close() {
  46. this.$parent.$parent.$parent.lock = false
  47. this.visible = false
  48. this.tableData = null
  49. this.goodsId = null
  50. this.index = null
  51. },
  52. refresh() {
  53. this.loadData()
  54. },
  55. async loadData(loading = false) {
  56. const res = await this.$service.sell.bidListByGoods(1, 20, this.goodsId)
  57. this.tableData = res
  58. },
  59. async changePrice(item) {
  60. this.$message.confirm(`确定要改为${item.bidPrice}元吗?`, async () => {
  61. const res = await this.$service.sell.change(this.goodsId, item.bidPrice)
  62. if (res) {
  63. this.$emit('success', { index: this.index, price: item.bidPrice })
  64. this.close()
  65. } else {
  66. this.price = ''
  67. }
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .mask {
  75. position: absolute;
  76. left: 0;
  77. right: 0;
  78. top: 0;
  79. bottom: 0;
  80. }
  81. .wrapper {
  82. padding: 0 28rpx 64rpx;
  83. background: #171b1e;
  84. border-radius: 15px 15px 2px 2px;
  85. .title {
  86. width: 172rpx;
  87. height: 30rpx;
  88. }
  89. .x {
  90. position: absolute;
  91. right: 28rpx;
  92. top: 50%;
  93. margin-top: -16rpx;
  94. width: 32rpx;
  95. height: 32rpx;
  96. }
  97. .cell {
  98. .avatar {
  99. width: 52rpx;
  100. height: 52rpx;
  101. border-radius: 26rpx;
  102. }
  103. .btn {
  104. height: 48rpx;
  105. line-height: 48rpx;
  106. text-align: center;
  107. padding: 0 20rpx;
  108. color: #fff;
  109. font-size: 28rpx;
  110. background: linear-gradient(270deg, #d070ff 0%, #8b3dff 100%);
  111. border-radius: 24rpx;
  112. }
  113. }
  114. }
  115. </style>