Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向伟
educationStu
Commits
0c91ba88
Commit
0c91ba88
authored
Aug 18, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c2d9530e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
242 additions
and
216 deletions
+242
-216
main.js
src/main.js
+4
-0
askForLeaveList.vue
src/pages/course/askForLeaveList.vue
+1
-1
examPaper.vue
src/pages/exam/examPaper.vue
+5
-2
index.vue
src/pages/index/index.vue
+6
-2
index2.vue
src/pages/index/index2.vue
+19
-1
login.vue
src/pages/login/login.vue
+197
-207
common.css
src/static/css/common.css
+5
-1
request.js
src/utils/request.js
+5
-2
No files found.
src/main.js
View file @
0c91ba88
...
...
@@ -3,8 +3,12 @@ import {
}
from
'vue'
import
App
from
'./App.vue'
import
Toast
from
"./wxcomponents/vant/toast/toast"
;
import
Dialog
from
"./wxcomponents/vant/dialog/dialog"
;
import
plugin
from
'./utils/plugin'
let
app
=
createApp
(
App
)
app
.
provide
(
"$toast"
,
Toast
)
app
.
provide
(
"$dialog"
,
Dialog
)
app
.
use
(
plugin
)
// app.config.globalProperties.$toast = Toast;//全局挂载方法
// app.component('v-MessageBox',MessageBox);//全局注册组件
app
.
mount
()
src/pages/course/askForLeaveList.vue
View file @
0c91ba88
...
...
@@ -90,7 +90,6 @@ import {
}
from
"vue"
;
import
{
getStudentLeaveList
,
invalidReceiptInfo
}
from
"../../api/index"
;
import
Loadmore
from
"../../components/loadmore.vue"
;
import
Dialog
from
"../../wxcomponents/vant/dialog/dialog"
;
export
default
{
components
:
{
Loadmore
,
...
...
@@ -98,6 +97,7 @@ export default {
setup
()
{
let
userInfo
=
uni
.
getStorageSync
(
"userInfo"
);
let
Toast
=
inject
(
"$toast"
);
let
Dialog
=
inject
(
"$dialog"
);
let
data
=
reactive
({
data
:
[],
pageState
:
"more"
,
...
...
src/pages/exam/examPaper.vue
View file @
0c91ba88
...
...
@@ -2,9 +2,11 @@
<view
:style=
"
{ 'padding-top': `${statusBarHeight}px` }">
<view
style=
"height: 100rpx"
></view>
<van-nav-bar
fixed
>
<van-icon
name=
"cross"
slot=
"left"
size=
"30rpx"
@
click=
"back"
/>
<template
#
left
>
<van-icon
name=
"cross"
size=
"30rpx"
@
click=
"back"
/>
</
template
>
<
template
#
title
>
<view
slot=
"title"
class=
"flex"
style=
"justify-content: center"
@
click=
"start"
...
...
@@ -23,6 +25,7 @@
ref=
"countdown"
/>
</view>
</
template
>
</van-nav-bar>
<view
class=
"exam-con"
>
<Sub1
/>
...
...
src/pages/index/index.vue
View file @
0c91ba88
...
...
@@ -131,6 +131,7 @@ import {
}
from
"vue"
;
import
{
getIndexInfo
}
from
"../../api/index"
;
import
{
getSystemInfo
,
desensitization
}
from
"../../utils/index"
;
import
request
from
"../../utils/request.js"
;
export
default
{
name
:
""
,
props
:
{},
...
...
@@ -203,7 +204,6 @@ export default {
},
],
});
let
methods
=
{
jumpPage
(
url
)
{
uni
.
navigateTo
({
...
...
@@ -232,6 +232,7 @@ export default {
};
onMounted
(()
=>
{
console
.
log
(
process
.
env
);
getSystemInfo
((
res
)
=>
{
data
.
statusBarHeight
=
res
.
statusBarHeight
;
});
...
...
@@ -250,7 +251,10 @@ export default {
};
},
onLoad
()
{
console
.
log
(
"index load"
);
// let { ctx } = getCurrentInstance();
// ctx.$test("首页");
// this.$test("首页");
// console.log(256, this);
uni
.
setNavigationBarTitle
({
title
:
"首页"
,
});
...
...
src/pages/index/index2.vue
View file @
0c91ba88
...
...
@@ -6,7 +6,7 @@
如果需要解构 prop,可以通过使用 setup 函数中的 toRefs 来完成此操作
* // ref和reactive的区别: ref()传入的是js的基本数据类型; reactive()中传入的是object普通对象,------------reactive对象不能直接赋值--------------
*@reactive:处理的是对象的双向绑定, 对象不能被***解构或展开***,一旦被解构或者展开,返回的值将失去响应式,需用...toRef()
* 没有this 通过 @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy } = getCurrentInstance(); ctx或proxy.$挂载的方法
* 没有this 通过 @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy
,refs
} = getCurrentInstance(); ctx或proxy.$挂载的方法
*/
import
{
ref
,
...
...
@@ -37,11 +37,19 @@ export default {
watch
(
name
,
(
newVal
,
oldVal
)
=>
{
console
.
log
(
51
,
newVal
);
});
//监听对象的某一项
watch
(
()
=>
msg
.
Account
,
(
val
)
=>
{
console
.
log
(
val
);
}
);
// computed 计算属性 : 适合计算一个属性, 并且绑定.
// computed将监听它里面所有的变量, 里面变量发生变化就会触发结果重新计算
// 计算出来的结果是只读的, 所以fullName是不能被改变的
const
fullName
=
computed
(()
=>
name
.
firstname
+
name
.
lastname
);
// const fullName = computed(() => { return name.firstname + name.lastname});
// 高级用法: 可以修改值
const
fullName2
=
computed
({
get
:
()
=>
name
.
firstname
+
name
.
lastname
,
...
...
@@ -57,5 +65,15 @@ export default {
fullName2
,
};
},
onLoad
()
{
//这里有this
let
{
ctx
}
=
getCurrentInstance
();
ctx
.
$test
(
"首页"
);
this
.
$test
(
"首页"
);
console
.
log
(
69
,
this
);
uni
.
setNavigationBarTitle
({
title
:
"首页"
,
});
},
};
</
script
>
src/pages/login/login.vue
View file @
0c91ba88
This diff is collapsed.
Click to expand it.
src/static/css/common.css
View file @
0c91ba88
*
{
/*
*{
font-family: PingFang SC;
box-sizing: border-box;
} */
:global
(*)
{
font-family
:
PingFang
SC
;
box-sizing
:
border-box
;
}
.flex
{
...
...
src/utils/request.js
View file @
0c91ba88
let
host
=
'http://192.168.20.17:8017/api'
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
host
=
'http://192.168.20.17:8017/api'
}
else
{
host
=
'http://192.168.20.17:8017/api'
}
import
Toast
from
'../wxcomponents/vant/toast/toast'
;
let
token
=
uni
.
getStorageSync
(
'userInfo'
).
Token
;
let
request
=
(
param
)
=>
{
...
...
@@ -28,7 +33,5 @@ let request = (param) => {
}
});
})
}
export
default
request
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment