From 8045547ec6c29f88cf1b4e3afba292777ec0db36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com> Date: Wed, 29 Sep 2021 11:05:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BE=9B=E5=BA=94=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E7=B1=BB=E5=9E=8B=EF=BC=8C=E4=BE=9B=E5=BA=94=E5=B9=BF?= =?UTF-8?q?=E5=9C=BA=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/demandHall/companyDetail/index.wxml | 4 +- pages/demandHall/index.js | 57 ++++++--- pages/demandHall/index.wxml | 6 +- pages/user/editNeeds/index.js | 33 +++++- pages/user/editNeeds/index.wxml | 33 +++--- pages/user/editNeeds/index.wxss | 16 ++- project.private.config.json | 134 +--------------------- 7 files changed, 109 insertions(+), 174 deletions(-) diff --git a/pages/demandHall/companyDetail/index.wxml b/pages/demandHall/companyDetail/index.wxml index 92ff69d..f2f2eea 100644 --- a/pages/demandHall/companyDetail/index.wxml +++ b/pages/demandHall/companyDetail/index.wxml @@ -54,11 +54,11 @@ 法定代表 - 张三 + {{detail.legalPersonName}} 企业规模 - 300人 + {{detail.enterpriseScale}}人 经营范围 diff --git a/pages/demandHall/index.js b/pages/demandHall/index.js index a998f54..7bbdecf 100644 --- a/pages/demandHall/index.js +++ b/pages/demandHall/index.js @@ -15,6 +15,8 @@ Page({ page: 1, loading: true, //是否加载更多 cagetoryList: [] , // 分类列表 + cName:'', //筛选企业/个人 + resourceCagetoryId: '' //筛选分类 }, topTabClick(e){ this.setData({ @@ -28,10 +30,15 @@ Page({ }, tabClick(e){ this.setData({ - tabActive: e.currentTarget.dataset.i + tabActive: e.currentTarget.dataset.i, + loading: true, + page: 1, + size: 10 }) if(e.currentTarget.dataset.i == 2){ this.getCompanyList() + } else{ + this.getPageData() } }, showDialog(){ @@ -39,11 +46,7 @@ Page({ showScreenDialog: true }) }, - finishClick(){ - this.setData({ - showScreenDialog: false - }) - }, + toResourceDetail(e){ let id = e.currentTarget.dataset.id; wx.navigateTo({ @@ -67,7 +70,7 @@ Page({ */ onLoad: function (options) { app.editTabbar() - this.getPageData() + // this.getPageData() this.getCagetoryList() }, getCagetoryList(){ @@ -83,7 +86,26 @@ Page({ let item = e.currentTarget.dataset.item let i = e.currentTarget.dataset.i this.setData({ - cagetoryActive: i + cagetoryActive: i, + resourceCagetoryId: item.id + }) + }, + businessChange(e){ + let type = e.currentTarget.dataset.type + this.setData({cName: type}) + }, + finishClick(){ + this.setData({loading: true,page: 1, size: 10}) + this.getPageData() + this.setData({ + showScreenDialog: false + }) + }, + resetClick(){ + this.setData({ + cName: '', + cagetoryActive: null, + resourceCagetoryId:'' }) }, getPageData(){ @@ -91,7 +113,9 @@ Page({ app.http('post','Resources/listResources',{ resourceType: this.data.active, page: this.data.page, - pagesize:this.data.pagesize + pagesize:this.data.pagesize, + resourceCagetoryId:this.data.resourceCagetoryId, + cName: this.data.cName, }).then((res)=>{ if(res.data.success){ if(res.data.data.content.length < this.data.pagesize){ @@ -99,9 +123,16 @@ Page({ loading: false }) } - this.setData({ - list: this.data.list.concat(res.data.data.content) - }) + if(this.data.page > 1){ + this.setData({ + list: this.data.list.concat(res.data.data.content) + }) + } else{ + this.setData({ + list: res.data.data.content + }) + } + } }) } @@ -129,7 +160,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + this.getPageData() }, /** diff --git a/pages/demandHall/index.wxml b/pages/demandHall/index.wxml index 03ece7f..f09d8e1 100644 --- a/pages/demandHall/index.wxml +++ b/pages/demandHall/index.wxml @@ -180,12 +180,12 @@ 商家身份(所有商家均实名认证) - 个人认证 - 企业认证 + 个人认证 + 企业认证 - 重置 + 重置 完成 diff --git a/pages/user/editNeeds/index.js b/pages/user/editNeeds/index.js index 0af7010..a599b04 100644 --- a/pages/user/editNeeds/index.js +++ b/pages/user/editNeeds/index.js @@ -16,8 +16,9 @@ Page({ resourceStartTime:'', resourceEndTime: '', }, - typeArr:['供应' , '需求'], - active: 1 + active: 1, + resourcesList: [], + resourcesIdx: null }, tabClick(e){ let i = e.currentTarget.dataset.i; @@ -63,16 +64,35 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - console.log(options) if(options.id){ this.getDetail() } if(options.type){ this.setData({ - ['form.resourceType']: Number(options.type) - 1 + ['form.resourceType']: Number(options.type) }) } this.initValidate()//验证规则函数 + this.getResourcesCagetory() + }, + //获取供应、需求类型 + getResourcesCagetory(){ + app.http('GET','ResourcesCagetory/listResourcesCagetory').then((res)=>{ + // console.log(res) + if(res.data.success){ + this.setData({ + resourcesList: res.data.data + }) + } + }) + }, + resourcesChange(e){ + // console.log(e) + let idx = Number(e.detail.value) + this.setData({ + resourcesIdx: idx, + ['form.resourceCagetoryId']: this.data.resourcesList[idx].id + }) }, // 重新发布,获取提交数据 getDetail(){ @@ -101,7 +121,7 @@ Page({ required: '请填写标题', }, resourceCagetoryId: { - required: '请填写需求类型', + required: '请选择需求类型', }, detailedDescription: { required: '请填写内容', @@ -128,7 +148,8 @@ Page({ let that = this let type = e.detail.target.dataset.type let params = e.detail.value - params.resourceType = that.data.form.resourceType + 1 + params.resourceType = that.data.form.resourceType + params.resourceCagetoryId = that.data.form.resourceCagetoryId params.resourceImgs = that.data.form.resourceImgs params.capital = that.data.form.capital if(type == 0){ diff --git a/pages/user/editNeeds/index.wxml b/pages/user/editNeeds/index.wxml index 95e07f7..0ac1922 100644 --- a/pages/user/editNeeds/index.wxml +++ b/pages/user/editNeeds/index.wxml @@ -4,29 +4,36 @@
我是供应/需求 - - + + {{form.resourceType == 1 ? '供应' : '需求'}} + - 供应/需求标题* + {{form.resourceType == 1 ? '供应' : '需求'}}标题* - + - 供应/需求类型* - + {{form.resourceType == 1 ? '供应' : '需求'}}类型* + + + + {{resourcesList[resourcesIdx].cagetoryName || '请选择'}} + + + - 供应/需求内容* - 看看别人怎么写> + {{form.resourceType == 1 ? '供应' : '需求'}}内容* + - + @@ -38,7 +45,7 @@ - 供应/需求预算* + {{form.resourceType == 1 ? '供应' : '需求'}}预算* 明确预算 价格可议 @@ -58,14 +65,14 @@ {{form.resourceStartTime || '请选择'}} - + {{form.resourceEndTime || '请选择'}} - + diff --git a/pages/user/editNeeds/index.wxss b/pages/user/editNeeds/index.wxss index 59329fb..addbafa 100644 --- a/pages/user/editNeeds/index.wxss +++ b/pages/user/editNeeds/index.wxss @@ -8,9 +8,7 @@ .form-item{ margin-bottom: 60rpx; } -.pick-box{ - color: #666; -} + .red{ color: #FF0000; } @@ -25,6 +23,16 @@ color: #666; margin-top: 36rpx; } +.pick-box{ + width: 92%; + background: #eee; + box-sizing: border-box; + /* padding: 10rpx 22rpx; */ +} +.pick-box .picker{ + width: 100%; + color: #666666; +} .inp-box input{ width: 90%; height: 100%; @@ -83,7 +91,7 @@ .timepick-box picker{ width: 100%; } -.timepick-box image{ +.arrow-d{ width: 14rpx; height: 24rpx; transform: rotate(90deg); diff --git a/project.private.config.json b/project.private.config.json index ab36da8..f971560 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -12,142 +12,10 @@ }, "miniprogram": { "list": [ - { - "name": "pages/user/personalData/index", - "pathName": "pages/user/personalData/index", - "query": "", - "scene": null - }, - { - "name": "pages/user/completeData/index", - "pathName": "pages/user/completeData/index", - "query": "", - "scene": null - }, - { - "name": "pages/user/completeData/index", - "pathName": "pages/user/completeData/index", - "query": "", - "scene": null - }, - { - "name": "pages/user/agreement/index", - "pathName": "pages/user/agreement/index", - "query": "id=101", - "scene": null - }, - { - "name": "pages/user/agreement/index", - "pathName": "pages/user/agreement/index", - "query": "", - "scene": null - }, - { - "name": "pages/user/incomeDetail/index", - "pathName": "pages/user/incomeDetail/index", - "query": "", - "scene": null - }, - { - "name": "pages/user/index", - "pathName": "pages/user/index", - "query": "", - "scene": null - }, - { - "name": "pages/demandHall/contact/index", - "pathName": "pages/demandHall/contact/index", - "query": "", - "scene": null - }, - { - "name": "pages/release/personAuth/index", - "pathName": "pages/release/personAuth/index", - "query": "", - "scene": null - }, - { - "name": "pages/release/companyAuth/index", - "pathName": "pages/release/companyAuth/index", - "query": "", - "scene": null - }, - { - "name": "pages/release/perfectCompanyInfo/index", - "pathName": "pages/release/perfectCompanyInfo/index", - "query": "", - "scene": null - }, - { - "name": "pages/release/perfectPersonInfo/index", - "pathName": "pages/release/perfectPersonInfo/index", - "query": "", - "scene": null - }, { "name": "pages/user/editNeeds/index", "pathName": "pages/user/editNeeds/index", - "query": "", - "scene": null - }, - { - "name": "pages/demandHall/index", - "pathName": "pages/demandHall/index", - "query": "", - "scene": null - }, - { - "name": "pages/demandHall/resourcesDetail/index", - "pathName": "pages/demandHall/resourcesDetail/index", - "query": "id=1", - "scene": null - }, - { - "name": "pages/demandHall/needsDetail/index", - "pathName": "pages/demandHall/needsDetail/index", - "query": "id=2", - "scene": null - }, - { - "name": "pages/demandHall/needsDetail/index", - "pathName": "pages/demandHall/needsDetail/index", - "query": "id=9", - "scene": null - }, - { - "name": "pages/demandHall/createProject/index", - "pathName": "pages/demandHall/createProject/index", - "query": "item=%257B%2522resourcesDto%2522%253A%257B%2522id%2522%253A1%252C%2522resourceType%2522%253A1%252C%2522createUserId%2522%253A823%252C%2522title%2522%253A%2522%25E5%2590%2584%25E7%25A7%258D%25E7%25B1%25BB%25E5%259E%258B%25E7%25BD%2591%25E7%25AB%2599%25E3%2580%2581%25E5%25B0%258F%25E7%25A8%258B%25E5%25BA%258F%25E5%25BC%2580%25E5%258F%2591%2522%252C%2522resourceCagetoryId%2522%253A2%252C%2522capital%2522%253A%252230000%2522%252C%2522detailedDescription%2522%253A%2522%25E5%2590%2584%25E7%25A7%258D%25E7%25B1%25BB%25E5%259E%258B%25E7%25BD%2591%25E7%25AB%2599%25EF%25BC%258C%25E5%2590%2584%25E5%25B9%25B3%25E5%258F%25B0%25E5%25B0%258F%25E7%25A8%258B%25E5%25BA%258F%25E5%25BC%2580%25E5%258F%2591%25EF%25BC%258C%25E6%2595%2588%25E7%258E%2587%25E5%25BF%25AB%25EF%25BC%258C%25E5%258A%259F%25E8%2583%25BD%25E5%2585%25A8%25EF%25BC%258C%25E6%2580%25A7%25E4%25BB%25B7%25E6%25AF%2594%25E9%25AB%2598%2522%252C%2522createTime%2522%253A%25222021-08-31%252013%253A47%253A21%2522%252C%2522updateTime%2522%253Anull%252C%2522isDel%2522%253A0%252C%2522resourceStartTime%2522%253A%25222021-08-31%2522%252C%2522resourceEndTime%2522%253A%25222022-08-31%2522%252C%2522resourceAuditState%2522%253A2%252C%2522resourceState%2522%253A1%252C%2522resourceImgs%2522%253Anull%252C%2522enterpriseName%2522%253Anull%252C%2522enterpriseAddress%2522%253Anull%252C%2522enterprise%2522%253Anull%252C%2522questionsDtos%2522%253Anull%252C%2522user%2522%253Anull%257D%252C%2522communicateDtoList%2522%253A%255B%257B%2522id%2522%253A2%252C%2522type%2522%253Anull%252C%2522resourceId%2522%253A1%252C%2522demandId%2522%253A2%252C%2522content%2522%253Anull%252C%2522initiatorId%2522%253A823%252C%2522createTime%2522%253A%25222021-09-01%252015%253A44%253A33%2522%252C%2522updateTime%2522%253Anull%252C%2522isDel%2522%253A%25220%2522%257D%252C%257B%2522id%2522%253A7%252C%2522type%2522%253Anull%252C%2522resourceId%2522%253A1%252C%2522demandId%2522%253Anull%252C%2522content%2522%253A%2522%25E6%2588%2591%25E6%2583%25B3%25E5%25BC%2580%25E5%258F%2591%25E4%25B8%2580%25E6%25AC%25BE%25E5%25B0%258F%25E7%25A8%258B%25E5%25BA%258F%25EF%25BC%258C%2520%25E5%25B8%258C%25E6%259C%259B%25E8%2583%25BD%25E5%25A4%259F%25E5%25B0%25BD%25E5%25BF%25AB%25E4%25B8%258E%25E6%2582%25A8%25E6%25B2%259F%25E9%2580%259A%2522%252C%2522initiatorId%2522%253A823%252C%2522createTime%2522%253A%25222021-09-02%252010%253A13%253A57%2522%252C%2522updateTime%2522%253Anull%252C%2522isDel%2522%253A%25220%2522%257D%255D%252C%2522open%2522%253Atrue%257D", - "scene": null - }, - { - "name": "pages/demandHall/createProject/index", - "pathName": "pages/demandHall/createProject/index", - "query": "id=7", - "scene": null - }, - { - "name": "pages/user/needsOrder/index", - "pathName": "pages/user/needsOrder/index", - "query": "", - "scene": null - }, - { - "name": "pages/demandHall/applyDetail/index", - "pathName": "pages/demandHall/applyDetail/index", - "query": "data=%257B%2522resourceInfo%2522%253A%257B%2522resourceId%2522%253A12%252C%2522name%2522%253Anull%252C%2522content%2522%253A%2522%25E8%258C%2583%25E5%25BE%25B7%25E8%2590%25A8%25E8%258C%2583%25E5%25BE%25B7%25E8%2590%25A8%25E5%258F%2591%25E7%2594%259F%25E8%258C%2583%25E5%25BE%25B7%25E8%2590%25A8%25E8%258C%2583%25E5%25BE%25B7%25E8%2590%25A8%2522%252C%2522logo%2522%253Anull%252C%2522budget%2522%253Anull%257D%252C%2522partnerInfos%2522%253A%255B%257B%2522communicateId%2522%253A12%252C%2522comminuteState%2522%253A1%252C%2522createTime%2522%253A%25222021-09-07%2522%252C%2522name%2522%253A%2522%25E6%25A5%259A%25E8%25B1%25A1%25E7%25A7%2591%25E6%258A%2580%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8%2522%252C%2522title%2522%253A%2522%25E6%259B%25B4%25E5%25BF%25AB%25EF%25BC%258C%25E6%259B%25B4%25E9%25AB%2598%25EF%25BC%258C%25E6%259B%25B4%25E5%25BC%25BA%2522%252C%2522logo%2522%253A%2522https%253A%252F%252Fqiniu.upload.gznl.top%252Fbc961e15-5030-4580-a273-1cdafe883520.png%2522%252C%2522phone%2522%253A%252207220324234%2522%257D%255D%252C%2522open%2522%253Atrue%257D", - "scene": null - }, - { - "name": "pages/index/index", - "pathName": "pages/index/index", - "query": "", - "scene": null - }, - { - "name": "pages/index/index", - "pathName": "pages/index/index", - "query": "", + "query": "type=1", "scene": null } ]