Browse Source

新加通用配置接口,首页直接跳转到街道详情列表

release
zhaoyongnian 5 years ago
parent
commit
32e361efef
  1. 4
      src/api/basicReality.ts
  2. 14
      src/api/index.ts
  3. 2
      src/pages/index/index.scss
  4. 22
      src/pages/index/index.ts
  5. 14
      src/subpages/basicReality/components/selectStreet/selectStreet.ts
  6. 8
      src/subpages/basicReality/pages/index/components/partyVan/components/enterSituation/enterSituation.ts

4
src/api/basicReality.ts

@ -191,12 +191,12 @@ export function getAllDynamicStatistics ({ someMonthsType, analysisType }: getAl
* @param {string} someMonthsType 1:最近1个月2:最近3个月3:最近半年4:最近一年
* @param {string} analysisType 分析类型:1.平台2.3.4.
*/
export function getDynamicPercentAnalysis ({ DeptId, someMonthsType, analysisType }: getDynamicPercentAnalysisApiOption) {
export function getDynamicPercentAnalysis ({ deptId, someMonthsType, analysisType }: getDynamicPercentAnalysisApiOption) {
return request({
url: 'cloudAnalysis/dynamic/getDynamicPercentAnalysis',
method: 'GET',
options: {
DeptId,
deptId,
someMonthsType,
analysisType
}

14
src/api/index.ts

@ -130,3 +130,17 @@ export function getIndexPanelV2() {
url: 'cloudAnalysis/home/v2/getIndexPanel',
})
}
/**
*
*
*/
export function getResidentConfig({ residentType }: {residentType : string}) {
return request({
method: 'GET',
url:'api/work/residentConfig/swagger/getResidentConfig',
options:{
residentType
}
})
}

2
src/pages/index/index.scss

@ -314,10 +314,12 @@ swiper {
display: flex;
align-items: center;
margin-top: 272rpx;
width: 100%;
.count-text-item{
width: 12rpx;
height: 12rpx;
border-radius: 50%;
margin-left: 24%;
}
.project-n-bg-color{
background: #3B85E7;

22
src/pages/index/index.ts

@ -1,4 +1,4 @@
import { bannerList, getAllSituation, getSurvey, getToken, getIndexPanelV2 } from '../../api/index'
import { bannerList, getAllSituation, getSurvey, getToken, getIndexPanelV2, getResidentConfig } from '../../api/index'
import { checkUpdateAvatar, updateAvatar } from '../../api/clerkOnline'
import { logout } from '../../api/setUp'
// @ts-ignore
@ -483,9 +483,9 @@ Page({
},
// 跳转到用户分析模块
navigateToUserNum() {
wx.navigateTo({
url: '/subpages/userNum/pages/userAnalysis/userAnalysis'
})
// 获取街道id
this.getResidentConfig()
// url: '/subpages/userNum/pages/userAnalysis/userAnalysis' 瑜山只有一个街道所以不再跳转到这个页面
},
// 跳转到议题总数详情
navigateToyt() {
@ -604,5 +604,19 @@ Page({
}
}
})
},
// 小程序配置通用接口,这里主要获取默认街道id
async getResidentConfig (){
const para = {
residentType: 'business_street_id'
}
try {
const res: any = await getResidentConfig(para)
wx.navigateTo({
url: `/subpages/userNum/pages/streetDetail/streetDetail?deptId=${res.data[0].residentCode}&deptName=${res.data[0].residentValue}`
})
} catch (error) {
console.log(error)
}
}
})

14
src/subpages/basicReality/components/selectStreet/selectStreet.ts

@ -1,4 +1,5 @@
import { getStreetList } from '../../../../api/basic'
import { getResidentConfig } from '../../../../api/index'
var utils = require('../../../../utils/util');
Component({
/**
@ -47,22 +48,25 @@ Component({
async getStreetList() {
// @ts-ignore
let streetList = [];
const para = {
residentType: 'business_street_id'
}
try {
let res: any = await getStreetList()
let res: any = await getResidentConfig(para)
res.data.forEach((item: any) => {
this.data.streetList.push({
// @ts-ignore
select: false,
// @ts-ignore
title: item.deptName,
title: item.residentValue,
// @ts-ignore
id: item.deptId,
id: item.residentCode,
})
this.setData({ // 2020.9.11 去掉全部只保留瑜山街道
// @ts-ignore
'choosedStreet.title': item.deptName,
'choosedStreet.title': item.residentValue,
// @ts-ignore
'choosedStreet.id': item.deptId
'choosedStreet.id': item.residentCode
})
})
this.setData({

8
src/subpages/basicReality/pages/index/components/partyVan/components/enterSituation/enterSituation.ts

@ -85,6 +85,9 @@ Component({
preloadVisible: true,
streetContentList: []
})
if(!this.data.condition.streetId) { // 9.14 必须传DeptId
return
}
this.getAllDynamicStatistics()
this.rankOfPartyJoin()
this.getDynamicPercentAnalysis()
@ -213,13 +216,10 @@ Component({
// 党员参与占比分析
async getDynamicPercentAnalysis () {
const para = {
DeptId: this.data.condition.streetId,
deptId: this.data.condition.streetId,
someMonthsType: this.data.condition.timeId ? this.data.condition.timeId : '0',
analysisType: '1'
}
if(!this.data.condition.streetId) { // 9.14 必须传DeptId
return
}
try {
const res:any = await getDynamicPercentAnalysis(para)
const categoryList:Array<string> = []

Loading…
Cancel
Save