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

addressselector

v1.0.0

Published

整合当前项目城市选择器—《仿京东》 ``` 1,数据格式—json—【area_two.json】 2,主要控件 —①(自定义Cell—【AreaTableViewCell】) —②(自定义View—【AreaView】) —③(自定义Button—【暂时不知道用处】) —④(RN交互文件—【CitySelectss】) 3,第三方用到Masonry自动布局 ``` # 如何使用 * 手动导入 直接下载工程把 `Masonry`+`CitySelectModules`+`CitySe

Downloads

2

Readme

AddressSelector

整合当前项目城市选择器—《仿京东》

	1,数据格式—json—【area_two.json】
	2,主要控件
		—①(自定义Cell—【AreaTableViewCell】)
		—②(自定义View—【AreaView】)
		—③(自定义Button—【暂时不知道用处】)
		—④(RN交互文件—【CitySelectss】)
	3,第三方用到Masonry自动布局

如何使用

  • 手动导入 直接下载工程把 Masonry+CitySelectModules+CitySelectss 文件夹导入到自己工程中。

  • RN中在文件内react-native里导入NativeModules,然后配置XCode中选择器文件方法,const JDAddressSelect = Platform.OS === 'ios' ? NativeModules.CitySelectss : NativeModules.JDAddressSelect;

  • 调用方法

    Ios:

          `JDAddressSelect.OpenCity()`。

    Android:

          —① `JDAddressSelect.showJDAdressSelectDialog(
      		"","","","","","",
      		(provinceName, cityName, yorkName, provinceCode, cityCode, yorkCode) => {
                      console.log(provinceName + cityName + yorkName + provinceCode + cityCode + yorkCode)
      		})`。
    			
          —②  `JDAddressSelect.showJDAdressSelectDialog(
      		"内蒙古","呼和浩特","新城区","150000","150100","150102",
      		(provinceName, cityName, yorkName, provinceCode, cityCode, yorkCode) => {
                      console.log(provinceName + cityName + yorkName + provinceCode + cityCode + yorkCode)
      		})`。  
    			

    使用方法①时,每次调用皆是一个全新的选择器。

    使用方法②时,会显示上次选择内容。如果需要打开后显示上次选择内容请选择方法②,六个参数依次为:省份名称,市名称,区名称,省级编码,市级编码,区级编码。这六个参数请按照上次选择后回调的六个参数依次填写,即console打印的内容。

    注意:如果不需要上次选择内容,请也将六个参数补齐,即六个空字符串即可。

iOS原生访问调用React Native

  • 如果我们需要从iOS原生方法发送数据到JavaScript中,那么可以使用eventDispatcher。首先我们需要在RCTBridgeModule实现中中引入:
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
@synthesize bridge = _bridge;
  • 接下来通过iOS OC原生代码进行访问JavaScript--其中CityInfos是标识符,body内的事传递的参数。
  [self.bridge.eventDispatcher sendAppEventWithName:@"CityInfos"body:@{@"info":infoDic,@"code":codeDic}];
  • 其中RN中需使用DeviceEventEmitter.addListener("CityInfos", (params) 方法进行调用。
如上的代码,首先通过导入NativeAppEventEmitter模块,使用该模块在JavaScript代码中进行注册订阅相应的事件。然后我们在方法中使用addListener()方法进行添加订阅事件。有订阅当然有取消订阅,所以我们在remove()方法进行取消即可。

演示

联系我:

  • qq: 8513036
  • qq: 2667948594