feat(hobby-parent): 获取一级分类及其对应的二级分类

This commit is contained in:
huangzijian 2020-10-24 10:37:32 +08:00
parent 836b2f14dd
commit 7015860f28
No known key found for this signature in database
GPG Key ID: 437D4F23D11788BA
4 changed files with 27 additions and 3 deletions

View File

@ -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
*/

15
model/hobby-parent.js Normal file
View File

@ -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',
})
}
}

View File

@ -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()
},
/**

View File

@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"enhance": false,
"postcss": true,