Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
singleStore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Max
singleStore
Commits
c1ae791a
Commit
c1ae791a
authored
Jun 08, 2021
by
lmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:倒计时方法;styles:css-loyout处理
parent
dcf3a32d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
88 deletions
+49
-88
config/index.js
config/index.js
+6
-0
lib/service/index.js
lib/service/index.js
+10
-0
main.js
main.js
+3
-2
pages.json
pages.json
+3
-3
pages/home/index.vue
pages/home/index.vue
+10
-3
styles/layout.css
styles/layout.css
+0
-80
utils/common.js
utils/common.js
+17
-0
No files found.
config/index.js
View file @
c1ae791a
...
...
@@ -4,4 +4,10 @@ const env = {
develop
:
'
https://www.rmrfjune.cn
'
// 开发版
}
// #ifdef MP-WEIXIN
export
const
baseUrl
=
env
[
__wxConfig
.
envVersion
]
// #endif
// #ifndef MP-WEIXIN
export
const
baseUrl
=
process
.
env
.
NODE_ENV
===
'
development
'
?
env
.
develop
:
env
.
release
// #endif
lib/service/index.js
View file @
c1ae791a
...
...
@@ -17,6 +17,7 @@ function validateOps(options = {}) {
return
validator
.
validate
()
}
// 请求
export
function
request
(
options
)
{
const
valite_err
=
validateOps
(
options
)
if
(
valite_err
)
return
Toast
({
title
:
valite_err
})
...
...
@@ -69,3 +70,12 @@ export function request (options) {
})
})
}
// 上传文件
// export function upload() {
// return new Promise((resolve, reject) => {
// uni.uploadFile({
// })
// })
// }
main.js
View file @
c1ae791a
import
Vue
from
'
vue
'
import
App
from
'
./App
'
import
store
from
'
./store
'
import
"
@/utils/vue_prototype.js
"
import
store
from
'
./store
'
import
"
@/utils/vue_prototype.js
"
// 常用方法
Vue
.
config
.
productionTip
=
false
...
...
pages.json
View file @
c1ae791a
...
...
@@ -3,19 +3,19 @@
{
"path"
:
"pages/home/index"
,
"style"
:
{
"navigationBarTitleText"
:
"
uni-app
"
"navigationBarTitleText"
:
"
首页
"
}
},
{
"path"
:
"pages/mine/index"
,
"style"
:
{
"navigationBarTitleText"
:
"
uni-app
"
"navigationBarTitleText"
:
"
我的
"
}
}
],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
"navigationBarTitleText"
:
"
uni-app
"
,
"navigationBarTitleText"
:
"
"
,
"navigationBarBackgroundColor"
:
"#F8F8F8"
,
"backgroundColor"
:
"#F8F8F8"
},
...
...
pages/home/index.vue
View file @
c1ae791a
...
...
@@ -2,16 +2,19 @@
<view
class=
"content"
>
<view
class=
"test"
>
1
</view>
<view>
{{
str
}}
</view>
<button
type=
"default"
@
click=
"testTime"
>
倒计时测试
</button>
</view>
</
template
>
<
script
>
import
{
mapState
}
from
'
vuex
'
import
{
mapState
}
from
'
vuex
'
import
{
timerFn
}
from
'
@/utils/common.js
'
import
{
test
}
from
'
@/apis/test.js
'
export
default
{
data
()
{
return
{
str
:
""
}
},
computed
:
{
...
...
@@ -23,7 +26,11 @@
console
.
log
(
a
)
},
methods
:
{
testTime
()
{
timerFn
(
10
,
num
=>
{
this
.
str
=
num
})
}
}
}
</
script
>
...
...
styles/layout.css
View file @
c1ae791a
...
...
@@ -24,86 +24,6 @@
.flex-4
{
flex
:
4
;
}
.flex-5
{
flex
:
5
;
}
/* -- 内外边距 -- */
.m-0
{
margin
:
0
;
}
.m-1
{
margin
:
10
rpx
;
}
.m-2
{
margin
:
20
rpx
;
}
.m-3
{
margin
:
30
rpx
;
}
.m-4
{
margin
:
40
rpx
;
}
.m-5
{
margin
:
50
rpx
;
}
.mt-0
{
margin-top
:
0
;
}
.mt-1
{
margin-top
:
10
rpx
;
}
.mt-2
{
margin-top
:
20
rpx
;
}
.mt-3
{
margin-top
:
30
rpx
;
}
.mt-4
{
margin-top
:
40
rpx
;
}
.mt-5
{
margin-top
:
50
rpx
;
}
.mb-0
{
margin-bottom
:
0
;
}
.mb-1
{
margin-bottom
:
10
rpx
;
}
.mb-2
{
margin-bottom
:
20
rpx
;
}
.mb-3
{
margin-bottom
:
30
rpx
;
}
.mb-4
{
margin-bottom
:
40
rpx
;
}
.mb-5
{
margin-bottom
:
50
rpx
;
}
.ml-0
{
margin-left
:
0
;
}
.ml-1
{
margin-left
:
10
rpx
;
}
.ml-2
{
margin-left
:
20
rpx
;
}
.ml-3
{
margin-left
:
30
rpx
;
}
.ml-4
{
margin-left
:
40
rpx
;
}
.ml-5
{
margin-left
:
50
rpx
;
}
.mr-0
{
margin-right
:
0
;
}
.mr-1
{
margin-right
:
10
rpx
;
}
.mr-2
{
margin-right
:
20
rpx
;
}
.mr-3
{
margin-right
:
30
rpx
;
}
.mr-4
{
margin-right
:
40
rpx
;
}
.mr-5
{
margin-right
:
50
rpx
;
}
.my-0
{
margin-top
:
0
;
margin-bottom
:
0
;
}
.my-1
{
margin-top
:
10
rpx
;
margin-bottom
:
10
rpx
;
}
.my-2
{
margin-top
:
20
rpx
;
margin-bottom
:
20
rpx
;
}
.my-3
{
margin-top
:
30
rpx
;
margin-bottom
:
30
rpx
;
}
.my-4
{
margin-top
:
40
rpx
;
margin-bottom
:
40
rpx
;
}
.my-5
{
margin-top
:
50
rpx
;
margin-bottom
:
50
rpx
;
}
.mx-0
{
margin-left
:
0
;
margin-right
:
0
;
}
.mx-1
{
margin-left
:
10
rpx
;
margin-right
:
10
rpx
;
}
.mx-2
{
margin-left
:
20
rpx
;
margin-right
:
20
rpx
;
}
.mx-3
{
margin-left
:
30
rpx
;
margin-right
:
30
rpx
;
}
.mx-4
{
margin-left
:
40
rpx
;
margin-right
:
40
rpx
;
}
.mx-5
{
margin-left
:
50
rpx
;
margin-right
:
50
rpx
;
}
.p-1
{
padding
:
10
rpx
;
}
.p-2
{
padding
:
20
rpx
;
}
.p-3
{
padding
:
30
rpx
;
}
.p-4
{
padding
:
40
rpx
;
}
.p-5
{
padding
:
50
rpx
;
}
.pt-1
{
padding-top
:
10
rpx
;
}
.pt-2
{
padding-top
:
20
rpx
;
}
.pt-3
{
padding-top
:
30
rpx
;
}
.pt-4
{
padding-top
:
40
rpx
;
}
.pt-5
{
padding-top
:
50
rpx
;
}
.pb-1
{
padding-bottom
:
10
rpx
;
}
.pb-2
{
padding-bottom
:
20
rpx
;
}
.pb-3
{
padding-bottom
:
30
rpx
;
}
.pb-4
{
padding-bottom
:
40
rpx
;
}
.pb-5
{
padding-bottom
:
50
rpx
;
}
.pl-1
{
padding-left
:
10
rpx
;
}
.pl-2
{
padding-left
:
20
rpx
;
}
.pl-3
{
padding-left
:
30
rpx
;
}
.pl-4
{
padding-left
:
40
rpx
;
}
.pl-5
{
padding-left
:
50
rpx
;
}
.pr-1
{
padding-right
:
10
rpx
;
}
.pr-2
{
padding-right
:
20
rpx
;
}
.pr-3
{
padding-right
:
30
rpx
;
}
.pr-4
{
padding-right
:
40
rpx
;
}
.pr-5
{
padding-right
:
50
rpx
;
}
.py-1
{
padding-top
:
10
rpx
;
padding-bottom
:
10
rpx
;
}
.py-2
{
padding-top
:
20
rpx
;
padding-bottom
:
20
rpx
;
}
.py-3
{
padding-top
:
30
rpx
;
padding-bottom
:
30
rpx
;
}
.py-4
{
padding-top
:
40
rpx
;
padding-bottom
:
40
rpx
;
}
.py-5
{
padding-top
:
50
rpx
;
padding-bottom
:
50
rpx
;
}
.px-1
{
padding-left
:
10
rpx
;
padding-right
:
10
rpx
;
}
.px-2
{
padding-left
:
20
rpx
;
padding-right
:
20
rpx
;
}
.px-3
{
padding-left
:
30
rpx
;
padding-right
:
30
rpx
;
}
.px-4
{
padding-left
:
40
rpx
;
padding-right
:
40
rpx
;
}
.px-5
{
padding-left
:
50
rpx
;
padding-right
:
50
rpx
;
}
/* 文字对齐 */
.text-left
{
text-align
:
left
;
}
.text-right
{
text-align
:
right
;
}
...
...
utils/common.js
0 → 100644
View file @
c1ae791a
import
{
isFunction
}
from
"
@/utils/types.js
"
/**
* @desc 倒计时
* @param { Number } num 倒计时时间
* @param { Functiom } cb 回调
*/
export
function
timerFn
(
num
=
60
,
cb
)
{
let
timer
=
setInterval
(()
=>
{
cb
&&
isFunction
(
cb
)
&&
cb
.
call
(
this
,
num
)
num
--
if
(
num
<
0
)
{
clearInterval
(
timer
)
timer
=
null
return
}
},
1000
)
}
\ No newline at end of file
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