Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze the Open Interface in Wechat JS-SDK

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to carry out Wechat JS-SDK has an open interface analysis, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, hope you can gain something.

Hide the upper-right menu interface wx.hideOptionMenu (); show the upper-right menu interface wx.showOptionMenu (); close the current web window interface wx.closeWindow (); batch hide function button interface wx.hideMenuItems ({menuList: [] / / menu items to be hidden can only hide the "propagation class" and "protection class" buttons, all menu items see Appendix 3}) Bulk display function button interface wx.showMenuItems ({menuList: [] / / menu items to be displayed, all menu items see Appendix 3}); hide all non-basic button interface wx.hideAllNonBaseMenuItem (); / / basic class button details see Appendix 3 to show all function button interface wx.showAllNonBaseMenuItem () Scan Wechat, scan Wechat, scan API wx.scanQRCode ({needResult: 0, / / default is 0, scan result is processed by Wechat, 1 returns scan result directly. ScanType: ["qrCode", "barCode"], / / you can specify scan QR code or QR code. By default, both have success: function (res) {var resresult = res.resultStr / / the result returned by scanning code}} when needResult is 1); the API wx.openProductSpecificView for redirecting Wechat Shop to Wechat product page ({productId:', / / Product id viewType:''/ / 0. Default value, general commodity details page 1. Scan the product details page 2. Shop details page}) Wechat card coupons bring up the card and coupon list applicable to stores and obtain the user selection list wx.chooseCard ({shopId:', / store Id cardType:'', / / card coupon type cardId:'', / / card coupon Id timestamp: 0, / / card coupon signature timestamp nonceStr:'', / / card coupon signature random string signType:'', / / signature method Default 'SHA1' cardSign:', / / card coupon signature. For more information, please see Appendix 4 success: function (res) {var cardList= res.cardList / / the card voucher list information selected by the user}}); the API wx.addCard for bulk adding card coupons ({cardList: [{cardId:'', cardExt:'}], / / the card voucher list success: function (res) {var cardList = res.cardList; / / added card voucher list}}) Check the card voucher API wx.openCard in Wechat card package ({cardList: [{cardId:', code:'}] / / list of cards and coupons to be opened}); WeChat Pay initiates a WeChat Pay request wx.chooseWXPay ({timestamp: 0, / payment signature timestamp). Note that all timestamp fields in Wechat jssdk are lowercase. However, the timeStamp field name used by the payment backend to generate signature in the * version needs to capitalize the S character nonceStr:'', / / payment signature random string, which is not longer than the prepay_id parameter value returned by the 32-bit package:'', / / unified payment API. The submission format, such as: prepay_id=***) signType:', / / signature, defaults to 'SHA1'. To use the new version of payment, you need to input 'MD5' paySign:', / / payment signature success: function (res) {/ / callback function}} after successful payment Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report