forked from opengaussexamples/examples
feat(hobby-parent): 获取一级分类及其对应的二级分类
This commit is contained in:
parent
836b2f14dd
commit
7015860f28
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* @Author: Lamdaer
|
||||
* @Date: 2020-10-24 02:08:13
|
||||
* @LastEditTime: 2020-10-24 02:15:06
|
||||
* @LastEditTime: 2020-10-24 10:36:37
|
||||
* @Description:
|
||||
* @FilePath: /opengauss/config.js
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* @Author: Lamdaer
|
||||
* @Date: 2020-10-24 02:56:28
|
||||
* @LastEditTime: 2020-10-24 03:27:02
|
||||
* @Description:
|
||||
* @FilePath: /opengauss/model/hobby-parent.js
|
||||
*/
|
||||
import { HTTP } from '../utils/http'
|
||||
export class HobbyParentModel extends HTTP {
|
||||
getHobbyList() {
|
||||
return this.request({
|
||||
url: '/gauss/hobby_parent/with_children',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,15 @@
|
|||
/*
|
||||
* @Author: Lamdaer
|
||||
* @Date: 2020-10-24 01:58:20
|
||||
* @LastEditTime: 2020-10-24 02:53:00
|
||||
* @LastEditTime: 2020-10-24 03:28:07
|
||||
* @Description:
|
||||
* @FilePath: /opengauss/pages/index/index.js
|
||||
*/
|
||||
// pages/index/index.js
|
||||
import { JobModel } from '../../model/job'
|
||||
import { HobbyParentModel } from '../../model/hobby-parent'
|
||||
const jobModel = new JobModel()
|
||||
const hobbyParentModel = new HobbyParentModel()
|
||||
Page({
|
||||
getJobList() {
|
||||
jobModel.getJobList().then((response) => {
|
||||
|
|
@ -17,11 +19,17 @@ Page({
|
|||
console.log(response)
|
||||
})
|
||||
},
|
||||
getHobbyList() {
|
||||
hobbyParentModel.getHobbyList().then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
jobList: [],
|
||||
hobbyParentList: [],
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -29,6 +37,7 @@ Page({
|
|||
*/
|
||||
onLoad: function (options) {
|
||||
this.getJobList()
|
||||
this.getHobbyList()
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"ignore": []
|
||||
},
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"enhance": false,
|
||||
"postcss": true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue