展品维保小程序前端代码接口
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.

49 lines
1.1 KiB

2 weeks ago
  1. export default {
  2. data() {
  3. return {
  4. }
  5. },
  6. methods: {
  7. // 自定义分享内容
  8. mixinCustomShare() {
  9. return {
  10. }
  11. }
  12. },
  13. computed: {
  14. // 获取全局配置的文本
  15. configParamText() {
  16. return key => this.$store.state.configList[key]?.paramText || '默认文本'
  17. },
  18. // 获取全局配置的图片
  19. configParamImage() {
  20. return key => this.$store.state.configList[key]?.paramImage || '/static/默认图片.png'
  21. },
  22. // 获取全局配置的富文本
  23. configParamTextarea() {
  24. return key => this.$store.state.configList[key]?.paramTextarea || '默认富文本'
  25. },
  26. // 默认的全局分享参数
  27. GShare() {
  28. return {
  29. title: this.configParamText('config_app_name'),
  30. desc: this.configParamText('share_desc'),
  31. imageUrl: this.configParamImage('config_logo'),
  32. path: '/pages/index/index'
  33. }
  34. }
  35. },
  36. onShareAppMessage() {
  37. return {
  38. ...this.GShare,
  39. ...this.mixinCustomShare()
  40. }
  41. },
  42. onShareTimeline() {
  43. return {
  44. ...this.GShare,
  45. ...this.mixinCustomShare()
  46. }
  47. }
  48. }