App.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <script>
  2. import mqtt from "@/unit/mqtt.js"
  3. import router from "@/router/router.js"
  4. export default {
  5. onLaunch: function() {
  6. // #ifdef APP-PLUS
  7. plus.screen.lockOrientation('portrait-primary');
  8. const dom = weex.requireModule('dom');
  9. dom.addRule('fontFace', {
  10. 'fontFamily': "iconfont",
  11. 'src': "url('/static/iconfont/fontIcons.ttf')"
  12. });
  13. // dom.addRule('fontFace', {
  14. // 'fontFamily': "graceIconfont",
  15. // 'src': "url('/Grace6/font/grace.ttf')"
  16. // });
  17. // #endif
  18. },
  19. onShow: async function() {
  20. // 如果ip为空,则重新登录
  21. if (uni.$baseUrl == "") {
  22. uni.reLaunch({
  23. url: "/pages/login/loginPage"
  24. })
  25. return;
  26. }
  27. },
  28. onHide: function() {},
  29. }
  30. </script>
  31. <style lang="scss">
  32. /* 加载框架核心样式 */
  33. @import "./Grace6/css/grace.scss";
  34. /* 加载深色模式适配样式 */
  35. // @import "./Grace6/css/graceDark.scss";
  36. /* 加载自定义样式 */
  37. @import "./custom/custom.scss";
  38. /* iconfont */
  39. @import '/static/iconfont/iconfont.css';
  40. /* 引入字体 */
  41. @font-face {
  42. font-family: "得意黑 斜体";
  43. font-weight: 400;
  44. src: url("https://at.alicdn.com/wf/webfont/ki9sYvEuu3UO/0Fqxi2lkCsOf.woff2") format("woff2"),
  45. url("https://at.alicdn.com/wf/webfont/ki9sYvEuu3UO/DTlsylq2Pu7o.woff") format("woff");
  46. font-display: swap;
  47. }
  48. /* 加载图标字体 - 条件编译模式 */
  49. /* #ifdef APP-PLUS-NVUE */
  50. // .gui-icons {
  51. // font-family: graceIconfont;
  52. // }
  53. .font-icons {
  54. font-family: fonticon;
  55. }
  56. /* #endif */
  57. /* #ifndef APP-NVUE */
  58. page {
  59. background: #fbfbfb;
  60. }
  61. .gui-button-text-mini {
  62. color: #F8F8F8 !important;
  63. }
  64. // 主题背景色
  65. .gui-theme-background-color {
  66. background-color: rgba(0, 160, 233, 1);
  67. }
  68. /* #endif */
  69. // 弹框
  70. .uni-popup-dialog {
  71. width: 90vw !important;
  72. .uni-dialog-title {
  73. padding: 6px 0 12px 0 !important;
  74. }
  75. .uni-dialog-content {
  76. padding: 0 20px !important;
  77. }
  78. }
  79. .button {
  80. height: 45px;
  81. width: 100%;
  82. font-size: 18px;
  83. background-color: #afafaf;
  84. display: flex;
  85. justify-content: center;
  86. align-items: center;
  87. border-radius: 8px;
  88. margin: 4px 0;
  89. }
  90. .button[size='primary'] {
  91. background-color: #49a5e0;
  92. }
  93. /* 自定义图标加载 */
  94. /* #ifndef APP-NVUE */
  95. // 使用unicode本地编码
  96. @font-face {
  97. font-family: "wms";
  98. src: url('@/static/iconfont/iconfont.ttf') format('truetype');
  99. }
  100. .font-icons {
  101. font-family: "wms";
  102. font-style: normal;
  103. fill: gray;
  104. }
  105. /* #endif */
  106. // 全局输入框样式
  107. .gui-form-input {
  108. font-size: 14px;
  109. margin: 0 !important;
  110. }
  111. // 下拉框全局样式
  112. .custom-select {
  113. height: 40px;
  114. width: 65%;
  115. min-width: 200px;
  116. line-height: 40px;
  117. padding: 5px 0;
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. background-color: transparent;
  122. .select-options {
  123. width: 180px;
  124. }
  125. }
  126. // 悬浮菜单全局样式
  127. .menu-items {
  128. width: 100rpx;
  129. height: 100rpx;
  130. margin: 20rpx 0;
  131. border-radius: 100rpx;
  132. display: flex;
  133. align-items: center;
  134. }
  135. .menu-icon {
  136. width: 100rpx;
  137. line-height: 40rpx;
  138. font-size: 36rpx;
  139. }
  140. .menu-text {
  141. width: 78rpx;
  142. line-height: 30rpx;
  143. font-size: 22rpx;
  144. }
  145. .bg-image {
  146. display: flex;
  147. flex-direction: column;
  148. justify-content: center;
  149. align-items: center;
  150. height: calc(100vh - 75px);
  151. background-color: white !important;
  152. uni-image {
  153. width: 240px;
  154. height: 180px;
  155. }
  156. text {
  157. font-size: 36rpx;
  158. font-family: "得意黑 斜体";
  159. color: #c0c7d2;
  160. }
  161. }
  162. text {
  163. font-size: 12px;
  164. }
  165. // popup
  166. ::v-deep .uni-popup {
  167. view {
  168. view[name] {
  169. border-top-left-radius: 15px !important;
  170. border-top-right-radius: 15px !important;
  171. }
  172. }
  173. }
  174. ::v-deep .uni-popup__wrapper {
  175. border-top-left-radius: 15px !important;
  176. border-top-right-radius: 15px !important;
  177. }
  178. .popup-content {
  179. position: relative;
  180. border-top-left-radius: 15px !important;
  181. border-top-right-radius: 15px !important;
  182. }
  183. .uni-collapse {
  184. border-radius: 4px;
  185. }
  186. // 卡片列表样式
  187. .list-panel {
  188. // height: calc(100vh - 190px);
  189. // min-height: 230px;
  190. margin: 5px 0;
  191. padding: 5px 8px;
  192. position: relative;
  193. overflow-y: scroll;
  194. .panel {
  195. position: relative;
  196. margin: 16px 0;
  197. border-radius: 4px;
  198. box-shadow: 0 0 6px 0 rgba(121, 118, 118, 0.34);
  199. background-color: white;
  200. .panel-row {
  201. // height: 32px;
  202. line-height: 28px;
  203. padding: 0 12px;
  204. display: flex;
  205. justify-content: space-between;
  206. font-size: 12px;
  207. background-color: #fbfbfb;
  208. span:nth-of-type(1) {
  209. min-width: 30%;
  210. }
  211. }
  212. .panel-row:nth-of-type(1) {
  213. position: relative;
  214. font-weight: bold;
  215. border-top-left-radius: 4px;
  216. border-top-right-radius: 4px;
  217. border-bottom: 1px dashed rgba(237, 238, 238, 1);
  218. background-color: white;
  219. span {
  220. color: rgba(0, 160, 233, 1);
  221. }
  222. }
  223. .panel-row:nth-of-type(1)::before {
  224. content: '';
  225. position: absolute;
  226. top: 30px;
  227. left: 0;
  228. bottom: 0;
  229. transform: translate(-50%, -50%);
  230. width: 15px;
  231. height: 15px;
  232. border-radius: 50%;
  233. background-color: rgba(237, 238, 238, 1);
  234. }
  235. .panel-row:nth-of-type(1)::after {
  236. content: '';
  237. position: absolute;
  238. top: 30px;
  239. right: 0;
  240. bottom: 0;
  241. transform: translate(50%, -50%);
  242. width: 15px;
  243. height: 15px;
  244. border-radius: 50%;
  245. background-color: rgba(237, 238, 238, 1);
  246. }
  247. .panel-row-operation {
  248. line-height: 28px;
  249. display: flex;
  250. justify-content: end;
  251. }
  252. }
  253. .panel::before {
  254. content: '';
  255. position: absolute;
  256. left: 16px;
  257. bottom: -16px;
  258. width: 2px;
  259. height: 16px;
  260. transform: translate(-50%, 0);
  261. background-image: linear-gradient(#b3b4b4 50%, rgba(255, 255, 255, 0) 0%);
  262. /* 35%设置虚线点x轴上的长度 */
  263. background-position: left;
  264. /* top配置上边框位置的虚线 */
  265. background-size: 2px 12px;
  266. /* 第一个参数设置虚线点的间距;第二个参数设置虚线点y轴上的长度 */
  267. background-repeat: repeat-y;
  268. z-index: 1;
  269. }
  270. .panel::after {
  271. content: '';
  272. position: absolute;
  273. right: 16px;
  274. bottom: -16px;
  275. width: 2px;
  276. height: 16px;
  277. transform: translate(-50%, 0);
  278. background-image: linear-gradient(#b3b4b4 50%, rgba(255, 255, 255, 0) 0%);
  279. /* 35%设置虚线点x轴上的长度 */
  280. background-position: left;
  281. /* top配置上边框位置的虚线 */
  282. background-size: 2px 12px;
  283. /* 第一个参数设置虚线点的间距;第二个参数设置虚线点y轴上的长度 */
  284. background-repeat: repeat-y;
  285. z-index: 1;
  286. }
  287. }
  288. // 手风琴级联菜单
  289. .panel {
  290. box-shadow: 0 0 6px 0 rgba(121, 118, 118, 0.34);
  291. .uni-collapse-item__wrap-content {
  292. }
  293. }
  294. // uni-row
  295. .uni-row {
  296. display: flex;
  297. align-items: center;
  298. }
  299. </style>