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