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

68 lines
1.3 KiB

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