registration.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view >
  3. <ujp-navbar title="无牌车辆扫码停车" :is-back="false" ></ujp-navbar>
  4. <view class="main">
  5. <view class="park-name" v-if="detail.parkName">
  6. <img src="@/assets/static/img/if-location-pin@2x.png" alt="">
  7. <text>{{detail.parkName}}</text>
  8. </view>
  9. <view class="unlabeled" >
  10. 无牌车
  11. </view>
  12. <view class="bus-number" v-if="detail.id">
  13. {{detail.carNum}}
  14. </view>
  15. <view class="bus-number" v-if="!detail.id">
  16. {{message}}
  17. </view>
  18. </view>
  19. <view v-if="detail.inParkingStatus==1" style="
  20. text-align: center;
  21. font-size: 30px;
  22. font-weight: bold;
  23. ">
  24. 车辆已进场
  25. </view>
  26. <u-button v-if="detail.inParkingStatus==0" @click="submit" >请求进场</u-button>
  27. <view class="notice" v-if="txt">
  28. <view class="title">
  29. 停车场须知
  30. </view>
  31. <p v-html="txt"></p>
  32. </view>
  33. <view class="notice" >
  34. <view class="title">
  35. 停车场须知
  36. </view>
  37. <h3 style="color:red">入住酒店客户请截图保留此页面</h3>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import * as API from '@/apis/parking.js'
  43. import * as newsApi from '@/apis/news.js'
  44. export default {
  45. data() {
  46. return {
  47. channelId:'',
  48. detail:{},
  49. message:"",
  50. txt:''
  51. }
  52. },onLoad(op) {
  53. this.getNewsInfoDetail()
  54. if(op.id){
  55. this.channelId=op.id
  56. this.getInfo()
  57. }else{
  58. uni.showModal({
  59. content:"参数错误"
  60. })
  61. }
  62. }, methods: {
  63. getNewsInfoDetail() {
  64. newsApi.findConfigureByKey({
  65. key:'parking-registration-txt'
  66. }).then((res) => {
  67. this.txt = res.data.value;
  68. }).catch(error => {
  69. uni.showToast({
  70. title: error,
  71. icon: "none"
  72. })
  73. })
  74. },
  75. submit(){
  76. uni.showLoading({
  77. title: "加载中",
  78. mask: true,
  79. })
  80. API.temporaryCarNumInPark({
  81. id: this.detail.id,
  82. openId: this.carhelp.getOpenId(),
  83. channelId:this.channelId
  84. }).then(data => {
  85. var obj=data.data;
  86. this.carhelp.set("parkingregistration_submit",obj)
  87. uni.reLaunch({
  88. url:'/pages/parking/request'
  89. })
  90. }).catch(error => {
  91. uni.hideLoading()
  92. uni.showToast({
  93. title: error,
  94. icon: "none"
  95. })
  96. })
  97. },
  98. getInfo(){
  99. uni.showLoading({
  100. title: "加载中",
  101. mask: true,
  102. })
  103. API.generateTemporaryCarNum({
  104. openId:this.carhelp.getOpenId(),
  105. channelId:this.channelId
  106. }).then((res) => {
  107. uni.hideLoading();
  108. this.detail = res.data;
  109. if(this.detail.status==2){
  110. uni.reLaunch({
  111. url:'/pages/parking/outPayment?id='+this.channelId
  112. })
  113. }
  114. }).catch(error => {
  115. uni.hideLoading()
  116. this.message=error
  117. })
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .main{
  124. padding: 20px 0px 28px 23px;
  125. background: linear-gradient(#1F55FF,#27ABFF);
  126. .park-name{
  127. line-height: 20px;
  128. color: rgba(255, 255, 255, 100);
  129. font-size: 20px;
  130. position: relative;
  131. text{
  132. margin-left: 25px;
  133. }
  134. img{
  135. width: 20px;
  136. height: 20px;
  137. margin-right: 8px;
  138. position: absolute;
  139. }
  140. }
  141. .unlabeled{
  142. line-height: 36px;
  143. color: rgba(255, 255, 255, 100);
  144. font-size: 36px;
  145. margin-top: 28px;
  146. }
  147. .bus-number{
  148. line-height: 48px;
  149. color: rgba(255, 255, 255, 100);
  150. font-size: 48px;
  151. margin-top: 20px;
  152. }
  153. }
  154. .u-btn{
  155. width: 89.3% ;
  156. background-color:#005AD9;
  157. color: #ffffff;
  158. border-radius: 12px;
  159. margin-top: 20px;
  160. }
  161. .notice{
  162. padding: 20px 23px;
  163. .title{
  164. font-size: 16px;
  165. color: #101010;
  166. }
  167. p{
  168. color: #666666;
  169. margin-top: 8px;
  170. }
  171. }
  172. </style>