card.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!-- 删除,单元,修改,添加,管理功能皆未实现 -->
  2. <template>
  3. <view class="">
  4. <view class="data" v-for="(item, index) in list" :key="index">
  5. <view class="top">
  6. <view class="left">
  7. <view class="title">
  8. <u-icon name="xingming" custom-prefix="custom-icon" size="40" color="#51c75b"></u-icon>
  9. <text class="padding-left-20">车主姓名:{{item.userName}}</text>
  10. <text @click.stop="copy(item.userName)" style="text-decoration: underline;" class="text-blue padding-left-20">复制</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="item">
  15. <view class="left">
  16. <view style="padding: 0 30rpx;">
  17. <view class="content flex">
  18. <u-icon name="chepaihao" custom-prefix="custom-icon" size="40" color="#1296db"></u-icon>
  19. <text class="text-bold padding-left-10">车牌号:</text>
  20. <text>{{item.loginName}}</text>
  21. </view>
  22. <view class="content flex">
  23. <u-icon name="cheliang" custom-prefix="custom-icon" size="40" color="#fdba4e"></u-icon>
  24. <text class="text-bold padding-left-10">车辆类型:</text>
  25. <text class="text-bold" v-text="item.loginPwd?item.loginPwd:'未知'" ></text>
  26. </view>
  27. <view class="content flex">
  28. <u-icon name="color" custom-prefix="custom-icon" size="40" color="#7fc6ac"></u-icon>
  29. <text class="text-bold padding-left-10">车身颜色:</text>
  30. <text v-text="item.remark?item.remark:'未知'"></text>
  31. </view>
  32. <view class="content flex">
  33. <u-icon name="shoujihaoma" custom-prefix="custom-icon" size="40" color="#5ca8f0"></u-icon>
  34. <text class="text-bold padding-left-10">手机号码:</text>
  35. <text class="text-bold" v-text="item.userMobile" ></text>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="bottom flex" >
  41. <view @click="edit(item)" class="cu-btn sm round line-blue" style="margin: 0 10rpx;">
  42. 修改车辆
  43. </view>
  44. <view @click="delItem(item)" class="cu-btn sm round bg-red" style="margin: 0 10rpx;">
  45. 删除车辆
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. name: 'card',
  54. props:{
  55. list:{
  56. type:Array,
  57. default:()=>{
  58. []
  59. }
  60. }
  61. },
  62. data() {
  63. return {
  64. loading:false
  65. };
  66. },
  67. created() {
  68. },
  69. methods:{
  70. copy(data){
  71. uni.setClipboardData({
  72. data:data
  73. })
  74. },
  75. edit(item){
  76. getApp().globalData.carData=item
  77. uni.navigateTo({
  78. url:"/pages/car/add?id="+item.id
  79. })
  80. },
  81. delItem(item){
  82. this.$emit('delItem',item)
  83. }
  84. }
  85. };
  86. </script>
  87. <style lang="scss">
  88. .data {
  89. width: 710rpx;
  90. background-color: #ffffff;
  91. margin: 20rpx auto;
  92. border-radius: 6rpx;
  93. box-sizing: border-box;
  94. padding: 20rpx 10rpx;
  95. font-size: 28rpx;
  96. .top {
  97. display: flex;
  98. justify-content: space-between;
  99. padding-bottom: 20rpx;
  100. border-bottom: 1rpx solid #dedede;
  101. .left {
  102. display: flex;
  103. align-items: center;
  104. .title {
  105. margin: 0 10rpx;
  106. font-size: 30rpx;
  107. }
  108. }
  109. .right{
  110. margin-right: 10rpx;
  111. }
  112. }
  113. .item {
  114. margin: 5rpx 0 20rpx 0;
  115. .content {
  116. border-bottom: 1rpx dashed #DDDDDD;
  117. padding: 30rpx 0;
  118. }
  119. }
  120. .bottom {
  121. display: flex;
  122. margin-top: 30rpx;
  123. justify-content: flex-end;
  124. align-items: center;
  125. }
  126. }
  127. </style>