App.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. // console.log("App Launch");
  5. // this.checkArguments(); // 检测启动参数
  6. // if (uni.getSystemInfoSync().platform == 'android') {
  7. // // 重点是以下: 一定要监听后台恢复 !一定要
  8. // plus.globalEvent.addEventListener('newintent', e => {
  9. // this.checkArguments(); // 检测启动参数
  10. // });
  11. // }
  12. // console.log(uni.getSystemInfoSync());
  13. const {
  14. platform,
  15. windowWidth
  16. } = uni.getSystemInfoSync();
  17. if (platform === 'android' && windowWidth > 500) {
  18. //pad下锁死竖屏适配布局
  19. // #ifdef APP-PLUS
  20. plus.screen.lockOrientation('portrait-primary');
  21. // #endif
  22. }
  23. /* 条件编译,仅在H5平台生效 */
  24. // #ifdef H5
  25. //在页面加载时读取Storage里的状态信息
  26. // const store = uni.getStorageSync('store');
  27. // console.log('this.$store.state',this.$store.state);
  28. // if (store) {
  29. // console.log('读取Storage里的状态信息');
  30. // this.$store.replaceState(
  31. // Object.assign({},
  32. // this.$store.state,
  33. // JSON.parse(store)
  34. // )
  35. // );
  36. // }else {
  37. // console.log('设置Storage里的状态信息');
  38. // uni.setStorageSync('store',JSON.stringify(this.$store.state));
  39. // }
  40. uni.getSystemInfo({
  41. success(e) {
  42. /* 窗口宽度大于420px且不在PC页面且不在移动设备时跳转至 PC.html 页面 */
  43. console.log(e, window.top.isPC, !/iOS|Android/i.test(e.system));
  44. if (e.windowWidth > 420 && !window.top.isPC && !/iOS|Android/i.test(e.system)) {
  45. const url = decodeURIComponent(`/TracerMethodology/static/html/template.html`);
  46. // console.log({hospSign,url});
  47. window.location.pathname = url;
  48. /* 若项目未设置根目录(默认为 / 时),则使用下方代码 */
  49. // window.location.pathname = '/static/html/pc.html';
  50. }
  51. }
  52. })
  53. // #endif
  54. },
  55. onShow: function() {
  56. // console.log("App Show");
  57. },
  58. onHide: function() {
  59. // console.log("App Hide");
  60. },
  61. methods: {
  62. // 监测是否传参数
  63. checkArguments() {
  64. try {
  65. if (uni.getSystemInfoSync().platform === 'android') {
  66. // 接收第三方app传递的参数 extra;
  67. // #ifdef APP-PLUS
  68. if (plus.runtime.arguments) {
  69. // patParams: 院区,病区, 床号
  70. const {
  71. patParams
  72. } = JSON.parse(plus.runtime.arguments);
  73. console.log({
  74. patParams
  75. });
  76. uni.setStorageSync('patParams', patParams);
  77. }
  78. // #endif
  79. }
  80. } catch (e) {}
  81. },
  82. }
  83. };
  84. </script>
  85. <style lang="scss">
  86. @import "uview-ui/index.scss";
  87. /*每个页面公共css */
  88. /* 条件编译,仅在H5平台生效 */
  89. // #ifdef H5
  90. body::-webkit-scrollbar,
  91. html::-webkit-scrollbar {
  92. display: none;
  93. }
  94. // #endif
  95. body,
  96. uni-app,
  97. uni-page,
  98. uni-page-wrapper,
  99. uni-page-body {
  100. height: 100%;
  101. font-size: 20rpx;
  102. line-height: 30rpx;
  103. color: #292C33;
  104. background-color: #F5F6FA;
  105. }
  106. view,
  107. label,
  108. scroll-view {
  109. box-sizing: border-box;
  110. }
  111. // 底部固定的按钮
  112. .fixed-buttom-btn {
  113. position: fixed;
  114. left: 0;
  115. bottom: 0;
  116. display: flex;
  117. justify-content: center;
  118. align-items: center;
  119. margin-top: 12.5rpx;
  120. width: 100%;
  121. height: 75rpx;
  122. background-color: #3377FF;
  123. .btn-text {
  124. flex: 1;
  125. font-size: 22.5rpx;
  126. color: #fff;
  127. text-align: center;
  128. }
  129. .btn-text.cancle {
  130. line-height: 76.25rpx;
  131. background-color: #FFFFFF;
  132. color: #3377FF;
  133. }
  134. }
  135. // 新建情境样式start
  136. .creatingSituations {
  137. .title {
  138. padding-bottom: 35rpx;
  139. padding-left: 25rpx;
  140. font-size: 30rpx;
  141. line-height: 45rpx;
  142. color: #292C33;
  143. }
  144. }
  145. // 新建情境样式end
  146. // 查核地图列表样式start
  147. .check-map-list {
  148. overflow: hidden;
  149. padding: 0 25rpx;
  150. .item {
  151. position: relative;
  152. overflow: hidden;
  153. margin-bottom: 25rpx;
  154. border-radius: 5rpx;
  155. padding-top: 16.25rpx;
  156. padding-bottom: 0;
  157. width: 100%;
  158. background-color: #fff;
  159. box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
  160. .title-wrap {
  161. display: flex;
  162. flex-direction: row;
  163. align-items: center;
  164. padding: 0 25rpx;
  165. >text {
  166. font-size: 35rpx;
  167. line-height: 52.5rpx;
  168. color: #292C33;
  169. }
  170. >view {
  171. display: flex;
  172. flex-direction: row;
  173. align-items: center;
  174. margin-left: 20rpx;
  175. border-radius: 17.5rpx;
  176. height: 35rpx;
  177. font-size: 17.5rpx;
  178. line-height: 35rpx;
  179. color: #8F9BB3;
  180. background-color: #EDF2FA;
  181. image {
  182. width: 35rpx;
  183. height: 35rpx;
  184. }
  185. text {
  186. padding-left: 10rpx;
  187. padding-right: 20rpx;
  188. }
  189. }
  190. }
  191. .content {
  192. display: flex;
  193. flex-direction: column;
  194. padding: 11.25rpx 25rpx 20rpx;
  195. >text {
  196. overflow: hidden;
  197. white-space: nowrap;
  198. text-overflow: ellipsis;
  199. font-size: 20rpx;
  200. line-height: 30rpx;
  201. color: #666F80;
  202. &:first-child {
  203. margin-bottom: 5rpx;
  204. font-weight: bold;
  205. color: #292C33;
  206. }
  207. }
  208. }
  209. }
  210. }
  211. // 查核地图列表样式end
  212. </style>