windrectAnimate.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view style="width: 100%; height: 100%">
  3. <div class="checkwind-echarts-div" v-if="windType == 'windrect_rect'">
  4. <div class="checkwind">
  5. <div
  6. class="sub_line"
  7. v-bind:class="
  8. state == '0'
  9. ? 'top_state'
  10. : state == '1'
  11. ? 'middle_state'
  12. : state == '2'
  13. ? 'bottom_state'
  14. : 'bottom_state'
  15. "
  16. id="subline"
  17. ></div>
  18. </div>
  19. </div>
  20. <div class="checkwind-echarts-div" v-if="windType == 'windrect_ds'">
  21. <div class="checkwind_ds">
  22. <div
  23. class="sub_line"
  24. v-bind:class="
  25. state == '0'
  26. ? 'top_state'
  27. : state == '1'
  28. ? 'middle_state'
  29. : state == '2'
  30. ? 'bottom_state'
  31. : 'bottom_state'
  32. "
  33. id="subline"
  34. ></div>
  35. <div
  36. class="sub_line1"
  37. v-bind:class="
  38. state == '0'
  39. ? 'top_state1'
  40. : state == '1'
  41. ? 'middle_state1'
  42. : state == '2'
  43. ? 'bottom_state1'
  44. : 'bottom_state1'
  45. "
  46. id="subline1"
  47. ></div>
  48. <div
  49. class="sub_line2"
  50. v-bind:class="
  51. state == '0'
  52. ? 'top_state2'
  53. : state == '1'
  54. ? 'middle_state2'
  55. : state == '2'
  56. ? 'bottom_state2'
  57. : 'bottom_state2'
  58. "
  59. id="subline2"
  60. ></div>
  61. </div>
  62. </div>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. height: "200px",
  70. };
  71. },
  72. props: ["state", "title", "height", "type"],
  73. computed: {
  74. // 兼容后端 deviceType 的多种写法:windrect / windrect_rect / windrect_ds / sys_windrect_* 等
  75. windType() {
  76. const t = String(this.type || "").toLowerCase();
  77. if (t.indexOf("windrect") === -1) {
  78. return "";
  79. }
  80. return t.indexOf("ds") > -1 ? "windrect_ds" : "windrect_rect";
  81. },
  82. },
  83. methods: {},
  84. onLoad(query) {},
  85. };
  86. </script>
  87. <style scoped>
  88. /*门里面*/
  89. div.checkwind {
  90. position: relative;
  91. width: 480rpx;
  92. height: 480rpx;
  93. margin: 0 auto;
  94. overflow: hidden;
  95. background-image: url(/static/wind.png);
  96. background-size: 100% 100%;
  97. perspective: 2400rpx;
  98. }
  99. /*左门/右门*/
  100. div.checkwind .sub_line {
  101. margin-top: 30rpx;
  102. margin-left: 30rpx;
  103. width: 426rpx;
  104. height: 90rpx;
  105. box-sizing: border-box;
  106. float: left;
  107. z-index: 1;
  108. transition: all 2s ease;
  109. background-image: url(/static/line.png);
  110. background-size: 100% 100%;
  111. }
  112. div.checkwind .sub_line {
  113. transform-origin: left center;
  114. border-right: 3rpx solid rgb(8, 8, 8);
  115. }
  116. .checkwind .top_state {
  117. transform: translateY(15rpx);
  118. }
  119. .checkwind .middle_state {
  120. transform: translateY(135rpx);
  121. }
  122. .checkwind .bottom_state {
  123. transform: translateY(270rpx);
  124. }
  125. </style>
  126. <style scoped>
  127. /*门里面*/
  128. div.checkwind_ds {
  129. position: relative;
  130. width: 500rpx;
  131. height: 460rpx;
  132. margin: 0 auto;
  133. overflow: hidden;
  134. background-image: url(/static/wind.png);
  135. background-size: 100% 100%;
  136. perspective: 2400rpx;
  137. }
  138. /*左门/右门*/
  139. div.checkwind_ds .sub_line {
  140. margin-top: 30rpx;
  141. margin-left: 24rpx;
  142. width: 540rpx;
  143. height: 75rpx;
  144. box-sizing: border-box;
  145. float: left;
  146. z-index: 1;
  147. transition: all 2s ease;
  148. background-image: url(/static/line_ds.png);
  149. background-size: 100% 100%;
  150. }
  151. div.checkwind_ds .sub_line1 {
  152. position: absolute;
  153. top: 60rpx;
  154. left: 36rpx;
  155. width: 90rpx;
  156. height: 105rpx;
  157. box-sizing: border-box;
  158. z-index: 4;
  159. transition: all 2s ease;
  160. background-image: url(/static/wind_ds1.png);
  161. background-size: 100% 100%;
  162. }
  163. div.checkwind_ds .sub_line2 {
  164. position: absolute;
  165. top: 36rpx;
  166. right: 36rpx;
  167. width: 99rpx;
  168. height: 114rpx;
  169. box-sizing: border-box;
  170. z-index: 4;
  171. transition: all 2s ease;
  172. background-image: url(/static/wind_ds2.png);
  173. background-size: 100% 100%;
  174. }
  175. div.checkwind_ds .sub_line {
  176. transform-origin: left center;
  177. border-right: 3rpx solid rgb(8, 8, 8);
  178. }
  179. .checkwind_ds .top_state {
  180. transform: translateY(45rpx) rotateY(-40deg);
  181. /* transform: rotateY(-20deg) */
  182. }
  183. .checkwind_ds .middle_state {
  184. transform: translateY(135rpx) rotateY(0deg) scaleX(0.83);
  185. }
  186. .checkwind_ds .bottom_state {
  187. transform: translateY(240rpx);
  188. }
  189. .checkwind_ds .top_state1 {
  190. transform: translateY(0);
  191. /* transform: rotateY(-20deg) */
  192. }
  193. .checkwind_ds .middle_state1 {
  194. transform: translateY(90rpx);
  195. }
  196. .checkwind_ds .bottom_state1 {
  197. transform: translateY(195rpx);
  198. }
  199. .checkwind_ds .top_state2 {
  200. transform: translateY(0);
  201. /* transform: rotateY(-20deg) */
  202. }
  203. .checkwind_ds .middle_state2 {
  204. transform: translateY(105rpx);
  205. }
  206. .checkwind_ds .bottom_state2 {
  207. transform: translateY(216rpx);
  208. }
  209. </style>