PannelTitle.vue 4.9 KB

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