diff --git a/epdc-resident-mp-yushan/pages/property/property.js b/epdc-resident-mp-yushan/pages/property/property.js index 94933bd..33eb216 100644 --- a/epdc-resident-mp-yushan/pages/property/property.js +++ b/epdc-resident-mp-yushan/pages/property/property.js @@ -11,17 +11,18 @@ Page({ loadMoreVisible: true, tabList:[],//tab列表 currentTabIndex:0, - propertyInfo:{}, + projectInfo:{}, recommendList:[], pageNo: 1, // 新闻列表-分页页码 pageSize: 10, // 新闻列表-分页页长 - isLoading: true + isLoading: true, + timeStamp:'' }, /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { + onLoad: function (options) { if (options.scene) { this.setData({ statusHeight: app.globalData.deviceInfo.statusHeight, @@ -33,13 +34,15 @@ Page({ statusHeight: app.globalData.deviceInfo.statusHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight, }) - } - this.initTab(); - if(this.data.tabList.length>0){ - this.initPropertyInfo(this.data.tabList[0].propertyId); + this.setData({ + timeStamp:getTimestamp() + }) } // this.getRecommend(); }, + onReady:function(){ + this.initTab(); + }, /** * 生命周期函数--监听页面显示 */ @@ -47,38 +50,40 @@ Page({ }, initTab(){ - // var tabList=[{name:"敦化路万科物业"}]; - // var tabList=[{name:"敦化路万科物业"},{name:'辽宁路万科物业'}]; - var tabList=[{name:"敦化路万科物业"},{name:'辽宁路万科物业'},{name:'站山路万科物业'},{name:'辽源路万科物业'}]; - this.setData({ - tabList:tabList - }) + api.getPropertyProjectList().then((res)=>{ + this.setData({ + tabList:res.data + }); + if(this.data.tabList.length>0){ + this.initPropertyInfo(this.data.tabList[0].id); + } + }).catch(err=>{ + this.setData({ + tabList:[] + }) + }); }, initPropertyInfo(id){ wx.showLoading({ }); - var info={ - propertyId:'111', - projectName:"敦化路万科城", - propertyName:"敦化路万科物业", - tel:'13666666666', - personInCharge:'张磊', - address:'市北区敦化路88号15-90', - pic:'../../images/home/dang_logo.png', - groupName:"物业交流群", - peopleCount:'456', - partyCount:'88', - joinStatus:'1', - groupId:'111' - }; - this.setData({ - propertyInfo:info, - isLoading:false - }) - wx.hideLoading({ - complete: (res) => {}, - }) + api.getPropertyProjectDetail(id).then(res=>{ + this.setData({ + projectInfo:res.data, + isLoading:false + }) + wx.hideLoading({ + complete: (res) => {}, + }) + }).catch(err=>{ + this.setData({ + projectInfo:{}, + isLoading:false + }) + wx.hideLoading({ + complete: (res) => {}, + }) + }); }, // getRecommend(){ // var list=[]; @@ -105,33 +110,54 @@ Page({ if(this.data.isLoading){ }else{ - let {index , propertyid} = e.currentTarget.dataset; + let {index , id} = e.currentTarget.dataset; this.setData({ currentTabIndex:index, isLoading:true }) - this.initPropertyInfo(propertyid) + this.initPropertyInfo(id) } }, joinGroup(e){ - const { joinstatus, groupid, groupname } = e.currentTarget.dataset + const { joinstatus, groupid, groupname,state } = e.currentTarget.dataset if(joinstatus == '0'){ wx.showModal({ title:'提示', - content:'尚未加入群组,是否加入?', - confirmText:'加入', + content:'尚未加入群组,是否申请加入?', + confirmText:'申请', cancelColor: 'cancelColor', success:(res)=>{ if(res.cancel){ - - }else{ + }else{ + api.applyForGroup(groupid).then(res=>{ + if(res.code == '0'){ + wx.showToast({ + title: '申请成功' + }) + }else{ + wx.showToast({ + title: '申请失败', + icon:"none" + }) + } + }).catch(err=>{ + wx.showToast({ + title: '网络错误,申请失败', + icon:"none" + }) + }) } } }) - }else{ + }else if(joinstatus == '1'){ + wx.showToast({ + title: '已经申请,审核中', + icon:"none" + }) + }else if(joinstatus == '2'){ wx.navigateTo({ - url: `/subpages/property/pages/topicList/topicList?groupId=${groupid}&groupName=${groupname}&state=${joinstatus}` + url: `/subpages/property/pages/topicList/topicList?groupId=${groupid}&groupName=${groupname}&state=${state}` }) } } diff --git a/epdc-resident-mp-yushan/pages/property/property.json b/epdc-resident-mp-yushan/pages/property/property.json index 06e2517..15525eb 100644 --- a/epdc-resident-mp-yushan/pages/property/property.json +++ b/epdc-resident-mp-yushan/pages/property/property.json @@ -3,6 +3,7 @@ "navigationStyle": "custom", "navigationBarTextStyle": "white", "usingComponents": { - "load-more": "../../components/loadMore/loadMore" + "load-more": "../../components/loadMore/loadMore", + "pulldown-refresh": "/components/pullDownRefresh/pullDownRefresh" } } \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/property/property.wxml b/epdc-resident-mp-yushan/pages/property/property.wxml index af10e9c..4fd944d 100644 --- a/epdc-resident-mp-yushan/pages/property/property.wxml +++ b/epdc-resident-mp-yushan/pages/property/property.wxml @@ -2,10 +2,11 @@ 物业服务 + - - {{item.name}} + + {{item.projectName}} @@ -16,35 +17,35 @@ - 物业项目名称: {{propertyInfo.projectName}} + 物业项目名称: {{projectInfo.projectName}} - 物业名称: {{propertyInfo.propertyName}} + 物业名称: {{projectInfo.propertyName}} - 物业电话: {{propertyInfo.tel}} + 物业电话: {{projectInfo.propertyTel}} - 物业负责人: {{propertyInfo.personInCharge}} + 物业负责人: {{projectInfo.propertyManager}} - 物业地址: {{propertyInfo.address}} + 物业地址: {{projectInfo.propertyAddress}} - - + + - {{propertyInfo.groupName}} - 共{{propertyInfo.peopleCount}}人 {{propertyInfo.partyCount}}名党员 + {{projectInfo.groupName}} + 共{{projectInfo.numberGroupMember}}人 {{projectInfo.numberGroupPartyMember}}名党员 - 加入 + 加入 @@ -101,5 +102,6 @@ --> + diff --git a/epdc-resident-mp-yushan/pages/toRegister/toRegister.js b/epdc-resident-mp-yushan/pages/toRegister/toRegister.js index d0c4f0e..7ee0069 100644 --- a/epdc-resident-mp-yushan/pages/toRegister/toRegister.js +++ b/epdc-resident-mp-yushan/pages/toRegister/toRegister.js @@ -21,7 +21,7 @@ Page({ } }) let that = this - const versionNum = '0.9.7.23' + const versionNum = '1.2.11' api.getScanSwitch(versionNum).then(function (res) { console.log(res.data) let state = res.data.scanFlag @@ -42,9 +42,9 @@ Page({ // }) }, experience() { - app.globalData.tempGridId = '1232925355908550657' + app.globalData.tempGridId = '1222032503139762178' wx.reLaunch({ - url: '/pages/index/index?scene=1232925355908550657' + url: '/pages/index/index?scene=1222032503139762178' }) }, scan() { diff --git a/epdc-resident-mp-yushan/subpages/property/utils/api.js b/epdc-resident-mp-yushan/subpages/property/utils/api.js index 6f44b02..cae0478 100644 --- a/epdc-resident-mp-yushan/subpages/property/utils/api.js +++ b/epdc-resident-mp-yushan/subpages/property/utils/api.js @@ -1,54 +1,26 @@ const request = require('../../../utils/request') - -/** - * 创建社群 - * @params { - * groupNamegroupName 社群名称 - * groupAvatar 社群头像 - * groupIntroduction 社群介绍 - * } - */ -export function createAssociation ({ groupName, groupAvatar, groupIntroduction }) { - return request.post('group/group/create', { - groupName, - groupAvatar, - groupIntroduction - }) -} - /** * 社群详情 */ export function getAssociationDetail (id) { - return request.get(`group/group/detail/${id}`) + return request.get(`property/group/detail/${id}`) } /** * 修改群头像 */ export function modifyAvatar ({id, groupAvatar}) { - return request.post('group/group/modifyAvatar', { + return request.post('property/group/modifyAvatar', { id, groupAvatar }) } - -/** - * 解散群 - */ -export function disbandAssociation({id, processingOpinions}) { - return request.post('group/group/disband', { - id, - processingOpinions - }) -} - /** * 加入社群 */ export function joinAssociation (groupId) { - return request.post('group/group/applyForGroup', { + return request.post('property/group/applyForGroup', { groupId }) } @@ -57,7 +29,7 @@ export function disbandAssociation({id, processingOpinions}) { * 修改群介绍 */ export function changeIntroduce ({id, groupIntroduction}) { - return request.post('group/group/modifyIntroduction', { + return request.post('property/group/modifyIntroduction', { id, groupIntroduction }) @@ -67,7 +39,7 @@ export function disbandAssociation({id, processingOpinions}) { * 群成员列表 审核通过/待审核 */ export function getAssociationMember ({groupId, state}) { - return request.get('group/group/listOfMember', { + return request.get('property/group/listOfMember', { groupId, state }) @@ -77,7 +49,7 @@ export function disbandAssociation({id, processingOpinions}) { * 删除群成员 */ export function deleteMember ({groupId, userId}) { - return request.post('group/group/removeMember', { + return request.post('property/group/removeMember', { groupId, userId }) @@ -87,7 +59,7 @@ export function disbandAssociation({id, processingOpinions}) { * 审核入群成员 */ export function incomingVerify ({ groupId, members }) { - return request.post('group/group/reviewApply', { + return request.post('property/group/reviewApply', { groupId, members }) @@ -97,7 +69,7 @@ export function disbandAssociation({id, processingOpinions}) { * 添加好友列表 */ export function getInviteList ({groupId, mobile, road, lastName}) { - return request.get('group/group/getInviteList', { + return request.get('property/group/getInviteList', { groupId, mobile, road, @@ -109,7 +81,7 @@ export function disbandAssociation({id, processingOpinions}) { * 添加好友 */ export function addMember ({ groupId, members}) { - return request.post('group/group/addMember', { + return request.post('property/group/addMember', { groupId, members }) @@ -119,7 +91,7 @@ export function disbandAssociation({id, processingOpinions}) { * 发布话题 */ export function addTopic ({topicContent, topicAddress, topicLatitude, topicLongitude, groupId, groupName, images}) { - return request.post('group/topic/submit', { + return request.post('property/topic/submit', { topicContent, topicAddress, topicLatitude, @@ -134,7 +106,7 @@ export function disbandAssociation({id, processingOpinions}) { * 话题列表 */ export function getTopicList ({ pageIndex, pageSize, timestamp, groupId, topicId }) { - return request.get('group/topic/list', { + return request.get('property/topic/list', { pageIndex, pageSize, timestamp, @@ -146,8 +118,8 @@ export function disbandAssociation({id, processingOpinions}) { /** * 话题详情 */ -export function getTopicDetail (detailId) { - return request.get(`group/topic/detail/${detailId}`) +export function getTopicDetail (id) { + return request.get(`property/topic/detail/${id}`) } /** @@ -155,7 +127,7 @@ export function getTopicDetail (detailId) { * @param groupId */ export function withdrawGroup (groupId) { - return request.post('group/group/quitGroup', { + return request.post('property/group/quitGroup', { groupId }) } @@ -164,7 +136,7 @@ export function withdrawGroup (groupId) { * 评论最新最热列表 */ export function getRemarkList({ pageIndex, pageSize, timestamp, orderType, topicId }) { - return request.get('group/comment/list', { + return request.get('property/comment/list', { pageIndex, pageSize, timestamp, @@ -177,7 +149,7 @@ export function getRemarkList({ pageIndex, pageSize, timestamp, orderType, topic * 评论或者回复 */ export function remarkOrReply ({ topicId, faCommentId, content }) { - return request.post('group/comment/submit', { + return request.post('property/comment/submit', { topicId, faCommentId, content @@ -188,7 +160,7 @@ export function remarkOrReply ({ topicId, faCommentId, content }) { * 关闭话题 */ export function closeTopic ({ id, processingOpinions }) { - return request.post('group/topic/close', { + return request.post('property/topic/close', { id, processingOpinions }) @@ -205,7 +177,7 @@ export function getClassifyList () { * 话题转议题 */ export function changeToIssue ({ id, categoryId, advice }) { - return request.post('group/topic/changeToIssue', { + return request.post('property/topic/changeToIssue', { id, categoryId, advice @@ -216,7 +188,7 @@ export function changeToIssue ({ id, categoryId, advice }) { * 支持/反对 表态 */ export function publishStatement ({ attitude, commentId, topicId }) { - return request.post('group/comment/statement', { + return request.post('property/comment/statement', { attitude, commentId, topicId @@ -238,5 +210,5 @@ export function publishStatement ({ attitude, commentId, topicId }) { * 获取关闭原因 */ export function getCloseReason (topicId) { - return request.get(`group/topic/auditRecord/${topicId}`) + return request.get(`property/topic/auditRecord/${topicId}`) } \ No newline at end of file diff --git a/epdc-resident-mp-yushan/utils/api.js b/epdc-resident-mp-yushan/utils/api.js index a4275ff..55be339 100644 --- a/epdc-resident-mp-yushan/utils/api.js +++ b/epdc-resident-mp-yushan/utils/api.js @@ -48,7 +48,10 @@ module.exports = { unpassActivityDetail: unpassActivityDetail, completeInfoV2: completeInfoV2, getTokenV3: getTokenV3, - getWxPhone: getWxPhone + getWxPhone: getWxPhone, + getPropertyProjectList:getPropertyProjectList, + getPropertyProjectDetail:getPropertyProjectDetail, + applyForGroup:applyForGroup } function getToken(wxCode) { @@ -416,4 +419,21 @@ function getWxPhone ({wxCode,encryptedData,iv}) { }) } +/********物业项目-物业项目列表 ********/ +function getPropertyProjectList(){ + return fly.get('property/projectList') +} + +/********物业项目-物业项目详情 ********/ +function getPropertyProjectDetail(propertyProjectId){ + return fly.get(`property/projectDetail/${propertyProjectId}`) +} + +/********物业群-申请入群 ********/ +function applyForGroup(groupId){ + return fly.get('property/group/applyForGroup',{ + groupId:groupId + }) +} + diff --git a/epdc-resident-mp-yushan/utils/config.js b/epdc-resident-mp-yushan/utils/config.js index 8c7be6c..3792918 100644 --- a/epdc-resident-mp-yushan/utils/config.js +++ b/epdc-resident-mp-yushan/utils/config.js @@ -6,14 +6,16 @@ module.exports = { }; function BASEURL() { - // return 'http://10.10.10.77:9094/epdc-api/api/' // 本地测试 接口地址 + return 'http://192.168.51.59:9094/epdc-api/api/' // 本地测试 接口地址 // return 'http://10.10.10.225:9094/epdc-api/api/' // 本地测试 接口地址 // return 'https://epdc-shibei.elinkit.com.cn/epdc-api/api/' // return 'https://eug-test.elinkit.com.cn/epdc-api/api/' // 测试环境 接口地址 - // return "http://219.146.91.110:9094/epdc-api/api/" // 测试环境 ip接口地址 + // return "https://epdc-test.elinkservice.cn/epdc-api/api/" // 测试环境 ip接口地址 // return "https://epdc.elinkservice.cn/epdc-api/api/" // 正式环境 接口地址 // return 'https://epdc-app.qingdaoshibei.cn/epdc-api/api/' // 电政办 正式环境 接口地址 - return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 电政办 正式环境 接口地址 + // return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 电政办 正式环境 接口地址 + // return 'httpss://epdc-kongcun.elinkit.com.cn/epdc-api/api/' // 孔村正式环境地址 + // return "https://nei.netease.com/api/apimock-v2/ccdea843b26ece1e1f9873d6825e7a09/api/" //mock地址 return 'https://epdc-test.elinkservice.cn/epdc-api/api/' // 先锋市北正式环境 }