parent
2f287f0c70
commit
d6709cb790
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Eslint config file
|
||||
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||
* Install the Eslint extension before using this feature.
|
||||
*/
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
wx: true,
|
||||
App: true,
|
||||
Page: true,
|
||||
getCurrentPages: true,
|
||||
getApp: true,
|
||||
Component: true,
|
||||
requirePlugin: true,
|
||||
requireMiniProgram: true,
|
||||
},
|
||||
// extends: 'eslint:recommended',
|
||||
rules: {},
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
// app.js
|
||||
App({
|
||||
onLaunch() {
|
||||
// 展示本地存储能力
|
||||
const logs = wx.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
wx.setStorageSync('logs', logs)
|
||||
|
||||
// 登录
|
||||
wx.login({
|
||||
success: res => {
|
||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||
}
|
||||
})
|
||||
},
|
||||
globalData: {
|
||||
userInfo: null
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,36 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/video/video",
|
||||
"pages/music/music"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "中国古代数学",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
},
|
||||
"tabBar": {
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "主页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/video/video",
|
||||
"text": "视频介绍"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/music/music",
|
||||
"text": "音乐欣赏"
|
||||
}
|
||||
],
|
||||
"color": "#000",
|
||||
"selectedColor": "#1AAD19",
|
||||
"backgroundColor": "#fff",
|
||||
"borderStyle": "black"
|
||||
},
|
||||
"style": "v2",
|
||||
"componentFramework": "glass-easel",
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"lazyCodeLoading": "requiredComponents"
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
/**app.wxss**/
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 200rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
<view class="container">
|
||||
<!-- 轮播图 -->
|
||||
<swiper class="swiper" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}">
|
||||
<block wx:for="{{banners}}" wx:key="index">
|
||||
<swiper-item>
|
||||
<image src="{{item.url}}" mode="aspectFill" class="swiper-img"></image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
|
||||
<!-- 关于我们 -->
|
||||
<view class="section">
|
||||
<view class="section-title">关于我们</view>
|
||||
<view class="section-content">
|
||||
我们的小程序致力于展示中国古代数学的悠久历史和丰富贡献。通过视频和音乐的形式,我们希望带领您领略古代数学的魅力。
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 历史名人 -->
|
||||
<view class="section">
|
||||
<view class="section-title">历史名人</view>
|
||||
<view class="section-content">
|
||||
<view wx:for="{{historians}}" wx:key="index" class="historian">
|
||||
<image src="{{item.avatar}}" mode="aspectFill" class="historian-avatar"></image>
|
||||
<text class="historian-name">{{item.name}}</text>
|
||||
<text class="historian-intro">{{item.intro}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 数学趣题 -->
|
||||
<view class="section">
|
||||
<view class="section-title">数学趣题</view>
|
||||
<view class="section-content">
|
||||
<view wx:for="{{mathProblems}}" wx:key="index" class="math-problem">
|
||||
<text class="math-problem-title">{{item.title}}</text>
|
||||
<text class="math-problem-content">{{item.content}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -0,0 +1,75 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.swiper-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.section {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.section-content {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.historian {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.historian-avatar {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.historian-name {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.historian-intro {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.math-problem {
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.math-problem-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.math-problem-content {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
Page({
|
||||
data: {
|
||||
relatedMusic: [
|
||||
{
|
||||
title: '古代数学之歌',
|
||||
url: 'http://music.163.com/song/media/outer/url?id=1888687693.mp3' //
|
||||
},
|
||||
{
|
||||
title: '数学之美',
|
||||
url: 'http://music.163.com/song/media/outer/url?id=2043218731.mp3' //
|
||||
},
|
||||
{
|
||||
title: '智慧的旋律',
|
||||
url: 'http://music.163.com/song/media/outer/url?id=2043218731.mp3' //
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
<view class="container">
|
||||
<view class="title">音乐欣赏</view>
|
||||
<view class="music-section">
|
||||
<audio src="http://music.163.com/song/media/outer/url?id=2043218731.mp3" controls class="music-player"></audio>
|
||||
</view>
|
||||
<view class="description-section">
|
||||
<view class="section-title">音乐简介</view>
|
||||
<view class="section-content">
|
||||
本音乐作品灵感来源于中国古代数学,旋律优美动听,带您领略古代数学的文化韵味。希望您在欣赏音乐的同时,也能感受到数学的魅力。
|
||||
</view>
|
||||
</view>
|
||||
<view class="related-music">
|
||||
<view wx:for="{{relatedMusic}}" wx:key="index" class="related-music-item">
|
||||
<text class="related-music-title">{{item.title}}</text>
|
||||
<audio src="{{item.url}}" controls class="related-music-player" poster=""></audio>
|
||||
</view>
|
||||
</view>
|
||||
<view class="back-btn">
|
||||
<navigator url="/pages/index/index">返回首页</navigator>
|
||||
</view>
|
||||
</view>
|
||||
@ -0,0 +1,71 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.music-section {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.music-player {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.description-section,
|
||||
.related-music-section {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.section-content {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.related-music {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.related-music-item {
|
||||
width: 48%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.related-music-cover {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
padding-bottom: 75%; /* 16:9 aspect ratio */
|
||||
background-size: cover;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.related-music-title {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
font-size: 18px;
|
||||
color: #1AAD19;
|
||||
text-decoration: none;
|
||||
padding: 10px 20px;
|
||||
border: 1px solid #1AAD19;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
Page({
|
||||
data: {
|
||||
relatedVideos: [
|
||||
{
|
||||
thumbnail: 'https://kvideo01.youju.sohu.com/160b49f1-b4b0-41f2-8068-70c5a3768b1e2_0_0.mp4?sign=d69dc4422d7864c6856b22421d461c5b&t=1718629907',
|
||||
title: '古代数学家的故事'
|
||||
},
|
||||
{
|
||||
thumbnail: 'https://kvideo01.youju.sohu.com/70e7f352-7c9d-4c5c-96ef-2a685ab6c0d52_0_0.mp4?sign=9be599bbb78d5554f7110765fac73ea5&t=1718630313',
|
||||
title: '中国古代数学定理'
|
||||
},
|
||||
{
|
||||
thumbnail: 'https://721-4.vod.tv.itc.cn/sohu/v1/TmwdqAIsRYWHMYA2TKwB0Lsl8SkDD6e2RYbO8Y6AhhXUyYbSoO27fSx.mp4?k=n7kFEZ&p=jWlvzSwdqLsBqmx3qEO349xIWhysRYNsZY14WBeXWhetfDy4WhWS0MocRYo70ScAZMx4gGo70O2CfMXS0pbcWhoGgY27oVfS0p0cWJoV0Y2svmN2ZM1mNp&r=TUldziJCtpCmhWlvsmCioLwWtWaizY&q=OpC3hW7IWhodRDvOvmfCyY2slGdOlGvOWJXOWho2ZDvXfGbOWDbOwm4cWJesr&nid=721',
|
||||
title: '数学在古代中国的应用'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
<view class="container">
|
||||
<view class="title">视频介绍</view>
|
||||
<view class="video-section">
|
||||
<video src="https://kvideo01.youju.sohu.com/2091f24d-6c1b-4992-b5fa-925d6ee87f162_0_0.mp4?sign=b36a42ceac968f048902b3256deb040e&t=1718629716" controls class="video-player"></video>
|
||||
</view>
|
||||
<view class="description-section">
|
||||
<view class="section-title">视频简介</view>
|
||||
<view class="section-content">
|
||||
本视频介绍了中国古代数学的发展历程,包括重要的数学家、定理和计算方法。通过观看本视频,您将对中国古代数学有一个全面的了解。
|
||||
</view>
|
||||
</view>
|
||||
<view class="related-videos-section">
|
||||
<view class="section-title">相关视频推荐</view>
|
||||
<view class="related-videos">
|
||||
<view wx:for="{{relatedVideos}}" wx:key="index" class="related-video">
|
||||
<video src="{{item.thumbnail}}" mode="aspectFill" class="related-video-thumbnail"></video>
|
||||
<text class="related-video-title">{{item.title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="back-btn">
|
||||
<navigator url="/pages/index/index">返回首页</navigator>
|
||||
</view>
|
||||
</view>
|
||||
@ -0,0 +1,72 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.video-section {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.video-player {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.description-section,
|
||||
.related-videos-section {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.section-content {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.related-videos {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.related-video {
|
||||
width: 48%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.related-video-thumbnail {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
padding-bottom: 75%; /* 16:9 aspect ratio */
|
||||
background-size: cover;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.related-video-title {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
font-size: 18px;
|
||||
color: #1AAD19;
|
||||
text-decoration: none;
|
||||
padding: 10px 20px;
|
||||
border: 1px solid #1AAD19;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
{
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "trial",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "auto",
|
||||
"tabSize": 2
|
||||
},
|
||||
"appid": "wxfabab2225eb5630e"
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||
"rules": [{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}]
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
const formatTime = date => {
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
|
||||
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
|
||||
}
|
||||
|
||||
const formatNumber = n => {
|
||||
n = n.toString()
|
||||
return n[1] ? n : `0${n}`
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime
|
||||
}
|
||||
|
After Width: | Height: | Size: 126 KiB |
Loading…
Reference in new issue