App.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <script>
  2. // var wsUrl="ws://42.194.245.189:8008/app/webSocket/w-";
  3. var pingpangTimes=null;
  4. var isSocketOpen=false;
  5. var socket=null;
  6. let nowapp='福本源'
  7. export default {
  8. data() {
  9. return {
  10. };
  11. },
  12. onLaunch: function() {
  13. // uni.hideTabBar();
  14. this.checkUpdate()
  15. console.log(nowapp)
  16. },
  17. onLoad() {
  18. // #ifndef MP-WEIXIN
  19. uni.hideNavigationBar(); // H5 隐藏导航栏
  20. // #endif
  21. },
  22. onShow: function() {
  23. console.log('App Show')
  24. },
  25. onHide: function() {
  26. console.log('App Hide')
  27. },
  28. onUnload() {
  29. },
  30. methods:{
  31. checkUpdate() {
  32. const updateManager = uni.getUpdateManager();
  33. updateManager.onCheckForUpdate(function(res) {
  34. // 请求完新版本信息的回调
  35. console.log('是否有新版本:', res.hasUpdate);
  36. });
  37. updateManager.onUpdateReady(function() {
  38. uni.showModal({
  39. title: '更新提示',
  40. content: '新版本已经准备好,是否重启小程序?',
  41. confirmText: '立即重启',
  42. confirmColor: '#2179f5',
  43. success(res) {
  44. if (res.confirm) {
  45. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  46. updateManager.applyUpdate();
  47. }
  48. }
  49. });
  50. });
  51. updateManager.onUpdateFailed(function() {
  52. // 新的版本下载失败
  53. uni.showModal({
  54. title: '更新提示',
  55. content: '新版本下载失败,请检查网络后重试。',
  56. showCancel: false
  57. });
  58. });
  59. },
  60. }
  61. }
  62. </script>
  63. <style lang="scss">
  64. /*每个页面公共css */
  65. @import "@/uni_modules/uview-ui/index.scss";
  66. @import '@/assets/css/theme.scss';
  67. @import '@/assets/css/common.scss';
  68. view{
  69. box-sizing: border-box;
  70. }
  71. .ellipsis{
  72. overflow: hidden;
  73. text-overflow: ellipsis;
  74. white-space: nowrap;
  75. }
  76. .single-line-ellipsis {
  77. width: 480rpx; /* 设置固定宽度 */
  78. white-space: nowrap; /* 文本不换行 */
  79. overflow: hidden; /* 隐藏超出部分 */
  80. text-overflow: ellipsis; /* 超出部分用省略号表示 */
  81. }
  82. .single-ellipsis {
  83. width: 260rpx; /* 设置固定宽度 */
  84. white-space: nowrap; /* 文本不换行 */
  85. overflow: hidden; /* 隐藏超出部分 */
  86. text-overflow: ellipsis; /* 超出部分用省略号表示 */
  87. }
  88. .ellipsis2{
  89. overflow:hidden;
  90. text-overflow:ellipsis;
  91. display:-webkit-box;
  92. -webkit-box-orient:vertical;
  93. -webkit-line-clamp:2;
  94. }
  95. .no-data-box{
  96. height:100%;
  97. width: 100%;
  98. display: flex;
  99. justify-content: center;
  100. align-items: center;
  101. flex-direction: column;
  102. image{
  103. width: 264upx;
  104. height: 212upx;
  105. }
  106. .empty-title{
  107. margin-top: 20rpx;
  108. font-size: 28rpx;
  109. color: gray;
  110. }
  111. }
  112. .w-calc-30 {
  113. padding: 0 30rpx;
  114. width: calc(100% - 60rpx);
  115. }
  116. .hb {
  117. height: 100%;
  118. box-sizing: border-box;
  119. }
  120. .hidden {
  121. overflow: hidden;
  122. }
  123. .base-color {
  124. color: $--base-color;
  125. }
  126. .base-color-2 {
  127. color: $--base-color2;
  128. }
  129. .base-color-3 {
  130. color: $--base-color3;
  131. }
  132. .base-color-9 {
  133. color: $--base-color-9;
  134. }
  135. .base-color-8 {
  136. color: $--base-color-f8;
  137. }
  138. .base-color-6 {
  139. color: $--base-color-6;
  140. }
  141. .base-color-gray {
  142. color: $--base-color-gray;
  143. }
  144. .base-color-red{
  145. color:#ee0a25;
  146. }
  147. .base-color-dark {
  148. color: $--base-color-dark;
  149. }
  150. .base-color-dark2 {
  151. color: $--base-color-dark2;
  152. }
  153. .base-price {
  154. color: $--base-color-price;
  155. }
  156. .base-success {
  157. color: $--base-color-success;
  158. }
  159. .base-bg {
  160. background: $--base-bg;
  161. }
  162. .base-bg-2 {
  163. background: $--base-bg2;
  164. }
  165. .base-bg-red{
  166. background: #ee0a25;
  167. }
  168. .base-bg-f{
  169. background-color:#fff;
  170. }
  171. .base-bg-f8{
  172. background-color: $--base-color-f8;
  173. }
  174. .base-bg-f5{
  175. background-color: $--base-color-f5;
  176. }
  177. .base-bg-9{
  178. background-color: $--base-color-9;
  179. }
  180. .base-bg-blue{
  181. background:$--base-bg-blue;
  182. }
  183. .base-bg-sure{
  184. background:$--base-sure-bg;
  185. }
  186. .base-bg-orange{
  187. background:$--base-bg-orange;
  188. }
  189. .base-bg-false{
  190. background:$--base-false-bg;
  191. }
  192. .bor-blue{
  193. border: 2rpx solid $--base-bor-blue;
  194. }
  195. .bor-red{
  196. border: 2rpx solid $--base-bor-red;
  197. }
  198. .colorf {
  199. color: #fff;
  200. }
  201. .bgf {
  202. background: #fff;
  203. }
  204. .fixed {
  205. position: fixed;
  206. }
  207. .absolute {
  208. position: absolute;
  209. }
  210. .relative {
  211. position: relative;
  212. }
  213. .w100 {
  214. width: 100%;
  215. }
  216. .h100 {
  217. height: 100%;
  218. }
  219. .card {
  220. background: #fff;
  221. border-radius: 15rpx;
  222. }
  223. .cover-height {
  224. height: 100%;
  225. display: flex;
  226. flex-direction: column;
  227. box-sizing: border-box;
  228. }
  229. .row {
  230. display: flex;
  231. flex-direction: row;
  232. }
  233. .column {
  234. display: flex;
  235. flex-direction: column;
  236. }
  237. .justify-start {
  238. display: flex;
  239. justify-content: flex-start;
  240. }
  241. .justify-center {
  242. display: flex;
  243. justify-content: center;
  244. }
  245. .justify-end {
  246. display: flex;
  247. justify-content: flex-end;
  248. }
  249. .justify-around {
  250. display: flex;
  251. justify-content: space-around;
  252. }
  253. .justify-evenly {
  254. display: flex;
  255. justify-content: space-evenly;
  256. }
  257. .justify-between {
  258. display: flex;
  259. justify-content: space-between;
  260. }
  261. .align-start {
  262. display: flex;
  263. align-items: flex-start;
  264. }
  265. .align-center {
  266. display: flex;
  267. align-items: center;
  268. }
  269. .align-end {
  270. display: flex;
  271. align-items: flex-end;
  272. }
  273. .center {
  274. display: flex;
  275. justify-content: center;
  276. align-items: center;
  277. }
  278. .centerV {
  279. display: flex;
  280. justify-content: center;
  281. align-items: center;
  282. flex-direction: column;
  283. }
  284. .wrap {
  285. flex-wrap: wrap;
  286. }
  287. .flex-1 {
  288. flex: 1;
  289. }
  290. .ellipsis {
  291. overflow: hidden;
  292. text-overflow: ellipsis;
  293. display: -webkit-box;
  294. -webkit-box-orient: vertical;
  295. box-sizing: border-box;
  296. width: 100%;
  297. -webkit-line-clamp: 1;
  298. }
  299. .lines-2 {
  300. -webkit-line-clamp: 2 !important;
  301. }
  302. .lines-3 {
  303. -webkit-line-clamp: 3 !important;
  304. }
  305. .bold {
  306. font-weight: bold;
  307. }
  308. .line-through {
  309. text-decoration: line-through;
  310. }
  311. .nowrap {
  312. white-space: nowrap;
  313. }
  314. .scrollx {
  315. overflow-x: scroll;
  316. }
  317. .scrolly {
  318. overflow-y: scroll;
  319. }
  320. .cvauto {
  321. content-visibility: auto;
  322. }
  323. </style>
  324. <style lang="less">
  325. /*每个页面公共css */
  326. @import './assets/iconfont/iconfont.css';
  327. @import './assets/css/common.less';
  328. </style>