Files
dvcp_v2_webapp/project/fengdu/app/AppIntegratingTask/components/Detail.vue
yanran200730 f53c7b82ef 151
2023-03-30 09:49:08 +08:00

129 lines
4.0 KiB
Vue

<template>
<ai-detail class="activitiesAdd">
<template slot="title">
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper>
<ai-info-item label="活动名称" :value="info.title"></ai-info-item>
<ai-info-item label="创建人" :value="info.createUserName"></ai-info-item>
<ai-info-item label="活动说明" isLine :value="info.detail"></ai-info-item>
<ai-info-item label="活动图片" isLine>
<ai-uploader
disabled
:instance="instance"
:value="info.files">
</ai-uploader>
</ai-info-item>
<ai-info-item label="活动说明" isLine :value="info.areaName"></ai-info-item>
<ai-info-item label="活动地点" :value="info.address"></ai-info-item>
<ai-info-item label="标绘地址" isLine><div id="mapDetail"></div></ai-info-item>
<ai-info-item label="积分类型" isLine :value="info.type === '0' ? '打卡得积分' : '报名得积分'"></ai-info-item>
<ai-info-item label="活动状态">
{{ dict.getLabel('tfx_activityStatus',info.status) }}
</ai-info-item>
<ai-info-item label="打卡范围">{{ info.clockRange }}</ai-info-item>
<ai-info-item :label="info.type === '0' ? '进场打卡时间' : '进场时间'">{{ info.intoBegintime }}{{ info.intoEndtime}}</ai-info-item>
<ai-info-item v-if="info.type === '0'" label="进场得积分">{{ info.intoIntegral }}</ai-info-item>
<ai-info-item :label="info.type === '0' ? '离场打卡时间' : '离场时间'">{{ info.exitBegintime }}{{ info.exitEndtime}}</ai-info-item>
<ai-info-item v-if="info.type === '0'" label="离场得积分">{{ info.exitIntegral }}</ai-info-item>
<ai-info-item v-if="info.type === '1'" label="报名得积分">{{ info.enrollIntegral }}</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
import AMapLoader from '@amap/amap-jsapi-loader'
export default {
props: {
instance: Function,
dict: Object,
params: Object,
},
data () {
return {
id: '',
info: {},
mapDetail: null,
map: null
}
},
created () {
this.id = this.params.id
this.$dict.load('tfx_activityStatus').then(() => {
this.getDetail()
})
},
methods: {
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
},
getMap(lng,lat,address) {
AMapLoader.load({
key: '54a02a43d9828a8f9cd4f26fe281e74e',
version: '2.0',
plugins: ['AMap.PlaceSearch', 'AMap.AutoComplete', 'AMap.Geocoder'],
}).then((AMap) => {
this.mapDetail = new AMap.Map(document.getElementById("mapDetail"), {
resizeEnable: true,
zooms: [6, 20],
zoom: 11,
})
let marker = new AMap.Marker({
position: new AMap.LngLat(lng,lat),
title: address
})
this.mapDetail.add(marker);
})
},
update() {
this.isEdit = true
this.getDetail()
},
getDetail() {
this.instance.post(`/app/appintegraltask/queryDetailById?id=${this.params.id}`).then((res) => {
if(res.data) {
this.info = res.data
this.getMap(this.info.lng, this.info.lat, this.info.address)
}
})
}
}
}
</script>
<style lang="scss" scope>
.activitiesAdd {
height: 100%;
:deep( .amap-logo ){
display: none!important;
}
:deep( .amap-copyright ){
display: none!important;
}
:deep( .el-date-editor .el-input ){
width: 100%;
}
.amap-container {
height: 380px;
}
}
</style>