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

@alipay-inc/mpaas-mcdp-wx-render

v0.0.3-alpha.19

Published

## Package信息

Downloads

17

Readme

接入文档

Package信息

包名:@alipay-inc/mpaas-mcdp-wx-render 类型:公共类库 适用场景:微信小程序 功能简介:支持在微信小程序进行弹屏、公告、轮播(banner)、浮标四种类型的展位投放,和个性化广告投放能力。

npm标签引入

  1. 添加依赖
npm install @alipay-inc/mpaas-mcdp-wx-render
  1. 在小程序源码中的app.js顶部,插入以下代码,init参数见下表
import McdpView from '@alipay-inc/mpaas-mcdp-wx-render';
McdpView.init({
  appId: 'my-appId', // 必传
  workspaceId: 'my-workspaceId', // 必传
  reportURL: 'my-url' // 必传
  uploadURL: 'my-url' // 必传
})
  1. 在引用组件页面的json文件中插入以下代码(根据实际项目路径引入要使用的广告类型),广告类型见下表
{
  "usingComponents": {
    "rotation": "../../miniprogram_npm/@alipay-inc/mpaas-mcdp-wx-render/rotation/rotation"
  }
}
  1. 在使用页面的wxml文件中插入以下代码,并绑定对应展位码应用ID
<rotation mcdpCode="my-code"></rotation>

web-view跳转说明

小程序配置跳转地址

因为用户点击广告需跳转h5,为了解决跳转页面符合习惯交互,需要使用者在接入插件的小程序中手动添加web-view页面,如果不添加,请参考小程序不内置跳转地址
  1. 在小程序app.js定义web-view路由,并在项目中新建web-view页面
{
  "pages":[
    "pages/index/index",
    "pages/webview/webview"
  ]
}
  1. 在组件标签绑定web-view跳转地址,跳转地址说明见下表
<rotation webviewPath="/pages/webview/webview" mcdpCode="my-code"></rotation>
  1. 在web-view页面wxml文件中插入以下代码
<web-view src="{{url}}"></web-view>
  1. 在web-view页面js文件中插入以下代码
Page({
  data: {
    url: ''
  },
  onLoad(query) {
    this.setData({ url: query.url });
  },
})

小程序不配置跳转地址

小程序不内置跳转地会默认在当前页面打开web-view,右上角有关闭按钮(微信IDE不显示)

配置参数

init配置参数

| 属性名 | 类型 | 必填 | 默认值 | 说明 | 备注 | | ---- | ---- | ---- | ---- | ---- | ---- | | appId | string | 是 | - | 展位应用ID | 获取展位信息必需 | | workspaceId | string | 是 | - | 展位工作控件ID | 获取展位信息必需 | | reportURL | string | 是 | - | 请求路径host | 获取展位信息必需 | | uploadURL | string | 是 | - | 埋点上报数据host | 埋点上报数据必需 |

广告类型配置参数