card.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view>
  3. <view class="card" v-for="(item,index) in list" :key="index">
  4. <view style="display: flex;padding-bottom: 10rpx;">
  5. <image :src="item.image"></image>
  6. <view class="content">
  7. <text class="title">{{item.name}}</text>
  8. <view class="data-container">
  9. <view class="data">
  10. <text>可用积分:- {{item.pointsValue || 0}}</text>
  11. <text>可用热力:- {{item.hotValue || 0}}</text>
  12. <text>支付现金:¥{{item.cashvalue || 0}}</text>
  13. </view>
  14. <view class="price">
  15. <text>价格</text>
  16. <text>¥{{item.price}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view @click="confirm(item)" class="bottom" v-if="item.pointsGoodsStatus==1">
  22. <button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 60upx;" >确认收货</button>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props:{
  30. list:Array
  31. },
  32. data() {
  33. return {
  34. }
  35. },
  36. methods: {
  37. confirm(item){
  38. this.$emit('confirm',item)
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="scss">
  44. .card{
  45. margin: 15rpx;
  46. background-color: #FFFFFF;
  47. border-radius: 12rpx;
  48. display: flex;
  49. flex-direction: column;
  50. justify-content: space-between;
  51. padding: 15rpx;
  52. image{
  53. width: 180rpx;
  54. height: 180rpx;
  55. }
  56. .bottom{
  57. display: flex;
  58. justify-content: flex-end;
  59. padding:10rpx 0;
  60. margin-right: -10rpx;
  61. }
  62. .content{
  63. position: relative;
  64. width: 80%;
  65. padding-left: 20rpx;
  66. .title{
  67. font-size: 32rpx;
  68. }
  69. .data-container{
  70. display: flex;
  71. justify-content: space-between;
  72. width: 100%;
  73. .data{
  74. padding-top: 20rpx;
  75. font-size: 28rpx;
  76. color: #a3a3a3;
  77. display: flex;
  78. flex-direction: column;
  79. }
  80. .price{
  81. color: #ff0000;
  82. display: flex;
  83. justify-content: flex-end;
  84. align-items: flex-end;
  85. }
  86. }
  87. }
  88. }
  89. </style>