App.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. * {
  68. box-sizing: border-box;
  69. }
  70. uni-page-body,
  71. html,
  72. body {
  73. height: 100%;
  74. width: 750rpx;
  75. background: #F6F6F6;
  76. }
  77. .u-button--primary {
  78. background-color: #5776E6;
  79. }
  80. .uni-input-placeholder {
  81. text-align: right;
  82. }
  83. .ml5 {
  84. margin-left: 10rpx;
  85. }
  86. .contain {
  87. height: 100%;
  88. padding-bottom: 120rpx;
  89. padding-top: 24rpx;
  90. overflow-y: auto;
  91. .main {
  92. padding: 0 32rpx;
  93. background-color: #fff;
  94. }
  95. .tijiao {
  96. position: fixed;
  97. width: 100%;
  98. bottom: 0;
  99. left: 0;
  100. background-color: #fff;
  101. padding: 16rpx 32rpx;
  102. box-sizing: border-box;
  103. box-shadow: 0 -6px 12px 0 rgba(153, 153, 153, 0.10);
  104. }
  105. .u-cell__value {
  106. color: #333 !important;
  107. }
  108. }
  109. .tabPage{
  110. background: #F7F7F7;
  111. padding: 0 24rpx 194rpx;
  112. box-sizing: border-box;
  113. }
  114. .adf{
  115. display: flex;
  116. }
  117. .adfac{
  118. display: flex;
  119. align-items: center;
  120. }
  121. .adffc{
  122. display: flex;
  123. flex-direction: column;
  124. }
  125. .adfacjc{
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. }
  130. .adfacjb{
  131. display: flex;
  132. align-items: center;
  133. justify-content: space-between;
  134. }
  135. .adffcac{
  136. display: flex;
  137. flex-direction: column;
  138. align-items: center;
  139. }
  140. .adffcacjc{
  141. display: flex;
  142. flex-direction: column;
  143. align-items: center;
  144. justify-content: center;
  145. }
  146. .adffcacjb{
  147. display: flex;
  148. flex-direction: column;
  149. align-items: center;
  150. justify-content: space-between;
  151. }
  152. .zt_btn{
  153. width: 100%;
  154. height: 88rpx;
  155. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  156. border-radius: 44rpx;
  157. font-family: PingFangSC, PingFang SC;
  158. font-weight: bold;
  159. font-size: 32rpx;
  160. color: #FFFFFF;
  161. line-height: 88rpx;
  162. text-align: center;
  163. letter-spacing: 2rpx;
  164. }
  165. .qx_btn{
  166. width: 100%;
  167. height: 88rpx;
  168. border-radius: 44rpx;
  169. background: rgba(25, 156, 156, 0.06);
  170. font-family: PingFang-SC, PingFang-SC;
  171. font-weight: bold;
  172. font-size: 32rpx;
  173. color: #009191;
  174. line-height: 88rpx;
  175. text-align: center;
  176. letter-spacing: 2rpx;
  177. }
  178. </style>