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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yeepay/satisfaction-survey-h5

v0.1.3

Published

Vue3 + Vant4 满意度调研弹窗(H5)

Readme

@yeepay/satisfaction-survey-h5

Vue3 + Vant4 满意度调研弹窗(H5)。

推荐接入(类似 Vant)

1. 安装

pnpm add @yeepay/satisfaction-survey-h5

本地调试
npm run build:watch
它会持续:
src变化
 ↓
自动更新dist

应用端使用link指向本地npm的dist
"@yeepay/satisfaction-survey-h5": "link:../satisfaction-survey-h5",

2. main.ts 一次注册

import { createApp } from 'vue'
import SatisfactionSurvey from '@yeepay/satisfaction-survey-h5'
import '@yeepay/satisfaction-survey-h5/style.css'
import { post } from '@/utils/request'
import App from './App.vue'

const app = createApp(App)

app.use(SatisfactionSurvey, {
  request: ({ url, data }) => post(url, data),
  apiPrefix: '/app',
  // 本地无接口时可开 mock
  // mock: true,
  getBackendVersion: () => 'MERCHANT'
})

app.mount('#app')

插件会自动挂载 Host,无需改 App.vue。

3. 业务页只触发 open

import { openSatisfactionSurvey } from '@yeepay/satisfaction-survey-h5'

openSatisfactionSurvey({ businessType: 'NET_IN' })

未自定义 apis 时默认:

  1. POST {apiPrefix}/survey/satisfaction/checkAndPull
    • 入参(CheckAndPullParams):
      • businessType:业务类型(NET_IN | AGGREGATE | SPLIT | FUND | ACCOUNT | COMMON)
      • clientType:客户端类型(PC | APP)
      • backendVersion:后台版本(CHANNEL | MERCHANT)
    • 出参(checkAndPull 成功后会触发弹窗展示判断,通常解包到 payload;字段含义以 payload.* 为准):
      • canShow:是否展示弹窗(boolean)
      • questions:问题列表(Array<{ questionCode: string, questionText: string, sortNo?: number }>)
      • title 或 contentTitle(可选):弹窗标题
      • questionPrompt 或 content(可选):问题区块提示文案
  1. POST {apiPrefix}/survey/satisfaction/submit
    • 入参(SubmitSatisfactionParams):
      • score:满意度评分(number,1-5,必填)
      • questionCodes(可选):1-3 分时选择的问题 code 列表(string[];1-3 分必填)
      • remark(可选):补充描述(string;1-2 分必填,3 分可选)
      • businessType / clientType / backendVersion(建议与 checkAndPull 一致)
    • 出参(只关心 status / errMsg):
      • 成功:{ status: 'success' }(或不返回 { status: 'error' })
      • 失败:{ status: 'error', errMsg?: string }(页面会展示 errMsg,默认 提交失败)
  1. POST {apiPrefix}/survey/satisfaction/close
    • 入参(CloseSatisfactionParams,三维必填):
      • businessType / clientType / backendVersion
    • 出参:
      • 当前端不依赖返回值(例如 {})

可选:模板挂 Host

不使用插件时,也可在根节点挂一次:

<template>
  <router-view />
  <SatisfactionSurveyHost api-prefix="/app" :request="satisfactionRequest" />
</template>

Plugin Options

| 属性 | 说明 | |------|------| | request | 应用鉴权请求 | | apiPrefix | 路径前缀,如 /app | | apis | 覆盖默认接口 | | mock | 本地 mock,不打真实接口 | | autoMount | 是否自动挂 Host,默认 true | | getBackendVersion | 返回 CHANNEL / MERCHANT |

微前端

应用卸载时可调用 unmountSatisfactionHost() 清理 body 上的 Host。

语义化更新版本 主版本.次版本.补丁版本 major.minor.patch

npm run build ↓ npm version patch ↓ npm publish