App.vue 4.1 KB

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