attr.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="select_popup_container">
  3. <view class="popup_title">
  4. <navigator :url="`/pages/product/addGoods/mulSpecification?mer_id=${mer_id}`" hover-class="none" class="manage_btn">管理</navigator>
  5. <view class="popup_title_msn">{{title}}</view>
  6. <view class="close" @click="close"><text class="iconfont">&#xe761;</text></view>
  7. </view>
  8. <view class="content">
  9. <scroll-view scroll-y="true" class="popup_sroll" @scrolltolower="scrolltolower">
  10. <view class="content_list">
  11. <view v-for="(item, index) in attrList" :key="index" class="content_list_item">
  12. <view @click="selectItem(item)">{{ item.template_name }}</view>
  13. </view>
  14. </view>
  15. </scroll-view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. attrList: {
  23. type: Array,
  24. default() {
  25. return []
  26. }
  27. },
  28. title: {
  29. type: String,
  30. default: '请选择规格'
  31. },
  32. mer_id: {
  33. type: String || Number,
  34. default: 0
  35. }
  36. },
  37. data() {
  38. return {}
  39. },
  40. methods: {
  41. close(){
  42. this.$emit('close');
  43. },
  44. selectItem(item) {
  45. this.$emit('selectAttr', item);
  46. },
  47. scrolltolower() {
  48. this.$emit('scrolltolower');
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .select_popup_container {
  55. background: #fff;
  56. border-radius: 16rpx 16rpx 0 0;
  57. }
  58. .popup_title {
  59. display: flex;
  60. justify-content: flex-end;
  61. padding: 36rpx 30rpx;
  62. position: relative;
  63. &_msn {
  64. position: absolute;
  65. top: 50%;
  66. left: 50%;
  67. transform: translate(-50%, -50%);
  68. color: #282828;
  69. font-size: 32rpx;
  70. font-weight: bold;
  71. }
  72. .manage_btn{
  73. font-weight: normal;
  74. color: #e93323;
  75. font-size: 24rpx;
  76. position: absolute;
  77. left: 40rpx;
  78. top: 40rpx;
  79. }
  80. .close {
  81. position: relative;
  82. z-index: 10;
  83. font-size: 28rpx;
  84. color: #8a8a8a;
  85. }
  86. }
  87. .content {
  88. .popup_sroll {
  89. max-height: 742rpx;
  90. min-height: 300rpx;
  91. }
  92. &_list {
  93. &_item {
  94. color: #333333;
  95. margin-bottom: 50rpx;
  96. margin-left: 40rpx;
  97. margin-right: 40rpx;
  98. display: flex;
  99. align-items: center;
  100. justify-content: space-between;
  101. > view {
  102. flex: 0.6;
  103. }
  104. > view:nth-child(2) {
  105. flex: 0.4;
  106. display: flex;
  107. justify-content: flex-end;
  108. }
  109. .iconfont {
  110. color: #e93323;
  111. font-size: 36rpx !important;
  112. }
  113. }
  114. }
  115. }
  116. </style>