移动储能车V1版本
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <image class="top_logo" src="../../static/logo.png" mode=""></image>
  5. <image class="tite" src="../../static/tite.png" mode=""></image>
  6. <view class="time">
  7. <view class="time_top">
  8. {{ formattedTime}}
  9. </view>
  10. <view class="time_bottom">
  11. <view>
  12. </view>
  13. <view class="time_bottom1">
  14. 连接状态:
  15. <view class="time_state" v-if="status=='ok'">
  16. 在线
  17. </view>
  18. <view class="time_state1" v-else>
  19. 离线
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="tap">
  26. <view class="tap_1">
  27. AC
  28. </view>
  29. <view class="tap_2">
  30. DC
  31. </view>
  32. <view class="tap_3">
  33. System
  34. </view>
  35. </view>
  36. <view class="power">
  37. <view class="power_1">
  38. <image v-if="selectorid!=3&&selectorindex==1" src="../../static/choice1.png" mode=""></image>
  39. <image v-else src="../../static/electricity.png" mode="" @click="onclick(3)"></image>
  40. </view>
  41. <view class="power_1">
  42. <image v-if="selectorid!=2&&selectorindex==1" src="../../static/choice2.png" mode=""></image>
  43. <image v-else src="../../static/power1.png" mode="" @click="onclick(2)"></image>
  44. </view>
  45. <view class="power_1">
  46. <image v-if="selectorid!=4&&selectorindex==1" src="../../static/choice3.png" mode=""></image>
  47. <image v-else src="../../static/direct1.png" mode="" @click="onclick(4)"></image>
  48. </view>
  49. <view class="power_1">
  50. <image v-if="selectorid!=1&&selectorindex==1" src="../../static/choice4.png" mode=""></image>
  51. <image v-else src="../../static/DCpower1.png" mode="" @click="onclick(1)"></image>
  52. </view>
  53. <view class="power_5" @click="system">
  54. <image src="../../static/system.png" mode=""></image>
  55. </view>
  56. </view>
  57. <view class="power_6" v-if="selectorindex==1">
  58. <image src="../../static/!.png" mode=""></image>若想重新选择模式,请返回之前模式停止以后再重新选择!
  59. </view>
  60. <uni-popup ref="message" type="message">
  61. <uni-popup-message type="error" :message="messageText" :duration="2500"></uni-popup-message>
  62. </uni-popup>
  63. </view>
  64. </template>
  65. <script>
  66. import {getuidatas,control} from "../../api/api.js"
  67. import {getTime} from "../../utils/index.js"
  68. import { mapState } from 'vuex';
  69. export default {
  70. data() {
  71. return {
  72. title: '',
  73. uidatas:'',
  74. formatTimeid:'',
  75. messageText:''
  76. }
  77. },
  78. created() {
  79. },
  80. mounted(){
  81. },
  82. computed: {
  83. // 使用 mapState 映射多个状态到组件的计算属性
  84. ...mapState(['formattedTime','status','selectorid','selectorindex']),
  85. ...mapState({
  86. uidatasdata: state => state.uidatasdata
  87. })
  88. },
  89. onLoad() {
  90. // this.onfaultsList();
  91. },
  92. beforeUnmount() {
  93. clearInterval(this.uidatas);
  94. // clearInterval(this.formatTimeid);
  95. },
  96. methods: {
  97. onclick(e){
  98. this.pattern(e)
  99. },
  100. pattern(unm){
  101. let data = {
  102. id: "c32e6a80-9159-4f6e-9acc-8525cf177808",
  103. issaveinitvalue:true,
  104. value:unm+'' // 直流供电=1,直流补电=4,交流供电=2,交流补电=3
  105. }
  106. control(data).then(data => {
  107. console.log(data);
  108. if (data.status == 'ok') {
  109. if (unm==3) {
  110. uni.redirectTo({
  111. url: '/pages/home/index'
  112. });
  113. } else if(unm==2){
  114. uni.redirectTo({
  115. url: '/pages/electricity/index'
  116. });
  117. }else if(unm==4){
  118. uni.redirectTo({
  119. url: '/pages/supply/supply'
  120. });
  121. }else if(unm==1){
  122. uni.redirectTo({
  123. url: '/pages/supplyss/supplyss'
  124. });
  125. }
  126. } else {
  127. // uni.hideLoading()
  128. // uni.showToast({
  129. // title:'选择模式失败请重新选择',
  130. // icon: 'warning',
  131. // duration: 2500, // 显示时长,单位为毫秒
  132. // });
  133. this.messageText = '选择模式失败请重新选择'
  134. this.$refs.message.open()
  135. return
  136. }
  137. });
  138. },
  139. system(){
  140. uni.redirectTo({
  141. url: '/pages/faultlist/index'
  142. });
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .content{
  149. width: 100%;
  150. height: 100vh;
  151. opacity: 1;
  152. background: linear-gradient(180deg, rgba(215, 230, 245, 0) 0%, rgba(196, 229, 255, 1) 100%);
  153. box-sizing: border-box;
  154. }
  155. .top {
  156. width: 100%;
  157. height: 100px;
  158. display: flex;
  159. align-items: center;
  160. justify-content: space-between;
  161. background-size: 100% 100%;
  162. background-repeat: no-repeat;
  163. box-sizing: border-box;
  164. background-color: #fff;
  165. padding: 0px 46px;
  166. }
  167. .top_logo{
  168. width:426px;
  169. height: 68px;
  170. }
  171. .tite{
  172. width:277px;
  173. height: 48px;
  174. }
  175. .time{
  176. text-align: right;
  177. }
  178. .time_top{
  179. font-size: 17px;
  180. }
  181. .time_bottom{
  182. display: flex;
  183. font-size: 17px;
  184. justify-content: space-between;
  185. }
  186. .time_bottom1{
  187. display: flex;
  188. }
  189. .time_state{
  190. font-size: 17px;
  191. font-weight: 600;
  192. color: rgba(22, 68, 144, 1);
  193. }
  194. .time_state1 {
  195. font-size: 17px;
  196. font-weight: 600;
  197. color: rgba(217, 22, 22, 1);
  198. }
  199. .tap{
  200. width: 100%;
  201. height: 46.01px;
  202. display: flex;
  203. justify-content: space-between;
  204. margin-top: 118px;
  205. margin-bottom: 50px;
  206. padding: 0px 40px;
  207. box-sizing: border-box;
  208. }
  209. .tap_1{
  210. width: 485.57px;
  211. height: 46.5px;
  212. border-radius: 50px;
  213. background: linear-gradient(180deg, rgba(43, 158, 218, 1) 0%, rgba(39, 114, 186, 1) 100%);
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. font-size: 35.24px;
  218. font-weight: 700;
  219. color: #fff;
  220. }
  221. .tap_2{
  222. width: 485px;
  223. height: 46.5px;
  224. border-radius: 50px;
  225. background: linear-gradient(180deg, rgba(43, 158, 218, 1) 0%, rgba(39, 114, 186, 1) 100%);
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. font-size: 35.24px;
  230. font-weight: 700;
  231. color: #fff;
  232. }
  233. .tap_3{
  234. width: 155.17px;
  235. height: 46.01px;
  236. opacity: 1;
  237. border-radius: 24.47px;
  238. background: linear-gradient(180deg, rgba(43, 158, 218, 1) 0%, rgba(39, 114, 186, 1) 100%);
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. font-size: 30px;
  243. font-weight: 700;
  244. color: #fff;
  245. }
  246. .power{
  247. width: 100%;
  248. display: flex;
  249. justify-content: space-between;
  250. padding: 0px 50px;
  251. box-sizing: border-box;
  252. }
  253. .power_1{
  254. width: 237.55px;
  255. height: 298.98px;
  256. opacity: 1;
  257. box-sizing: border-box;
  258. image {
  259. width: 100%;
  260. height: 100%;
  261. }
  262. }
  263. .power_11{
  264. width: 237.55px;
  265. height: 298.98px;
  266. opacity: 1;
  267. box-sizing: border-box;
  268. font-size: 23px;
  269. font-family: 400;
  270. display: flex;
  271. flex-direction: column;
  272. align-items: center;
  273. .power_image{
  274. width: 100%;
  275. height: 248px;
  276. margin-bottom: 20px;
  277. background-image: url("../../static/electricity1.png");
  278. background-size: 100% 100%;
  279. display: flex;
  280. align-items: center;
  281. justify-content: center;
  282. padding: 0px 16px;
  283. box-sizing: border-box;
  284. image{
  285. width: 100%;
  286. height: 160.06px;
  287. }
  288. }
  289. }
  290. .power_5{
  291. width: 154.19px;
  292. height: 297.61px;
  293. opacity: 1;
  294. margin-left: 20px;
  295. image{
  296. width: 100%;
  297. height: 100%;
  298. }
  299. }
  300. .power_6{
  301. width: 100%;
  302. height: 50px;
  303. font-size: 17.62px;
  304. margin-top: 80px;
  305. display: flex;
  306. align-items: center;
  307. padding: 0px 20px;
  308. box-sizing: border-box;
  309. position: fixed;
  310. left: 0px;
  311. bottom: 64px;
  312. image{
  313. margin-right: 10px;
  314. width: 27.41px;
  315. height: 27.41px;
  316. };
  317. }
  318. </style>