Browse Source

【物业服务】-【接口对应】 -刘绍文 -2020.05.14

feature/v2.0
liushaowen 5 years ago
parent
commit
40ca79ab8f
  1. 110
      epdc-resident-mp-yushan/pages/property/property.js
  2. 3
      epdc-resident-mp-yushan/pages/property/property.json
  3. 28
      epdc-resident-mp-yushan/pages/property/property.wxml
  4. 6
      epdc-resident-mp-yushan/pages/toRegister/toRegister.js
  5. 68
      epdc-resident-mp-yushan/subpages/property/utils/api.js
  6. 22
      epdc-resident-mp-yushan/utils/api.js
  7. 8
      epdc-resident-mp-yushan/utils/config.js

110
epdc-resident-mp-yushan/pages/property/property.js

@ -11,17 +11,18 @@ Page({
loadMoreVisible: true, loadMoreVisible: true,
tabList:[],//tab列表 tabList:[],//tab列表
currentTabIndex:0, currentTabIndex:0,
propertyInfo:{}, projectInfo:{},
recommendList:[], recommendList:[],
pageNo: 1, // 新闻列表-分页页码 pageNo: 1, // 新闻列表-分页页码
pageSize: 10, // 新闻列表-分页页长 pageSize: 10, // 新闻列表-分页页长
isLoading: true isLoading: true,
timeStamp:''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
if (options.scene) { if (options.scene) {
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
@ -33,13 +34,15 @@ Page({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
}) })
} this.setData({
this.initTab(); timeStamp:getTimestamp()
if(this.data.tabList.length>0){ })
this.initPropertyInfo(this.data.tabList[0].propertyId);
} }
// this.getRecommend(); // this.getRecommend();
}, },
onReady:function(){
this.initTab();
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
@ -47,38 +50,40 @@ Page({
}, },
initTab(){ initTab(){
// var tabList=[{name:"敦化路万科物业"}]; api.getPropertyProjectList().then((res)=>{
// var tabList=[{name:"敦化路万科物业"},{name:'辽宁路万科物业'}]; this.setData({
var tabList=[{name:"敦化路万科物业"},{name:'辽宁路万科物业'},{name:'站山路万科物业'},{name:'辽源路万科物业'}]; tabList:res.data
this.setData({ });
tabList:tabList if(this.data.tabList.length>0){
}) this.initPropertyInfo(this.data.tabList[0].id);
}
}).catch(err=>{
this.setData({
tabList:[]
})
});
}, },
initPropertyInfo(id){ initPropertyInfo(id){
wx.showLoading({ wx.showLoading({
}); });
var info={ api.getPropertyProjectDetail(id).then(res=>{
propertyId:'111', this.setData({
projectName:"敦化路万科城", projectInfo:res.data,
propertyName:"敦化路万科物业", isLoading:false
tel:'13666666666', })
personInCharge:'张磊', wx.hideLoading({
address:'市北区敦化路88号15-90', complete: (res) => {},
pic:'../../images/home/dang_logo.png', })
groupName:"物业交流群", }).catch(err=>{
peopleCount:'456', this.setData({
partyCount:'88', projectInfo:{},
joinStatus:'1', isLoading:false
groupId:'111' })
}; wx.hideLoading({
this.setData({ complete: (res) => {},
propertyInfo:info, })
isLoading:false });
})
wx.hideLoading({
complete: (res) => {},
})
}, },
// getRecommend(){ // getRecommend(){
// var list=[]; // var list=[];
@ -105,33 +110,54 @@ Page({
if(this.data.isLoading){ if(this.data.isLoading){
}else{ }else{
let {index , propertyid} = e.currentTarget.dataset; let {index , id} = e.currentTarget.dataset;
this.setData({ this.setData({
currentTabIndex:index, currentTabIndex:index,
isLoading:true isLoading:true
}) })
this.initPropertyInfo(propertyid) this.initPropertyInfo(id)
} }
}, },
joinGroup(e){ joinGroup(e){
const { joinstatus, groupid, groupname } = e.currentTarget.dataset const { joinstatus, groupid, groupname,state } = e.currentTarget.dataset
if(joinstatus == '0'){ if(joinstatus == '0'){
wx.showModal({ wx.showModal({
title:'提示', title:'提示',
content:'尚未加入群组,是否加入?', content:'尚未加入群组,是否申请加入?',
confirmText:'加入', confirmText:'申请',
cancelColor: 'cancelColor', cancelColor: 'cancelColor',
success:(res)=>{ success:(res)=>{
if(res.cancel){ 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({ 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}`
}) })
} }
} }

3
epdc-resident-mp-yushan/pages/property/property.json

@ -3,6 +3,7 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"usingComponents": { "usingComponents": {
"load-more": "../../components/loadMore/loadMore" "load-more": "../../components/loadMore/loadMore",
"pulldown-refresh": "/components/pullDownRefresh/pullDownRefresh"
} }
} }

28
epdc-resident-mp-yushan/pages/property/property.wxml

@ -2,10 +2,11 @@
<image class="header-bg" src="../../images/home/home-status.png" /> <image class="header-bg" src="../../images/home/home-status.png" />
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">物业服务</view> <view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">物业服务</view>
</view> </view>
<view class="home" style="margin-top: {{statusHeight + navigationHeight}}px"> <view class="home" style="margin-top: {{statusHeight + navigationHeight}}px">
<scroll-view class="tab" scroll-x> <scroll-view class="tab" scroll-x>
<view wx:for="{{tabList}}"wx:for-item="item" wx:for-index="index" wx:key="index" data-index="{{index}}" data-propertyId="{{item.propertyId}}" bindtap="changeTab" class="tab-item"> <view wx:for="{{tabList}}"wx:for-item="item" wx:for-index="index" wx:key="index" data-index="{{index}}" data-id="{{item.id}}" bindtap="changeTab" class="tab-item">
<view class="tab-name{{index == currentTabIndex? ' active' : ''}}">{{item.name}}</view> <view class="tab-name{{index == currentTabIndex? ' active' : ''}}">{{item.projectName}}</view>
<view class="tab-line{{index == currentTabIndex? ' active' : ''}}"></view> <view class="tab-line{{index == currentTabIndex? ' active' : ''}}"></view>
</view> </view>
</scroll-view> </scroll-view>
@ -16,35 +17,35 @@
</view> </view>
<view class="info-item"> <view class="info-item">
<image src="../../images/property/name.png" class="info-img"></image> <image src="../../images/property/name.png" class="info-img"></image>
<view class="info-detail">物业项目名称: {{propertyInfo.projectName}}</view> <view class="info-detail">物业项目名称: {{projectInfo.projectName}}</view>
</view> </view>
<view class="info-item"> <view class="info-item">
<image src="../../images/property/property.png" class="info-img"></image> <image src="../../images/property/property.png" class="info-img"></image>
<view class="info-detail">物业名称: {{propertyInfo.propertyName}}</view> <view class="info-detail">物业名称: {{projectInfo.propertyName}}</view>
</view> </view>
<view class="info-item"> <view class="info-item">
<image src="../../images/property/tel.png" class="info-img"></image> <image src="../../images/property/tel.png" class="info-img"></image>
<view class="info-detail">物业电话: {{propertyInfo.tel}}</view> <view class="info-detail">物业电话: {{projectInfo.propertyTel}}</view>
</view> </view>
<view class="info-item"> <view class="info-item">
<image src="../../images/property/person-in-charge.png" class="info-img"></image> <image src="../../images/property/person-in-charge.png" class="info-img"></image>
<view class="info-detail">物业负责人: {{propertyInfo.personInCharge}}</view> <view class="info-detail">物业负责人: {{projectInfo.propertyManager}}</view>
</view> </view>
<view class="info-item"> <view class="info-item">
<image src="../../images/property/address.png" class="info-img"></image> <image src="../../images/property/address.png" class="info-img"></image>
<view class="info-detail">物业地址: {{propertyInfo.address}}</view> <view class="info-detail">物业地址: {{projectInfo.propertyAddress}}</view>
</view> </view>
<view class="info-group"> <view class="info-group" wx:if="{{projectInfo.id != undefined}}">
<image src="{{propertyInfo.pic}}" class="group-pic"></image> <image src="{{projectInfo.groupAvatar}}" class="group-pic"></image>
<view class="group-detail"> <view class="group-detail">
<view class="group-name">{{propertyInfo.groupName}}</view> <view class="group-name">{{projectInfo.groupName}}</view>
<view class="group-number"><text space="nbsp">共{{propertyInfo.peopleCount}}人 {{propertyInfo.partyCount}}名党员</text></view> <view class="group-number"><text space="nbsp">共{{projectInfo.numberGroupMember}}人 {{projectInfo.numberGroupPartyMember}}名党员</text></view>
</view> </view>
<view class="group-join"> <view class="group-join">
<!-- <image src="../../images/property/red-join.png" class="join-button"></image> --> <!-- <image src="../../images/property/red-join.png" class="join-button"></image> -->
<!-- <view class="join-text">加入</view> --> <!-- <view class="join-text">加入</view> -->
<view class="join-button" data-joinStatus="{{propertyInfo.joinStatus}}" <view class="join-button" data-joinStatus="{{projectInfo.groupMemberFlag}}"
data-groupName="{{propertyInfo.groupName}}" data-groupId="{{propertyInfo.groupId}}" bindtap="joinGroup">加入</view> data-groupName="{{projectInfo.groupName}}" data-state="{{projectInfo.groupState}}" data-groupId="{{projectInfo.id}}" bindtap="joinGroup">加入</view>
</view> </view>
</view> </view>
</view> </view>
@ -101,5 +102,6 @@
</view> --> </view> -->
<!--加载更多提示--> <!--加载更多提示-->
<!-- <load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more> --> <!-- <load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more> -->
</view> </view>

6
epdc-resident-mp-yushan/pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
} }
}) })
let that = this let that = this
const versionNum = '0.9.7.23' const versionNum = '1.2.11'
api.getScanSwitch(versionNum).then(function (res) { api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data) console.log(res.data)
let state = res.data.scanFlag let state = res.data.scanFlag
@ -42,9 +42,9 @@ Page({
// }) // })
}, },
experience() { experience() {
app.globalData.tempGridId = '1232925355908550657' app.globalData.tempGridId = '1222032503139762178'
wx.reLaunch({ wx.reLaunch({
url: '/pages/index/index?scene=1232925355908550657' url: '/pages/index/index?scene=1222032503139762178'
}) })
}, },
scan() { scan() {

68
epdc-resident-mp-yushan/subpages/property/utils/api.js

@ -1,54 +1,26 @@
const request = require('../../../utils/request') 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) { export function getAssociationDetail (id) {
return request.get(`group/group/detail/${id}`) return request.get(`property/group/detail/${id}`)
} }
/** /**
* 修改群头像 * 修改群头像
*/ */
export function modifyAvatar ({id, groupAvatar}) { export function modifyAvatar ({id, groupAvatar}) {
return request.post('group/group/modifyAvatar', { return request.post('property/group/modifyAvatar', {
id, id,
groupAvatar groupAvatar
}) })
} }
/**
* 解散群
*/
export function disbandAssociation({id, processingOpinions}) {
return request.post('group/group/disband', {
id,
processingOpinions
})
}
/** /**
* 加入社群 * 加入社群
*/ */
export function joinAssociation (groupId) { export function joinAssociation (groupId) {
return request.post('group/group/applyForGroup', { return request.post('property/group/applyForGroup', {
groupId groupId
}) })
} }
@ -57,7 +29,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 修改群介绍 * 修改群介绍
*/ */
export function changeIntroduce ({id, groupIntroduction}) { export function changeIntroduce ({id, groupIntroduction}) {
return request.post('group/group/modifyIntroduction', { return request.post('property/group/modifyIntroduction', {
id, id,
groupIntroduction groupIntroduction
}) })
@ -67,7 +39,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 群成员列表 审核通过/待审核 * 群成员列表 审核通过/待审核
*/ */
export function getAssociationMember ({groupId, state}) { export function getAssociationMember ({groupId, state}) {
return request.get('group/group/listOfMember', { return request.get('property/group/listOfMember', {
groupId, groupId,
state state
}) })
@ -77,7 +49,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 删除群成员 * 删除群成员
*/ */
export function deleteMember ({groupId, userId}) { export function deleteMember ({groupId, userId}) {
return request.post('group/group/removeMember', { return request.post('property/group/removeMember', {
groupId, groupId,
userId userId
}) })
@ -87,7 +59,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 审核入群成员 * 审核入群成员
*/ */
export function incomingVerify ({ groupId, members }) { export function incomingVerify ({ groupId, members }) {
return request.post('group/group/reviewApply', { return request.post('property/group/reviewApply', {
groupId, groupId,
members members
}) })
@ -97,7 +69,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 添加好友列表 * 添加好友列表
*/ */
export function getInviteList ({groupId, mobile, road, lastName}) { export function getInviteList ({groupId, mobile, road, lastName}) {
return request.get('group/group/getInviteList', { return request.get('property/group/getInviteList', {
groupId, groupId,
mobile, mobile,
road, road,
@ -109,7 +81,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 添加好友 * 添加好友
*/ */
export function addMember ({ groupId, members}) { export function addMember ({ groupId, members}) {
return request.post('group/group/addMember', { return request.post('property/group/addMember', {
groupId, groupId,
members members
}) })
@ -119,7 +91,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 发布话题 * 发布话题
*/ */
export function addTopic ({topicContent, topicAddress, topicLatitude, topicLongitude, groupId, groupName, images}) { export function addTopic ({topicContent, topicAddress, topicLatitude, topicLongitude, groupId, groupName, images}) {
return request.post('group/topic/submit', { return request.post('property/topic/submit', {
topicContent, topicContent,
topicAddress, topicAddress,
topicLatitude, topicLatitude,
@ -134,7 +106,7 @@ export function disbandAssociation({id, processingOpinions}) {
* 话题列表 * 话题列表
*/ */
export function getTopicList ({ pageIndex, pageSize, timestamp, groupId, topicId }) { export function getTopicList ({ pageIndex, pageSize, timestamp, groupId, topicId }) {
return request.get('group/topic/list', { return request.get('property/topic/list', {
pageIndex, pageIndex,
pageSize, pageSize,
timestamp, timestamp,
@ -146,8 +118,8 @@ export function disbandAssociation({id, processingOpinions}) {
/** /**
* 话题详情 * 话题详情
*/ */
export function getTopicDetail (detailId) { export function getTopicDetail (id) {
return request.get(`group/topic/detail/${detailId}`) return request.get(`property/topic/detail/${id}`)
} }
/** /**
@ -155,7 +127,7 @@ export function getTopicDetail (detailId) {
* @param groupId * @param groupId
*/ */
export function withdrawGroup (groupId) { export function withdrawGroup (groupId) {
return request.post('group/group/quitGroup', { return request.post('property/group/quitGroup', {
groupId groupId
}) })
} }
@ -164,7 +136,7 @@ export function withdrawGroup (groupId) {
* 评论最新最热列表 * 评论最新最热列表
*/ */
export function getRemarkList({ pageIndex, pageSize, timestamp, orderType, topicId }) { export function getRemarkList({ pageIndex, pageSize, timestamp, orderType, topicId }) {
return request.get('group/comment/list', { return request.get('property/comment/list', {
pageIndex, pageIndex,
pageSize, pageSize,
timestamp, timestamp,
@ -177,7 +149,7 @@ export function getRemarkList({ pageIndex, pageSize, timestamp, orderType, topic
* 评论或者回复 * 评论或者回复
*/ */
export function remarkOrReply ({ topicId, faCommentId, content }) { export function remarkOrReply ({ topicId, faCommentId, content }) {
return request.post('group/comment/submit', { return request.post('property/comment/submit', {
topicId, topicId,
faCommentId, faCommentId,
content content
@ -188,7 +160,7 @@ export function remarkOrReply ({ topicId, faCommentId, content }) {
* 关闭话题 * 关闭话题
*/ */
export function closeTopic ({ id, processingOpinions }) { export function closeTopic ({ id, processingOpinions }) {
return request.post('group/topic/close', { return request.post('property/topic/close', {
id, id,
processingOpinions processingOpinions
}) })
@ -205,7 +177,7 @@ export function getClassifyList () {
* 话题转议题 * 话题转议题
*/ */
export function changeToIssue ({ id, categoryId, advice }) { export function changeToIssue ({ id, categoryId, advice }) {
return request.post('group/topic/changeToIssue', { return request.post('property/topic/changeToIssue', {
id, id,
categoryId, categoryId,
advice advice
@ -216,7 +188,7 @@ export function changeToIssue ({ id, categoryId, advice }) {
* 支持/反对 表态 * 支持/反对 表态
*/ */
export function publishStatement ({ attitude, commentId, topicId }) { export function publishStatement ({ attitude, commentId, topicId }) {
return request.post('group/comment/statement', { return request.post('property/comment/statement', {
attitude, attitude,
commentId, commentId,
topicId topicId
@ -238,5 +210,5 @@ export function publishStatement ({ attitude, commentId, topicId }) {
* 获取关闭原因 * 获取关闭原因
*/ */
export function getCloseReason (topicId) { export function getCloseReason (topicId) {
return request.get(`group/topic/auditRecord/${topicId}`) return request.get(`property/topic/auditRecord/${topicId}`)
} }

22
epdc-resident-mp-yushan/utils/api.js

@ -48,7 +48,10 @@ module.exports = {
unpassActivityDetail: unpassActivityDetail, unpassActivityDetail: unpassActivityDetail,
completeInfoV2: completeInfoV2, completeInfoV2: completeInfoV2,
getTokenV3: getTokenV3, getTokenV3: getTokenV3,
getWxPhone: getWxPhone getWxPhone: getWxPhone,
getPropertyProjectList:getPropertyProjectList,
getPropertyProjectDetail:getPropertyProjectDetail,
applyForGroup:applyForGroup
} }
function getToken(wxCode) { 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
})
}

8
epdc-resident-mp-yushan/utils/config.js

@ -6,14 +6,16 @@ module.exports = {
}; };
function BASEURL() { 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 'http://10.10.10.225:9094/epdc-api/api/' // 本地测试 接口地址
// return 'https://epdc-shibei.elinkit.com.cn/epdc-api/api/' // return 'https://epdc-shibei.elinkit.com.cn/epdc-api/api/'
// return 'https://eug-test.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.elinkservice.cn/epdc-api/api/" // 正式环境 接口地址
// return 'https://epdc-app.qingdaoshibei.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/' // 先锋市北正式环境 return 'https://epdc-test.elinkservice.cn/epdc-api/api/' // 先锋市北正式环境
} }

Loading…
Cancel
Save