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

gweb_tools

v1.6.7

Published

柜柜工具函数以及网络请求API

Readme

安装

npm install gweb_tools

使用示例

import { utils, requests } from 'gweb_tools'

// 调用工具函数,获取当前时间的格式化字符串
utils.getNowFormatTime('yyyy-MM-dd hh:mm:ss'); 


// 调用测试环境的API
requests.test.getGuiguiOrderList({
  uid: 10845,
  type: -1
}).then(res) => {
  // 成功获取数据的回调
}).catch((err) => {
  // 失败的回调
})

// 调用正式环境的API
requests.formal.getGuiguiOrderList({
  uid: 10845,
  type: -1
}).then(res) => {
  // 成功获取数据的回调
}).catch((err) => {
  // 失败的回调
})

utils工具函数使用说明

getQueryParams

参数是一个数组(元素为查询字符串的key),或者不传参数。当参数为数组时,会按键值对返回对应查询字符串key以及对应值。当不传参数时,会按键值对返回全部合法的查询字符串的key和值。

示例

window.location.search = '?q=123&en=12345';
getQueryParams();
/* 返回:
{
  q: 123,
  en: 12345
}
*/

getQueryParams(['q']);
/* 返回:
{
  q: 123
}
*/

requests请求使用说明

获取柜柜订单 getGuiguiOrderList(payload)

参数payload为一个对象,具体字段参考接口文档

该函数返回值是一个promise,resolve状态的返回值是包含了订单列表信息的内容(对应接口文档中的返回示例中的data),reject状态返回值是网络请求失败信息(后端返回了非200状态),或者后端返回的msg信息。

获取CAD图纸数据 getCadData(payload)

接口文档暂缺,靠现有使用示例实现该请求。

payload是一个对象, 形如:

{
  oid: 102621, // 订单id
  rid: [190722] // 房间id的列表
}

请求成功会返回一个阿里云的json文件地址(这个文件内容包含了实际的cad绘图信息以及订单信息),得到这个地址后,需要使用这个地址去阿里云获取文件内容。

因为获取文件内容不涉及切换API的host,这里不再对获取文件内容的API进行封装,请自行通过axios的get请求获取。

注:以下接口的payload均为一个对象,键值对的取值根据相应接口文档而定

获取报价单数据 getOrderPrice(payload)

[接口文档]:(https://www.showdoc.com.cn/268789329907478?page_id=2952888840036681)

保存报价单 saveOrderPrice(payload)

[接口文档]:(https://www.showdoc.com.cn/268789329907478?page_id=2951768139016224)

加载报价配置数据 getOrderPriceSetting(payload)

[接口文档]:(https://www.showdoc.com.cn/268789329907478?page_id=2071827850041041)

加载报价配置选项 getOrderPriceSettingConfigs(payload)

[接口文档]:(https://www.showdoc.com.cn/268789329907478?page_id=3950066422306328)

保存报价配置 saveOrderPriceSetting(payload)

[接口文档]:(https://www.showdoc.com.cn/268789329907478?page_id=2071777587012122)

计算报价单 calcOrderPrice(payload)

[接口文档]:(https://www.showdoc.com.cn/268789329907478?page_id=4831536141286823)

获取订单详情 getOrderDetail(payload)

[接口文档]:(https://www.showdoc.com.cn/268789329907478?page_id=1536221418229468)