if your mobile phone number is not authorized by any Mini Program (any Mini Program), it will send a text message for the first time, as long as it is authorized, it will not send a text message
check the login status of the user when you call. If you refresh the sessionKey without encryption, it will cause the call to fail. Have you determined that the third party's call will call back the parameters? the default is
reference:
get the mobile number
wxml
<button wx:if="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo"></button>
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> </button>
js
Page({
/**
*
*/
data: {
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
/**
* --
*/
onLoad: function (options) {
var that = this;
//
wx.getSetting({
success: function (res) {
if (res.authSetting['scope.userInfo']) {
// getUserInfo
wx.getUserInfo({
success: function (res) {
//
if (res.userInfo) {
//
wx.request({
url: 'https:/xxxx',
data: {
userid: wx.getStorageSync('userid'),
avatarUrl: res.userInfo.avatarUrl,
city: res.userInfo.city,
country: res.userInfo.country,
gender: res.userInfo.gender,
nickName: res.userInfo.nickName,
province: res.userInfo.province
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
method: 'POST',
success: function (res) {
//console.log(res);
wx.showToast({
title: '',
})
}
})
}
}
})
}
}
})
},
/**
* --
*/
onReady: function () {
},
getPhoneNumber: function (e) {
console.log(e.detail.errMsg)
console.log(e.detail.iv)
console.log(e.detail.encryptedData)
},
}
I click to log in and harvest mobile phone in sequence
recently, we are going to do a leave function. Student A submitted an application for leave, which was then reviewed by teacher B, but later I found that I needed a reminder function on Wechat s message end. It seems that Wechat can only use template me...
do you want to know whether Mini Program and Mini Program, whose users enter from a specific channel, have such a function or method ...
the text matched by the search box above an article is highlighted to realize the idea. ...
The component of navigator has a limit on the number of jumps. I now have a project tabbar to write by myself, so it is inevitable to add navigator jump to it, but if there are too many pages to jump, there will be a jump limit. ...
for example, the details page, after sharing, other people open, can only see this page, I did not find a useful way to set API back to a route. You have to write it on the page? ...
RT how does Mini Program realize the friend-to-friend mode? the back end is php. looking for onlookers to fight. How are these two modes realized? What is the principle? ask the hero for advice. This is the first time to do this ....
Custom component life cycle res.height sometimes reports to null ready: function () { var that = this var query = wx.createSelectorQuery().in(this) query.select( .question ).boundingClientRect(function (res) { that.setData({ questionHeight: re...
for example, if you are editing on another page, you may just change the css style, be refreshed and jump to the front page, and then have to reopen the edit page. It is troublesome to get used to using Wechat developer tools on ctrl+s,. Is my configurat...
...
The problem with is that the return has neither error nor data, and the document says it will return binary and convert it to a picture. But now there is nothing. I don t know what went wrong. Ask for help contorller function getIssueQrcodeAction() ...
WeChat Mini Programs shopping cart requests shopping cart data in the app.js, and this.carts = app.globalData.carts in the onLoad on the shopping cart page (cart.wxml). on the shopping cart page, there are often operations to select, delete, and modif...
this is the data of setData , how can I render normally? ...
I just got in touch with Mini Program developer and recently encountered this problem when I wrote the demo, of a music player. After I returned to the list page from the playback page (or to the home page), I entered the playback page from the entrance...
WeChat Mini Programs s picture is saved to the photo album, api wx.saveImageToPhotosAlbum, which runs normally on the simulator and can be saved, but the error { "errMsg ": "saveImageToPhotosAlbum:fail file not exists "} is displayed in the real machi...
300 yuan was paid during the audit, and now it is about to expire. I don t know if I want to renew it. There is no text message or email notification, I am afraid that I will not be able to go on it one day. ...
I want to implement Mini Program s pull-up and load , but after using scroll-view, one line becomes one. Whether to set this or need to css, for a great solution ...
when wx.previewImage implements previewing pictures, long press can bring up options menu. If you want to add a text prompt to the user, you can bring up this menu by long pressing. How to realize ?...
how to get the parameters of Aladdin s QR code sharing in Mini Program app.js, be sure to get before login operation....
do I want to send openid+ data to the server and write to the database? ...
I built a new Mini Program on my work computer and uploaded it to Tencent Cloud. When I got home, I wanted to download the client and server folders and continue to write. How can I download it? Thank you! ...