Simple example development of WeChat mini-app reader

Source: Internet
Author: User
This article mainly introduces the information about the development of simple examples (readers) of small programs. For more information about the development of simple examples of small program readers, see the following article, for more information, see

Today, I chatted with my friends about the mini-app and read the book. then we got a demo of the mini-book, and now I will share it with you.

I. first come:

First, let's talk about the tabBar below. The project uses data configuration in json format. I have to say that this is a trend now ,. net core configuration is also in this way (exposure I am. net camp ).

Many students have found that many colors do not work. Yes, valid colors are restricted. for details, refer to the official document. A few tabbars are required, so you can write a few in the list. There are three in this article, so you have read three. The above iconPath is the tabBar icon, which is also limited in size, 40 KB. Then, pagePath is the page link corresponding to the tabBar. Text is the restricted content.

"TabBar": {"color": "# dddddddd", "selectedColor": "# d92121", "borderStyle": "white", "backgroundColor": "# fff ", "list": [{"pagePath": "pages/index", "iconPath": "images/main.png", "selectedIconPath": "images/main-s.png", "text ": "homepage" },{ "pagePath": "pages/layout/hot", "iconPath": "images/hot.png", "selectedIconPath": "images/hot-s.png ", "text": "Most Popular" },{ "pagePath": "pages/layout/new", "iconPath": "images/new.png", "selectedIconPath ": "images/new-s.png", "text": "latest"}]},

Open the project code directory as follows:

  

Code:

// App. jsApp ({getBanner: function () {var bannerUrl = [".. /images/banner.jpg "]; return bannerUrl;}, getOneBook: function (id) {var abook; var books = [{id:" 1 ", bookUrl :".. /images/img1.jpg ", bookName:" History of Western Philosophy ", bookInfor:" About Philosophy "}, {id:" 2 ", bookUrl :".. /images/tmd.jpg ", bookName:" tamude ", bookInfor:" about faith "}, {id:" 3 ", bookUrl :".. /images/holy.jpg ", bookName:" Bible ", bookInfor:" about faith "}, {id:" 4 ", bookUrl :".. /images/yuz.jpg ", bookName:" universe in the Shell ", bookInfor:" About Science "},{ id:" 5 ", bookUrl :".. /images/dream.jpg ", bookName:" Ideal country ", bookInfor:" About Philosophy "}, {id:" 6 ", bookUrl :".. /images/out.jpg ", bookName:" out of control ", bookInfor:" About Economics "}]; for (I = 0; I
 
  

Then the about page

    

The above is the details of the simple instance development of the mini-app reader. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.