App.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <script>
  2. export default {
  3. onLaunch: function (options) {
  4. console.log('app onLaunch--->'); // 公众号文章进小程序无底部导航调试,请勿删除
  5. console.log(options); // 公众号文章进小程序无底部导航调试,请勿删除
  6. console.log('<---app onLaunch'); // 公众号文章进小程序无底部导航调试,请勿删除
  7. if (options && options.scene) {
  8. this.$appScene = options.scene;
  9. }
  10. this.$store.dispatch('mallConfig/actionGetConfig');
  11. let _this = this;
  12. wx.getSystemInfo({
  13. success: function (response) {
  14. _this.$store.dispatch('gConfig/setSystemInfo', response);
  15. _this.$store.dispatch('iPhoneX/setIphone', response);
  16. }
  17. });
  18. // #ifdef MP_WEIXIN
  19. if (options.scene == '1011' || options.scene == '1012' || options.scene == '1013'
  20. || options.scene == '1047' || options.scene == '1048' || options.scene == '1049') {
  21. this.$store.dispatch('page/actionSetIsScanQrCode', true);
  22. }
  23. // #endif
  24. // #ifdef MP-ALIPAY
  25. if (typeof options.query != 'undefined') {
  26. this.$store.dispatch('page/actionSetQeury', options.query)
  27. }
  28. // #endif
  29. if (options.query && typeof options.query.user_id !== 'undefined') {
  30. this.$store.dispatch('user/setTempParentId', options.query.user_id)
  31. }
  32. },
  33. onShow(options) {
  34. console.log('app onShow--->'); // 公众号文章进小程序无底部导航调试,请勿删除
  35. console.log(options); // 公众号文章进小程序无底部导航调试,请勿删除
  36. console.log('<---app onShow'); // 公众号文章进小程序无底部导航调试,请勿删除
  37. if (options && options.scene) {
  38. this.$appScene = options.scene;
  39. }
  40. },
  41. };
  42. </script>
  43. <style lang="scss">
  44. /*每个页面公共css */
  45. // @import "./uni.scss";
  46. @import "./static/css/flex.scss";
  47. @import "./static/css/themeColor.scss";
  48. @import "./static/css/text.scss";
  49. @import "./static/css/image.scss";
  50. @import "./static/css/parse.scss";
  51. @import "./static/css/gift.scss";
  52. </style>