app-pt-attr.vue 1.3 KB

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