diff --git a/app.js b/app.js
index 40d04d2..773d7f4 100644
--- a/app.js
+++ b/app.js
@@ -6,9 +6,9 @@ App({
console.log('党群e家');
console.log(options);
if(options.referrerInfo.hasOwnProperty('extraData')){
- this.globalData.navigate.mobile = options.extraData.mobile,
- this.globalData.navigate.nickname = options.extraData.nickname,
- this.globalData.navigate.faceImg = options.extraData.faceImg
+ this.globalData.navigate.mobile = options.referrerInfo.extraData.mobile,
+ this.globalData.navigate.nickname = options.referrerInfo.extraData.nickname,
+ this.globalData.navigate.faceImg = options.referrerInfo.extraData.faceImg
}
http.fetchAuthToken(res => {
// console.log(res)
diff --git a/app.json b/app.json
index e14dc3b..29aeaf5 100644
--- a/app.json
+++ b/app.json
@@ -25,7 +25,13 @@
"pages/weChatAuth/index",
"pages/user/myWhistle/index",
"pages/user/myWhistle/whistleDetail/index",
- "pages/user/myWhistle/evaluate/index"
+ "pages/user/myWhistle/evaluate/index",
+ "pages/resource/index",
+ "pages/resource/detail/index",
+ "pages/resource/navigate/index",
+ "pages/topics/loan/index",
+ "pages/topics/rent/room/index",
+ "pages/topics/rent/detail/index"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/components/cell/index.js b/components/cell/index.js
index 5d890d5..9b748ac 100644
--- a/components/cell/index.js
+++ b/components/cell/index.js
@@ -12,6 +12,7 @@ Component({
value: false,
},
time: String,
+ type:String,
showTop: {
type: Boolean,
value: false,
@@ -19,7 +20,7 @@ Component({
image: {
type: String,
value: ''
- }
+ },
},
/**
* 组件的初始数据
@@ -32,7 +33,7 @@ Component({
*/
methods: {
onTap () {
- this.triggerEvent('clickListItem', { id: this.properties.cId, index: this.properties.index})
+ this.triggerEvent('clickListItem', { id: this.properties.cId, index: this.properties.index,type:this.properties.type})
}
}
})
diff --git a/models/topic.js b/models/topic.js
index a0155fc..2258ad4 100644
--- a/models/topic.js
+++ b/models/topic.js
@@ -19,7 +19,12 @@ const TopicBaseUrl = {
resource_type_url:'/api/resources/typelist ',
resource_list_url:'/api/resources/list',
resource_detail_url:'/api/resources/queryById',
- resource_collect_url:'/api/resources/collectResources/'
+ resource_collect_url:'/api/resources/collectResources/',
+ whistle_type_url:'/api/whistle/getTypeList',
+ apartment_url:'/api/room/typelist',
+ room_list_url:'/api/room/list',
+ room_detail_url:'/api/room/queryById',
+ room_collect_url:'/api/room/collectRoom/'
}
class TopicModel extends HTTP {
@@ -174,7 +179,7 @@ class TopicModel extends HTTP {
//添加人才吹哨
- addTalents(content, picList,departId,success){
+ addTalents(content, picList,departId,typeCode,success){
let params = {
url: TopicBaseUrl.topic_talents_url,
method: Method.POST,
@@ -182,6 +187,7 @@ class TopicModel extends HTTP {
content: content,
picList1: picList,
departId:departId,
+ typeCode:typeCode
},
success: success
}
@@ -199,6 +205,18 @@ class TopicModel extends HTTP {
}
this.request(params)
}
+
+ getWhistleTypeList(success) {
+ let params = {
+ url: TopicBaseUrl.whistle_type_url,
+ method: Method.POST,
+ data: {
+ },
+ success: success
+ }
+ this.request(params)
+ }
+
getCenterList(page,success) {
let params = {
url: TopicBaseUrl.topic_center_url + "?pageNo=" + page,
@@ -255,6 +273,49 @@ class TopicModel extends HTTP {
this.request(params)
}
+ getApartment(success){
+ let params = {
+ url: TopicBaseUrl.apartment_url,
+ method: Method.GET,
+ data: {
+ },
+ success: success
+ }
+ this.request(params)
+ }
+
+ getRoomList(id,page,success){
+ let params = {
+ url: TopicBaseUrl.room_list_url + "?pageSize=10&apartmentId=" + id + "&pageNo=" + page,
+ method: Method.GET,
+ data: {
+ },
+ success: success
+ }
+ this.request(params)
+ }
+
+ getRoomDetail(id,success){
+ let params = {
+ url: TopicBaseUrl.room_detail_url + "?id=" + id,
+ method: Method.GET,
+ data: {
+ },
+ success: success
+ }
+ this.request(params)
+ }
+
+ roomCollect(id,success){
+ let params = {
+ url: TopicBaseUrl.room_collect_url + `${id}`,
+ method: Method.POST,
+ data:{},
+ success: success
+ }
+ this.request(params)
+ }
+
}
diff --git a/pages/resource/detail/index.js b/pages/resource/detail/index.js
index 00b3193..6f4207f 100644
--- a/pages/resource/detail/index.js
+++ b/pages/resource/detail/index.js
@@ -102,12 +102,6 @@ Page({
this.setData({
isCollect: !this.data.isCollect
})
- this.fetchTopicCollect();
-
-
- },
-
- fetchTopicCollect(){
let id = this.data.detail.id
topicModel.resourceCollect(id,res =>{
//console.log('收藏')
@@ -118,6 +112,8 @@ Page({
})
}
})
- },
+
+
+ }
})
\ No newline at end of file
diff --git a/pages/resource/detail/index.wxml b/pages/resource/detail/index.wxml
index ee388b5..876fcc1 100644
--- a/pages/resource/detail/index.wxml
+++ b/pages/resource/detail/index.wxml
@@ -5,7 +5,6 @@
-
{{detail.title}}
{{detail.typeName}}
@@ -18,3 +17,4 @@
+
\ No newline at end of file
diff --git a/pages/resource/index.js b/pages/resource/index.js
index b6fdb7b..bdd2af0 100644
--- a/pages/resource/index.js
+++ b/pages/resource/index.js
@@ -11,7 +11,8 @@ Page({
list:[],
show:false,
typeCode:'',
- next:true
+ next:true,
+ con:''
},
/**
@@ -24,8 +25,18 @@ Page({
})
topicModel.getResourceList(typeCode,1,res=>{
this.setData({
- list:res.result.records
+ list:res.result.records,
+ con:res.result.content
})
+
+ wx.setNavigationBarTitle({ title:res.result.typeName})
+
+ var flag = wx.getStorageSync(typeCode);
+ if(!flag && res.result.content){
+ this.setData({
+ show:true
+ })
+ }
})
},
@@ -102,5 +113,16 @@ Page({
*/
onShareAppMessage: function () {
+ },
+ ok:function(){
+ this.setData({
+ show:false
+ })
+ },
+ never:function(){
+ wx.setStorageSync(this.data.typeCode, '1')
+ this.setData({
+ show:false
+ })
}
})
\ No newline at end of file
diff --git a/pages/resource/index.json b/pages/resource/index.json
index f197c7c..1979373 100644
--- a/pages/resource/index.json
+++ b/pages/resource/index.json
@@ -1,7 +1,8 @@
{
"usingComponents": {
"van-popup": "/components/vant/popup/index",
- "resource":"./list/index"
+ "resource":"./list/index",
+ "van-button": "/components/vant/button/index"
},
"onReachBottomDistance":50
}
\ No newline at end of file
diff --git a/pages/resource/index.wxml b/pages/resource/index.wxml
index 04e5b29..1a49e6f 100644
--- a/pages/resource/index.wxml
+++ b/pages/resource/index.wxml
@@ -8,9 +8,15 @@
>
+ 赋能政策
- 内容内容内容内容内容内容内容
+
+
+ 我知道了
+ 不再提示
+
+
\ No newline at end of file
diff --git a/pages/resource/index.wxss b/pages/resource/index.wxss
index b65bb89..deb268e 100644
--- a/pages/resource/index.wxss
+++ b/pages/resource/index.wxss
@@ -6,5 +6,38 @@ page{
background-color: whitesmoke;
padding-top: 10px;
}
+.tips{
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ flex-direction: column;
+}
+
+.title{
+ display: flex;
+ align-items: center;
+ height: 10%;
+ font-size: 20px;
+}
+.tips-con{
+ height: 72%;
+ width: 90%;
+ overflow: scroll;
+}
+.button{
+ width: 80%;
+ height: 18%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+.btn{
+ text-decoration:underline;
+ font-size:13px;
+ margin-top:5px;
+ color: #f04040;
+}
diff --git a/pages/topics/index.js b/pages/topics/index.js
index 15ed4c7..e994da4 100644
--- a/pages/topics/index.js
+++ b/pages/topics/index.js
@@ -15,9 +15,7 @@ Page({
* 页面的初始数据
*/
data: {
- headerTitles: ['找资源','报需求','交朋友','租房子','找贷款' ],
segmentIndex: 0,
- currPage: 1,
//留言互动的列表
topicList: [],
goodIdeaList: [],
@@ -26,8 +24,10 @@ Page({
typeList:[],
page:1,
next:true,
- tab:"1",
- active:"1"
+ tab:"5",
+ active:"5",
+ loan:{},
+ apartment:[]
},
@@ -36,7 +36,7 @@ Page({
*/
onLoad: function () {
-
+
},
//进入页面判断是否绑定微信号,如果绑定手机号根据segmentIndex的数值fetch留言互动和赋能中心的资源,否则退回注册页面或者首页
@@ -45,31 +45,41 @@ Page({
console.log('已经绑定微信')
if (store.hasPhone()) {
console.log('已经绑定手机号码')
- return this.fetchCenterList();
+
+ this.setData({
+ topicList: [],
+ goodIdeaList: [],
+ centerList: [],
+ page:1,
+ next:true,
+ // tab:"5",
+ // active:"5",
+ })
+ return this.getData(this.data.tab);
} else {
console.log('未绑定手机号码')
- wx.showModal({
- title: '温馨提示',
- content: '是否前往验证手机号码?',
- success(res) {
- if(app.globalData.navigate.mobile){
- var params = {
- phone:app.globalData.navigate.mobile,
- nickName:app.globalData.navigate.nickname,
- avatarUrl:app.globalData.navigate.faceImg
- }
- userModel.navigateUser(params,res=>{
- store.saveUserInfo({
- nickName: params.nickName,
- avatarUrl: params.avatarUrl,
- phone: params.phone
- })
- wx.reLaunch({
- url: '/pages/home/index',
- })
- })
- }else{
+ if(app.globalData.navigate.mobile){
+ var params = {
+ phone:app.globalData.navigate.mobile,
+ nickName:app.globalData.navigate.nickname,
+ avatarUrl:app.globalData.navigate.faceImg
+ }
+ userModel.navigateUser(params,res=>{
+ store.saveUserInfo({
+ nickName: params.nickName,
+ avatarUrl: params.avatarUrl,
+ phone: params.phone
+ })
+ wx.reLaunch({
+ url: '/pages/topics/index',
+ })
+ })
+ }else{
+ wx.showModal({
+ title: '温馨提示',
+ content: '是否前往验证手机号码?',
+ success(res) {
if (res.confirm) {
wx.redirectTo({
url: '/pages/weChatAuth/index?type=2',
@@ -80,9 +90,9 @@ Page({
})
}
}
-
- }
- })
+ })
+ }
+
}
} else {
@@ -101,7 +111,7 @@ Page({
phone: params.phone
})
wx.reLaunch({
- url: '/pages/home/index',
+ url: '/pages/topics/index',
})
})
}else{
@@ -134,11 +144,19 @@ Page({
centerList:[]
})
+ this.getData(tab);
+
+ },
+ getData:function(tab){
switch (tab) {
case "1":
return this.fetchCenterList();
case "3":
return this.fetchTopicList();
+ case "4":
+ return this.fetchLoan();
+ case "5":
+ return this.fetchRent();
default:
return;
}
@@ -220,7 +238,21 @@ Page({
}
})
},
+ fetchLoan:function(){
+ topicModel.getResourceDetail('aba954f98c489bddf137f6f9f83d6c89',res=>{
+ this.setData({
+ loan:res.result,
+ })
+ })
+ },
+ fetchRent:function(){
+ topicModel.getApartment(res=>{
+ this.setData({
+ apartment:res.result
+ })
+ })
+ },
/**
* 页面上拉触底事件的处理函数
*/
@@ -235,7 +267,7 @@ Page({
this.setData({
page: page + 1
})
- console.log(tab)
+
switch (tab) {
case "1":
return this.fetchCenterList();
diff --git a/pages/topics/index.json b/pages/topics/index.json
index 3cbcc97..5904856 100644
--- a/pages/topics/index.json
+++ b/pages/topics/index.json
@@ -9,7 +9,9 @@
"talents": "./talents/index",
"center": "./center/index",
"van-tab": "/components/vant/tab/index",
- "van-tabs": "/components/vant/tabs/index"
+ "van-tabs": "/components/vant/tabs/index",
+ "loan":"./loan/index",
+ "rent":"./rent/index"
},
"onReachBottomDistance":50
}
\ No newline at end of file
diff --git a/pages/topics/index.wxml b/pages/topics/index.wxml
index 4d97300..4438946 100644
--- a/pages/topics/index.wxml
+++ b/pages/topics/index.wxml
@@ -1,7 +1,15 @@
-
+
+
+
+
+
+
+
+
+
@@ -11,6 +19,8 @@
+
+
diff --git a/pages/topics/talents/index.js b/pages/topics/talents/index.js
index 7972dd0..8df21ff 100644
--- a/pages/topics/talents/index.js
+++ b/pages/topics/talents/index.js
@@ -23,11 +23,14 @@ Component({
// 所在街道
streets: [],
streetsIndex: 0,
-
+ typeList:[],
+ typeListIndex:0,
//接口街道的数据
results:[],
+ list:[],
//选择后获取的街道的I,
streetID:'',
+ typeCode:'',
textareaValue:''
},
// lifetimes: {
@@ -70,6 +73,26 @@ Component({
})
console.log(this.data.results)
})
+
+ topicModel.getWhistleTypeList(res=>{
+ var result = res.result
+ var typeList = []
+ result.forEach((value,index)=>{
+ typeList[index] = value.typeName
+ })
+ //把streett添加第一项设为空
+ typeList.unshift('')
+ console.log(111111111)
+ console.log(typeList)
+
+ this.setData({
+ typeList: typeList
+ })
+ //把接口数据放在results里
+ this.setData({
+ list: result
+ })
+ })
},
methods: {
bindPickerStreetsChange: function(e) {
@@ -83,6 +106,14 @@ Component({
})
// console.log(this.data.streetID)
},
+ bindPickerTypeChange:function(e){
+ this.setData({
+ typeListIndex: e.detail.value
+ })
+ this.setData({
+ typeCode: this.data.list[this.data.typeListIndex-1].typeCode
+ })
+ },
bindTextInput(e) {
this.setData({
messageTitle: e.detail.value
@@ -169,12 +200,21 @@ Component({
})
return
}
- topicModel.addTalents(this.data.messageDetail, this.data.files,this.data.streetID,res=>{
+ if (this.data.typeCode === ''){
+ wx.showModal({
+ title: '提示',
+ content: '请选择赋能类型',
+ showCancel:false
+ })
+ return
+ }
+ topicModel.addTalents(this.data.messageDetail, this.data.files,this.data.streetID,this.data.typeCode,res=>{
const id = res.result;
if(res.code === 200){
this.setData({
messageDetail: '',
streetID:'',
+ typeCode:'',
files:[],
},()=>{
wx.showModal({
@@ -200,6 +240,7 @@ Component({
})
this.setData({
streetsIndex: 0,
+ typeListIndex:0,
})
}
},
diff --git a/pages/topics/talents/index.wxml b/pages/topics/talents/index.wxml
index bb2c3d4..3ed519b 100644
--- a/pages/topics/talents/index.wxml
+++ b/pages/topics/talents/index.wxml
@@ -15,6 +15,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 需求类型
+
+
+ {{typeList[typeListIndex]}}
+
+
+
+
+
+
+
+
+
diff --git a/pages/topics/talents/index.wxss b/pages/topics/talents/index.wxss
index 8c9aad6..76354e5 100644
--- a/pages/topics/talents/index.wxss
+++ b/pages/topics/talents/index.wxss
@@ -78,8 +78,9 @@
}
.select-view{
display: flex;
+ height: 60px;
/* btnView是position:fix,所以为防止遮挡,设置街道选择盒子下边框margin-bottom为100px */
- margin-bottom: 100px;
+ /* margin-bottom: 100px; */
}
.select-mark{
width:15px;
diff --git a/pages/user/index.js b/pages/user/index.js
index 834ec08..067c093 100644
--- a/pages/user/index.js
+++ b/pages/user/index.js
@@ -7,7 +7,7 @@ import { UserModel } from '../../models/user.js'
let userModel = new UserModel()
import { AuthModel } from '../../models/auth.js'
let authModel = new AuthModel()
-
+const app = getApp()
Page({
/**
@@ -34,9 +34,29 @@ Page({
isAuth: true
})
} else {
- this.setData({
- isAuth: false
- })
+ if(app.globalData.navigate.mobile){
+ var params = {
+ phone:app.globalData.navigate.mobile,
+ nickName:app.globalData.navigate.nickname,
+ avatarUrl:app.globalData.navigate.faceImg
+ }
+ userModel.navigateUser(params,res=>{
+ store.saveUserInfo({
+ nickName: params.nickName,
+ avatarUrl: params.avatarUrl,
+ phone: params.phone
+ })
+
+ wx.reLaunch({
+ url: '/pages/user/index',
+ })
+ })
+ }else{
+ this.setData({
+ isAuth: false
+ })
+ }
+
// wx.redirectTo({
// url: '/pages/weChatAuth/index',
// })
@@ -79,7 +99,7 @@ Page({
})
wx.reLaunch({
- url: '/pages/home/index',
+ url: '/pages/user/index',
})
})
}else{
@@ -110,6 +130,25 @@ Page({
avatarUrl: res.result.avatarUrl,
phone: res.result.phone || ''
})
+ }else{
+ if(app.globalData.navigate.mobile){
+ var params = {
+ phone:app.globalData.navigate.mobile,
+ nickName:app.globalData.navigate.nickname,
+ avatarUrl:app.globalData.navigate.faceImg
+ }
+ userModel.navigateUser(params,res=>{
+ store.saveUserInfo({
+ nickName: params.nickName,
+ avatarUrl: params.avatarUrl,
+ phone: params.phone
+ })
+
+ wx.reLaunch({
+ url: '/pages/user/index',
+ })
+ })
+ }
}
})
},
diff --git a/pages/user/myFavorite/index.js b/pages/user/myFavorite/index.js
index 3074d4a..11816b8 100644
--- a/pages/user/myFavorite/index.js
+++ b/pages/user/myFavorite/index.js
@@ -96,9 +96,23 @@ Page({
clickListItem (e) {
if (e.detail.id) {
let id = e.detail.id
- wx.navigateTo({
- url: `/pages/article/index?id=${id}`,
- })
+ let type = e.detail.type;
+ if(type == '3'){
+ wx.navigateTo({
+ url: '/pages/resource/detail/index?id=' + id
+ })
+ return;
+ }else if(type == '4'){
+ wx.navigateTo({
+ url: '/pages/topics/rent/detail/index?id=' + id
+ })
+ return;
+ }else{
+ wx.navigateTo({
+ url: `/pages/article/index?id=${id}`,
+ })
+ }
+
} else {
const item = e.detail.item;
let id = item.topicId
diff --git a/pages/user/myFavorite/index.wxml b/pages/user/myFavorite/index.wxml
index 00f7140..8b070f1 100644
--- a/pages/user/myFavorite/index.wxml
+++ b/pages/user/myFavorite/index.wxml
@@ -30,12 +30,13 @@
-
+
diff --git a/project.config.json b/project.config.json
index 3aeea63..437e489 100644
--- a/project.config.json
+++ b/project.config.json
@@ -4,15 +4,18 @@
"ignore": []
},
"setting": {
- "urlCheck": true,
+ "urlCheck": false,
"es6": true,
"enhance": false,
"postcss": true,
+ "preloadBackgroundData": false,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": true,
"autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
@@ -20,7 +23,9 @@
"ignore": [],
"disablePlugins": [],
"outputPath": ""
- }
+ },
+ "useCompilerModule": false,
+ "userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"libVersion": "2.8.1",
@@ -116,6 +121,49 @@
"id": -1,
"name": "pages/weChatAuth/index",
"pathName": "pages/weChatAuth/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/topics/message/index",
+ "pathName": "pages/topics/message/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/user/myWhistle/evaluate/index",
+ "pathName": "pages/user/myWhistle/evaluate/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/user/myInfo/index",
+ "pathName": "pages/user/myInfo/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/user/myInfo/register/index",
+ "pathName": "pages/user/myInfo/register/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/resource/index",
+ "pathName": "pages/resource/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 14,
+ "name": "pages/resource/detail/index",
+ "pathName": "pages/resource/detail/index",
+ "query": "",
"scene": null
}
]