干货分享|科技从业者必读之微信小程序的潜能和局限 Dos and Don'ts of WeChat Mini Programs

2021-05-20 19:15 LeWagon沃耕

关注Le Wagon 沃耕公众号的小伙伴应该已经看到我们介绍过很多微信小程序的成功案例,深入探讨它是如何在各个行业发挥商业价值,大放异彩的。微信小程序已经渗入到城市生活的方方面面,但是它有没有什么限制吗?作为一个优秀的编程社群,我们怎么能放过这个话题?今天这篇文章我们就从开发人员的角度发掘一下微信小程序的潜能和一些些局限。


本文新手友好,实例丰富,搭配可以随时参考的关键术语,小程序资讯网站,还有线下 Dylan 导师的同话题工作坊,方便你稍后深入学习,相信你也很快能从微信小程序的技术角度向朋友侃侃而谈!



每个微信小程序需要事先设置通讯域名,小程序只可以跟指定的域名进行网络通信。包括普通 HTTPS 请求、上传文件、下载文件和 WebSocket 通信。


The Mini Program can only communicate with the specified domain name over the network. This includes normal HTTPS request, file upload and WebSocket communication.



手机中嵌入了很多设备和功能,例如陀螺仪,指南针,加速度计,并且微信小程序允许我们访问这些设备和嵌入的功能
There are a lot of devices and functions embedded inside our phones, which includes gyroscope, compass, accelerometer for instance, and WeChat Mini-Program allows us to access these devices and embedded functions.
上图例子是一个名为怪兽充电的小程序屏幕截图,该程序在页面底部提供了扫码功能,使用户可以扫描充电宝充电站上的二维码。
The picture above is a screenshot of a Mini-Program called 怪兽充电, which provides a scanning code function on the bottom of the page to let the users scan the QR codes on the charge stations.


这个相对容易理解,因为它在我们的日常生活中很常见。微信小程序能够获取,选择和查看位置

This is an easy one to understand since it appears commonly in our daily life. WeChat Mini-Program is capable of getting, selecting and viewing locations.

使用微信小程序的优势之一是它与微信中的其他组件(例如,微信支付,微信运动,企业微信等)的深度结合。左图是小程序与微信互动的演示。微信中的许多数据都可以从小程序中获取。


One of the advantages of using WeChat Mini-Program is its integration with other   components in WeChat such as WeChat Pay, WeRun. Here is the demonstration where Mini-Program interacts with WeChat. All the data from WeChat can be fetched from the Mini-Program.


微信小程序支持多种媒体类型,包括音频,视频,图像,直播等,以及相应的基本操作,如保存,获取,删除,打开等。通过接口,微信小程序还能够访问各种输入,例如相机,麦克风。

WeChat Mini-Program supports lots of media types which includes audio, video, images, livestream etc. and corresponding basic operations such as save, get, delete, open.

Through APIs, WeChat MP is also able to access inputs such as camera, microphone.


借助相关接口和插件,微信小程序功能可以通过以下方式得到扩展:

With APIs and plugins, WeChat MPs capabilities can be extended with:

AI MP supported by Baidu







小程序跳转小程序:

小程序虽然可以实现跳转到其他小程序的功能,但有一定限制

  • 每个小程序可跳转其他小程序的数量限制为不超过10

  • 需要用户触发跳转

  • 需要用户确认跳转


Navigating to other WXMPs

You can jump to other WXMPs with following limitations:

  • Each WXMP can jump to at most 10 other WXMPs

  • Need users to trigger the redirection

  • Need users to confirm the redirection

小程序跳转公众号:

  • 必须是与小程序关联的公众号,不能跳转至别人的公众号文章;

Navigating to Official Account

  • The WXMP has to be linked with the official accountcan not jump to others’ articles


从左到右依次是聊天记录,联系人名单,朋友圈,微信支付/钱包

From left to right is Chat History,Access / Manipulate Contact List,Users’ Moment,Wallet & Transactions


    


Follow us! 关注我们的微信公众号!

Learn with Le Wagon and build the skills

you need to be successful in the new digital economy.

640?wx_fmt=jpeg