Loading…

"Friendly Links/Partners" Example

# Preface This tutorial is based on the "apifm-wxapi" module and teaches you how to quickly implement small program development, so you may need to understand the following knowledge points first: ["Creating HelloWorld Project"](https://www.yuque.com/apifm/doc/hezlrm) ["Use "apifm-wxapi" to quickly develop small programs"](https://www.yuque.com/apifm/doc/mdldsd) ["Register for free to open the backend and obtain an exclusive domain name"](https://www.yuque.com/apifm/doc/qr6l4m) # Requirements description Backstage management of friendly links/partners; Display on the applet; # budget 0 yuan, free implementation # Requirements realization ### Enable the "Friendly Links/Partners" module Log in to the "First Step" registration background, left menu --> Factory settings --> Module management Find the "Friendly Links/Partners" module, click "Enable Module", then F5 to refresh the background interface, you will see a new menu: "System Settings" --> "Friendly Links"; ### Publish and manage data in the background: ![](https://dcdn.it120.cc/yuque/0/2019/png/572726/1572848080741-cb25eb1b-225d-41d1-99e5-e4b7327f92dd.png) ### Write small program code: ```plain const WXAPI = require('apifm-wxapi') WXAPI.init('gooking') Page({ data: { }, onLoad: function (options) { // Get friendly links/partners WXAPI.friendlyPartnerList().then(res => { console.log('Friendly links/partners:', res) }) } }) ``` > WXAPI.init('gooking') This code links your mini program to your backend, where gooking is your exclusive domain name (please check the chapter about exclusive domain names in the preface); > ### Advanced: The backend can group and manage data through "custom types"; > WXAPI.friendlyPartnerList('custom type') > You can obtain the specified type of data on the mini program, which is convenient for friends who need grouping (different pages display different data) to use this function flexibly. ### Thinking questions: Use your brain and try to realize it, fill in the link address in the background, and implement the partner's click-to-jump function on the mini-program. Looking forward to your progress! grateful!