本次修改内容

main
WangLuFei 5 months ago
parent 11ce436746
commit bd7b487ba2

@ -1,2 +1,2 @@
# gudaishuxue # gudaishuxue
![【中国古代数学微信小程序的介绍-哔哩哔哩】 https://b23.tv/Bthj5aT](./ff.png)

@ -0,0 +1,37 @@
//app.js
App({
onLaunch: function () {
console.log('App Launch')
//调用API从本地缓存中获取数据
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
},
getUserInfo: function (cb) {
var that = this
if (this.globalData.userInfo) {
typeof cb == "function" && cb(this.globalData.userInfo)
} else {
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
onShow: function () {
console.log('App Show')
},
onHide: function () {
console.log('App Hide')
},
globalData: {
userInfo: null
}
})

@ -0,0 +1,56 @@
{
"pages": [
"pages/index/index",
"pages/list/index",
"pages/component/index",
"pages/i/index",
"pages/logs/logs"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "中国古代数学",
"navigationBarBackgroundColor": "#000",
"backgroundColor": "#fbf9fe",
"enablePullDownRefresh": true
},
"tabBar": {
"color": "#dddddd",
"selectedColor": "#3cc51f",
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "image/icon_component.png",
"selectedIconPath": "image/icon_component_HL.png",
"text": "首页"
},
{
"pagePath": "pages/list/index",
"iconPath": "image/icon_API.png",
"selectedIconPath": "image/icon_API_HL.png",
"text": "古代数学家"
},
{
"pagePath": "pages/component/index",
"iconPath": "image/icon_API.png",
"selectedIconPath": "image/icon_API_HL.png",
"text": "数学的分类"
},
{
"pagePath": "pages/i/index",
"iconPath": "image/icon_API.png",
"selectedIconPath": "image/icon_API_HL.png",
"text": "关于数学"
}
]
},
"networkTimeout": {
"request": 10000,
"connectSocket": 10000,
"uploadFile": 10000,
"downloadFile": 10000
},
"debug": true
}

@ -0,0 +1,54 @@
/**app.wxss**/
@import "./style/layout.wxss";
.container {
font-family: Helvetica Neue,Helvetica,Arial,sans-serif;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
}
page {
background-color: #fbf9fe;
}
.green{
color: #09BB07;
}
.red{
color: #F76260;
}
.blue{
color: #10AEFF;
}
.yellow{
color: #FFBE00;
}
.gray{
color: #C9C9C9;
}
.strong{
font-weight: bold;
}
.bc_green{
background-color: #09BB07;
}
.bc_red{
background-color: #F76260;
}
.bc_blue{
background-color: #10AEFF;
}
.bc_yellow{
background-color: #FFBE00;
}
.bc_gray{
background-color: #C9C9C9;
}
.tc{
text-align: center;
}

BIN
ff.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

@ -0,0 +1,45 @@
Page({
data: {
list: [
{
id: 'view',
name: '实用主义',
open: false,
pages: ['农业生产的测量', '商业的计算', '水利工程的设计']
}, {
id: 'content',
name: '小学算法',
open: false,
pages: ['简化', '计算', '普遍应用于商业和工程领域']
}, {
id: 'form',
name: '算术',
open: false,
pages: ['整数', '分数', '百分数', '分数的四则运算', '开方', '数字比例', '平均分配', '正负数' ]
}, {
id: 'feedback',
name: '几何',
open: false,
pages: ['平行四边形', '三角形', '梯形', '数学几何基础']
}, {
id: 'media',
name: '分类与框架',
open: false,
pages: ['方田', '粟米', '差分', '均输', '商功']
}
]
},
widgetsToggle: function (e) {
var id = e.currentTarget.id, list = this.data.list;
for (var i = 0, len = list.length; i < len; ++i) {
if (list[i].id == id) {
list[i].open = !list[i].open;
} else {
list[i].open = false;
}
}
this.setData({
list: list
});
}
});

@ -0,0 +1,28 @@
<view class="index">
<view class="head">
<view class="title">中国古代数学</view>
<view class="desc">元元本本,数始于一。凡一之属皆从一。一之形,于六书为指事。</view>
</view>
<view class="body">
<view class="widgets">
<block wx:for-items="{{list}}" wx:key="item.id">
<view class="widgets__item">
<view id="{{item.id}}" class="widgets__info {{item.open ? 'widgets__info_show' : ''}}" bindtap="widgetsToggle">
<text class="widgets__info-name">{{item.name}}</text>
<image class="widgets__info-img" src="/image/arrowright.png" mode="aspectFill" />
</view>
<view class="widgets__list {{item.open ? 'widgets__list_show' : ''}}">
<block wx:for-items="{{item.pages}}" wx:for-item="page" wx:key="item.id">
<navigator url="component-pages/{{page}}/{{page}}" class="widget">
<text class="widget__name">{{page}}</text>
<image class="widget__arrow" src="/image/arrowright.png" mode="aspectFill" />
<view class="widget__line {{index == 0 ? 'widget__line_first' : ''}}"></view>
</navigator>
</block>
</view>
</view>
</block>
</view>
</view>
</view>

@ -0,0 +1,88 @@
.index{
background-color: #FBF9FE;
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
flex: 1;
min-height: 100%;
font-size: 32rpx;
}
.head{
padding: 80rpx;
line-height: 1;
}
.body{
padding-left: 30rpx;
padding-right: 30rpx;
overflow: hidden;
}
.title{
font-size: 52rpx;
}
.desc{
margin-top: 10rpx;
color: #888888;
font-size: 28rpx;
}
.widgets__item{
margin-top: 20rpx;
margin-bottom: 20rpx;
background-color: #FFFFFF;
overflow: hidden;
border-radius: 4rpx;
cursor: pointer;
}
.widgets__info{
display: flex;
padding: 40rpx;
align-items: center;
flex-direction: row;
}
.widgets__info_show{
}
.widgets__info_show .widgets__info-img{
transform: rotate(-90deg);
}
.widgets__info-name{
flex: 1;
}
.widgets__info-img{
width: 32rpx;
height: 32rpx;
transition: transform .4s;
transform: rotate(90deg);
}
.widgets__list{
display: none;
}
.widgets__list_show{
display: block;
}
.widget{
position: relative;
padding-top: 26rpx;
padding-bottom: 26rpx;
padding-left: 40rpx;
padding-right: 40rpx;
}
.widget__arrow{
position: absolute;
top: 28rpx;
right: 44rpx;
width: 32rpx;
height: 32rpx;
}
.widget__line{
content: " ";
position: absolute;
left: 40rpx;
top: 0;
right: 0;
height: 2rpx;
background-color: #F0F0F0;
}
.widget__line_first{
left: 0;
right: 0;
background-color: #D8D8D8;
}

@ -0,0 +1,34 @@
//index.js
//获取应用实例
var app = getApp()
Page( {
//事件处理函数
bindViewTap: function() {
wx.navigateTo( {
url: '../logs/logs'
})
},
calling: function () {
wx.makePhoneCall({
phoneNumber: '010-88545360',
success: function () {
console.log("拨打电话成功!")
},
fail: function () {
console.log("拨打电话失败!")
}
})
},
onLoad: function() {
var that = this
//调用应用实例的方法获取全局数据
app.getUserInfo( function( userInfo ) {
//更新数据
that.setData( {
userInfo: userInfo
})
})
}
})

@ -0,0 +1,23 @@
<!--index.wxml-->
<view class="gy1">
<image src="/image/gy1.jpg"></image>
</view>
<view class="text">
<view class="line_y"></view>
<text>关于中国古代数学</text>
</view>
<view class="text2">
<text>
中国古代数学家注重整体观念和经验归纳,他们更关注方法的应用,而非严格的逻辑推理。这种思维方式影响了中国古代数学的发展,使得中国数学在许多实际问题上取得了巨大的成就。
若想更多关于中国古代数学的知识,请咨询中国国家图书馆
全国统一服务电话010-88545360
</text>
</view>
<view class="gy">
<image src="/image/gy.jpg"></image>
</view>
<button type="default" bindtap="calling">点击拨打图书馆电话</button>

@ -0,0 +1,60 @@
/**index.wxss**/
.container {
padding-top: 30px;
}
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.userinfo-nickname {
color: #aaa;
}
.info {
margin-top: 50px;
text-align: center;
}
.line_y {
width: 3px;
height: 100%;
height: 18px;
display: inline-block;
background-color: #09bb07;
}
view.text {
display: flex;
align-items: center;
position: relative;
padding: 10px 10px 10px 12px;
font-size: 15px;
color: #656565;
background-color: #ccc;
}
view.text text {
margin-left: 10px;
line-height: 18px;
}
view.text2 {
display: flex;
align-items: center;
position: relative;
padding: 10px 10px 10px 12px;
font-size: 15px;
color: #656565;
}
.gy image{
width: 750rpx;
height: 280rpx;
}
.gy1 image{
width: 750rpx;
height: 300rpx;
}

@ -0,0 +1,88 @@
//index.js
//获取应用实例
var app = getApp()
Page( {
data: {
//向模板传入数据
// 轮播
index_index_scroll_tmpl: {
images: [
'/image/2.jpg',
'/image/1.jpg',
'/image/3.jpg',
],
indicatorDots: true,
vertical: false,
autoplay: true,
interval: 3000,
duration: 1200
},
// nav
index_index_navs_tmpl: {
navs: [
{
image: '/image/i3.jpg',
text: '九章算术'
}, {
image: '/image/i2.jpg',
text: '周骸算经'
}, {
image: '/image/i4.jpg',
text: '算经十书'
}, {
image: '/image/i1.jpg',
text: '墨经'
}
]
},
// item
index_index_items_tmpl: {
items: [
{ image: '/image/a1.jpg'},
{ image: '/image/a2.jpg'},
{ image: '/image/a3.jpg'}
]
}
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo( {
url: '../logs/logs'
})
},
swiperchange: function(e) {
//FIXME: 当前页码
//console.log(e.detail.current)
},
onLoad: function() {
console.log( 'onLoad' )
var that = this
//调用应用实例的方法获取全局数据
app.getUserInfo( function( userInfo ) {
//更新数据
that.setData( {
userInfo: userInfo
})
})
},
onShareAppMessage: function () {
return {
title: '中国古代数学',
desc: '世界数学的引领者',
path: '/page/user?id=123'
}
},
go: function(event) {
wx.navigateTo({
url: '../list/index?type=' + event.currentTarget.dataset.type
})
}
})

@ -0,0 +1,32 @@
<!--index.wxml-->
<import src="../../template/item-template.wxml"/>
<view class="container">
<view class="section section_gap swiper_box">
<template is="index_index_scroll_tmpl" data="{{...index_index_scroll_tmpl}}" />
</view>
<view class="text">
<view class="line_y"></view>
<text>相关书籍</text>
</view>
<view class="section index-nav">
<template is="index_index_navs_tmpl" data="{{...index_index_navs_tmpl}}"/>
</view>
<view class="text">
<view class="line_y"></view>
<text>推荐了解</text>
</view>
<view class="nr11">
<image src="/image/a1.jpg"></image>
</view>
<view class="nr11">
<image src="/image/a2.jpg"></image>
</view>
<view class="nr11">
<image src="/image/a3.jpg"></image>
</view>
</view>

@ -0,0 +1,95 @@
.container {
background-color: #F2f2f2;
}
view.section {
/*display: block;*/
/*width: 100%;*/
}
/*轮播*/
.swiper_box {
/*width: 100%;*/
height: 157.5px;
}
swiper.swiper {
height: 100%;
}
.swiper-item {
display: block;
height: 100%;
}
.slide-image {
height: 100%;
width: 100%;
display: inline-block;
overflow: hidden;
}
/*分类*/
.index-nav {
height: 80px;
/*background: red;*/
display: flex;
flex-direction: row;
/*align-items: center;*/
background-color: #fff;
color: #646464;
}
.index-nav view {
flex: 1;
flex-direction: column;
border-right: 1px solid #F2f2f2;
}
.index-nav image {
width: 38px;
height: 38px;
}
.index-nav text {
font-size: 16px;
}
view.text {
display: flex;
align-items: center;
position: relative;
padding: 10px 10px 10px 12px;
font-size: 15px;
color: #656565;
}
view.text:before {
position: absolute;
display: block;
content: ' ';
left: -5px;
width: 2px;
height: 100%;
background-color: #09bb07;
}
.line_y {
width: 3px;
height: 100%;
height: 18px;
display: inline-block;
background-color: #09bb07;
}
view.text text {
margin-left: 10px;
line-height: 18px;
}
.item {
margin-bottom: 7px;
height: 126px;
}
.nr11{
}
.nr11 image{
width: 100%;
height: 280rpx;
}

@ -0,0 +1,18 @@
Page({
data: {
title: '',
//向模板传入数据
list_index_items_tmpl: {
items: [{"mprice":0,"maxpacks":100,"price":12800,"subcate":210,"remains":998,"type":1,"freight":0,"title":"V7702","imgs":["../../image/V7702.jpg"],"unit":"只","id":302,"quantity":"1"},{"mprice":0,"maxpacks":14,"price":1600,"subcate":410,"remains":14,"type":4,"freight":1000,"title":"红糖粉","imgs":["https://81.jpg"],"unit":"g","id":93,"quantity":"400"},{"mprice":0,"maxpacks":100,"price":4800,"subcate":202,"remains":5,"type":1,"freight":1000,"title":"极致Q弹肉丸子","imgs":["https:/fe3.png"],"unit":"g","id":69,"quantity":"300"}]
}
},
//事件处理函数
onLoad: function (options) {
this.title = options.type || '中国古代数学大家'
},
onReady: function () {
wx.setNavigationBarTitle({
title: this.title
})
},
})

@ -0,0 +1,46 @@
<!--index.wxml-->
<!--<import src="../../template/item-template.wxml" />--》
<!--<view class="container">
<template is="list_index_items_tmpl" data="{{...list_index_items_tmpl}}" />
</view>-->
<view class="container">
<image src="/image/V7702.jpg"></image>
</view>
<view class="container">
<image src="/image/F9.jpg"></image>
</view>
<view class="container">
<image src="/image/K77.jpg"></image>
</view>
<view class="container">
<image src="/image/L77.jpg"></image>
</view>
<view class="container">
<image src="/image/LS79.jpg"></image>
</view>
<view class="container">
<image src="/image/T77.jpg"></image>
</view>
<view class="container">
<image src="/image/T7701.jpg"></image>
</view>
<view class="container">
<image src="/image/V77.jpg"></image>
</view>
<view class="container">
<image src="/image/V177.jpg"></image>
</view>
<view class="container">
<image src="/image/V551.jpg"></image>
</view>
<view class="container">
<image src="/image/V7701.jpg"></image>
</view>
<view class="container">
<image src="/image/V7703.jpg"></image>
</view>
<view class="container">
<text class="daodi">到底了</text>
</view>

@ -0,0 +1,45 @@
.container {
padding: 8px 0;
}
.container image {
display: block;
ime-mode: widthFix;
width: 750rpx;
height: 600rpx;
}
.item {
padding: 8px;
background-color: #fff;
border-top: 1px solid #e4e4e4;
color: #787878;
}
.item image {
display: block;
width: 129px;
height: 114px;
}
.item-right {
margin-left: 11px;
}
.title {
margin-bottom: 25px;
}
.title text {
font-size: 16px;
color: #787878;
}
text {
font-size: 15px;
color: #444;
}
.c-1 {
color: #09bb07;
}
.daodi{
text-align: center;
color: #ccc;
}

@ -0,0 +1,14 @@
//logs.js
var util = require('../../utils/util.js')
Page({
data: {
logs: []
},
onLoad: function () {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(function (log) {
return util.formatTime(new Date(log))
})
})
}
})

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "查看启动日志"
}

