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

dfo-mall-sdk

v1.4.1

Published

开发者也可直接克隆当前仓库,使用微信开发者工具导入本项目后,执行以下步骤,快速浏览相关功能:

Downloads

35

Readme

dfo-mall-sdk微信小程序SDK使用指南

是DFO小程序SDK(本SDK)为小程序自定义组件形式,使用npm方式发布。本文引导开发者从零开始,一步一步搭建起DFO基本功能框架。如果开发者是在现有项目中集成本SDK,可直接从第2步开始阅读。

开发者也可直接克隆当前仓库,使用微信开发者工具导入本项目后,执行以下步骤,快速浏览相关功能:

  • 点击IDE右上角的“详情”,修改AppID。
  • 使用命令提示符或终端,进入当前项目所在本地目录,执行命令更新SDK:npm i dfo-mall-sdk@latest --production。
  • 点击IDE菜单中的“工具”-“构建 npm”。

特别说明

  1. 本项目所使用的AppId为接口测试号AppId,在终端上执行预览会提示错误信息,请更换为实际可用的AppId。
  2. 本项目所使用token和channel为演示专用,无法应用到测试或生产环境。

通过本SDK可实现以下功能:

  • 商品展示
  • 商品购物
  • 个人信息

项目搭建

1. 新建项目

  • 启动IDE,选择小程序项目。
  • 新建项目。
  • 选择项目目录,输入AppID和项目名称,点击确定。

2. 修改项目设置

  • 点击IDE右上角的“详情”,勾选“使用npm模块”和“不校验合法域名、web-view(业务域名)、TLS版本以及HTTPS证书”。

3. 加载SDK

  • 使用命令提示符或终端,进入小程序项目所在根目录,执行命令初始化:npm init --yes
  • 初始化成功后,执行命令加载SDK:npm i dfo-mall-sdk --production

4. npm构建

  • 点击IDE菜单中的“工具”-“构建 npm”,如果构建成功,会提示“完成构建”。

5. 使用SDK创建页面

  • 使用小程序IDE创建新的页面(以pages/index/index为例),编辑index.json文件,声明要使用的SDK组件。
  • 编辑index.wxml文件,插入SDK组件标签。
  • 编辑index.js文件,通过setData()给相应的变量赋值。

6. 如何更新SDK

  • 使用命令提示符或终端,进入小程序项目所在根目录,执行命令更新:npm i dfo-mall-sdk --production
  • 打开小程序开发者IDE,点击IDE菜单中的“工具”-“构建 npm”。

小程序后台配置

1.登录微信小程序管理后台:https://mp.weixin.qq.com

2.点击【开发】-【开发设置】

3.在”服务器域名“中增加如下配置:

  • request合法域名:
  https://www.china-dfs.com
  • socket合法域名:
  wss://www.china-dfs.com
  • uploadFile合法域名:
  https://www.china-dfs.com
  • downloadFile合法域名:
  https://www.china-dfs.com
  • UDP合法域名:
  https://www.china-dfs.com
  • web-view合法域名:
  https://www.china-dfs.com

6. 在“设置”-“基本设置”下,将“基础库最低版本设置”设置为2.12.2或更高版本。

SDK说明

1.公共参数说明

  • 说明 :以下参数为公共参数(必填),用于用户登录和身份验证,任何独立调用组件
  • mobile :Integer,需要登陆的手机号码。
  • channel :String,由DFO提供的第三方频道号。
  • token :String,由DFO提供的第三方频道加密码,加密方式请和DFO联系。
  • isDev :Boolen,是否是开发版本
  • openid :String,本地appid的openid
  • indexPage :String,sdk首页地址,本地系统的内页面/pages/XXX

2.可被独立调用的组件

  • index : 首页
  • cartList : 购物车
  • cateBrand : 分类
  • cateList : 产品列表
  • orderDetail : 订单详情,需要设置 id:orderDetail
  • orderList : 订单列表,需要设置 id:orderList
  • address : 地址列表,需要设置 id:address
  • userReal : 实名认证