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

How to build user churn warning?

Before a user becomes a churned user, the risk of...

How to select high-quality APP promotion channels?

With the rapid development of the mobile Internet...

Landing page design tips for the education industry!

With the winter vacation approaching, the educati...

I'm already full, so why can't I control my mouth?

There are two things that are difficult for human...

7 ways to effectively achieve user retention!

User retention is the lifeline for most products ...

How many people can the earth support?

As early as 2012, the academic journal Journal of...

C4D Zero-Based Introductory Course

This course is designed for students with no basic...

What is the correct approach for online novels to go overseas?

As China's Internet overseas expansion has en...