App.vue 3.6 KB

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