registration.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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="../../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>
  34. </template>
  35. <script>
  36. import * as API from '@/apis/parking.js'
  37. import * as newsApi from '@/apis/news.js'
  38. export default {
  39. data() {
  40. return {
  41. channelId:'',
  42. detail:{},
  43. message:"",
  44. txt:''
  45. }
  46. },onLoad(op) {
  47. this.getNewsInfoDetail()
  48. if(op.id){
  49. this.channelId=op.id
  50. this.getInfo()
  51. }else{
  52. uni.showModal({
  53. content:"参数错误"
  54. })
  55. }
  56. }, methods: {
  57. getNewsInfoDetail() {
  58. newsApi.findConfigureByKey({
  59. key:'parking-registration-txt'
  60. }).then((res) => {
  61. this.txt = res.data.value;
  62. }).catch(error => {
  63. uni.showToast({
  64. title: error,
  65. icon: "none"
  66. })
  67. })
  68. },
  69. submit(){
  70. uni.showLoading({
  71. title: "加载中",
  72. mask: true,
  73. })
  74. API.temporaryCarNumInPark({
  75. id: this.detail.id,
  76. openId: this.carhelp.getOpenId(),
  77. channelId:this.channelId
  78. }).then(data => {
  79. var obj=data.data;
  80. this.carhelp.set("parkingregistration_submit",obj)
  81. uni.reLaunch({
  82. url:'/pages/parking/request'
  83. })
  84. }).catch(error => {
  85. uni.hideLoading()
  86. uni.showToast({
  87. title: error,
  88. icon: "none"
  89. })
  90. })
  91. },
  92. getInfo(){
  93. uni.showLoading({
  94. title: "加载中",
  95. mask: true,
  96. })
  97. API.generateTemporaryCarNum({
  98. openId:this.carhelp.getOpenId(),
  99. channelId:this.channelId
  100. }).then((res) => {
  101. uni.hideLoading();
  102. this.detail = res.data;
  103. if(this.detail.status==2){
  104. uni.reLaunch({
  105. url:'/pages/parking/outPayment?id='+this.channelId
  106. })
  107. }
  108. }).catch(error => {
  109. uni.hideLoading()
  110. this.message=error
  111. })
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .main{
  118. padding: 20px 0px 28px 23px;
  119. background: linear-gradient(#1F55FF,#27ABFF);
  120. .park-name{
  121. line-height: 20px;
  122. color: rgba(255, 255, 255, 100);
  123. font-size: 20px;
  124. position: relative;
  125. text{
  126. margin-left: 25px;
  127. }
  128. img{
  129. width: 20px;
  130. height: 20px;
  131. margin-right: 8px;
  132. position: absolute;
  133. }
  134. }
  135. .unlabeled{
  136. line-height: 36px;
  137. color: rgba(255, 255, 255, 100);
  138. font-size: 36px;
  139. margin-top: 28px;
  140. }
  141. .bus-number{
  142. line-height: 48px;
  143. color: rgba(255, 255, 255, 100);
  144. font-size: 48px;
  145. margin-top: 20px;
  146. }
  147. }
  148. .u-btn{
  149. width: 89.3% ;
  150. background-color:#005AD9;
  151. color: #ffffff;
  152. border-radius: 12px;
  153. margin-top: 20px;
  154. }
  155. .notice{
  156. padding: 20px 23px;
  157. .title{
  158. font-size: 16px;
  159. color: #101010;
  160. }
  161. p{
  162. color: #666666;
  163. margin-top: 8px;
  164. }
  165. }
  166. </style>