Skip to content

Commit

Permalink
Merge pull request #7 from j10ccc/master
Browse files Browse the repository at this point in the history
chore(*): 统一组件写法
  • Loading branch information
j10ccc authored Dec 25, 2022
2 parents ace7b5d + 7d8faa5 commit a720572
Show file tree
Hide file tree
Showing 169 changed files with 18,398 additions and 3,546 deletions.
15 changes: 0 additions & 15 deletions .eslintrc

This file was deleted.

39 changes: 39 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended"
],
"overrides": [],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"ecmaVersion": 2021,
"sourceType": "module"
},
"plugins": [
"vue",
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
}
10 changes: 0 additions & 10 deletions .prettierignore

This file was deleted.

12 changes: 0 additions & 12 deletions .prettierrc.js

This file was deleted.

19 changes: 10 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# WeJH-Taro

使用跨平台框架 Taro
使用跨平台框架 Taro 构建的基于 Vue + TS 的小程序

# 微精弘
## 介绍

> 微精弘是是碎片化、一站式、一体化校园移动门户,适用于浙江工业大学学生,集课表、成绩、考试、空教室、一卡通、借阅等功能于一身。
>
> 微精弘有更好用的课表查询,本周视图、学期视图、对应日期及时钟轴,清晰明了。
>
> 微精弘有更方便的考试安排,帮你折算出考试周对应的日期,以及考试时间倒计时,一目了然。
>
> 微精弘还是校园生活助手与管家,一卡通余额及消费一览无余,让同学们更合理安排生活费。微精弘更是/更有... (期待您的发现)
- 微精弘是是碎片化、一站式、一体化校园移动门户,适用于浙江工业大学学生,集课表、成绩、考试、空教室、一卡通、借阅等功能于一身。
- 微精弘有更好用的课表查询,本周视图、学期视图、对应日期及时钟轴,清晰明了。
- 微精弘有更方便的考试安排,帮你折算出考试周对应的日期,以及考试时间倒计时,一目了然。
- 微精弘还是校园生活助手与管家,一卡通余额及消费一览无余,让同学们更合理安排生活费。微精弘更是/更有... (期待您的发现)

## 技术栈

Vue3, Typescript, Taro, Vuex

## 更多资料

Expand Down
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
module.exports = {
presets: [
[
'taro',
"taro",
{
framework: 'vue3',
framework: "vue3",
ts: true,
loose: false
}
Expand Down
4 changes: 2 additions & 2 deletions config/dev.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
env: {
NODE_ENV: '"development"',
HOST: '"https://wejh.zjutjh.com"'
NODE_ENV: "\"development\"",
HOST: "\"https://wejh.zjutjh.com\""
},
defineConstants: {},
mini: {},
Expand Down
59 changes: 30 additions & 29 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
import { buildDate, commit } from './utils/version';
import PackageJson from '../package.json';
import path from 'path';
import { buildDate, commit } from "./utils/version";
import PackageJson from "../package.json";
import path from "path";
const config = {
projectName: 'WeJh-Taro',
date: '2021-4-20',
projectName: "WeJh-Taro",
date: "2021-4-20",
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2,
375: 2 / 1
},
sourceRoot: 'src',
outputRoot: 'dist',
sourceRoot: "src",
outputRoot: "dist",
defineConstants: {
APP_VERSION: JSON.stringify(PackageJson.version),
'process.env.APP_NAME': JSON.stringify(PackageJson.name),
'process.env.COMMIT_HASH': JSON.stringify(commit),
'process.env.BUILD_TIME': JSON.stringify(buildDate),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
"process.env.APP_NAME": JSON.stringify(PackageJson.name),
"process.env.COMMIT_HASH": JSON.stringify(commit),
"process.env.BUILD_TIME": JSON.stringify(buildDate),
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
},
copy: {
patterns: [],
options: {}
},
framework: 'vue3',
framework: "vue3",
alias: {
'@/assets': path.resolve(__dirname, '..', 'src/assets'),
'@/store': path.resolve(__dirname, '..', 'src/store'),
'@/utils': path.resolve(__dirname, '..', 'src/utils'),
'@/types': path.resolve(__dirname, '..', 'src/types'),
'@/services': path.resolve(__dirname, '..', 'src/services'),
'@/constants': path.resolve(__dirname, '..', 'src/constants'),
'@/components': path.resolve(__dirname, '..', 'src/components'),
'@/style': path.resolve(__dirname, '..', 'src/style')
"@/assets": path.resolve(__dirname, "..", "src/assets"),
"@/store": path.resolve(__dirname, "..", "src/store"),
"@/utils": path.resolve(__dirname, "..", "src/utils"),
"@/hooks": path.resolve(__dirname, "..", "src/hooks"),
"@/types": path.resolve(__dirname, "..", "src/types"),
"@/services": path.resolve(__dirname, "..", "src/services"),
"@/constants": path.resolve(__dirname, "..", "src/constants"),
"@/components": path.resolve(__dirname, "..", "src/components"),
"@/style": path.resolve(__dirname, "..", "src/style")
},
mini: {
miniCssExtractPluginOption: {
Expand All @@ -53,15 +54,15 @@ const config = {
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
namingPattern: "module", // 转换模式,取值为 global/module
generateScopedName: "[name]__[local]___[hash:base64:5]"
}
}
}
},
h5: {
publicPath: '/',
staticDirectory: 'static',
publicPath: "/",
staticDirectory: "static",
postcss: {
autoprefixer: {
enable: true,
Expand All @@ -70,17 +71,17 @@ const config = {
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
namingPattern: "module", // 转换模式,取值为 global/module
generateScopedName: "[name]__[local]___[hash:base64:5]"
}
}
}
}
};

module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'));
if (process.env.NODE_ENV === "development") {
return merge({}, config, require("./dev"));
}
return merge({}, config, require('./prod'));
return merge({}, config, require("./prod"));
};
4 changes: 2 additions & 2 deletions config/prod.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
env: {
NODE_ENV: '"production"',
HOST: '"https://wejh.zjutjh.com"'
NODE_ENV: "\"production\"",
HOST: "\"https://wejh.zjutjh.com\""
},
defineConstants: {},
mini: {},
Expand Down
12 changes: 6 additions & 6 deletions config/utils/version.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import dayjs from 'dayjs';
const child_process = require('child_process');
import dayjs from "dayjs";
const child_process = require("child_process");
// git 最后一次提交的 Head
const commit = child_process
.execSync('git show -s --format=%H')
.execSync("git show -s --format=%H")
.toString()
.trim();
const commitDateObj = new Date(
child_process.execSync(`git show -s --format=%cd`).toString()
child_process.execSync("git show -s --format=%cd").toString()
);
const commitDate = dayjs(commitDateObj).format('YYYY-MM-DD HH:mm:ss');
const buildDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
const commitDate = dayjs(commitDateObj).format("YYYY-MM-DD HH:mm:ss");
const buildDate = dayjs().format("YYYY-MM-DD HH:mm:ss");

