App.vue 6.3 KB

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