WeChat applet
Applet is a new open ability, developers can quickly develop a small program. Applets can be easily obtained and spread in WeChat, and have excellent use experience.
Install typecho
http://typecho.org/
Download and install on official website
Installation environment requirements
- PHP 5.4 or above
- MySQL, PostgreSQL and SQLite database support, and related extensions are installed in PHP
- CURL extension support
- Mbstring or iconv extension support
It needs to be set in typecho ssl
, Fixed link
, Pseudo static
And domain name keep on record Can be used normally.
Recommended ssl Typecho ssl configuration Pseudo static
Background settings

Make typecho support JSON output
Code from Sunny Blog
- <?php
- if ( stripos ( $this ->request->getRequestUri(), 'json')) {
- $arr = array ();
- while ( $this ->next()) {
- $a = array ('title' => $this ->title, ' date ' => $this -> date ->format('Y-m-j H:i'), 'content' => $this ->content, 'categories' => $this ->categories, 'tags' => $this ->tags);
- $arr [] = $a ;
- }
- $this ->response->throwJson( array ( "servererror" => "" , "status" => 1, "message" => $arr ));
- }
- ?>
Add to the beginning of the typecho header template
- usr/themes/default/header.php
You can achieve simple JSON output and API effect.
Recommended: plug-in version (highly customized)
https://github.com/insoxin/typecho-json-miniprogram

Configure the server domain name and business domain name of WeChat applet
On WeChat public platform https://mp.weixin.qq.com/cgi-bin/wx Register the applet, and after the registration, the information can be improved and developed synchronously.
In the background of WeChat applet public platform, select "Settings"=>"Development Settings" to configure "Server Domain Name" and "Business Domain Name", as shown below:

among request The legal domain name must be configured. This parameter ensures that the applet can be sent normally request Request, the program can run. At the same time, this domain name must keep on record 。
Applet information improvement
Fill in the basic information of the applet, including name, avatar, introduction and service scope.

Develop applet
After the applet developer binding and development information configuration are completed, the developer can download the developer tools and refer to the development documents for applet development and debugging
Common applet developer tool
Download address of the latest version (1.02.1803210)
Mac link: https://share.weiyun.com/5R8wo2B (Password: K9AJ)
Supplement win64 link win64: https://share.weiyun.com/5NM8qin (Password: YOTl)
my


Code packaging link: https://pan.baidu.com/s/1EFIajj7lNmC4-_V8m_ZN-g (Unapproved)
Modify the following parameters after downloading
- export default {
- getDomain: blog.isoyu.com,
- GetWebsiteName: Ji Changxin,
- getAboutId: ABOUTID,
- getPayTemplateId: PAYTEMPPLATEID,
- getPageCount: PAGECOUNT,
- getCategoriesID :CATEGORIESID,
- getIndexNav: INDEXNAV,
- getReplayTemplateId: REPLAYTEMPPLATEID,
- getMinAppType: MINAPPTYPE,
- getZanImageUrl: ZANIMAGEURL,
- getIndexListType: INDEXLISTTYPE,
- getLogo: LOGO,
- getPostImageUrl: POSTERIMGURL
- }
Submit for review and release
After completing the development of the applet, submit the code to the WeChat team for review. After the review is passed, it can be released (it cannot be released during the public beta).

Applet Welcome
Add 151 other collected applet source codes (Fri, 13 Apr 2018 14:12:41 GMT)
This article is written by Ji Changxin Author, article address: https://blog.isoyu.com/archives/typecho-json-miniprogram.html
use Knowledge Sharing Attribution 4.0 International License Agreement. Unless the reprint/source is indicated, they are all original or translated by this website. Please sign your name before reprinting. Last editing time: May 2, 2018 at 06:34 p.m