app-pt-attr.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="u-pt-group dir-top-nowrap">
  3. <text class="u-group-name">拼团人数</text>
  4. <view class="app-content dir-left-wrap">
  5. <view class="u-group-item" v-for="(item, index) in groups"
  6. :style="{'background-color': selectGroupAttrId == item.groups.id ? theme.background : ''}"
  7. :class="selectGroupAttrId == item.groups.id ? 'u-checked u-unchecked': ''"
  8. @click="active(item)" :key="index">{{item.groups.people_num}}人团</view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'app-pt-attr',
  15. props: {
  16. groups: {
  17. type: Array,
  18. default() {
  19. return [];
  20. }
  21. },
  22. selectGroupAttrId: String,
  23. theme: Object
  24. },
  25. methods: {
  26. active: function(item) {
  27. this.$emit('click',item);
  28. }
  29. }
  30. }
  31. </script>
  32. <style scoped lang="scss">
  33. .u-unchecked {
  34. background-color: #f2f2f2;
  35. color: #353535;
  36. }
  37. .u-pt-group {
  38. margin:24upx 32upx 0 32upx;
  39. border-bottom: 1upx solid #e2e2e2;
  40. }
  41. .u-group-name {
  42. font-size: 26upx;
  43. color: #666666;
  44. margin-bottom: 20upx;
  45. }
  46. .u-group-item {
  47. padding: 15upx 24upx;
  48. border-radius: 8upx;
  49. margin:0 20upx 20upx 0;
  50. font-size: 26upx;
  51. }
  52. .u-checked {
  53. color: #ffffff;
  54. }
  55. </style>