App.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <script>
  2. export default {
  3. data() {
  4. return {
  5. }
  6. },
  7. onLaunch: function() {
  8. },
  9. onShow: function() {
  10. this.autoUpdate();
  11. },
  12. onHide: function() {
  13. },
  14. methods: {
  15. autoUpdate() {
  16. if (wx.canIUse('getUpdateManager')) {
  17. const updateManager = wx.getUpdateManager();
  18. updateManager.onCheckForUpdate(res => {
  19. if (res.hasUpdate) {
  20. updateManager.onUpdateReady(() => {
  21. wx.showModal({
  22. title: '更新提示',
  23. content: '发现新版本,是否更新?',
  24. success: function(res) {
  25. if (res.confirm) {
  26. updateManager.applyUpdate();
  27. }
  28. }
  29. })
  30. });
  31. updateManager.onUpdateFailed(function() {
  32. wx.showModal({
  33. title: '最新版提示',
  34. content: '新版本已上线,请您删除当前小程序,重新搜索打开',
  35. showCancel: false
  36. })
  37. });
  38. }
  39. })
  40. } else {
  41. wx.showModal({
  42. title: '提示',
  43. content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。',
  44. showCancel: false
  45. })
  46. }
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. /*每个页面公共css */
  53. @import "@/uni_modules/uview-ui/index.scss";
  54. * {
  55. box-sizing: border-box;
  56. }
  57. uni-page-body,
  58. html,
  59. body {
  60. height: 100%;
  61. width: 750rpx;
  62. background: #F6F6F6;
  63. }
  64. .u-button--primary {
  65. background-color: #5776E6;
  66. }
  67. .uni-input-placeholder {
  68. text-align: right;
  69. }
  70. .ml5 {
  71. margin-left: 10rpx;
  72. }
  73. .contain {
  74. height: 100%;
  75. padding-bottom: 120rpx;
  76. padding-top: 24rpx;
  77. overflow-y: auto;
  78. .main {
  79. padding: 0 32rpx;
  80. background-color: #fff;
  81. }
  82. .tijiao {
  83. position: fixed;
  84. width: 100%;
  85. bottom: 0;
  86. left: 0;
  87. background-color: #fff;
  88. padding: 16rpx 32rpx;
  89. box-sizing: border-box;
  90. box-shadow: 0 -6px 12px 0 rgba(153, 153, 153, 0.10);
  91. }
  92. .u-cell__value {
  93. color: #333 !important;
  94. }
  95. }
  96. .tabPage{
  97. width: 100%;
  98. padding-bottom: 172rpx;
  99. box-sizing: border-box;
  100. }
  101. .adf{
  102. display: flex;
  103. }
  104. .adfac{
  105. display: flex;
  106. align-items: center;
  107. }
  108. .adfacjc{
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. }
  113. .adfacjb{
  114. display: flex;
  115. align-items: center;
  116. justify-content: space-between;
  117. }
  118. .adffcacjc{
  119. display: flex;
  120. flex-direction: column;
  121. align-items: center;
  122. justify-content: center;
  123. }
  124. .adffcacjb{
  125. display: flex;
  126. flex-direction: column;
  127. align-items: center;
  128. justify-content: space-between;
  129. }
  130. .zt_btn{
  131. width: 100%;
  132. height: 88rpx;
  133. background: #833478;
  134. border-radius: 24rpx;
  135. font-family: PingFangSC, PingFang SC;
  136. font-weight: 400;
  137. font-size: 32rpx;
  138. color: #FFFFFF;
  139. line-height: 88rpx;
  140. text-align: center;
  141. letter-spacing: 2rpx;
  142. }
  143. .qx_btn{
  144. width: 100%;
  145. height: 88rpx;
  146. background: #FAFAFA;
  147. border-radius: 24rpx;
  148. font-family: PingFangSC, PingFang SC;
  149. font-weight: 400;
  150. font-size: 32rpx;
  151. color: #393939;
  152. line-height: 88rpx;
  153. text-align: center;
  154. letter-spacing: 2rpx;
  155. }
  156. </style>