当前位置:网站首页>小程序H5获取手机号方案
小程序H5获取手机号方案
2022-07-25 09:24:00 【|刘钊|】
原因说明:
1、由于小程序获取手机号是通过小城的button组件获取,和UI是耦合关系;
2、小程序的web-view组件默认铺满全屏幕,并且web-view组件上不允许覆盖任何其他小程序组件;
具体内容可参照web-view 、 button 组件介绍;


解决方案:
H5页面跳转小程序页面,获取到手机号后通过url传参方式将手机号传入h5页面
代码实现
小程序原声获取手机号:
1、.wxml文件
|
2、.js文件
|
小程序web-view页面接收返回传过来的参数:
.js文件
|
h5页面接收参数
|
注意:
1、从原声页面返回web-view页面,通过url传参数直接进入h5的下一个页面,即一次history.push操作。
2、h5页面数据需要保留的一律使用redux的sotre缓存,这样能保证h5页面返回重新渲染页面数据还在。
边栏推荐
- [tensorflow2 installation] tensorflow2.3-cpu installation pit avoidance guide!!!
- CCF 201509-3 template generation system
- Gartner 2022年顶尖科技趋势之超级自动化
- 手持振弦采集仪对振弦传感器激励方法和激励电压
- FPGA basic advanced
- FPGA基础进阶
- 【建议收藏】靠着这些学习方法,我入职了世界五百强——互联网时代的“奇技淫巧”
- Temperature, humidity and light intensity acquisition based on smart cloud platform
- Mlx90640 infrared thermal imaging sensor temperature measurement module development notes (II)
- CDA Level1多选题精选
猜你喜欢

ROS分布式操作--launch文件启动多个机器上的节点

工程监测多通道振弦传感器无线采集仪外接数字传感器过程

Principle analysis of self supervised depth estimation of fish eye image and interpretation of omnidet core code

Swift creates weather app

Introduction to armv8 general timer

FPGA basic advanced

【成长必备】我为什么推荐你写博客?愿你多年以后成为你想成为的样子。

概率论与数理统计 4 Continuous Random Variables and Probability Distributions(连续随机变量与概率分布)(上篇)

阿里MQTT物联网平台“云产品流转”实战——两片ESP32通过物联网平台实现远程互操作

工程仪器振弦传感器无线采集仪的采集数据发送方式及在线监测系统
随机推荐
一个硬件攻城狮的经济学基础
Mlx90640 infrared thermal imaging sensor temperature measurement module development notes (III)
Introduction to armv8 general timer
OC -- packaging class and processing object
AI模型风险评估 第1部分:动机
rospy Odometry天坑小计
FLASH read / write operation and flash upload file of esp8266
SystemVerilog syntax
用Arduino写个ESP32看门狗
单目深度估计基础理论和论文学习总结
File -- first acquaintance
ARMV8 datasheet学习
AMD EPYC 9664旗舰规格曝光:96核192线程 480MB缓存 3.8GHz频率
C语言基础
用ESP32+TM1638实验NTP网络校时闹钟的ARDUINO代码
OC -- Inheritance and polymorphic and pointer
Store to-do items locally (improve on to-do items)
CCF 201512-4 送货
TensorFlow raw_ RNN - implement the seq2seq mode to take the output of the previous time as the input of the next time
Data viewing and parameter modification of multi-channel vibrating wire, temperature and analog sensing signal acquisition instrument