Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望增加反馈按钮 #284

Closed
4 tasks done
QYG2297248353 opened this issue Nov 20, 2024 · 1 comment
Closed
4 tasks done

希望增加反馈按钮 #284

QYG2297248353 opened this issue Nov 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@QYG2297248353
Copy link

Description

在现有基础上增加反馈按钮,
描述框 + 图片/回放日志 + 反馈按钮

Suggested solution

增加反馈模块
后台表单 + 前台悬浮反馈按钮

Alternative

No response

Additional context

No response

Validations

@QYG2297248353 QYG2297248353 added the enhancement New feature or request label Nov 20, 2024
@wqcstrong
Copy link
Collaborator

你可以借助 PageSpy 的能力自行封装反馈的 UI:

// 第一步:注册插件、实例化
window.$harbor = new DataHarborPlugin();
window.$rrweb = new RRWebPlugin();
[window.$harbor, window.$rrweb].forEach(p => {
  PageSpy.registerPlugin(p);
})

window.$PageSpy = new PageSpy({
  autoRender: false, // 不渲染 PageSpy 自带的控件
  ...
})

//  第二步:自行封装反馈按钮,然后绑定事件
button.addEventListener('click', async () => {
  // 上传数据,其他操作日志的方式可以参考 https://www.pagespy.org/#/docs/data-harbor#onOfflineLog
  const url = await window.$harbor.upload({ remark });

  doSomething(url); // url 是回放地址
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants