


WeChat Mini Program 0.11.122100 version update details introduction
0.11.122100 Update Overview
Added 4 new APIs, 2 new components
Expansion Added 10 component properties and added 6 component events
Fixed dozens of API and component bugs and optimized some interactive experiences
Development The developer tool adds debugging support for new APIs and components
The developer tool adds debugging support for WeChat payment
Basic library update
A New API wx.switchTab Details
A New API wx .scanCode
A New API wx.createMapContext
A New API wx.createCanvasContext
A Added new API wx.showToast calling parameter mask
A Added new page method Page.onShareAppMessage for customizing sharing content
A New framework method App.onError
A New page configuration disabelScroll
A New
component A Added
component, used to display customer service session button A Added
Component attribute openType A Added
Component attribute color -
A Added component attribute objectFit
A Added component attribute markers polyline circles include-points controls show-location
A Added
component attribute circular to control connection sliding A Added component attribute cursor- spacing
A Added component attribute cursor-spacing
A Added
component attribute disabled A Add
component attribute hover-class A Add
Component attributes scroll-x, scroll-y support dynamic modification A Added component event bindtap bindmarkertap bindcontrolstap bindregionchange
A Add component event bindconfirm
A Add component event bindtimeupdate
A New component event bindconfirm
A New component event bindinput
A New Component event bindlongtap
A Added AudioContext.setSrc() context API
A Added CanvasContext context
A Added CanvasContext.arc() context API
A Added CanvasContext.fillRect() context API
A New CanvasContext.strokeRect() context API
A New CanvasContext.createLinearGradient() context API
A New Added CanvasContext.createCircularGradient() context API
A Added
component to prevent the page from scrolling when scrolling U Update API wx.getSystemInfo Add platform return parameters
U Update API wx.downloadFile When the HTTP status code is 200 or 304, tmpFilePath will be returned
U Update the character limit of API wx.showModal call parameter confirmText cancelText
U Update WXML dataset return to support Object and Array
U Update
component attribute mode optional widthFix U Update
component attribute range Add ObjectArray type support U Update
default style U Update CanvasContext.save() CanvasContext.restore() Context API Save brush style
U Update CanvasContext.arc() Context API parameter adjustment, add eAngle, counterclockwise, remove sweepAngle
U Optimize the sliding experience of
U Optimize the interactive experience of
in U Optimize
component click experience F Fix wx.request method on Android can only use uppercase letters Value problem
F Fix the problem that wx.uploadFile cannot set header on iOS
F Fix wx.getLocation type=gcj02 on iOS The problem that it does not take effect
F Fix the problem that wx.showToast is still displayed after exiting the applet
F Fix the wx.showModal return parameter in Inconsistency between Android and iOS
F Fixed the layout disorder problem when wx.showModal content is too long or the title is empty
F Fix the problem that the default value is not displayed when wx.showModal cancelText and confirmText are empty
F Fix the problem that the keyboard pops up during wx.showModal and the keyboard cannot be closed
F Fix the problem that wx.getImageInfo cannot obtain http link images on Android
F Fixed the problem of inconsistent screen height obtained by wx.getSystemInfo due to tabbar appearance
F Fixed wx.downloadFile image not being displayed after downloading on Android Problem
F Fix the problem that wx.request does not correctly encode the request data
F Fix wx.login App.onLaunch in iOS No callback problem
F Fix wx.createAnimationContext setting transformOrigin exception and animation cannot proceed to the next step
F Fix wx.navigateTo wx .redirectTo On iOS, the problem that Page.onLoad cannot be called
F Fixed the problem that the default behavior of catch blocking events is invalid
F Fixed SetInterval parameter-passing error on iOS causes the page to freeze.
F Fixed the problem of onReachBottom triggering multiple times
F Fixed
Problem with error when having descendants of text nodes - ##F Fix
hidden attribute does not take effect - F Fix the problem that the
label does not take effect - F Fix the problem of
sliding to the top or bottom of the splash screen - F Fix the problem of event not taking effect on iOS
- F Fix the problem that the sound of will continue to exist after it is removed on iOS
- F Fix
The problem that class and style will not be dynamically updated when embedded - F Fixed the problem of incorrect text color when disabled
- F Fix the issue where focus attribute is invalid
- F Fix When using display:flex in iOS9, the first input is not displayed Problem
- F Fix the problem of displaying exception when the initial value is undefined
- F Fix
- F Fix
color abnormality problem before and after focusing - F Fix the problem of abnormal positioning of position:fixed
- F Fix the problem of not triggering the blur event after opening the picker
- F Fix the problem of height change when setting auto-height in ##F Fix the problem of destruction exception of
- F Fixed the problem that the full screen button in needs to be clicked twice to take effect on Android
- ##F Fixed the problem in The problem of conflicting use of the same id in multiple pages
##F Fixed the problem that drawImage cannot be displayed normally
F Fixed
In the bindload event, setData will have an infinite loop problem -
F Fix the problem of
scroll-into-view failure -
F Fix the problem that
submit cannot get the input content D The
redirect attribute will be removed soon D The wx.createContext interface will be removed soon
D The auto-focus attribute will be removed soon, use focus directly Attributes
D will be removed covers attribute
-
Basic functions of developer tools
A Added debugging support for wx.switchTab
A Added wx.startRecord wx.stopRecord wx.playVoice wx. pauseVoice wx.stopVoice API debugging support
A Added WeChat payment debugging support
A Added QR code scanning debugging support
A Added a new message about app.json repeatedly defining the page file, resulting in a submission preview error
A Added a new message about network error when loading images in the simulator
A Added the function of setting the initialization page and parameters when compiling
A Added the function of setting the initialization page and parameters when submitting the preview
F Optimize the appdata panel to view data in separate pages, support dynamic updates and code mode display
F Fix wx.getBackgroundAudioPlayerState when there is no music playing No return problem
F Fix wx.getBackgroundAudioPlayerState getting status incorrect problem
F Fix wxml panel white screen in some cases Problem
F Fixed the problem that wxml panel attributes cannot be copied, and the copy contains a carriage return
F Fixed the problem that wxml panel single text node is not displayed Alignment problem
F Fix the simulator display error when the tabbar position in app.json is set to top
F Fix devtools and The problem of incorrect clicking on external links in the editor
F Fixed the problem of wx.requst being unable to send the request due to cache
wx.switchTab(OBJECT)
Jump to the tabBar page and close all other non-tabBar pages
OBJECT parameters Description:
[tr]Parameter type required description[/tr]
url | String | is | The path of the tabBar page that needs to be jumped (the page that needs to be defined in the field of app.json), the path cannot be followed by parameters |
success | Function | No | Callback function for successful interface call |
fail | Function | No | Interface call Failed callback function |
complete | Function | No | The callback function that ends the interface call (will be executed if the call is successful or failed) ) |
{ "tabBar": { "list": [{ "pagePath": "index", "text": "Homepage" },{ " pagePath": "other", "text": "other" }] }}wx.switchTab({ url: '/index'})
wx.scanCode( OBJECT)
Launch the client QR code scanning interface, and return the corresponding result after successful scanning.
Object parameter description:
[tr]Parameter type required description[/tr]
success | Function | No | The interface calls the callback function successfully. For details of the return content, see the return parameter description. |
fail | Function | No | Callback function that fails to call the interface |
complete | Function | No | The callback function at the end of the interface call (will be executed if the call is successful or failed) |
[tr]Parameter description[/tr]
result | Content of code |
wx.scanCode({ success: (res) => { console.log(res) }})
onShareAppMessage
Define the onShareAppMessage function in Page to set the sharing information of the page.
Only when this event handler is defined, the "Share" button will be displayed in the upper right corner menu
It will be called when the user clicks the share button
This event needs to return an Object for custom sharing content
[tr]Field description Default value[/tr]
title | Share title | Current applet name |
Sharing description | Current applet name | |
Sharing path | Current page path, required Is the complete path starting with / |
##wx.showToast(OBJECT)
Display message prompt Box
OBJECT parameter description:
[tr]Parameter type required description[/tr]
String | Yes | Prompt content | |
String | No | icon, only supports "success", "loading" | |
Number | No | The delay time of the prompt, in milliseconds, default: 1500, maximum 10000 | |
Boolean | No | Whether to display a transparent mask to prevent touch penetration, default: false | |
Function | No | Callback function for successful interface call | |
Function | No | Callback function for failed interface call | |
Function | No | The callback function at the end of the interface call (will be executed if the call is successful or failed) |
onShareAppMessage
Define the onShareAppMessage function in Page to set the sharing information of the page.
- Only when this event handler is defined, the "Share" button will be displayed in the upper right corner menu
- It will be called when the user clicks the share button
- This event needs to return an Object for custom sharing content
-
Customized sharing field [tr]Field description Default value[/tr]
Share title | Current applet name | ##desc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Current applet name | path | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Current page path, required Is the full path starting with / | Sample code: |
canvasId | String | Canvas representation, pass in the canvas-id defined in |
##New component:
audioContext
audioContext is bound to an component through audioId, through which the corresponding component.
AudioContext object method list:
[tr]Method parameter description[/tr]
src | Audio Address | |
None | Play | |
None | Pause | |
position | Jump to the specified position, unit s |

Scroll selector embedded in the page
[tr]Attribute name type default value description[/tr]
Number Array |
The numbers in the array sequentially represent the number selected by the picker-view-colume in the picker-view (the subscript starts from 0), the number When the length of the picker-view-column options is greater than the length, the last item is selected. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
String | ##Set the style of the selected box in the middle of the selector |
bindchange | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The change event is triggered when the value changes during scroll selection, event.detail = {value: value} ;value is an array, indicating which item is currently selected in the picker-view-column in the picker-view (the subscript starts from 0) |
Note: Only the |
x | Number | x coordinate of the center of the circle |
y | Number | y coordinate of the center of the circle |
r | Number | The radius of the circle |
##Example
const ctx = wx. createCanvasContext('myCanvas')// Create circular gradientconst grd = ctx.createCircularGradient(75, 50, 50)grd.addColorStop(0, 'red')grd.addColorStop(1, 'white')// Fill with gradientctx.setFillStyle (grd)ctx.fillRect(10, 10, 150, 80)ctx.draw()

##createLinearGradient
Definition
Create a linear gradient color.
Tip: You need to use addColorStop() to specify gradient points, at least two.
Parameters
[tr]Parameter type definition[/tr]
Number | x coordinate of the starting point | |
Number | y coordinate of the starting point | |
Number | x coordinate of the end point | |
Number | y coordinate of the end point |
Example
const ctx = wx.createCanvasContext('myCanvas')// Create linear gradientconst grd = ctx.createLinearGradient(0 , 0, 200, 0)grd.addColorStop(0, 'red')grd.addColorStop(1, 'white')// Fill with gradientctx.setFillStyle(grd)ctx.fillRect(10, 10, 150, 80)ctx .draw()
strokeRect

