npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

feedback-qrcode

v1.1.5

Published

feedback for pc

Downloads

7

Readme

小程序二维码组件

申请接入组件详细对接文档:对接文档

效果展示

安装依赖

npm i feedback-qrcode --save -S

调用

import feedbackQrcode from 'feedback-qrcode/libs/index.js';

/**
 * isOpen: Boolean 非必传 是否展开(默认收起)
 * feecBackQrcode: String 必传 问题反馈二维码图片地址(注:需要带来源参数)
 * tabAction: String 非必传 初始显示的界面,默认'form';
 *     值为:form 问题反馈(表单提交界面)
 *     值为:qrcode 语音反馈(小程序二维码界面)
 *     值为:list 历史反馈(已反馈的列表界面)
 *
 * uploadApi: Object 非必传 上传文件的接口参数
 *     url:String 如果有uploadApi,必传 上传文件接口地址
 *     parseData: Function 非必传 编辑接口请求参数
 *     parseResponseData: Function 非必传 编辑接口返回的数据
 *
 * submitApi: Object 非必传 提交问题接口
 *     url:String 如果有submitApi,必传 提交问题接口地址
 *     parseData: Function 非必传 编辑接口请求参数
 *     parseResponseData: Function 非必传 编辑接口返回的数据
 */ 
feedbackQrcode.config({
    isOpen: false,
    tabAction: 'form',
    feecBackQrcode: 'https://image.tf56.com/dfs/group1/M00/18/12/CiFCLl2OqO2AREG5AACAZj11-vk823.png',
    uploadApi: {
        url: '/tfCommonApi/helpdesk/uploadFile',
        parseData: (data) => {
            // data: FormData数据
            return data;
        },
        parseResponseData: (res) => {
            // 编辑成以下格式返回:
            // res = {
            //    "code":0,
            //    "data":{
            //        "contentUrl":"group1/M00/01/87/Ck1AUF236qyAGuQSAAFbVk7-x1s223.jpg",
            //        "filePreUrl":"http://site.test.tf56.com/fastdfsWeb/dfs",
            //        "contentType":"4"
            //    },
            //    "msg": "***"
            //}
            return res;
        }
    },
    submitApi: {
        url: '/tfCommonApi/helpdesk/createHelpdeskIssue',
        parseData: (data) => {
            //data: {
            //    issueDesc: "问题描述内容",
            //    helpdeskIssueContentList: [{
            //        contentType: "4",
            //        contentUrl: "group1/M00/01/87/Ck1AUF237VqAXvJDAAFbVk7-x1s687.jpg"
            //    }]
            //}
            return data;
        },
        parseResponseData: (res) => {
            // 编辑成以下格式返回:
            // res = {
            //    "code":0,
            //    "msg": "***"
            //}
            return res;
        }
    }
});

开放事件, 可以监听按钮点击事件,自己去发送请求,成功后触发成功事件

feedbackQrcode.bind('on-upload', (formdata, contentType) => {
    const res = {
            "code":0,
            "data":{
                "contentUrl":"group1/M00/01/87/Ck1AUF236qyAGuQSAAFbVk7-x1s223.jpg",
                "filePreUrl":"http://site.test.tf56.com/fastdfsWeb/dfs",
                "contentType":"4"
           },
            "msg": "***"
        }
    feedbackQrcode.trigger('on-upload-success', res);
});

feedbackQrcode.bind('on-submit', (value) => {
    const res = {
            "code":0,
            "msg": "提交成功"
        }
    feedbackQrcode.trigger('on-submit-success', res);
});