App.vue 5.9 KB

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