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

An example Analysis of the Interface of Wechat Shop Jump Wechat Product Page developed by Wechat

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

Share

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

This article mainly introduces the example analysis of Wechat development shop jump Wechat commodity page interface, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article. Next, let the editor take you to understand it.

Wechat Xiaodian API must be verified by Wechat service number before it can be called with permission. Subscription account does not have permission.

Wechat shop jumps to Wechat product page interface

Wx.openProductSpecificView ({

ProductId:', / / Commodity id

ViewType:'/ / 0. Default value, general commodity details page 1. Scan the product details page 2. Shop details page

});

First, create a new jsp page and introduce the js library

Jweixin-1.1.0.js is a library that calls Wechat jsapi, so it must be introduced. The second line is that this case uses jquery, so the second is the jquery library. Second, introduce the interface style. Because several interface case styles are too ugly, this case beautifies the interface.

Third, the html code between.

Welcome to Wechat jsapi test interface-V-type knowledge base Wechat shop interface jump to Wechat commodity page interface openProductSpecificView

Fourth, initialize Wechat jsapi library and add interface functions

Wx.config ({debug: true, / / enables debug mode. The returned values of all api called will be displayed in the alert on the client side. To view the parameters passed, you can open them on the PC side, and the parameter information will be typed out through log and printed only on the PC side. AppId:'${appId}', / / required, unique ID of official account timestamp:'${timestamp}', / / required, timestamp of generating signature nonceStr:'${nonceStr}', / / required, generating random string of signature signature:'${signature}', / / required, signature See Appendix 1 jsApiList: ['checkJsApi',' chooseImage', 'previewImage',' uploadImage', 'downloadImage',' getNetworkType',// Network status Interface 'openLocation',// use Wechat built-in map to view geographic location interface' getLocation' / / get geographic location interface 'hideOptionMenu',// interface operation interface 1' showOptionMenu',// interface operation interface 2 'closeWindow', / interface operation interface 3' hideMenuItems',//// interface operation interface 4 'showMenuItems' / / Interface Operation Interface 5 'hideAllNonBaseMenuItem',//// Interface Operation Interface 6' showAllNonBaseMenuItem',//// Interface Operation Interface 7 'scanQRCode',// Wechat scan interface' openProductSpecificView'// Wechat Shop] / / required List of JS interfaces to be used, all JS interfaces are listed in Appendix 2})

The last item in the jsApiList array is that we call the function of Wechat shop API. This function must be initialized in the jsapi library, otherwise the function of Wechat shop jumping to Wechat product page cannot be adjusted.

Sixth, complete jsp page code, readers can directly copy and run

Wechat jsapi Test-V-type knowledge Base .desc {color: red;} Welcome to Wechat jsapi Test Interface-V-Type knowledge Base Wechat Shop Interface Jump Wechat Product Page API openProductSpecificView

Wechat scan and adjust Wechat scan interface scanQRCode (Wechat processing result) scanQRCode (direct return result) interface operation interface

Hide menu interface in the upper right corner

HideOptionMenu

Display the menu interface in the upper right corner

ShowOptionMenu

Close the current web window interface

CloseWindow

Batch hide function button interface

HideMenuItems

Batch display function button interface

ShowMenuItems

Hide all non-basic button interfaces

HideAllNonBaseMenuItem

Show all function button interfaces

ShowAllNonBaseMenuItem

The basic interface determines whether the current client supports the specified js interface.

Geolocation Interface-use Wechat built-in map view location API

OpenLocation

Geolocation Interface-get geolocation API

GetLocation

Get network status interface

GetNetworkType

Image interface to take a picture or select a picture interface from a mobile photo album

ChooseImage

Preview picture interface

PreviewImage

Upload image API

UploadImage

Download picture interface

DownloadImage

Show picture

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