Commit 43db2e59 authored by 谢卓城's avatar 谢卓城

1.add constants. 2.change apis/index.js. 3.change README.md

parent 3d6f8597
......@@ -7,6 +7,18 @@
终端运行:sh MiniprogramTemplate.sh <#生成模板路径#>
```
##### 安装依赖
```
终端运行:npm install && cd package && rm package-lock.json && npm install && sh miniprogramnpm.sh && cd ..
```
##### 运行
```
终端运行:npm run dev
```
### 使用
```
......
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
//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() {
// 网络请求
getHomeList()
getData()
.then(res => {
console.log("发起get请求-res", res);
})
......@@ -48,7 +50,7 @@ Page({
},
requestAction(e) {
// 网络请求
getHomeList()
getData()
.then(res => {
console.log("发起get请求-res", res);
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment