当前位置:网站首页>Realize business development on behalf of small programs, and 99% restore the function of service category management in the background of official account
Realize business development on behalf of small programs, and 99% restore the function of service category management in the background of official account
2022-06-24 17:21:00 【Wukong codeword】
Hello, guys , I am Wukong code word , About the implementation business of generation applet on wechat open platform , I wrote the code of related modules before , Including quick registration applet 、 Code upload 、 Submit audit 、 Release the main functions such as applet . You can refer to the third-party platform development of wechat open platform , A whole process .
Write it at the front
The little friend who is using this system recently told me , If you do not want to set or modify the applet service category by logging in to the official account background , Can it be directly in this system , Quickly create an applet , You can set or modify the service category , So much the better . My answer is, of course of course, Wechat has provided us with such an interface , The interface has , The next step is to roll up your sleeves , Oh , No , Is to manipulate the code is to do .
Don't underestimate this function , I have already implemented this function before writing this article , But in the process of implementation , It's really complicated , The function mode is basically 99% Restore the service category management in the background of official account . This process has encountered problems , However, by checking the data and Du Niang solved them one by one , Speaking of this , Have to give elementUI A big compliment , It's really easy to use for the back end of our half hanging front end . And a sigh , No matter what you do , Do it with your own hands , That's why we have problems , solve the problem , To learn something .
Problem solution list
Here are some problems and solutions :
problem : To set a category , First, get all the settable categories , The official interface is to return all data , It includes primary and secondary categories , And the primary and secondary data are objects of the same level , Because we need to do two-level linkage , That is to say, the first one select Only one level of category can be displayed , Select a level-1 category , In the second select Displays the secondary category under this level . This kind of request returns all data formats at once, which is not friendly to us .
programme : I don't know other languages very well , but Java8 Provides stream api, Among them the LIst The collection provides Filter Methods of filtration , It's very convenient . Did you think of something here . Yes , After obtaining the wechat data, it is mapped into a collection , The returned data is provided level( Category level ) and father( Category parent ID) Field , Whether it's getting level 1 or level 2 , Call directly Filter Method , You can filter through these fields , Post the main code .
List<Category> list = (List<Category>) CategoryUtils.getCategoriesByType(info,verifyType).get(DATA_TAG);
if (list != null) {
List<Category> collect;
if (categoryId == 0) {
collect = list
.stream()
.filter(category -> (!category.getId().equals(0)) && (category.getLevel().equals(level)) && (category.getFather().equals(father)))
.collect(toList());
} else {
collect = list
.stream()
.filter(category -> (category.getId().equals(categoryId)) && (category.getLevel().equals(level)) && (category.getFather().equals(father)))
.collect(toList());
}
if (level == 2) {
collect.forEach(item -> {
if (item.getSensitive_type() == 1) {
List<Exter> exterList = item.getQualify().getExter_list();
exterList.forEach(exter -> {
List<Inner> innerList = exter.getInner_list();
String name = "";
for (Inner inner : innerList) {
name = name + inner.getName() + " And ";
}
exter.setCerticateName(name.substring(0, name.length()-1));
});
}
});
}
return AjaxResult.success(collect);
}problem : In the use of elementui When uploading the picture of the framework , It needs to pass in several event methods except file and fileList Custom parameters for , How to transfer values to get .
programme : I posted the code directly , among categoryIndex、innerIndex Is the custom parameter
:on-success="(file, fileList) =>handleSuccess('edit',file, fileList,categoryIndex,innerIndex)"
:on-preview="(file, fileList) =>handlePreview('edit',file, fileList,categoryIndex,innerIndex)"
:on-remove="(file, fileList) =>handleRemove('edit',file, fileList,categoryIndex,innerIndex)"Function display
Last one : Byte jump integrated Alipay payment
边栏推荐
- Activeindex selection and redirection in the menu bar on the right of easycvs
- zblog系统实现前台调用当天发布文章数量的教程
- FPGA systematic learning notes serialization_ Day8 [design of 4-bit multiplier and 4-bit divider]
- Tiktok Kwai, e-commerce enters the same river
- Coding enhances security vulnerability scanning capability and helps the team "move left safely"
- Tencent monthly security report helps rural revitalization, releases cloud security reports, and jointly builds a joint network security laboratory
- Research on clock synchronization performance monitoring system based on 1588v2 Technology
- Devops in digital transformation digital risk
- Management system permission design
- zblog系统如何根据用户ID获取用户相关信息的教程
猜你喜欢

Why do you develop middleware when you are young? "You can choose your own way"

MySQL learning -- table structure of SQL test questions
Using consistent hash algorithm in Presto to enhance the data cache locality of dynamic clusters
![[leetcode108] convert an ordered array into a binary search tree (medium order traversal)](/img/e1/0fac59a531040d74fd7531e2840eb5.jpg)
[leetcode108] convert an ordered array into a binary search tree (medium order traversal)

Daily algorithm & interview questions, 28 days of special training in large factories - the 15th day (string)
随机推荐
Contributed code to famous projects for the first time, a little nervous
TVP experts talk about geese factory middleware: innovating forward and meeting the future
Collect tke logs through daemonset CRD
[play Tencent cloud] experience and development of game multimedia engine (II)
With the solution, the nickname of the applet suddenly becomes "wechat user", and the avatar cannot be displayed?
构建跨公链平台解决DApp开发问题
How to perform concurrent stress testing on RTSP video streams distributed by audio and video streaming servers?
Use cloud development to make a login free resource navigation applet!
问题有多大,中台就有多大
Tencent security officially released the IOT security capability map
Learn typescript with VAM (phase 1)
zblog判断某个插件是否安装启用的内置函数代码
Radiology: contralateral preoperative resting state MRI functional network integration is related to the surgical results of temporal lobe epilepsy
Best practices for H5 page adaptation and wechat default font size
When the game meets NFT, is it "chicken ribs" or "chicken legs"?
Five steps to effectively monitor network traffic
Using consistent hash algorithm in Presto to enhance the data cache locality of dynamic clusters
zblog系统如何根据用户ID获取用户相关信息的教程
主链系统发展解析
One article combs multi task learning (mmoe/ple/dupn/essm, etc.)