dfws-channel

0.0.9 • Public • Published

东方网升 header头公共渠道组件

发布

  1. 更改package.json版本
  2. yarn run build
  3. npm publish 注:镜像源需切换回NPM官方源

链接

示例

  • yarn
  • yarn start

使用之前

该组件用于taro、react和jquery版本。

何时使用

  • 项目公共 header 参数配置。

API

jquery 版本

<script src="https://f3-df.veimg.cn/common/lib/dfws-channel.min.js"></script>
<script>
//具体配置:管理后台-最佳东方-系统设置-渠道管理
var channel = { "project": "VE", "origin": "C", "platform": "PC", "device": "ZJDF","version":" 1.0.0" };
var dfws_params = window.getPublicChannel(channel);
console.log(dfws_params, 'dfws_params')
</script>

react/vue 版本

import getPublicChannel from "dfws-channel"

//具体配置:管理后台-最佳东方-系统设置-渠道管理
const channel = { "project": "VE", "origin": "C", "platform": "PC", "device": "ZJDF","version":" 1.0.0" };
/**
 * 东方网升项目公共 header
 * @param {object} params
 */
const dfws_params = JSON.stringify(getPublicChannel(channel));

taro 小程序版本

import Taro from '@tarojs/taro'
import getPublicChannel from "dfws-channel/dist/taro"

//具体配置:管理后台-最佳东方-系统设置-渠道管理
const channel = { "project": "VE", "origin": "C", "platform": "XCX", "device": "ZJDF","version":" 1.0.0" };
/**
 * 东方网升项目公共 header
 * @param {object} dfws_header
 */
const dfws_header = getPublicChannel(channel, Taro)
// 获取网络环境
dfws_header.getNetworkType(network => {
  channel.network = network
})
const dfws_params= JSON.stringify(dfws_header.xcxQueryChannels())

props

参数 说明 类型 默认值
channel 公共渠道配置参数 object -

返回值

{"project":"VE","origin":"C","device":"ZJDF","network":"4G","device_brand":"unknown","system":"unknown","system_version":"unknown","version":"1.0.0","browser":"chrome","browser_version":"121.0.0.0","screen":"1920*1080","platform":"PC"}

参考文档

渠道管理

Package Sidebar

Install

npm i dfws-channel

Weekly Downloads

6

Version

0.0.9

License

ISC

Unpacked Size

157 kB

Total Files

26

Last publish

Collaborators

  • dfws.fed