WeChat JS-SDK Description-Open Interface Description (2)

WeChat JS-SDK Description-Open Interface Description (2)

Hide the upper right corner menu interface

  1. wx.hideOptionMenu();

Display the upper right corner menu interface

  1. wx.showOptionMenu();

Close the current web page window interface

  1. wx.closeWindow();

Batch hiding function button interface

  1. wx.hideMenuItems({
  2. menuList: [] // Menu items to be hidden. Only the "Dissemination" and "Protection" buttons can be hidden. For all menu items, see Appendix 3
  3. });

Batch display function button interface

  1. wx.showMenuItems({
  2. menuList: [] // Menu items to be displayed. For all menu items, see Appendix 3
  3. });

Hide all non-basic button interfaces

  1. wx.hideAllNonBaseMenuItem();
  2. // "Basic Class" button, see Appendix 3

Display all function button interfaces

  1. wx.showAllNonBaseMenuItem();

WeChat Scan

Call up the WeChat scan interface

  1. wx.scanQRCode({
  2. needResult: 0, // The default value is 0, the scan result is processed by WeChat, 1 directly returns the scan result,
  3. scanType: ["qrCode","barCode"], // You can specify whether to scan a QR code or a 1D code. The default is to scan both.
  4. success: function (res) {
  5. var res result = res.resultStr; // When needResult is 1, the result returned by scanning the code
  6. }
  7. });

WeChat Store

Jump to WeChat product page interface

  1. wx.openProductSpecificView({
  2. productId: '', // product id
  3. viewType: '' // 0. Default value, ordinary product details page 1. Scan product details page 2. Store product details page
  4. });

WeChat Cards

Call up the list of cards and coupons applicable to the store and obtain the user's selection list

  1. wx.chooseCard({
  2. shopId: '', // store ID
  3. cardType: '', // Card type
  4. cardId: '', // Card ID
  5. timestamp: 0, // Card signature timestamp
  6. nonceStr: '', // Card coupon signature random string
  7. signType: '', // Signature method, default is 'SHA1'
  8. cardSign: '', // Card signature, see Appendix 4 for details
  9. success: function (res) {
  10. var cardList = res .cardList; // Card list information selected by the user
  11. }
  12. });

Batch add card and coupon interface

  1. wx.addCard({
  2. cardList: [{
  3. cardId: '',
  4. cardExt: ''
  5. }], // Cards and coupons list to be added
  6. success: function (res) {
  7. var cardList = res .cardList; // Added card list information
  8. }
  9. });

View the card and coupon interface in WeChat card wallet

  1. wx.openCard({
  2. cardList: [{
  3. cardId: '',
  4. code: ''
  5. }] // List of cards and coupons that need to be opened
  6. });

WeChat Pay

Initiate a WeChat payment request

  1. wx.chooseWXPay({
  2. timestamp: 0, // Payment signature timestamp. Note that all timestamp fields used in WeChat jssdk are lowercase. However, the timestamp field name used in the signature generated by the *** version of the payment backend needs to be capitalized with the S character in it
  3. nonceStr: '', // Payment signature random string, no longer than 32 bits
  4. package: '', // The prepay_id parameter value returned by the unified payment interface, the submission format is as follows: prepay_id =***)
  5. signType: '', // Signature method, default is 'SHA1', use the new version of payment to pass in 'MD5'
  6. paySign: '', // payment signature
  7. success: function (res) {
  8. //Callback function after successful payment
  9. }
  10. });

<<:  WeChat JS-SDK Description-Open Interface Description

>>:  Unity Awards 2015 is about to start, and good games are coming soon!

Recommend

To prevent obesity, should you eat like a pig?

You may not believe it, but some scientists sugge...

What is the effect of micro-loan advertising on Momo?

We can see a lot of micro-loan advertisements on ...

Guess what? It’s not mind reading, but predictive processing of the brain

Produced by: Science Popularization China Author:...

Will QR codes be scanned by humans? Yes! But we can’t wait for that day

Payment codes, business card codes, health codes,...

Samsung thrives on memory chips, how can Chinese manufacturers break through?

Since the second half of last year, the prices of...

QQ, Weibo, Momo: Social media cannot escape the fate of social media

In 1994, the first Internet BBS in mainland China...

How to create a landing page with high conversion rate? Share 2 pictures!

Unlike traditional industries that can bring prod...

Get APP product analysis

Before fully understanding this app, everyone tho...

How much does it cost to customize the Yongxin Musical Instruments Mini Program?

How much does it cost to customize the Yongxin Mu...

In 2019, there are two modes of content operation!

All content production is the product of certain ...

Tik Tok Operation Skills in the Beauty Industry

How to become a beauty influencer from scratch? A...