stayCheck.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="新增订单" :showIcon="true"></c-nav-bar>
  4. <view class="box">
  5. <u-form :model="form" ref="form">
  6. <u-form-item label="姓名" prop="guestName" label-width="172rpx" border-bottom>
  7. <u-input border="false" v-model="form.guestName" placeholder="请输入姓名"/>
  8. </u-form-item>
  9. <u-form-item label="手机号码" prop="guestPhone" label-width="172rpx" border-bottom>
  10. <u-input border="false" v-model="form.guestPhone" placeholder="请输入手机号"/>
  11. </u-form-item>
  12. <u-form-item label="证件类型" label-width="172rpx" border-bottom>
  13. <view class="personInfo" @click.native="show=true">
  14. <text style="font-size: 30rpx;">{{form.idName}}</text>
  15. <!-- 证件下拉框 -->
  16. <u-picker :itemHeight="88" :immediateChange="true" :show="show" :columns="list" keyName="label"
  17. :defaultIndex="passengerDefault" @cancel="show=false;"
  18. @confirm="passengerConfirm"></u-picker>
  19. <!-- <u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select> -->
  20. <u-icon name="arrow-right" ></u-icon>
  21. </view>
  22. </u-form-item>
  23. <u-form-item label="证件号" prop="idCard" label-width="172rpx" border-bottom>
  24. <u-input border="false" v-model="form.idCard" placeholder="请输入证件号"/>
  25. </u-form-item>
  26. <u-form-item class="delete" >
  27. <view class="delete" @click="del">
  28. <u-icon name="trash"></u-icon>
  29. <text style="font-size: 30rpx;">删除</text>
  30. </view>
  31. </u-form-item>
  32. </u-form>
  33. </view>
  34. <!-- 添加入住人 -->
  35. <view class="addPerson">
  36. <u-icon name="plus" color="#2979ff"></u-icon>添加入住人
  37. </view>
  38. <!-- 按钮 -->
  39. <!-- 按钮 -->
  40. <view class="yes" @click.native="submit">
  41. 确定
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default{
  47. data(){
  48. return {
  49. passengerDefault:[0],
  50. form:{
  51. guestPhone:'',
  52. idCard:'',
  53. idName:'',
  54. guestName:'',
  55. },
  56. orderInfo:[],
  57. orderId:null,
  58. show: false,
  59. list: [[
  60. {
  61. value: '1',
  62. label: '身份证'
  63. },
  64. {
  65. value: '2',
  66. label: '居住证'
  67. }]
  68. ],
  69. }
  70. },
  71. onLoad({id}){
  72. console.log(id)
  73. this.orderId=id
  74. console.log(this.orderId)
  75. this.getOrderInfo()
  76. },
  77. methods:{
  78. passengerConfirm(e){
  79. this.form.idName=e.value[0].label
  80. },
  81. // 证件下拉菜单
  82. showCardChoose(){
  83. console.log(11)
  84. this.show=true
  85. },
  86. // 订单数据回显
  87. getOrderInfo(){
  88. this.$api.get(`/merchant/hotel/order/getMerchantOrderInfo/${this.orderId}`,{
  89. orderId:this.orderId
  90. }).then((res)=>{
  91. console.log(res)
  92. if(res.data.code==0){
  93. this.orderInfo = res.data.data
  94. // console.log(this.orderInfo)
  95. this.form.guestName=res.data.data.guestName
  96. this.form.guestPhone=res.data.data.guestPhone
  97. }
  98. })
  99. },
  100. del(){
  101. this.form.guestName=''
  102. this.form.idCard=''
  103. this.form.guestPhone=''
  104. },
  105. submit(){
  106. uni.navigateTo({
  107. url:'/pages/house/orderInfo'
  108. })
  109. },
  110. }
  111. // onReady(){
  112. // this.$refs.form.setRules(this.rules)
  113. // }
  114. }
  115. </script>
  116. <style lang="scss">
  117. .page {
  118. background: #F3F4F4;
  119. padding-bottom: 260rpx;
  120. box-sizing: border-box;
  121. overflow-y: auto;
  122. overflow-x: auto;
  123. }
  124. .box{
  125. background-color: #fff;
  126. margin: 0 auto 20rpx;
  127. border-radius: 10rpx;
  128. width: 92%;
  129. padding: 0 30rpx;
  130. margin-top: 20rpx;
  131. }
  132. .tit {
  133. font-size: 32rpx;
  134. font-weight: bold;
  135. color: #333;
  136. }
  137. .del{
  138. display: flex;
  139. justify-content: center;
  140. align-items: center;
  141. width: 100%;
  142. height: 102rpx;
  143. background-color: #fff;
  144. font-size: 30rpx
  145. }
  146. .addPerson{
  147. // margin: 0 auto ;
  148. width: 92%;
  149. height: 100rpx;
  150. margin-left: 30rpx;
  151. // margin-top: 20rpx;
  152. background-color: #fff;
  153. border-radius: 10rpx;
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. font-size: 30rpx;
  158. color: #1372FF;
  159. }
  160. .yes{
  161. display: flex;
  162. justify-content: center;
  163. align-items: center;
  164. width: 690rpx;
  165. height: 96rpx;
  166. background-color: #1372FF;
  167. border-radius: 48rpx;
  168. position: fixed;
  169. bottom: 10%;
  170. margin-left: 30rpx;
  171. color: #fff;
  172. font-size: 34rpx;
  173. // line-height: 96rpx;
  174. // margin-top: 200rpx;
  175. }
  176. .delete{
  177. display: flex;
  178. justify-content: center;
  179. align-items: center;
  180. }
  181. .personInfo{
  182. padding-left: 15rpx;
  183. display: flex;
  184. align-items: center;
  185. justify-content: space-between;
  186. }
  187. </style>