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

Only 40 days after its establishment, Dada Bus raised 42 million yuan

This year, competition in the ride-sharing market...

Why did the old man, who was in good health, die soon after falling down?

In the past two days, many places have welcomed s...

How can an APP quickly build a push operation system?

The Internet population dividend has completely b...

Deconstructing the Jiutouniu brand’s Xiaohongshu advertising strategy!

Summer is coming, and cold drink brands have begu...

"Tianzhi-2D" satellite was launched, and the types of satellites are as follows

China Science and Technology News Network, Januar...

A comprehensive summary of promotion channels in 2019!

With the rapid rise of the Internet, there are to...

Are driverless subways reliable?

I read in the news that the first batch of fully ...

CES2015: Razer Forge TV Gaming Set-Top Box

Are you tired of the smartphones, watches and car...

3 “Antidotes” for “Flow Anxiety”

Nowadays, those who work in marketing suffer from...

A user growth system that increased followers by 45 million!

Everyone knows that they should read more books a...