From 836b2f14dd5a025976acced18bc72e1777a0ec95 Mon Sep 17 00:00:00 2001 From: huangzijian Date: Sat, 24 Oct 2020 02:55:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(info):=20=E8=8E=B7=E5=8F=96=E5=B2=97?= =?UTF-8?q?=E4=BD=8D=E6=95=B0=E6=8D=AE=E5=B9=B6=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/info/index.js | 15 ++++++++--- components/info/index.wxml | 18 ++++++++----- model/job.js | 15 +++++++++++ pages/index/index.js | 52 ++++++++++++++++++++------------------ pages/index/index.wxml | 4 +-- 5 files changed, 67 insertions(+), 37 deletions(-) create mode 100644 model/job.js diff --git a/components/info/index.js b/components/info/index.js index 9cc0cb75..838ad9f4 100644 --- a/components/info/index.js +++ b/components/info/index.js @@ -1,7 +1,7 @@ /* * @Author: Lamdaer * @Date: 2020-10-24 01:54:38 - * @LastEditTime: 2020-10-24 02:06:25 + * @LastEditTime: 2020-10-24 02:41:40 * @Description: * @FilePath: /opengauss/components/info/index.js */ @@ -19,10 +19,19 @@ Component({ /** * 组件的初始数据 */ - data: {}, + data: { + index: null, + }, /** * 组件的方法列表 */ - methods: {}, + methods: { + jobChange(e) { + console.log(e) + this.setData({ + index: e.detail.value, + }) + }, + }, }) diff --git a/components/info/index.wxml b/components/info/index.wxml index cd520f1d..0d717f83 100644 --- a/components/info/index.wxml +++ b/components/info/index.wxml @@ -1,9 +1,13 @@ - + - 普通选择 - - - {{index?picker[index]:'禁止换行,超出容器部分会以 ... 方式截断'}} - + 岗位 + + {{index?jobList[index].name:"请选择岗位"}} - \ No newline at end of file + + + 多列选择 + + {{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}} + + \ No newline at end of file diff --git a/model/job.js b/model/job.js new file mode 100644 index 00000000..0ac3b77f --- /dev/null +++ b/model/job.js @@ -0,0 +1,15 @@ +/* + * @Author: Lamdaer + * @Date: 2020-10-24 02:18:15 + * @LastEditTime: 2020-10-24 02:30:08 + * @Description: + * @FilePath: /opengauss/model/job.js + */ +import { HTTP } from '../utils/http' +export class JobModel extends HTTP { + getJobList() { + return this.request({ + url: '/gauss/job', + }) + } +} diff --git a/pages/index/index.js b/pages/index/index.js index 3facff02..1f5434c1 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,66 +1,68 @@ +/* + * @Author: Lamdaer + * @Date: 2020-10-24 01:58:20 + * @LastEditTime: 2020-10-24 02:53:00 + * @Description: + * @FilePath: /opengauss/pages/index/index.js + */ // pages/index/index.js +import { JobModel } from '../../model/job' +const jobModel = new JobModel() Page({ - + getJobList() { + jobModel.getJobList().then((response) => { + this.setData({ + jobList: response.data.jobList, + }) + console.log(response) + }) + }, /** * 页面的初始数据 */ data: { - + jobList: [], }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + this.getJobList() }, /** * 生命周期函数--监听页面初次渲染完成 */ - onReady: function () { - - }, + onReady: function () {}, /** * 生命周期函数--监听页面显示 */ - onShow: function () { - - }, + onShow: function () {}, /** * 生命周期函数--监听页面隐藏 */ - onHide: function () { - - }, + onHide: function () {}, /** * 生命周期函数--监听页面卸载 */ - onUnload: function () { - - }, + onUnload: function () {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh: function () { - - }, + onPullDownRefresh: function () {}, /** * 页面上拉触底事件的处理函数 */ - onReachBottom: function () { - - }, + onReachBottom: function () {}, /** * 用户点击右上角分享 */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file + onShareAppMessage: function () {}, +}) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 73109daf..8dfc8c61 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,2 +1,2 @@ - - \ No newline at end of file + + \ No newline at end of file