checkOut.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="page-content">
  3. <u-gap height="10" bg-color="#f8f8f8"></u-gap>
  4. <u-field
  5. class="field-item"
  6. v-model="storeName"
  7. disabled
  8. input-align="right"
  9. label="收取门店"
  10. placeholder="请填写手机号"
  11. >
  12. </u-field>
  13. <u-field
  14. v-model="remarks"
  15. label="备注"
  16. input-align="right"
  17. auto-height
  18. placeholder="请填写备注(最多500个字符)"
  19. type="textarea"
  20. >
  21. </u-field>
  22. <view class="num-cont">
  23. <text>支付数量</text>
  24. <view class="num-input">
  25. <u-input v-model="number" @click="inputNum('num')" type="number" placeholder="请输入数量" />
  26. <text>个乐豆</text>
  27. </view>
  28. </view>
  29. <u-gap height="50" bg-color="#f8f8f8"></u-gap>
  30. <view class="pay-btn">
  31. <u-button @click="handlePay" type="error" >确认支付</u-button>
  32. </view>
  33. <!-- 确认支付弹窗 -->
  34. <u-popup mode="center" closeable v-model="showPayModal" width="500rpx" >
  35. <view class="slot-content">
  36. <view>请输入支付密码</view>
  37. <view class="text-cont">
  38. <view>
  39. <text>收取门店:</text>
  40. <text>{{storeName}}</text>
  41. </view>
  42. <view>
  43. <text>支付数量:</text>
  44. <text><text class="num-big">{{number}}</text>个乐豆</text>
  45. </view>
  46. <view>
  47. <text>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</text>
  48. <text>{{remarks||'--'}}</text>
  49. </view>
  50. </view>
  51. <view class="footer">
  52. <u-input v-model="password" @click="inputNum('psw')" type="password" placeholder="请输入支付密码" />
  53. </view>
  54. </view>
  55. </u-popup>
  56. <u-keyboard mode="number"
  57. safe-area-inset-bottom
  58. v-model="showKeyboard"
  59. @change="handleChange"
  60. @backspace="handleBack"
  61. @confirm="showKeyboard=false"
  62. @cancel="showKeyboard=false">
  63. </u-keyboard>
  64. </view>
  65. </template>
  66. <script>
  67. export default{
  68. data() {
  69. return {
  70. storeName: '和超级大黄蜂发挥教师的回复', // 门店名称
  71. remarks: '', // 备注
  72. number: '', // 支付数量
  73. showPayModal: false, // 支付弹窗
  74. password: '', // 支付密码
  75. showKeyboard: false, // 数字键盘
  76. keyInputType: '' // 适用数字键盘输入关联的文本框 num:乐豆数量 psw: 支付密码
  77. }
  78. },
  79. onLoad() {
  80. },
  81. methods: {
  82. // 打开数字键盘
  83. inputNum(type) {
  84. this.keyInputType = type
  85. this.showKeyboard = true
  86. },
  87. // 数字键盘输入改变
  88. handleChange (val) {
  89. if (this.keyInputType == 'num') {
  90. this.number += val
  91. } else {
  92. this.password += val
  93. }
  94. console.log(this.value)
  95. },
  96. // 数字键盘退格键
  97. handleBack () {
  98. },
  99. // 确认支付
  100. handlePay() {
  101. this.showPayModal = true
  102. }
  103. },
  104. }
  105. </script>
  106. <style lang="less">
  107. page{
  108. height: 100%;
  109. }
  110. .page-content{
  111. width: 100%;
  112. height: 100%;
  113. background-color: #fff;
  114. .num-cont{
  115. width: 100%;
  116. padding: 30upx;
  117. .num-input{
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. >u-input {
  122. width: 300upx;
  123. border-bottom: 1px solid #f8f8f8;
  124. }
  125. }
  126. }
  127. .pay-btn{
  128. padding: 0 30upx;
  129. }
  130. }
  131. .slot-content{
  132. padding: 30upx 0;
  133. display: flex;
  134. flex-direction: column;
  135. align-items: center;
  136. justify-content: space-between;
  137. .text-cont{
  138. width: 100%;
  139. margin-top: 20upx;
  140. border-bottom: 1px solid #F8F8F8;
  141. >view {
  142. padding: 20upx 40upx;
  143. display: flex;
  144. >text{
  145. &:last-child {
  146. flex: 1;
  147. padding-left: 30upx;
  148. }
  149. .num-big{
  150. font-size: 36upx;
  151. color: red;
  152. }
  153. }
  154. }
  155. }
  156. .footer{
  157. width: 50%;
  158. border-bottom: 1px solid #b1b1b1;
  159. }
  160. }
  161. </style>