specPopup.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <uni-popup ref="popup" background-color="#fff" @change="change">
  3. <view class="s-box padding-sm">
  4. <view class="s-img"></view>
  5. <view class="g-info">
  6. <view class="s-name">商品名称01</view>
  7. <view class="s-price">¥12.36</view>
  8. </view>
  9. </view>
  10. <uni-section title="规格">
  11. <view class="spec-box padding-lr-sm">
  12. <view class="spec-item padding-lr-sm" :class="{'on-spec':item % 3 == 0}" v-for="item in 5">规格{{item + 1}}</view>
  13. </view>
  14. </uni-section>
  15. <uni-section title="购买数量">
  16. <view class="purchase-num padding-lr-sm">
  17. <view class="num">剩余562件</view>
  18. <uni-number-box v-model="vModelValue" @change="changeValue" />
  19. </view>
  20. </uni-section>
  21. <view class="btn-box">
  22. <view class="btn reset">重置</view>
  23. <view class="btn confirm">确定</view>
  24. </view>
  25. </uni-popup>
  26. </template>
  27. <script>
  28. export default {
  29. name:"specPopup",
  30. data(){
  31. return{
  32. vModelValue:1
  33. }
  34. },
  35. methods:{
  36. changeValue(){},
  37. change(){},
  38. open(){
  39. this.$refs.popup.open('bottom');
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .btn-box{
  46. width: 100%;
  47. display: flex;
  48. justify-content: space-around;
  49. align-items: center;
  50. padding-top: 80upx;
  51. .btn{
  52. width: 45%;
  53. height: 60upx;
  54. text-align: center;
  55. line-height: 60upx;
  56. border-radius: 30upx;
  57. }
  58. .reset{
  59. border:solid 1px #EEE;
  60. box-sizing: border-box;
  61. }
  62. .confirm{
  63. background-image: $base-bg-gradient-color;
  64. color: #FFF;
  65. }
  66. }
  67. .spec-box{
  68. width: 100%;
  69. display: flex;
  70. flex-wrap: wrap;
  71. .spec-item{
  72. height: 60upx;
  73. line-height: 60upx;
  74. border:solid 1px #EEE;
  75. box-sizing: border-box;
  76. text-align: center;
  77. margin-left: 20upx;
  78. border-radius: 3px;
  79. margin-bottom: 20upx;
  80. font-size: 12px;
  81. }
  82. .spec-item:first-child{
  83. margin-left: 0;
  84. }
  85. .on-spec{
  86. background-image: $base-bg-gradient-color;
  87. color: #FFF;
  88. }
  89. }
  90. .s-box{
  91. width: 100%;
  92. display: flex;
  93. border-bottom: solid 1px #EEE;
  94. .s-img{
  95. width: 140upx;
  96. height: 140upx;
  97. background-color: #EEE;
  98. border-radius: 4px;
  99. }
  100. .g-info{
  101. padding-left: 20upx;
  102. .s-name{
  103. padding-bottom: 4px;
  104. }
  105. .s-price{
  106. color: #F00;
  107. font-size: 14px;
  108. }
  109. }
  110. }
  111. .purchase-num{
  112. width: 100%;
  113. display: flex;
  114. justify-content: space-between;
  115. align-items: center;
  116. border-bottom: solid 1px #EEE;
  117. padding-bottom: 30upx;
  118. .num{
  119. font-size: 12px;
  120. }
  121. }
  122. </style>