App.vue 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <script>
  2. export default {
  3. globalData() {
  4. return {
  5. stystem: {},
  6. text: ''
  7. }
  8. },
  9. onLaunch: function (options) {
  10. console.log('app onLaunch--->'); // 公众号文章进小程序无底部导航调试,请勿删除
  11. console.log(options); // 公众号文章进小程序无底部导航调试,请勿删除
  12. console.log('<---app onLaunch'); // 公众号文章进小程序无底部导航调试,请勿删除
  13. if (options && options.scene) {
  14. this.$appScene = options.scene;
  15. }
  16. this.$store.dispatch('mallConfig/actionGetConfig');
  17. let _this = this;
  18. wx.getSystemInfo({
  19. success: function (response) {
  20. _this.$store.dispatch('gConfig/setSystemInfo', response);
  21. _this.$store.dispatch('iPhoneX/setIphone', response);
  22. }
  23. });
  24. // #ifdef MP_WEIXIN
  25. if (options.scene == '1011' || options.scene == '1012' || options.scene == '1013'
  26. || options.scene == '1047' || options.scene == '1048' || options.scene == '1049') {
  27. this.$store.dispatch('page/actionSetIsScanQrCode', true);
  28. }
  29. // #endif
  30. // #ifdef MP-ALIPAY
  31. if (typeof options.query != 'undefined') {
  32. this.$store.dispatch('page/actionSetQeury', options.query)
  33. }
  34. // #endif
  35. if (options.query && typeof options.query.user_id !== 'undefined') {
  36. this.$store.dispatch('user/setTempParentId', options.query.user_id)
  37. }
  38. },
  39. onShow(options) {
  40. console.log('app onShow--->'); // 公众号文章进小程序无底部导航调试,请勿删除
  41. console.log(options); // 公众号文章进小程序无底部导航调试,请勿删除
  42. console.log('<---app onShow'); // 公众号文章进小程序无底部导航调试,请勿删除
  43. if (options && options.scene) {
  44. this.$appScene = options.scene;
  45. }
  46. // #ifdef MP-WEIXIN
  47. this.$user.silentLogin();
  48. // #endif
  49. }
  50. };
  51. </script>
  52. <style lang="scss">
  53. /*每个页面公共css */
  54. // @import "./uni.scss";
  55. @import "./static/css/flex.scss";
  56. @import "./static/css/themeColor.scss";
  57. @import "./static/css/text.scss";
  58. @import "./static/css/image.scss";
  59. @import "./static/css/parse.scss";
  60. @import "./static/css/gift.scss";
  61. @import "./static/css/u-index.scss";
  62. @import "./static/css/border-box.scss";
  63. @import './static/css/iconfont.css';
  64. .u-goods-detail {
  65. background-image: url("./static/image/goods.png");
  66. background-repeat: no-repeat;
  67. background-size: 100% 100%;
  68. min-height: 100vh;
  69. }
  70. .u-border-box {
  71. box-sizing: border-box;
  72. }
  73. </style>