PannelTitle.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view class="status">
  3. <view class="circle">
  4. <image :src="flag?'/static/change/green.png':'/static/change/yellow.png'" v-if="!circle"></image>
  5. </view>
  6. <view class="descript carTitle">{{ words }}</view>
  7. <view class="frame" @click="words=='车牌号'?ShowEditCar(value):''">
  8. <span :class="[Isblue?'frameText':flag?'':'isflag']">{{value || '—'}}</span>
  9. <view class="shinning"></view>
  10. </view>
  11. <view v-if="words=='车牌号'" @click="refresh" class="submit">刷新</view>
  12. <view v-if="words=='在线车辆'" @click="handleCarShow" class="submit">查看</view>
  13. <view v-if="words=='车辆识别'" @click="handleStatusShow" class="submit">查看</view>
  14. <view class="btnBox">
  15. <view class="submit" v-if="words=='解锁状态'" @click="HandlerDownLock">解锁</view>
  16. <view class="submit unlock" v-if="words=='解锁状态'" @click="HandleOnLock">上锁</view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name: "PannelTitle",
  23. data() {
  24. return {
  25. };
  26. },
  27. props: ['words', 'value', 'flag', 'Isblue', 'circle'],
  28. methods: {
  29. //修改车牌号
  30. ShowEditCar(plate) {
  31. this.$emit('ShowCarline',plate)
  32. },
  33. handleStatusShow() {
  34. this.$emit('handleStatusShow')
  35. },
  36. //车牌号刷新
  37. refresh(){
  38. let that=this
  39. uni.showModal({
  40. title:`是否重新检测车辆?`,
  41. content:'',
  42. success: function(res) {
  43. if (res.confirm) {
  44. that.$http.getRefresh().then(res=>{
  45. that.$emit('ExchangeMessage',res.code === 0?'success':'error',res.code === 0?'刷新成功!':'刷新失败!')
  46. })
  47. } else if (res.cancel) {
  48. return false
  49. //用户点击取消按钮触发
  50. }
  51. }
  52. })
  53. },
  54. //车辆上锁
  55. HandleOnLock() {
  56. let that=this
  57. uni.showModal({
  58. title:`请确认对车辆上锁?`,
  59. content:'',
  60. success: function(res) {
  61. if (res.confirm) {
  62. that.$http.Updatelock().then(res=>{
  63. that.$emit('ExchangeMessage',res.code === 0?'success':'error',res.code === 0?'上锁成功!':'上锁失败!')
  64. })
  65. } else if (res.cancel) {
  66. return false
  67. //用户点击取消按钮触发
  68. }
  69. }
  70. })
  71. },
  72. //车辆解锁
  73. HandlerDownLock() {
  74. let that=this
  75. uni.showModal({
  76. title:`请确认对车辆解锁?`,
  77. content:'',
  78. success: function(res) {
  79. if (res.confirm) {
  80. that.$http.Updateunlock().then(res=>{
  81. that.$emit('ExchangeMessage',res.code === 0?'success':'error',res.code === 0?'解锁成功!':'解锁失败!')
  82. })
  83. } else if (res.cancel) {
  84. return false
  85. //用户点击取消按钮触发
  86. }
  87. }
  88. })
  89. },
  90. //在线车辆
  91. handleCarShow() {
  92. this.$emit('ShowCarline','line');
  93. }
  94. },
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .submit{
  99. width: 60px;
  100. height: 32px;
  101. text-align: center;
  102. background: #91FDB9;
  103. border-radius: 2px;
  104. line-height: 32px;
  105. margin-left: 16px;
  106. font-size: 14px;
  107. font-weight: 400;
  108. color: #000000;
  109. }
  110. .status {
  111. display: flex;
  112. width: 100%;
  113. align-items: center;
  114. position: relative;
  115. .circle {
  116. width: 24px;
  117. height: 24px;
  118. margin-right: 4px;
  119. image {
  120. width: 24px;
  121. height: 24px;
  122. }
  123. }
  124. .descript {
  125. font-size: 14px;
  126. font-weight: 500;
  127. width: 78px;
  128. color: rgba(153,174,197,0.65);
  129. text-shadow: 0px 0px 4px rgba(39,69,201,0.5);
  130. }
  131. .carTitle{
  132. width: 75px !important;
  133. }
  134. .frameText {
  135. color: #C7D2DF;
  136. text-shadow: 0px 0px 4px #0027D8;
  137. position: relative;
  138. left: -4px;
  139. }
  140. .frame {
  141. flex: 1;
  142. position: relative;
  143. height: 32px;
  144. text-indent: 8px;
  145. font-size: 13px;
  146. font-weight: 500;
  147. color: #91FDB9;
  148. line-height: 32px;
  149. text-shadow: 0px 0px 4px #0027D8;
  150. border: 1px solid #334568;
  151. box-sizing: border-box;
  152. .shinning {
  153. position: absolute;
  154. border: 1px solid #c9f8ff;
  155. border-radius: 1px;
  156. left: -1px;
  157. top: -1px;
  158. }
  159. .editCar {
  160. cursor: pointer;
  161. position: absolute;
  162. right: 20px;
  163. top: 3px;
  164. width: 18px;
  165. height: 18px;
  166. img {
  167. width: 18px;
  168. height: 18px;
  169. }
  170. }
  171. .isflag {
  172. color: #ED7735;
  173. text-shadow: 0px 0px 4px rgba(39, 69, 201, 0.5);
  174. }
  175. .isblue {
  176. color: #148CFA;
  177. }
  178. .btn {
  179. display: flex;
  180. position: absolute;
  181. right: 15px;
  182. top: 5px;
  183. button {
  184. width: 48px;
  185. height: 28px;
  186. background: #91FDB9;
  187. border-radius: 2px 2px 2px 2px;
  188. font-size: 16px;
  189. font-weight: 400;
  190. line-height: 28px;
  191. text-align: center;
  192. border: none;
  193. padding: 0;
  194. color: black;
  195. }
  196. button:hover {
  197. background: #69b889;
  198. }
  199. }
  200. }
  201. }
  202. .btnBox{
  203. display: flex;
  204. position: absolute;
  205. right: 0;
  206. .submit{
  207. width: 45px;
  208. height: 26px;
  209. line-height: 26px;
  210. margin-left: 0px;
  211. margin-right: 10px;
  212. }
  213. .unlock{
  214. margin-right: 0px;
  215. }
  216. }
  217. </style>