猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.2 KiB

3 months ago
2 months ago
3 months ago
1 month ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
1 month ago
3 months ago
2 months ago
3 months ago
2 months ago
1 month ago
3 months ago
2 months ago
3 months ago
2 months ago
2 months ago
3 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
  1. <template>
  2. <view class="have-order">
  3. <view class="have-order-list mt20" v-for="(item,index) in listData" :key="item.id">
  4. <view class="have-order-up">
  5. <view class="have-order-image flex-rowl">
  6. <up-image width="80rpx" height="80rpx" src="https://image.hhlm1688.com/2025/03/287ecbed1d50a141759103f1d776ca063eGroup 213084@2x.png" shape="circle"></up-image>
  7. <text class="ml20">{{ item.nickname }}</text>
  8. </view>
  9. <view class="have-order-image flex-rowr" @click="()=>arrowClick(index)">
  10. <text class="mr10 size-22 color-999">{{ item.isShow == true ? '收起' : '展开' }}</text>
  11. <up-icon :name="item.isShow == true ? 'arrow-up-fill' : 'arrow-down-fill'" color="#707070"
  12. size="10"></up-icon>
  13. </view>
  14. </view>
  15. <up-line color="#C7C7C7"></up-line>
  16. <view class="have-order-time flex-b size-26 color-999">
  17. <view >
  18. 注册时间
  19. </view>
  20. <view >
  21. {{ item.createTime }}
  22. </view>
  23. </view>
  24. <view class="have-order-time flex-b size-26 color-999" v-show="item.isShow">
  25. <view >
  26. 最近一次下单
  27. </view>
  28. <view >
  29. {{ item.createTime }}
  30. </view>
  31. </view>
  32. <view class="have-order-time flex-b size-26 color-999" v-show="item.isShow">
  33. <view >
  34. 累计消费金额
  35. </view>
  36. <view >
  37. {{ item.orderAmount.toFixed(2) }}
  38. </view>
  39. </view>
  40. <view class="have-order-time flex-b size-26 color-999" v-show="item.isShow">
  41. <view >
  42. 累计消报酬
  43. </view>
  44. <view >
  45. {{ item.accumulate_money }}
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. props: {
  54. list: {
  55. type: Array,
  56. default: () => []
  57. }
  58. },
  59. data() {
  60. return {
  61. listData: []
  62. }
  63. },
  64. watch: {
  65. list(val) {
  66. if (val && val.length > 0) {
  67. val.forEach(item => {
  68. item.isShow = false
  69. })
  70. this.listData = val
  71. }
  72. }
  73. },
  74. methods: {
  75. // 每次只展开一个
  76. arrowClick(ind) {
  77. this.listData.forEach((i, index) => {
  78. if (index === ind) {
  79. i.isShow = !i.isShow
  80. } else {
  81. i.isShow = false
  82. }
  83. })
  84. console.log(this.listData)
  85. this.listData = [...this.listData]
  86. }
  87. }
  88. }
  89. </script>
  90. <style scoped lang="scss">
  91. @import "../index";
  92. </style>