app-pt-attr.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 pintuan_groups" :class="{'app-active-item': selectGroupAttrId == item.id}" @click="active(item.id)" :key="index">{{item.people_num}}人团</text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: "app-pt-attr",
  12. props: {
  13. pintuan_groups: {
  14. type: Array,
  15. default() {
  16. return [];
  17. }
  18. },
  19. selectGroupAttrId: String,
  20. },
  21. data() {
  22. return {
  23. }
  24. },
  25. methods: {
  26. active: function(id) {
  27. this.$emit('click', id);
  28. }
  29. }
  30. }
  31. </script>
  32. <style scoped lang="scss">
  33. .app-pt-attr {
  34. width: 100%;
  35. .app-title {
  36. color: #666666;
  37. margin-bottom: #{20rpx};
  38. }
  39. .app-item {
  40. display: inline-block;
  41. background-color: #f2f2f2;
  42. margin-right: #{20rpx};
  43. margin-bottom: #{20rpx};
  44. padding: #{15upx 24upx};
  45. border-radius: #{8rpx};
  46. color: #353535;
  47. }
  48. .app-active-item {
  49. background-color: #ff4544;
  50. color: #ffffff;
  51. }
  52. }
  53. </style>