普兆健康管家前端代码仓库
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.

183 lines
3.8 KiB

  1. <template>
  2. <view>
  3. <uv-popup ref="popup" mode="bottom" bgColor="none" >
  4. <view class="popup__view">
  5. <view class="flex header">
  6. <view class="title">线上试剂盒回寄</view>
  7. <button class="btn" @click="close">关闭</button>
  8. </view>
  9. <view class="form">
  10. <uv-form
  11. ref="form"
  12. :model="form"
  13. :rules="rules"
  14. errorType="toast"
  15. >
  16. <view class="form-item">
  17. <uv-form-item prop="trackingNo" :customStyle="formItemStyle">
  18. <view class="form-item-label">回寄订单号</view>
  19. <view class="form-item-content">
  20. <formInput v-model="form.trackingNo" inputAlign="right"></formInput>
  21. </view>
  22. </uv-form-item>
  23. </view>
  24. </uv-form>
  25. </view>
  26. <view class="footer">
  27. <button class="flex btn" @click="close">取消</button>
  28. <button class="flex btn" @click="onConfirm">确认</button>
  29. </view>
  30. </view>
  31. </uv-popup>
  32. </view>
  33. </template>
  34. <script>
  35. import formInput from '@/pages_order/components/formInput.vue'
  36. export default {
  37. components: {
  38. formInput,
  39. },
  40. data() {
  41. return {
  42. id: null,
  43. form: {
  44. trackingNo: null,
  45. },
  46. rules: {
  47. 'trackingNo': {
  48. type: 'string',
  49. required: true,
  50. message: '请输入联系人',
  51. },
  52. },
  53. formItemStyle: { padding: 0 },
  54. }
  55. },
  56. methods: {
  57. open(id) {
  58. this.id = id
  59. this.$refs.popup.open()
  60. },
  61. close() {
  62. this.$refs.popup.close()
  63. },
  64. async onConfirm() {
  65. try {
  66. const res = await this.$refs.form.validate()
  67. console.log('onConfirm res', res)
  68. // todo: save
  69. this.$emit('submitted')
  70. this.close()
  71. } catch (err) {
  72. console.log('onConfirm err', err)
  73. }
  74. },
  75. },
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .popup__view {
  80. width: 100vw;
  81. display: flex;
  82. flex-direction: column;
  83. box-sizing: border-box;
  84. background: #FFFFFF;
  85. border-top-left-radius: 32rpx;
  86. border-top-right-radius: 32rpx;
  87. }
  88. .header {
  89. position: relative;
  90. width: 100%;
  91. padding: 24rpx 0;
  92. box-sizing: border-box;
  93. border-bottom: 2rpx solid #EEEEEE;
  94. .title {
  95. font-family: PingFang SC;
  96. font-weight: 500;
  97. font-size: 34rpx;
  98. line-height: 1.4;
  99. color: #181818;
  100. }
  101. .btn {
  102. font-family: PingFang SC;
  103. font-weight: 500;
  104. font-size: 32rpx;
  105. line-height: 1.4;
  106. color: #8B8B8B;
  107. position: absolute;
  108. top: 26rpx;
  109. left: 40rpx;
  110. }
  111. }
  112. .form {
  113. padding: 32rpx 40rpx;
  114. &-item {
  115. padding: 8rpx 0 6rpx 0;
  116. & + & {
  117. padding-top: 24rpx;
  118. border-top: 2rpx solid #EEEEEE;
  119. }
  120. &-label {
  121. margin-bottom: 14rpx;
  122. font-family: PingFang SC;
  123. font-weight: 400;
  124. font-size: 26rpx;
  125. line-height: 1.4;
  126. color: #181818;
  127. }
  128. &-content {
  129. .placeholder {
  130. color: #C6C6C6;
  131. font-size: 32rpx;
  132. font-weight: 400;
  133. }
  134. .region {
  135. min-height: 44rpx;
  136. justify-content: flex-start;
  137. }
  138. }
  139. }
  140. }
  141. .footer {
  142. width: 100%;
  143. // todo:check
  144. // height: 214rpx;
  145. padding: 32rpx 40rpx;
  146. box-sizing: border-box;
  147. border-top: 2rpx solid #F1F1F1;
  148. .btn {
  149. width: 100%;
  150. padding: 16rpx 0;
  151. font-family: PingFang SC;
  152. font-weight: 500;
  153. font-size: 36rpx;
  154. line-height: 1.4;
  155. color: #FFFFFF;
  156. background-image: linear-gradient(to right, #4B348F, #845CFA);
  157. border-radius: 41rpx;
  158. }
  159. }
  160. </style>