registration.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view >
  3. <u-navbar title="无牌车辆扫码停车" :is-back="false" ></u-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" v-if="titleShow">
  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. idList: [
  48. '1597417780772667394',
  49. '1597520273619877889',
  50. '1597419066154876929',
  51. '1598241772815319041'
  52. ],
  53. titleShow: false,
  54. channelId:'',
  55. detail:{},
  56. message:"",
  57. txt:''
  58. }
  59. },onLoad(op) {
  60. this.getNewsInfoDetail()
  61. if(op.id){
  62. this.channelId=op.id
  63. for (var i = 0; i < this.idList.length; i++) {
  64. if(this.idList[i] == this.channelId) {
  65. this.titleShow = true;
  66. }
  67. }
  68. this.getInfo()
  69. }else{
  70. uni.showModal({
  71. content:"参数错误"
  72. })
  73. }
  74. }, methods: {
  75. getNewsInfoDetail() {
  76. newsApi.findConfigureByKey({
  77. key:'parking-registration-txt'
  78. }).then((res) => {
  79. this.txt = res.data.value;
  80. }).catch(error => {
  81. uni.showToast({
  82. title: error,
  83. icon: "none"
  84. })
  85. })
  86. },
  87. submit(){
  88. uni.showLoading({
  89. title: "加载中",
  90. mask: true,
  91. })
  92. API.temporaryCarNumInPark({
  93. id: this.detail.id,
  94. openId: this.carhelp.getOpenId(),
  95. channelId:this.channelId
  96. }).then(data => {
  97. var obj=data.data;
  98. this.carhelp.set("parkingregistration_submit",obj)
  99. uni.reLaunch({
  100. url:'/pages/parking/request'
  101. })
  102. }).catch(error => {
  103. uni.hideLoading()
  104. uni.showToast({
  105. title: error,
  106. icon: "none"
  107. })
  108. })
  109. },
  110. getInfo(){
  111. uni.showLoading({
  112. title: "加载中",
  113. mask: true,
  114. })
  115. API.generateTemporaryCarNum({
  116. openId:this.carhelp.getOpenId(),
  117. channelId:this.channelId
  118. }).then((res) => {
  119. uni.hideLoading();
  120. this.detail = res.data;
  121. if(this.detail.status==2){
  122. uni.reLaunch({
  123. url:'/pages/parking/outPayment?id='+this.channelId
  124. })
  125. }
  126. }).catch(error => {
  127. uni.hideLoading()
  128. this.message=error
  129. })
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. .main{
  136. padding: 20px 0px 28px 23px;
  137. background: linear-gradient(#1F55FF,#27ABFF);
  138. .park-name{
  139. line-height: 20px;
  140. color: rgba(255, 255, 255, 100);
  141. font-size: 20px;
  142. position: relative;
  143. text{
  144. margin-left: 25px;
  145. }
  146. img{
  147. width: 20px;
  148. height: 20px;
  149. margin-right: 8px;
  150. position: absolute;
  151. }
  152. }
  153. .unlabeled{
  154. line-height: 36px;
  155. color: rgba(255, 255, 255, 100);
  156. font-size: 36px;
  157. margin-top: 28px;
  158. }
  159. .bus-number{
  160. line-height: 48px;
  161. color: rgba(255, 255, 255, 100);
  162. font-size: 48px;
  163. margin-top: 20px;
  164. }
  165. }
  166. .u-btn{
  167. width: 89.3% ;
  168. background-color:#005AD9;
  169. color: #ffffff;
  170. border-radius: 12px;
  171. margin-top: 20px;
  172. }
  173. .notice{
  174. padding: 20px 23px;
  175. .title{
  176. font-size: 16px;
  177. color: #101010;
  178. }
  179. p{
  180. color: #666666;
  181. margin-top: 8px;
  182. }
  183. }
  184. </style>