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

gk-comments-h5

v1.0.0

Published

h5端评论组件包

Downloads

3

Readme

gk-comments-h5

h5端点赞评论组件包

组件基于antd-mobile的UI风格进行界面布局设计,由评论区/评论工具栏/评论面板构成; 支持评论区快速定位、点赞点踩、发表评论(上传图片、@人)、评论区展示功能;

📅 版本历史

  • 1.0.0 2021/12/30
    • 支持移动端h5引入评论点赞功能

🧩 基础核心依赖

  • TypeScript
  • axios
  • antd-mobile

🧩 功能模块

  • 点赞点踩
  • 发表评论(上传图片、@人)

🎉 使用

🛎️ 安装

yarn add gk-comments-h5 -D

or

npm i -D gk-comments-h5

☘️ 目录结构


│  .babelrc
│  LICENSE
│  list.txt
│  package-lock.json
│  package.json
│  README.md
│  tsconfig.json
│  typings.d.ts
│  webpack.config.js
│  yarn-error.log
│  yarn.lock
│  
├─dist       
│                      
├─public
│      index.html
└─src
    │  index.d.ts
    │  index.js
    │  index.less
    │  index.tsx
    │  
    ├─assets
    │      at.svg
    │      comment.svg
    │      diancai-active.svg
    │      diancai.svg
    │      dianzan-active.svg
    │      dianzan.svg
    │      img.svg
    │      
    ├─declare
    │      define.d.ts
    │      define.ts
    │      
    └─service
        │  config.js
        │  index.js
        │  
        └─apis
                comment.js
                
...

🧭 指令

  • yarn tree
    显示目录树

  • yarn install
    安装依赖

  • yarn build
    构建 npm 包

🛎️ 编译环境变量参数说明

  • BUILD_ENV 数据库连接环境,接口域名
    • local: 本地开发,相对路径,会走 node 的转发代理
    • dev: dev 域名
    • test: test 域名
    • uat: uat 域名
    • prod: prod 域名

npm 包名

适配项目

  • 仅支持移动端
  • 使用 typescript 编写,且与前端框架解耦,支持 js 或 ts 项目的编写环境,也支持各种语言框架(React/Vue/Angular/JQuery)的集成

问题反馈

  • 钉钉联系 @谭嘉

引用完整流程

h5端系统

  1. 安装依赖
yarn add gk-comments-h5 -D
// or
npm i gk-comments-h5 -D
  1. 入口文件引入
import GkComments from 'gk-comments-h5'

const Demo = () => {
    let config = {
    //评论中心的key
    commentKey: 'abcdefg',
    commentUrl: 'http://test.com/api/appraise',
    targetId: '123456',
    targetPerson: '测试员',
    targetPersonId: '1234567'
}
    return (
        <div>
            <GkComments
                url={config.commentUrl}
                commentKey={config.commentKey}
                target={{
                    targetId: config.targetId,
                    targetPerson: config.targetPerson,
                    targetPersonId: config.targetPersonId,
                }}
            />
        </div>
    )
}

API 文档-属性

url

评价中心的接口请求域名地址

commentKey

应用唯一key值,需要与后端协定

target

目标源对象

targetId

需要评论的指定数据id

targetPerson

指定数据的创建人姓名

targetPersonId

指定数据的创建人id