对接大部分接口

This commit is contained in:
aixianling
2023-10-23 10:48:30 +08:00
parent 189e7621ad
commit 8c07c9a6cb
5 changed files with 232 additions and 139 deletions

View File

@@ -1,7 +1,7 @@
<template>
<section class="AppBIBoard" :class="{fullscreen}">
<ai-fit-view @scale="v=>scale=v">
<ai-dv-wrapper ref="fddv" title="丰收号-家庭互助" :instance="instance" :mask="false">
<ai-dv-wrapper ref="fddv" title="丰收号-家庭互助" :instance="instance" :mask="false" @pick="getData()">
<template v-slot:head="head">
<fengdu-head v-model="areaId" v-bind="head" @fullscreen="handleFullScreen" @setting="handleSetting"/>
</template>
@@ -53,9 +53,10 @@
</fd-card>
</div>
<div class="center fill relative">
<fd-map class="w100 h100"/>
<fd-map class="w100 h100" v-model="map"/>
<fd-card class="centerBottom pad-b8" label="实时动态">
<dv-scroll-board class="mar-t14" :config="realtimeEvents" style="height: 228px"/>
<dv-scroll-board class="mar-t14" :config="realtimeEvents" style="height: 228px"
@click="handleRealtimeEventDialog"/>
</fd-card>
</div>
<div class="right">
@@ -67,11 +68,11 @@
<div class="boxSta flex">
<div class="flex text">
<div>获取总积分</div>
<p v-text="12000"/>
<p v-text="GongdeBank.total"/>
</div>
</div>
<div class="staPanel simple right flex mar-t14">
<div class="fill" v-for="(v,k) in volunteers" :key="k">
<div class="fill" v-for="(v,k) in GongdeBank.users" :key="k">
<div v-text="k"/>
<b v-text="v"/>
</div>
@@ -79,17 +80,17 @@
<div class="boxSta flex">
<div class="flex text">
<div>兑换总积分</div>
<p v-text="9500"/>
<p v-text="GongdeBank.useTotal"/>
</div>
</div>
<div class="staPanel simple right flex mar-t14">
<div class="fill" v-for="(v,k) in volunteers" :key="k">
<div class="fill" v-for="(v,k) in GongdeBank.stores" :key="k">
<div v-text="k"/>
<b v-text="v"/>
</div>
</div>
<div class="grid c-3 pad-t14 pad-b20">
<div class="staPanel" v-for="(v,k) in volunteers">
<div class="staPanel" v-for="(v,k) in GongdeBank.tasks">
<div v-text="k"/>
<b v-text="v"/>
</div>
@@ -228,13 +229,13 @@ export default {
columnWidth: [250],
align: ['left', 'right', 'right'],
data: [
['渝快办', 178, 266],
['公交乘车码', 178, 266],
['警快办', 178, 266],
['医保电子凭证', 178, 266],
['居民上报', 178, 266],
['医保电子凭证', 178, 266],
['居民上报', 178, 266],
// ['渝快办', 178, 266],
// ['公交乘车码', 178, 266],
// ['警快办', 178, 266],
// ['医保电子凭证', 178, 266],
// ['居民上报', 178, 266],
// ['医保电子凭证', 178, 266],
// ['居民上报', 178, 266],
]
},
current: 1,
@@ -245,24 +246,31 @@ export default {
columnWidth: [226],
align: ['center', 'left'],
data: [
['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 创建了新的居民群'],
['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 邀请居民"蓝天白云"加入居民群“书院社区2群”'],
['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 将居民"蓝天白云"踢出居民群 “书院社区2群”'],
['<div class="timeRow">2023-10-19 14:55:32</div>', '滨江东路社区居民-陈思宇在丰收号小程序中进行了打卡签到'],
['<div class="timeRow">2023-10-19 14:55:32</div>', '滨江东路社区居民-陈思宇在丰收号小程序中进行了积分申请'],
['<div class="timeRow">2023-10-19 14:55:32</div>', '滨滨江东路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 创建了新的居民群'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 邀请居民"蓝天白云"加入居民群“书院社区2群”'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 将居民"蓝天白云"踢出居民群 “书院社区2群”'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '滨江东路社区居民-陈思宇在丰收号小程序中进行了打卡签到'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '滨江东路社区居民-陈思宇在丰收号小程序中进行了积分申请'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '滨滨江东路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
// ['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
// ['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
// ['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
]
},
shortcut: 0
shortcut: 0,
GongdeBank: {},
map: null
}
},
computed: {
tablePages: v => Math.ceil(v.volunteerConfig.data.length / v.volunteerConfig.rowNum) || 0,
shortcuts: () => Object.assign({0: '昨日', 1: '近七天', 2: '近30天', 3: '近一年'})
},
watch: {
shortcut() {
this.getGdyh(this.areaId)
}
},
methods: {
handleFullScreen() {
this.fullscreen = this.$refs.fddv.handleFullScreen()
@@ -283,13 +291,86 @@ export default {
setTimeout(() => this.watchTablePageChange(++c), 500)
}
},
getData() {
getData(c = 0) {
const {areaId} = this.$data
if (areaId) {
this.getMiniAppInfo()
this.getRealTimeDynamic(areaId)
this.getWxGroupOverview(areaId)
this.getGdyh(areaId)
} else if (c < 10) setTimeout(() => this.getData(++c), 500)
else console.error(`尝试${c}次加载数据,无法过去数据`)
},
getMiniAppInfo() {
this.instance.post("/app/fdDiy/miniAppInfo").then(res => {
if (res?.data) {
const data = res.data.map(e => [e.name || "应用", e.lastDayClick, e.totalClick])
this.appSta = {...this.appSta, data}
}
})
},
getRealTimeDynamic(areaId) {
this.instance.post("/app/fdDiy/realTimeDynamic", null, {params: {areaId}}).then(res => {
if (res?.data) {
const data = res.data.map(e => [`<div class="timeRow">${e.eventTime}</div>`, `<div class="flex">${e.bizId ? e.description.replace(e.type, `<div class="blue">${e.type}</div>`) : e.description}</div>`])
this.realtimeEvents = {...this.realtimeEvents, data, meta: res.data}
}
})
},
getWxGroupOverview(areaId) {
this.instance.post("/app/fdDiy/wxGroupOverview", null, {params: {areaId}}).then(res => {
if (res?.data) {
}
})
},
getGdyh(areaId) {
this.instance.post("/app/fdDiy/gdyh", null, {params: {areaId, type: this.shortcut}}).then(res => {
if (res?.data) {
const {
宣发发布任务数,
宣发未审核数,
宣发审核通过数,
店铺总数,
店品库存量 = 0,
兑换物品数量,
获取积分总数: total = 0,
居民签到人次: 签到人数 = 0,
积分申请次数: 申请人数 = 0,
兑换总积分: useTotal = 0
} = res.data
this.GongdeBank = {
total, useTotal,
users: {
参与人数: 签到人数 + 申请人数,
申请人数,
签到人数
},
stores: {店铺总数, 店品库存量, 兑换物品数量},
tasks: {
宣发发布任务数,
审核通过率: (宣发审核通过数 / 宣发发布任务数 * 100 || 0).toFixed(2) + "%",
宣发未审核数,
}
}
}
})
},
handleRealtimeEventDialog({rowIndex}) {
const row = this.realtimeEvents.meta[rowIndex]
if (row.bizId) {
const action = {
积分申请: "",
物品兑换: "",
精选动态: "",
}[row.type]
this.instance.post(action, null, {params: {id: row.bizId}}).then(res => {
if (res?.data) {
}
})
}
console.log(row)
}
},
created() {
@@ -444,6 +525,11 @@ export default {
background-position: 20px center;
text-indent: 24px;
}
.blue {
color: #02FEFF;
cursor: pointer;
}
}
.dots {
@@ -498,7 +584,7 @@ export default {
.boxSta {
margin-top: 16px;
padding-right: 70px;
padding-right: 40px;
justify-content: flex-end;
background: url("./assets/box.png") no-repeat 80px center;
height: 82px;
@@ -506,7 +592,7 @@ export default {
.text {
color: #FFFFFF;
width: 156px;
width: 200px;
justify-content: space-between;
& > p {

View File

@@ -8,6 +8,13 @@ import fdEdge from "../assets/fdEdge.json"
export default {
name: "fdMap",
model: {
prop: "ins",
event: "input"
},
props: {
ins: {default: null}
},
data() {
return {
map: null
@@ -54,6 +61,7 @@ export default {
},
]
})
this.$emit("input", this.map)
} else if (c < 5) setTimeout(() => this.init(++c), 500)
}
},

View File

@@ -1,7 +1,7 @@
<template>
<section class="fengduHead">
<div class="content flex">
<ai-area class="fill" v-model="current" :mask="false" :root="currentRoot">
<ai-area class="fill" v-model="current" :mask="false" :root="currentRoot" @area="v=>$emit('pick',v)">
<template slot-scope="{areaname}">
<el-input class="areaPicker" :value="areaname" readonly suffix-icon="el-icon-arrow-down"/>
</template>
@@ -45,11 +45,11 @@ export default {
active: {
immediate: true,
handler(v) {
if (v != this.current) this.current = this.$copy(this.active)
if (v && v != this.current) this.current = this.$copy(this.active)
}
},
current(v) {
this.$emit("change", v)
v != this.active && this.$emit("change", v)
}
},
created() {