四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.3 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <script>
  2. import share from '@/utils/share.js'
  3. export default {
  4. methods: {
  5. // 提前获取二维码并保存起来
  6. async getQrcode() {
  7. uni.getImageInfo({
  8. src: `${this.$config.baseURL}/promotion/qrCode?token=${uni.getStorageSync('token')}`,
  9. success: (image) => {
  10. this.Qrcode = image.path;
  11. this.$store.commit('setQrcode', this.Qrcode)
  12. },
  13. fail: (err) => {
  14. console.error('获取二维码失败:', err);
  15. }
  16. });
  17. }
  18. },
  19. onLaunch() {
  20. // 提前获取二维码
  21. this.getQrcode()
  22. // #ifdef H5
  23. share()
  24. // #endif
  25. },
  26. async onShow() {
  27. // if(!uni.getStorageSync('token')){
  28. // uni.redirectTo({
  29. // url: '/subPages/login/login',
  30. // })
  31. // }
  32. await this.$store.dispatch('initData')
  33. console.log('配置数据初始化完成')
  34. },
  35. onHide: function() {
  36. console.log('App Hide')
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. // @import '@/uni_modules/uv-ui-tools/index.scss';
  42. /* 富文本全局样式 - rich-text组件的class样式必须写在全局中 */
  43. h1, h2, h3, h4, h5, h6 {
  44. font-weight: bold;
  45. margin: 10px 0;
  46. line-height: 1.4;
  47. }
  48. h2 {
  49. font-size: 20px;
  50. color: #333;
  51. }
  52. p {
  53. margin: 8px 0;
  54. line-height: 1.6;
  55. color: #666;
  56. }
  57. strong {
  58. font-weight: bold;
  59. color: #333;
  60. }
  61. /* 首行缩进样式 */
  62. .text-indent {
  63. text-indent: 2em;
  64. }
  65. </style>