CardList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="order-card">
  3. <view v-for="(item, index) in list" :key="item.name + 'CardList'">
  4. <view class="order-item" v-if="hanlerIF(index)">
  5. <view class="dict-tags tag-posi">服务中</view>
  6. <view class="font-30-85 card-title">子订单编号: 123456789</view>
  7. <view class="hr-dashed"></view>
  8. <view class="card-content">
  9. <view class="order-content flex_s_c">
  10. <view class="content-img"></view>
  11. <view class="content-rigth">
  12. <view class="content-item flex_c_s">
  13. <view class="font-30-333">金邻助家</view>
  14. <view class="font-30-333" style="font-weight: bold;">140</view>
  15. </view>
  16. <view class="font-28-grey flex_c_s">
  17. <view>(次)</view>
  18. <view>x5</view>
  19. </view>
  20. <view class="font-26-333 card-text">
  21. 已选日期:6月30号
  22. </view>
  23. </view>
  24. </view>
  25. <view class="flex_c_s card-time-box">
  26. <view class="font-28-14">服务时间:</view>
  27. <view class="font-28-85 flex_c_r">上午9:30 <up-icon name="arrow-right" color="#7B7B7B" size="14"></up-icon></view>
  28. </view>
  29. </view>
  30. <view v-if="item.status" class="card-btn-footer">
  31. <view class="hr-dashed"></view>
  32. <view class="flex_c_c card-btn-box">
  33. <view class="cus-parmas-btn">去服务</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="flex_c_c order-item order-footer" @click="handleClick">
  39. <text class="font-28-cb">{{ status ? '收起' : '展开' }}</text> <up-icon :name="icon_value" color="#CB9964"
  40. size="16"></up-icon>
  41. </view>
  42. </view>
  43. </template>
  44. <script setup>
  45. import { computed, ref } from 'vue';
  46. const list = [
  47. {
  48. name: '支付金额:',
  49. value: '¥100.00',
  50. status: true
  51. },
  52. {
  53. name: '订单编号:',
  54. value: '123456',
  55. status: false
  56. },
  57. ]
  58. const status = ref(false);
  59. const icon_value = computed(() => {
  60. return status.value ? 'arrow-up' : 'arrow-down'
  61. })
  62. const hanlerIF = (index) => {
  63. return status.value ? true : index < 1;
  64. }
  65. const handleClick = () => {
  66. status.value = !status.value;
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .order-card {
  71. padding-bottom: 112rpx;
  72. }
  73. .order-item {
  74. border-radius: 20rpx;
  75. background: #FFFFFF;
  76. padding: 26rpx;
  77. position: relative;
  78. .tag-posi {
  79. position: absolute;
  80. right: 0;
  81. top: 0;
  82. }
  83. margin-bottom: 16rpx;
  84. }
  85. .card-title {
  86. margin-bottom: 24rpx;
  87. }
  88. .card-content {
  89. padding: 38rpx 20rpx 0;
  90. width: 100%;
  91. .content-img {
  92. width: 144rpx;
  93. height: 144rpx;
  94. margin-right: 20rpx;
  95. background: red;
  96. }
  97. .content-rigth {
  98. flex: 1;
  99. padding-top: 38rpx 0 10rpx;
  100. }
  101. .card-text {
  102. margin-top: 20rpx;
  103. }
  104. .card-time-box {
  105. margin-top: 24rpx;
  106. }
  107. }
  108. .order-footer {
  109. padding: 26rpx 0;
  110. }
  111. .card-btn-footer {
  112. margin-top: 20rpx;
  113. }
  114. .card-btn-box {
  115. padding: 30rpx 0 8rpx;
  116. }
  117. </style>