Definition
Draw a rectangle (non-filled).
Tip: Use setFillStroke() to set the color of the rectangular line. If not set, the default is black.
Parameters
[tr]Parameter type range description[/tr]
Number |
The x-coordinate of the upper left corner of the rectangular path |
||||||||||||||||||||||||||||||||
Number |
The y coordinate of the upper left corner of the rectangular path |
||||||||||||||||||||||||||||||||
Number |
Rectangular path The width |
||||||||||||||||||||||||||||||||
Number | ##The height of the rectangular path |
x | Number | x coordinate of the upper left corner of the rectangular path |
y | Number | y coordinate of the upper left corner of the rectangular path |
width | Number | The width of the rectangular path |
height | Number | The height of the rectangular path |
Example
const ctx = wx.createCanvasContext('myCanvas')ctx.setFillStyle('red' )ctx.fillRect(10, 10, 150, 75)ctx.draw()

##arc
Definition
Draw an arc.
Tip: To create a circle, you can use the arc() method to specify that the actual arc is 0 and the ending arc is 2 * Math.PI.
Tip: Use the stroke() or fill() method to draw arcs in the canvas.
Parameters
[tr]Parameter type description[/tr]
Number | x coordinate of the circle | |
Number | y coordinate of the circle | |
Number | The radius of the circle | |
Number | Starting radian, unit radian ( At 3 o'clock) | |
Number | Ending arc | |
Boolean | Optional. Specifies whether the direction of radians is counterclockwise or clockwise. The default is false, which is clockwise. |
Example
const ctx = wx.createCanvasContext('myCanvas')// Draw coordinatesctx.arc(100, 75, 50, 0, 2 * Math.PI)ctx.setFillStyle('#EEEEEE')ctx.fill()ctx.beginPath()ctx.moveTo(40, 75)ctx.lineTo(160, 75)ctx.moveTo(100 , 15)ctx.lineTo(100, 135)ctx.setStrokeStyle('#AAAAAA')ctx.stroke()ctx.setFontSize(12)ctx.setFillStyle('black')ctx.fillText('0', 165, 78 )ctx.fillText('0.5*PI', 83, 145)ctx.fillText('1*PI', 15, 78)ctx.fillText('1.5*PI', 83, 10)// Draw pointsctx.beginPath( )ctx.arc(100, 75, 2, 0, 2 * Math.PI)ctx.setFillStyle('lightgreen')ctx.fill()ctx.beginPath()ctx.arc(100, 25, 2, 0, 2 * Math.PI)ctx.setFillStyle('blue')ctx.fill()ctx.beginPath()ctx.arc(150, 75, 2, 0, 2 * Math.PI)ctx.setFillStyle('red')ctx .fill()// Draw arcctx.beginPath()ctx.arc(100, 75, 50, 0, 1.5 * Math.PI)ctx.setStrokeStyle('#333333')ctx.stroke()ctx.draw()
The three key coordinates for arc(100, 75, 50, 0, 1.5 * Math.PI) are as follows:

- Green: Circle center (100, 75)
- Red: Starting arc (0)
- Blue: Ending arc (1.5 * Math.PI)
Drawing on Canvas
All drawings in must be done with JavaScript:
WXML: (We In the following examples, this WXML will be used as the template if there is no special statement and will not be repeated)
JS: (We In the following example, JS will be placed in onLoad)
const ctx = wx.createCanvasContext('myCanvas')ctx.setFillStyle('red')ctx.fillRect(10, 10, 150, 75)ctx. draw()
Step one: Create a Canvas drawing context
First, we need to create a Canvas drawing context CanvasContext.
CanvasContext is an object built into the applet and has some drawing methods:
const ctx = wx.createCanvasContext('myCanvas')
Step 2: Use Canvas drawing context Drawing description
Next, let's describe what we want to draw in Canvas.
Set the fill color of the drawing context to red:
ctx.setFillStyle('red') Use the fillRect(x, y, width, height) method to draw a rectangle and fill it with the red just set:
ctx .fillRect(10, 10, 150, 75)
Step 3: Draw
Tell the component that you want to draw the description just now:
ctx.draw()
The above is the detailed content of WeChat Mini Program 0.11.122100 version update details introduction. 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

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools