forked from TDesignOteam/tdesign-miniprogram-starter-apply
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 664636f
Showing
29 changed files
with
645 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# Next.js build output | ||
.next | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Wechat miniprogram | ||
miniprogram_npm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 leejimqiu | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Miniprogram Starter | ||
基于 TDesign 小程序组件库的基础模板 | ||
|
||
## 初始化 | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
然后打开微信开发者工具,点击菜单栏 ”工具“ - “构建npm”,即可开启预览。 | ||
|
||
## 特性 | ||
|
||
- [x] 支持 LESS (v0.0.1) | ||
- [x] 使用自定义 tabbar (v0.0.1) | ||
- [x] 支持版本检测,并弹窗更新 (v0.0.2) | ||
- [ ] 通过 GitHub Action 自动发布小程序 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// app.js | ||
App({ | ||
onLaunch() { | ||
const updateManager = wx.getUpdateManager() | ||
|
||
updateManager.onCheckForUpdate(function (res) { | ||
// console.log(res.hasUpdate) | ||
}) | ||
|
||
updateManager.onUpdateReady(function () { | ||
wx.showModal({ | ||
title: '更新提示', | ||
content: '新版本已经准备好,是否重启应用?', | ||
success(res) { | ||
if (res.confirm) { | ||
updateManager.applyUpdate() | ||
} | ||
} | ||
}) | ||
}) | ||
}, | ||
globalData: { | ||
userInfo: null | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"pages": [ | ||
"pages/index/index", | ||
"pages/explore/index", | ||
"pages/my/index" | ||
], | ||
"window": { | ||
"backgroundTextStyle": "light", | ||
"navigationBarBackgroundColor": "#fff", | ||
"navigationBarTitleText": "Weixin", | ||
"navigationBarTextStyle": "black" | ||
}, | ||
"tabBar": { | ||
"custom": true, | ||
"color": "#000000", | ||
"selectedColor": "#000000", | ||
"backgroundColor": "#000000", | ||
"list": [ | ||
{ | ||
"pagePath": "pages/index/index", | ||
"text": "首页" | ||
}, | ||
{ | ||
"pagePath": "pages/explore/index", | ||
"text": "发现" | ||
}, | ||
{ | ||
"pagePath": "pages/my/index", | ||
"text": "我的" | ||
} | ||
] | ||
}, | ||
"style": "v2", | ||
"sitemapLocation": "sitemap.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
Component({ | ||
data: { | ||
value: 'index', | ||
list: [{ | ||
icon: 'home', | ||
value: 'index', | ||
label: '首页', | ||
},{ | ||
icon: 'control-platform', | ||
value: 'explore', | ||
label: '发现', | ||
}, { | ||
icon: 'user', | ||
value: 'my', | ||
label: '我的' | ||
}] | ||
}, | ||
lifetimes: { | ||
ready() { | ||
const pages = getCurrentPages(); | ||
const curPage = pages[pages.length - 1]; | ||
|
||
if (curPage) { | ||
const nameRe = /pages\/(\w+)\/index/.exec(curPage.route); | ||
|
||
if (nameRe[1]) { | ||
this.setData({ | ||
value: nameRe[1] | ||
}) | ||
} | ||
} | ||
} | ||
}, | ||
methods: { | ||
handleChange(e) { | ||
const { value } = e.detail; | ||
|
||
// this.setData({ value }); | ||
wx.switchTab({ | ||
url: `/pages/${value}/index`, | ||
}) | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar", | ||
"t-tab-bar-item": "tdesign-miniprogram/tab-bar/tab-bar-item" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* custom-tab-bar/index.wxss */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<t-tab-bar value="{{value}}" bind:change="handleChange"> | ||
<t-tab-bar-item wx:for="{{list}}" wx:key="index" icon="{{item.icon}}" value="{{item.value}}"> | ||
{{item.label}} | ||
</t-tab-bar-item> | ||
</t-tab-bar> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "miniprogram-starter", | ||
"version": "0.0.2", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": ["wechat", "miniprogram", "starter"], | ||
"author": "leejim", | ||
"license": "MIT", | ||
"description": "a start-kit for wechat miniprogram powerby TDesign miniprogram", | ||
"dependencies": { | ||
"tdesign-miniprogram": "^0.12.1" | ||
}, | ||
"devDependencies": {} | ||
} |
Oops, something went wrong.