select-item.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="slot">
  3. <view class="item" v-for="(item, index) in ops" :key="index" @click="change(item, index)">
  4. <view class="left">
  5. <u-image :src="item.icon" width="40rpx" height="40rpx" style="margin-right: 24rpx;"></u-image>
  6. <view class="info">
  7. <view class="title">{{ item.title }}</view>
  8. <view class="desc">{{ item.desc }}</view>
  9. </view>
  10. </view>
  11. <view class="right"><u-icon size="20" name="arrow-right" :color="arrowColor"></u-icon></view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. ops: {
  19. type: Array,
  20. default: () => {
  21. return [];
  22. }
  23. }
  24. },
  25. data() {
  26. return {
  27. arrowColor: this.$appTheme.appThemeTextGrayColor
  28. };
  29. },
  30. methods: {
  31. change(item, index) {
  32. this.$emit('change', { item, index });
  33. }
  34. }
  35. };
  36. </script>
  37. <style lang="scss" scoped>
  38. .slot {
  39. padding: 30rpx;
  40. box-shadow: $app-theme-shadow;
  41. border-radius: 16rpx;
  42. background-color: $app-theme-bg-color;
  43. .item {
  44. margin-bottom: 54rpx;
  45. display: flex;
  46. justify-content: space-between;
  47. align-items: center;
  48. &:last-child {
  49. margin-bottom: 0;
  50. }
  51. .left {
  52. display: flex;
  53. justify-content: flex-start;
  54. align-items: center;
  55. .info {
  56. .title {
  57. font-size: 28rpx;
  58. color: $app-theme-text-black-color;
  59. margin-bottom: 8rpx;
  60. }
  61. .desc {
  62. font-size: 24rpx;
  63. color: $app-theme-shop-gray-color;
  64. }
  65. }
  66. }
  67. .right {
  68. display: flex;
  69. align-items: center;
  70. }
  71. }
  72. }
  73. </style>