module.exports = {
commit,
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"@tarojs/cli": "^3.5.5",
"@types/jest": "^26.0.17",
"@types/webpack-env": "^1.16.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"@vue/babel-plugin-jsx": "^1.0.0-rc.4",
"@vue/compiler-sfc": "^3.0.0",
"@vue/test-utils": "^2.0.0-rc.6",
Expand All @@ -67,12 +67,11 @@
"cross-env": "^7.0.2",
"eslint": "^7.25.0",
"eslint-config-taro": "^3.5.5",
"eslint-plugin-vue": "^7.9.0",
"eslint-plugin-vue": "^9.8.0",
"git-revision-webpack-plugin": "^5.0.0",
"jest": "^26.6.3",
"jest-serializer-vue": "^2.0.2",
"jest-transform-stub": "^2.0.0",
"prettier": "^2.4.0",
"ts-jest": "^26.5.5",
"ts-loader": "^9.2.6",
"typescript": "^4.4.3",
Expand Down
Empty file removed src/apis/index.ts
Empty file.
Empty file removed src/apis/interfaces/applist.ts
Empty file.
Empty file removed src/apis/interfaces/index.ts
Empty file.
45 changes: 21 additions & 24 deletions src/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
export default {
pages: [
'pages/index/index',
'pages/activation/index',
'pages/bind/index',
'pages/lessonstable/index',
'pages/schoolbus/index',
'pages/library/index',
'pages/schoolcard/index',
'pages/about/index',
'pages/exam/index',
'pages/score/index',
'pages/setting/index',
'pages/connect/index',
'pages/connect/faq/index',
'pages/lab/index',
'pages/freeroom/index',
'pages/canteenflow/index',
'pages/announcement/index'
"pages/index/index",
"pages/activation/index",
"pages/bind/index",
"pages/lessonstable/index",
"pages/schoolbus/index",
"pages/library/index",
"pages/schoolcard/index",
"pages/about/index",
"pages/exam/index",
"pages/score/index",
"pages/setting/index",
"pages/connect/index",
"pages/connect/faq/index",
"pages/lab/index",
"pages/freeroom/index",
"pages/canteenflow/index",
"pages/announcement/index"
],
darkmode: false,
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
// navigationBarBackgroundColor: '@navBgColor',
// navigationBarTextStyle: '@navTxtStyle',
navigationBarTextStyle: 'black',
navigationStyle: 'custom'
backgroundTextStyle: "light",
navigationBarBackgroundColor: "#fff",
navigationBarTextStyle: "black",
navigationStyle: "custom"
}
// themeLocation: 'theme.json'
};
3 changes: 1 addition & 2 deletions src/app.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@import './style/icons.scss';
@import './style';
@import './style/puhuiti.scss'
@import './style/theme.scss';
22 changes: 11 additions & 11 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { createApp } from 'vue';
import store from './store/index';
import { LoginByTaro } from './services';
import { SystemService } from './services';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import relativeTime from 'dayjs/plugin/relativeTime';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc'; // dependent on utc plugin
import 'dayjs/locale/zh-cn';
import './app.scss';
import { createApp } from "vue";
import store from "./store/index";
import { LoginByTaro } from "./services";
import { SystemService } from "./services";
import customParseFormat from "dayjs/plugin/customParseFormat";
import relativeTime from "dayjs/plugin/relativeTime";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc"; // dependent on utc plugin
import "dayjs/locale/zh-cn";
import "./app.scss";

dayjs.locale('zh-cn');
dayjs.locale("zh-cn");
dayjs.extend(customParseFormat);
dayjs.extend(utc);
dayjs.extend(relativeTime);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Alarm/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

.wjh-alarm-icon {
font-size: 1.2rem;
font-size: 1.2rem !important;
color: var(--wjh-color-text-secondary);
}

Expand All @@ -21,4 +21,4 @@
border-radius: 1000Px;
position: relative;
text-align: center;
}
}
Loading

0 comments on commit a720572

Please sign in to comment.