App.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <script>
  2. // import {
  3. // getPricePercentReq,
  4. // } from '@/api/test/index.js'
  5. import uploadUrl from '@/common/config.js'
  6. export default {
  7. globalData: {
  8. showPrivacy: false,
  9. priceConfig: {}
  10. },
  11. async onLaunch(options) {
  12. if (uni.getPrivacySetting) {
  13. uni.getPrivacySetting({
  14. success: res => {
  15. console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
  16. if (res.needAuthorization) {
  17. getApp().globalData.showPrivacy = true;
  18. } else {
  19. getApp().globalData.showPrivacy = false;
  20. }
  21. },
  22. fail: () => {},
  23. complete: () => {},
  24. })
  25. }
  26. uni.setStorageSync('switchs', [1, 0, 0])
  27. uni.request({
  28. url: uploadUrl.baseUrl + '/api/common/getPriceConfig',
  29. method: "GET",
  30. success: (res) => {
  31. if (res.data.code == 0) {
  32. console.log('app.vue中获取的会员折扣数据', res.data.data)
  33. uni.setStorageSync('priceConfig', res.data.data)
  34. }
  35. }
  36. })
  37. // uni.request({
  38. // url: uploadUrl.baseUrl + '/api/common/getBannerData',
  39. // method: "GET",
  40. // success: (res) => {
  41. // if (res.data.code == 0) {
  42. // console.log('app.vue中获取的项目静态图片配置数据', res.data.data)
  43. // uni.setStorageSync('staticImgConf', res.data.data)
  44. // }
  45. // }
  46. // })
  47. },
  48. async onShow() {},
  49. onHide: function() {
  50. // console.log('App Hide')
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
  56. @import "@/uni_modules/uview-ui/index.scss";
  57. /*每个页面公共css */
  58. @import '@/uni_modules/uni-scss/index.scss';
  59. /* #ifndef APP-NVUE */
  60. @import '@/static/customicons.css';
  61. // 设置整个项目的背景色
  62. page {
  63. // background-color: #f5f5f5;
  64. }
  65. /* #endif */
  66. .example-info {
  67. font-size: 14px;
  68. color: #333;
  69. padding: 10px;
  70. }
  71. </style>