common-list.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="common-list">
  3. <view class="common-list-box" v-for="(i,index) in data" :key="i.index" @click="toDtl(data[index])">
  4. <view class="text">
  5. <view class="text-list" v-for="(j,jndex) in config" :key="jndex">
  6. <span class="label">
  7. {{j.label}}
  8. </span>
  9. <span class="value">
  10. {{i[j.key]}}
  11. </span>
  12. </view>
  13. </view>
  14. <view class="more">
  15. <uni-icons type="forward" class="icon" size="30"></uni-icons>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default{
  22. name:"common-list",
  23. props:{
  24. config:{
  25. type:Array
  26. },
  27. data:{
  28. type:Array
  29. },
  30. },
  31. methods:{
  32. toDtl(i){
  33. this.$emit('listClick',i)
  34. },
  35. },
  36. }
  37. </script>
  38. <style lang="less">
  39. .common-list{
  40. .common-list-box{
  41. background-color: #fff;
  42. padding: 24rpx;
  43. margin-top: 6rpx;
  44. display: flex;
  45. justify-content: space-between;
  46. .text{
  47. .text-list{
  48. line-height: 60rpx;
  49. .label{
  50. color: #999999;
  51. }
  52. .value{
  53. color: #000;
  54. margin-left: 20rpx;
  55. }
  56. }
  57. }
  58. .more{
  59. display: flex;
  60. align-items: center;
  61. }
  62. }
  63. }
  64. </style>