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