


Summary of Forty Must-See Tips for WeChat Mini Program Development
This article mainly introduces to you the relevant information summarizing the forty must-see tips for developing WeChat mini programs. I believe it has certain reference value for everyone to learn or use WeChat mini programs, so it is especially recommended to everyone. Friends who need it can come and take a look.
Preface
WeChat’s “mini program” has been officially launched for a week, and related topics continue to heat up. The news of Alipay's development of "mini programs" was immediately exposed, and Internet giants were gearing up. Many netizens joked that this momentum would challenge the existing "APP empire." Well, in the face of such a hot mini program, WeX5 Mobile Development Cloud has not been idle. After searching across the entire network, we have selected a must-read article for mini program developers, covering the actual development of mini programs. 40 technical points that need attention for your reference!
Q: Why can’t objects such as window be used in scripts
Q: Why zepto/ jquery cannot be used
window object and document object, so it cannot be used.
Q:wx.navigateTo cannot open the page
wx.navigateTo cannot open the new page normally. Please avoid multi-level interactions, or use
wx.redir<a href="http://www.php.cn/wiki/1275.html" target="_blank">ectTo</a>
A:
supports class selectors starting with .
A:
background-image<a href="http://www.php.cn/wiki/895.html" target="_blank">: You can use the network </a>picture
, or base64, or use the
A: Using the page
, you can modify the style of the top-level node
page { display: block; min-height: 100%; background-color: red; }
## Q: Why
upload is unsuccessfulA: In order to improve the smoothness of the experience, the size of the compiled code package must be less than 1MB. Code packages larger than 1MB will fail to be uploaded. .
Q: HTTPS request unsuccessful
A: tls only supports version 1.2 and above
A: Network request referer cannot be set, the format is fixed to
https://
Q: Page.data cannot be directly manipulated
A: Avoid directly assigning and modifying Page.data
Page.set
Data Perform operations to synchronize data to the page for rendering. How to obtain user input <a href="http://www.php.cn/code/8209.html" target="_blank"></a>
To obtain user input components, you need to use components The
Attribute
<input id="myInput" bindchange="bindChange" /><checkbox id="myCheckbox" bindchange="bindChange" /> var inputContent = {} Page({ data: { inputContent: {} }, bindChange: function(e) { inputContent[e.currentTarget.id] = e.detail.value } })
Q: Does the WeChat applet support fetch or promise?
A: The promise tool currently does not support it, and the fetch client does not support it. The tool will remain unified in the next version.
Q: The currentTarget.id value in the touchmove sliding
does not change. A: The target / currentTarget of the touchmove / touch
end
Q: The parameter transmission server of the POST method of wx.request cannot receive the bug.
A: The content-type of wx.request post defaults to 'application/
'<a href="http://www.php.cn/wiki/1488.html" target="_blank"></a>
If the server does not use json interpretation, you can set
content-type
urlencoded.
<p class="jb51code"></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'>wx.request({
....
method: "POST",
header: {
"content-type": "application/x-www-form-urlencoded"
},
...
})</pre><div class="contentsignin">Copy after login</div></div><p></p><p><strong>Q:wx.upload<a href="http://www.php.cn/wiki/1313.html" target="_blank">File</a>在手机上返回http码403。<br/></strong></p><p>A:安卓的微信升级到6.5.2及其以上版本。<br/></p><p><strong>Q:小程序SVG支持吗?</strong><br/></p><p>A:image的src放远程svg可以,<code>background-image
里也可以。
Q:wx.request返回statusCode两端类型不一致。
A:确实有这个问题,稍后的版本将会修复。
Q:关于组件的动态生成与销毁?
A:不支持动态生成组件,但可以用 wx:for 去渲染多个。
Q:小程序支持热更吗?
A:不支持开发者自行更替。
Q:一些接口的回调IOS和Android不一致,例如支付接口,用户取消支付后,ios只回调complete方法,android则回调fail方法,官方文档也没有任何回调说明,造成开发很困难;类似的还有图片选择接口,分享接口等等。
A:支付接口,用户取消支付后,ios只回调complete
方法,android则回调fail
方法,问题已记录,多谢反馈。
Q:如果icon已经在服务器上了,想用直接访问网址的方法加载图片进来这样可以吗?
A:不能。
Q:ipad不能使用小程序?
A:暂时不支持ipad打开小程序。
Q:小程序音频,视频播放器问题 。1、能够只隐藏进度条跟时间吗?2、现在iOS平台上的时间显示是0:00,但是android上会显示错误码,能够通过什么设置修改吗?
A:1:下个版本会修改这里的交互,不显示进度条和时间。2:6.5.3 版本已修复此问题。
Q:拍照窗口可以加浮层吗?
A:暂时不支持。
Q:开发者工具经常报jsEngineScriptError错误,会导致页面白屏。
A:移步下载最新 0.12.130400 版本的开发工具试试
Q:开发者工具里面,SPA页面,更改title无效。
A:wx.setNavigationBarTitle
可以通过 API 改变导航栏标题。
Q:请问小程序页内支持长按保存图片或分享图片吗?
A:目前没有这个功能。
Q:关于swiper中的current问题。如果在新的版本中,直接设current,会产生的效果是:无论从哪个swiper元素点击进去,都会显示swiper第一个子元素的值。
A:目前swiper在处理swiper-item
动态变化的情况时有一些bug,会很快修复的。
Q:小程序能引用自己服务器上的wxss和js文件吗?
A:不能,无法执行远程代码。
Q:苹果7,提示内部错误,内存占用过多。
A:页面做的预加载,列表中有图片,图片渲染的太多了,解决办法就是不当屏展示的图片,不让它渲染。
Q:小程序体验者安卓卡在加载页面进不去,IOS可以进去。
A:这是android微信客户端旧版本的bug, 请下载最新版本的 6.5.3 客户端。
Q:请问目前微信小程序支持蓝牙吗?
A:目前不支持。
Q:分享功能真机没有效果?
A:这是android微信客户端旧版本的bug, 请下载最新版本的 6.5.3 客户端。
Q:强制使用https,开发和测试环境下怎么联调和测试?
A:「微信web开发者工具」->「项目」->「开发环境不校验请求域名及TLS版本」。
Q:wx.showToast()方法无效。
调用wx.request
请求网络然后在
complete: function (res) { // complete wx.hideToast(); }
在成功方法里面如果要进行showToast
的时候感觉无效,并没有弹出提示框。
A: success
The callback call is before complete
. If it is success showToast
, the next step complete hideToast
will be Flush showToast
.
Q: Does the text size in the picker component support modification?
A: Modification is not supported.
Q: The size of the tabBar image is too different between Android and iOS.
A: This is a bug in the old version of the android WeChat client, please download the latest version 6.5.3 client
Q: tabbar Page returns problem. How to return to the mini program homepage when clicking the return arrow in the upper left corner of a tabbar page other than the homepage? Now it is time to quit the applet directly
A: When creating a new page, use navigateTo to create a new page, while retaining the old page. If you use redirectTo, it is in the current Jump within the page.
Q: I would like to ask how to set wx.request() to be synchronous.
A: reqeust is to initiate a network request. There is no sync interface.
Q: The latest mac version of the tool is unavailable, and a failure to obtain appservice appears when entering.
A: Select direct link network in tool settings. Or the proxy software setting tool in the system directly connects to the network.
Q: Real machine view overflow-yThe slide will be very stuck.
A: The parent layer requires <a href="http://www.php.cn/wiki/902.html" target="_blank">position</a>:relative;
It will not get stuck after adding it.
The above is the detailed content of Summary of Forty Must-See Tips for WeChat Mini Program Development. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Xianyu's official WeChat mini program has quietly been launched. In the mini program, you can post private messages to communicate with buyers/sellers, view personal information and orders, search for items, etc. If you are curious about what the Xianyu WeChat mini program is called, take a look now. What is the name of the Xianyu WeChat applet? Answer: Xianyu, idle transactions, second-hand sales, valuations and recycling. 1. In the mini program, you can post idle messages, communicate with buyers/sellers via private messages, view personal information and orders, search for specified items, etc.; 2. On the mini program page, there are homepage, nearby, post idle, messages, and mine. 5 functions; 3. If you want to use it, you must activate WeChat payment before you can purchase it;

WeChat applet implements picture upload function With the development of mobile Internet, WeChat applet has become an indispensable part of people's lives. WeChat mini programs not only provide a wealth of application scenarios, but also support developer-defined functions, including image upload functions. This article will introduce how to implement the image upload function in the WeChat applet and provide specific code examples. 1. Preparatory work Before starting to write code, we need to download and install the WeChat developer tools and register as a WeChat developer. At the same time, you also need to understand WeChat

To implement the drop-down menu effect in WeChat Mini Programs, specific code examples are required. With the popularity of mobile Internet, WeChat Mini Programs have become an important part of Internet development, and more and more people have begun to pay attention to and use WeChat Mini Programs. The development of WeChat mini programs is simpler and faster than traditional APP development, but it also requires mastering certain development skills. In the development of WeChat mini programs, drop-down menus are a common UI component, achieving a better user experience. This article will introduce in detail how to implement the drop-down menu effect in the WeChat applet and provide practical

Implementing picture filter effects in WeChat mini programs With the popularity of social media applications, people are increasingly fond of applying filter effects to photos to enhance the artistic effect and attractiveness of the photos. Picture filter effects can also be implemented in WeChat mini programs, providing users with more interesting and creative photo editing functions. This article will introduce how to implement image filter effects in WeChat mini programs and provide specific code examples. First, we need to use the canvas component in the WeChat applet to load and edit images. The canvas component can be used on the page

Use the WeChat applet to achieve the carousel switching effect. The WeChat applet is a lightweight application that is simple and efficient to develop and use. In WeChat mini programs, it is a common requirement to achieve carousel switching effects. This article will introduce how to use the WeChat applet to achieve the carousel switching effect, and give specific code examples. First, add a carousel component to the page file of the WeChat applet. For example, you can use the <swiper> tag to achieve the switching effect of the carousel. In this component, you can pass b

Implementing the sliding delete function in WeChat mini programs requires specific code examples. With the popularity of WeChat mini programs, developers often encounter problems in implementing some common functions during the development process. Among them, the sliding delete function is a common and commonly used functional requirement. This article will introduce in detail how to implement the sliding delete function in the WeChat applet and give specific code examples. 1. Requirements analysis In the WeChat mini program, the implementation of the sliding deletion function involves the following points: List display: To display a list that can be slid and deleted, each list item needs to include

To implement the picture rotation effect in WeChat Mini Program, specific code examples are required. WeChat Mini Program is a lightweight application that provides users with rich functions and a good user experience. In mini programs, developers can use various components and APIs to achieve various effects. Among them, the picture rotation effect is a common animation effect that can add interest and visual effects to the mini program. To achieve image rotation effects in WeChat mini programs, you need to use the animation API provided by the mini program. The following is a specific code example that shows how to

The official WeChat mini program of Xianyu has been quietly launched. It provides users with a convenient platform that allows you to easily publish and trade idle items. In the mini program, you can communicate with buyers or sellers via private messages, view personal information and orders, and search for the items you want. So what exactly is Xianyu called in the WeChat mini program? This tutorial guide will introduce it to you in detail. Users who want to know, please follow this article and continue reading! What is the name of the Xianyu WeChat applet? Answer: Xianyu, idle transactions, second-hand sales, valuations and recycling. 1. In the mini program, you can post idle messages, communicate with buyers/sellers via private messages, view personal information and orders, search for specified items, etc.; 2. On the mini program page, there are homepage, nearby, post idle, messages, and mine. 5 functions; 3.
