Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MiniprogramTemplate
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
谢卓城
MiniprogramTemplate
Commits
43db2e59
Commit
43db2e59
authored
Jan 24, 2021
by
谢卓城
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.add constants. 2.change apis/index.js. 3.change README.md
parent
3d6f8597
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
3 deletions
+35
-3
README.md
README.md
+12
-0
index.js
src/apis/index.js
+0
-0
index.js
src/constants/index.js
+18
-0
index.js
src/pages/index/index.js
+5
-3
No files found.
README.md
View file @
43db2e59
...
...
@@ -7,6 +7,18 @@
终端运行:sh MiniprogramTemplate.sh <#生成模板路径#>
```
##### 安装依赖
```
终端运行:npm install && cd package && rm package-lock.json && npm install && sh miniprogramnpm.sh && cd ..
```
##### 运行
```
终端运行:npm run dev
```
### 使用
```
...
...
src/apis/
root
.js
→
src/apis/
index
.js
View file @
43db2e59
File moved
src/constants/index.js
0 → 100644
View file @
43db2e59
export
const
EMPLOYEE_STATUS
=
{
NORMAL
:
{
value
:
1
,
desc
:
'正常'
},
DISABLED
:
{
value
:
1
,
desc
:
'禁用'
},
DELETED
:
{
value
:
2
,
desc
:
'已删除'
}
};
export
default
{
EMPLOYEE_STATUS
};
\ No newline at end of file
src/pages/index/index.js
View file @
43db2e59
//index.js
const
{
getHomeList
}
=
require
(
"../../apis/root.js"
);
const
{
getData
}
=
require
(
"../../apis/index.js"
);
let
app
=
getApp
();
Page
({
data
:
{
...
...
@@ -10,7 +12,7 @@ Page({
//事件处理函数
bindViewTap
:
function
()
{
// 网络请求
get
HomeList
()
get
Data
()
.
then
(
res
=>
{
console
.
log
(
"发起get请求-res"
,
res
);
})
...
...
@@ -48,7 +50,7 @@ Page({
},
requestAction
(
e
)
{
// 网络请求
get
HomeList
()
get
Data
()
.
then
(
res
=>
{
console
.
log
(
"发起get请求-res"
,
res
);
})
...
...
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