鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
4.0 KiB

  1. <template>
  2. <view class="input__view" :style="style">
  3. <view class="flex row">
  4. <view class="flex row-label">
  5. <view class="title">成人</view>
  6. <view class="desc">(18周岁以上)</view>
  7. <view class="flex price">
  8. <text>¥</text>
  9. <text class="highlight">{{ adultsPrice }}</text>
  10. </view>
  11. </view>
  12. <view class="row-content">
  13. <uv-number-box
  14. v-model="adultsNum"
  15. :min="0"
  16. :integer="true"
  17. :inputWidth="68"
  18. bgColor="transparent"
  19. :iconStyle="{
  20. background: '#F7F8FA',
  21. fontSize: '13px',
  22. lineHeight: 1,
  23. padding: '12px',
  24. borderRadius: '50%',
  25. }"
  26. ></uv-number-box>
  27. </view>
  28. </view>
  29. <view class="flex row">
  30. <view class="flex row-label">
  31. <view class="title">青少年</view>
  32. <view class="desc">(14周岁以上)</view>
  33. <view class="flex price">
  34. <text>¥</text>
  35. <text class="highlight">{{ teenagerPrice }}</text>
  36. </view>
  37. </view>
  38. <view class="row-content">
  39. <uv-number-box
  40. v-model="teenagerNum"
  41. :min="0"
  42. :integer="true"
  43. :inputWidth="68"
  44. bgColor="transparent"
  45. :iconStyle="{
  46. background: '#F7F8FA',
  47. fontSize: '13px',
  48. lineHeight: 1,
  49. padding: '12px',
  50. borderRadius: '50%',
  51. }"
  52. ></uv-number-box>
  53. </view>
  54. </view>
  55. <view class="flex row">
  56. <view class="flex row-label">
  57. <view class="title">儿童</view>
  58. <view class="desc">(14周岁以下)</view>
  59. <view class="flex price">
  60. <text>¥</text>
  61. <text class="highlight">{{ childPrice }}</text>
  62. </view>
  63. </view>
  64. <view class="row-content">
  65. <uv-number-box
  66. v-model="childNum"
  67. :min="0"
  68. :integer="true"
  69. :inputWidth="68"
  70. bgColor="transparent"
  71. :iconStyle="{
  72. background: '#F7F8FA',
  73. fontSize: '13px',
  74. lineHeight: 1,
  75. padding: '12px',
  76. borderRadius: '50%',
  77. }"
  78. ></uv-number-box>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. props: {
  86. adults: {
  87. type: Number,
  88. default: 0,
  89. },
  90. teenager: {
  91. type: Number,
  92. default: 0,
  93. },
  94. child: {
  95. type: Number,
  96. default: 0,
  97. },
  98. adultsPrice: {
  99. type: Number,
  100. default: 0,
  101. },
  102. teenagerPrice: {
  103. type: Number,
  104. default: 0,
  105. },
  106. childPrice: {
  107. type: Number,
  108. default: 0,
  109. },
  110. style: {
  111. type: String,
  112. default: ''
  113. },
  114. },
  115. computed: {
  116. adultsNum: {
  117. set(val) {
  118. this.$emit('update:adults', val)
  119. },
  120. get() {
  121. return this.adults
  122. }
  123. },
  124. teenagerNum: {
  125. set(val) {
  126. this.$emit('update:teenager', val)
  127. },
  128. get() {
  129. return this.teenager
  130. }
  131. },
  132. childNum: {
  133. set(val) {
  134. this.$emit('update:child', val)
  135. },
  136. get() {
  137. return this.child
  138. }
  139. },
  140. },
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. .input__view {
  145. width: 100%;
  146. }
  147. .row {
  148. justify-content: space-between;
  149. padding: 24rpx 0;
  150. font-family: PingFang SC;
  151. font-size: 24rpx;
  152. font-weight: 400;
  153. line-height: 1.4;
  154. border-bottom: 2rpx solid #EEEEEE;
  155. & + & {
  156. margin-top: 20rpx;
  157. }
  158. &-label {
  159. justify-content: flex-start;
  160. column-gap: 4rpx;
  161. }
  162. &-content {
  163. /deep/ .uv-number-box__minus--disabled {
  164. background: transparent !important;
  165. }
  166. }
  167. }
  168. .title {
  169. font-size: 28rpx;
  170. color: #000000;
  171. }
  172. .desc {
  173. color: #8B8B8B;
  174. }
  175. .price {
  176. font-weight: 500;
  177. color: #FF4800;
  178. .highlight {
  179. font-size: 32rpx;
  180. }
  181. }
  182. </style>