PannelItem.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="status">
  3. <view class="circle">
  4. <image :src="flag?'/static/change/green.png':'/static/change/yellow.png'"></image>
  5. </view>
  6. <view class="descript">{{ words }}</view>
  7. <view class="frame">
  8. <span :class="[flag?'':'isflag']">{{status || '—'}}</span>
  9. <view class="shinning"></view>
  10. </view>
  11. <view class="submit" v-if="words=='暂停状态'" @click="HandleSwapplc(4)">暂停</view>
  12. <view class="submit" v-if="words=='暂停状态'" @click="HandleSwapplc(5)">恢复</view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: "PannelItem",
  18. props: ['flag', 'words', 'status'],
  19. data() {
  20. return {
  21. };
  22. },
  23. methods: {
  24. //暂停,恢复
  25. HandleSwapplc(id) {
  26. let title=id===4?'暂停机器人':'恢复机器人'
  27. let that=this
  28. uni.showModal({
  29. title:`请确认${title}?`,
  30. content:'',
  31. success: function(res) {
  32. if (res.confirm) {
  33. that.$http.EditSwapplc(id+'').then(res=>{
  34. if(res.code === 0){
  35. that.$emit('ExchangeMessage','success',id===4?'暂停成功!':'恢复成功!')
  36. }else{
  37. that.$emit('ExchangeMessage','error',id===4?'暂停失败!':'恢复失败!')
  38. }
  39. })
  40. } else if (res.cancel) {
  41. return false
  42. //用户点击取消按钮触发
  43. }
  44. }
  45. })
  46. },
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .submit{
  52. width: 60px;
  53. height: 32px;
  54. text-align: center;
  55. background: #91FDB9;
  56. border-radius: 2px;
  57. line-height: 32px;
  58. margin-left: 16px;
  59. font-size: 14px;
  60. font-weight: 400;
  61. color: #000000;
  62. }
  63. .status {
  64. display: flex;
  65. width: 100%;
  66. align-items: center;
  67. .circle {
  68. width: 24px;
  69. height: 24px;
  70. margin-right: 4px;
  71. image {
  72. width: 24px;
  73. height: 24px;
  74. }
  75. }
  76. .descript {
  77. font-size: 14px;
  78. font-weight: 500;
  79. width: 78px;
  80. color: rgba(153,174,197,0.65);
  81. text-shadow: 0px 0px 4px rgba(39,69,201,0.5);
  82. }
  83. .carTitle{
  84. width: 68px !important;
  85. }
  86. .frameText {
  87. color: #C7D2DF;
  88. text-shadow: 0px 0px 4px #0027D8;
  89. }
  90. .frame {
  91. flex: 1;
  92. position: relative;
  93. height: 32px;
  94. text-indent: 15px;
  95. font-size: 14px;
  96. font-weight: 500;
  97. color: #91FDB9;
  98. line-height: 32px;
  99. text-shadow: 0px 0px 4px #0027D8;
  100. border: 1px solid #334568;
  101. box-sizing: border-box;
  102. .shinning {
  103. position: absolute;
  104. border: 1px solid #c9f8ff;
  105. border-radius: 1px;
  106. left: -1px;
  107. top: -1px;
  108. }
  109. .editCar {
  110. cursor: pointer;
  111. position: absolute;
  112. right: 20px;
  113. top: 3px;
  114. width: 18px;
  115. height: 18px;
  116. img {
  117. width: 18px;
  118. height: 18px;
  119. }
  120. }
  121. .isflag {
  122. color: #ED7735;
  123. text-shadow: 0px 0px 4px rgba(39, 69, 201, 0.5);
  124. }
  125. .isblue {
  126. color: #148CFA;
  127. }
  128. .btn {
  129. display: flex;
  130. position: absolute;
  131. right: 15px;
  132. top: 5px;
  133. button {
  134. width: 48px;
  135. height: 28px;
  136. background: #91FDB9;
  137. border-radius: 2px 2px 2px 2px;
  138. font-size: 16px;
  139. font-weight: 400;
  140. line-height: 28px;
  141. text-align: center;
  142. border: none;
  143. padding: 0;
  144. color: black;
  145. }
  146. button:hover {
  147. background: #69b889;
  148. }
  149. }
  150. }
  151. }
  152. </style>