


This is a small program novice practice project (adapted based on WeChat quick demo) and made a calculator. It has a basic UI, basic jumps and simple js logic, making it very suitable for beginners to read.
Reading other people’s code is to consolidate your own programming skills.
Related knowledge related to WeChat applet development:
1, CSS Flexbox layout
2, event binding, page jump
3, Page, window, App global settings
4. How to use wxml, wxsss, js, json files
5. How to use view, text, icon, button components
6.navigate , wx.setStorageSync, data binding and other API
Setup
1、Clone the repo
$ git clone github.com/dunizb/wxapp-sCalc.git
2、Import to Wechat DEV Tools
Import the project into the WeChat developer tools
Editor's note: There are two points worth noting in the source code -
1, the author did not bind one to each calculator button The event function is uniformly bound to the blinkBtn function, and the id and e.target.id are used to determine which button the user clicked, and the author directly used the screen display number of the calculated button to make the id, which is simple and direct
2. When you click the button, there is a red highlight effect. This effect is achieved through css:
.item:active { background-color: #ff0000; }
A simple line of code improves the UE experience a lot. Worth learning~
In addition, I would like to share another mini program game. Although WeChat officially prohibits mini games from being put on the shelves, who can stop learners. The drawing API and animation API in the WeChat applet documentation may also be prepared for future games.
github.com/natee/wxapp-2048
This is a 2048 game. If you like calculator-style demos, you may also like this one.
The above is the detailed content of Teach you how to make an open source small program calculator. For more information, please follow other related articles on the PHP Chinese website!

计算器上的ac是“全部清除”键,ac的英文全称是“All Clear”,表示“全清键”;按下ac键表示清除所有寄存器中的数值;在数字输入期间,第一次按下ac键将清除存储器内容外的所有数值。

计算器中的e表示10的幂,即表示以10为底的指数,比如1.99714E13就等于19971400000000;把一个数表示成a与10的n次幂相乘的形式,这种记数法叫做科学记数法;当我们要标记或运算某个较大或较小且位数较多时,用科学记数法免去浪费很多空间和时间。

win10系统有很多强大的功能,吸引不少网友下载安装使用,其中也有很多实用的小工具,比如说win10计算器工具。有网友还不清楚win10计算器怎么打开,下面小编就教下大家打开win10计算器的方法。方法一:开始菜单中查找1、在Windows10系统桌面,依次点击“开始/计算器”菜单项。2、就可以打开Windows10的计算器窗口了。方法二:小娜搜索打开1、在Windows10桌面,点击任务栏左下角的“小娜搜索”的图标。2、在弹出的菜单中输入“计算器”的关键词进行搜索,点击搜索结果中的计算器菜单项

无存储功能的计算器指的是科学型计算器;科学型计算器是电子计算器的一种,可进行乘方、开方、指数、对数、三角函数、统计等方面的运算,又称函数计算器;计算器一般由运算器、控制器、存储器、键盘、显示器、电源和一些可选外围设备及电子配件组成。

高效斐波那契数列计算器:PHP实现斐波那契数列(Fibonaccisequence)是一个非常经典的数学问题,其规律是每个数等于前两个数之和,即F(n)=F(n-1)+F(n-2),其中F(0)=0,F(1)=1。在计算斐波那契数列时,可以使用递归方式来实现,但随着数值增大会出现性能问题。因此,本文将介绍如何使用PHP编写一个高效的斐波那

PHP在小程序开发中的页面跳转与路由管理随着小程序的快速发展,越来越多的开发者开始将PHP与小程序开发相结合。在小程序开发中,页面跳转和路由管理是非常重要的一部分,它能够帮助开发者实现页面之间的切换和导航操作。PHP作为一种常用的服务器端编程语言,可以很好地与小程序进行交互和数据传递,下面我们来详细了解一下PHP在小程序中的页面跳转与路由管理。一、页面跳转基

计算器上的"AC" 键表示 "All Clear"的意思,按下AC键会清除计算器中的所有输入和操作,将计算器重置为初始状态,相当于重新开始一次计算。

简单计算器是执行一些基本运算的计算器,例如“+”、“-”、“*”、“/”。计算器可以快速完成基本操作。我们将使用switch语句来制作一个计算器。示例Operator−‘+’=>34+324=358Operator−‘-’=>3874-324=3550Operator−‘*’=>76*24=1824O


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
