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

Case Analysis of the third Party Development platform of Mini Program

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces "case analysis of Mini Program third-party development platform". In daily operation, I believe many people have doubts about the case analysis of Mini Program third-party development platform. I have consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "case analysis of Mini Program third-party development platform". Next, please follow the editor to study!

Overview

Unlike the development of ordinary Mini Program, the development of third-party platform Mini Program has a certain complexity, first of all, three concepts need to be confirmed:

Open3rd: third-party platform, which is the official approved third-party developer details of Mini Program.

3rdMiniProgramAppid: Mini Program applied for by a third-party platform and bound to that platform for the development of Mini Program templates

ExtAppid: Mini Program licensed to third-party platforms

Because of the above differences, Mini Program development related to third-party platforms needs to do some special processing:

Development of Mini Program template

Development and debugging of Mini Program template combined with extAppid

The latest version of the development tools supports the development and preview of third-party platform Mini Program.

Create a project

As with ordinary Mini Program, developers of third-party platforms can enter the relevant 3rdMiniProgramAppid, set the project name and select the project directory to create the project.

For the third-party platform Mini Program, you can find the relevant open3rd information and the current third-party 3rdMiniProgramAppid in the project page card. If the project is configured with the relevant extAppid, then there will be relevant information in the project page card.

Mini Program template development

As with the development of ordinary Mini Program, developers can view the real performance of Mini Program in Wechat after they have developed the relevant business logic on the development tools and submitted a preview in the project page card.

The difference is that the submission and upload of a third-party platform Mini Program is uploaded to the template draft box under the open account of the third-party platform. The administrator of this platform needs to set the template accordingly. For more information, please see the documentation of the open platform.

Development and debugging of extAppid

In order to facilitate the developers of third-party platforms to introduce the development and debugging of extAppid, it is necessary to introduce the concept of ext.json.

Ext.json is a configuration file that is placed in the root directory of the Mini Program project.

The following is an ext.json that contains all configuration options:

{"extEnable": true, "extAppid": "wxf9c4501a76931b33", "ext": {"name": "wechat", "attr": {"host": "open.weixin.qq.com", "users": ["user_1", "user_2"]}}, "extPages": {"pages/logs/logs": {"navigationBarTitleText": "logs"}}, "window": {"backgroundTextStyle": "light" "navigationBarBackgroundColor": "# fff", "navigationBarTitleText": "Demo", "navigationBarTextStyle": "black"}, "tabBar": {"list": [{"pagePath": "pages/index/index", "text": "Home"}, {"pagePath": "pages/logs/logs", "text": "Log"}]}, "networkTimeout": {"request": 10000, "downloadFile": 10000}}

There are two types of configuration fields in ext.json

Unique field

Same field as app.json

The unique field attribute type is required to describe whether extEnableBoolean is to configure ext.json whether it is valid or not extAppidString is to configure extAppidextObject not to develop custom data fields extPagesString Array No to set the jsonextEnable for each page separately

ExtEnable is a Boolean field that specifies whether the current ext.json file is valid or not. Developers can turn on and off the combined development of extAppid by modifying this field.

ExtAppid

ExtAppid is the AppID authorized to debug. For example, if the developer enters wxf9c4501a76931b33 here, then if the extEnable is true, the subsequent development logic will be run based on wxf9c4501a76931b33.

Ext

The ext field is a custom data field, and the configuration information can be obtained through wx.getExtConfigSync or wx.getExtConfig in Mini Program.

For example, in the above example, all the configurations of the ext field can be obtained through wx.getExtConfigSync.

{"name": "wechat", "attr": {"host": "open.weixin.qq.com", "users": ["user_1", "user_2"]}} extPages

ExtPages is an object, and each key in the object should be a page defined in the Mini Program template app.json, and the value corresponding to each key is the configuration specified in the page.json.

When the developer sets this configuration, the Mini Program framework will modify the configuration information of the corresponding page.

Same field as app.json

When the field in ext.json is the same as that in app.json, the field in ext.json overrides the corresponding field in app.json, such as the following ext.json

{"window": {"backgroundTextStyle": "light", "navigationBarBackgroundColor": "# fff", "navigationBarTitleText": "ext navigationBarTitleText", "navigationBarTextStyle": "black"}}

Then the final navigationBarTitleText of the Mini Program should be ext navigationBarTitleText.

At this point, the study on the "Mini Program third-party development platform case analysis" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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