四零语境前端代码仓库
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.

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