@ -0,0 +1,6 @@
<!--logs.wxml-->
<view class="container log-list">
<block wx:for="{{logs}}" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log}}</text>
</block>
</view>

@ -0,0 +1,8 @@
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}

@ -0,0 +1,59 @@
/**
* layout
*
* 说明
* l:layout
* r:row
* l:left
* r:right
* c:center
*/
.l-r {
display: flex;
}
/*l_auto:占用剩下的*/
.l_auto {
flex: 1;
}
/*& > * {
display: block;
}
// 1行内元素平分
// &[class^="l-r-auto"] {
// flex: 1;
// }
// 1行内元素平分
&[class^="l-r-auto"] {
& > * {
flex: 1;
text-align: center;
}
}
// 主轴为水平方向,起点在右端
&[class^="l-r-r"] {
flex-direction: row-reverse;
}
// 1行2列两边对齐
&[class^="l-r-lr"] {
justify-content: space-between;
}
*/
.l-c {
display: flex;
/*justify-content: center;*/
align-items: center;
}
/*垂直水平居中对齐*/
.l-c-c {
display: flex;
justify-content: center;
align-items: center;
}

@ -0,0 +1,32 @@
<!--index_index_scroll-->
<template name="index_index_scroll_tmpl">
<swiper class="swiper" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
<block wx:for="{{images}}" wx:key="item.id">
<swiper-item>
<image src="{{item}}" class="slide-image"/>
</swiper-item>
</block>
</swiper>
</template>
<!--index_index_navs-->
<template name="index_index_navs_tmpl">
<block wx:for="{{navs}}" wx:key="item.id">
<view class="l-c-c" catchtap="go" data-type="{{item.text}}">
<image src="{{item.image}}" class="slide-image"/>
<text>{{item.text}}</text>
</view>
</block>
</template>
<!--index_index_items-->
<template name="index_index_items_tmpl">
<block wx:for="{{items}}" wx:key="item.id">
<view class="item">
<image src="{{item.image}}" class="slide-image"/>
</view>
</block>
</template>

@ -0,0 +1,21 @@
function formatTime(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime
}
Loading…
Cancel
Save