Files
dvcp_v2_webapp/project/fengdu/app/AppIntegratingTask/components/Detail.vue

129 lines
4.1 KiB
Vue
Raw Normal View History

2023-03-28 17:01:52 +08:00
<template>
2023-03-29 09:24:13 +08:00
<ai-detail class="activitiesAdd">
2023-03-28 17:01:52 +08:00
<template slot="title">
2023-03-29 09:24:13 +08:00
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
2023-03-28 17:01:52 +08:00
</template>
<template slot="content">
2023-03-29 09:24:13 +08:00
<ai-card title="基本信息">
2023-03-28 17:01:52 +08:00
<template #content>
2023-03-29 09:24:13 +08:00
<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>
2023-03-30 09:56:50 +08:00
<ai-info-item label="活动地区" isLine :value="info.areaName"></ai-info-item>
2023-03-29 09:24:13 +08:00
<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="活动状态">
2023-03-30 12:02:20 +08:00
{{ dict.getLabel('fdIntegralTaskStatus',info.status) }}
2023-03-29 09:24:13 +08:00
</ai-info-item>
<ai-info-item label="打卡范围">{{ info.clockRange }}</ai-info-item>
2023-03-30 14:36:09 +08:00
<ai-info-item :label="info.type === '0' ? '进场打卡时间' : '报名时间'">{{ info.intoBegintime }}{{ info.intoEndtime}}</ai-info-item>
2023-03-29 09:24:13 +08:00
<ai-info-item v-if="info.type === '0'" label="进场得积分">{{ info.intoIntegral }}</ai-info-item>
2023-03-30 14:36:09 +08:00
<ai-info-item v-if="info.type === '0'" :label="info.type === '0' ? '离场打卡时间' : '离场时间'">{{ info.exitBegintime }}{{ info.exitEndtime}}</ai-info-item>
2023-03-29 09:24:13 +08:00
<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>
2023-03-28 17:01:52 +08:00
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
2023-03-29 09:24:13 +08:00
import AMapLoader from '@amap/amap-jsapi-loader'
2023-03-28 17:01:52 +08:00
export default {
props: {
instance: Function,
dict: Object,
2023-03-29 09:24:13 +08:00
params: Object,
2023-03-28 17:01:52 +08:00
},
data () {
return {
2023-03-29 09:24:13 +08:00
id: '',
2023-03-28 17:01:52 +08:00
info: {},
2023-03-29 09:24:13 +08:00
mapDetail: null,
map: null
2023-03-28 17:01:52 +08:00
}
},
created () {
2023-03-29 09:24:13 +08:00
this.id = this.params.id
this.$dict.load('tfx_activityStatus').then(() => {
this.getDetail()
})
2023-03-28 17:01:52 +08:00
},
methods: {
2023-03-29 09:24:13 +08:00
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
2023-03-28 17:01:52 +08:00
})
},
2023-03-29 09:24:13 +08:00
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);
2023-03-28 17:01:52 +08:00
})
},
2023-03-29 09:24:13 +08:00
update() {
this.isEdit = true
this.getDetail()
2023-03-28 17:01:52 +08:00
},
2023-03-29 09:24:13 +08:00
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)
}
2023-03-28 17:01:52 +08:00
})
2023-03-29 09:24:13 +08:00
}
2023-03-28 17:01:52 +08:00
}
}
</script>
2023-03-29 09:24:13 +08:00
<style lang="scss" scope>
.activitiesAdd {
height: 100%;
:deep( .amap-logo ){
display: none!important;
2023-03-28 17:01:52 +08:00
}
2023-03-29 09:24:13 +08:00
:deep( .amap-copyright ){
display: none!important;
2023-03-28 17:01:52 +08:00
}
2023-03-29 09:24:13 +08:00
:deep( .el-date-editor .el-input ){
width: 100%;
}
2023-03-28 17:01:52 +08:00
2023-03-29 09:24:13 +08:00
.amap-container {
height: 380px;
2023-03-28 17:01:52 +08:00
}
}
</style>