app-pt-attr.vue 1.3 KB

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