App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <script>
  2. export default {
  3. globalData: {
  4. showPrivacy: false
  5. },
  6. onLaunch: function(options) {
  7. if (uni.getPrivacySetting) {
  8. uni.getPrivacySetting({
  9. success: res => {
  10. console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
  11. if (res.needAuthorization) {
  12. getApp().globalData.showPrivacy = true;
  13. } else {
  14. getApp().globalData.showPrivacy = false;
  15. }
  16. },
  17. fail: () => {},
  18. complete: () => {},
  19. })
  20. }
  21. },
  22. onShow: function() {
  23. // console.log('App Show')
  24. },
  25. onHide: function() {
  26. // console.log('App Hide')
  27. }
  28. }
  29. </script>
  30. <style lang="scss">
  31. /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
  32. @import "@/uni_modules/uview-ui/index.scss";
  33. /*每个页面公共css */
  34. @import '@/uni_modules/uni-scss/index.scss';
  35. /* #ifndef APP-NVUE */
  36. @import '@/static/customicons.css';
  37. // 设置整个项目的背景色
  38. page {
  39. // background-color: #f5f5f5;
  40. }
  41. /* #endif */
  42. .example-info {
  43. font-size: 14px;
  44. color: #333;
  45. padding: 10px;
  46. }
  47. </style>