App.vue 6.3 KB

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