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

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