Browse Source

活动跟社区宣传分享问题修改

feature
mk 1 year ago
parent
commit
c78516e49d
  1. 8
      src/api/activity.js
  2. 38
      src/views/activity/detail.vue
  3. 31
      src/views/communityPublicity/detail.vue
  4. 3
      src/views/communityPublicity/index.vue
  5. 3
      src/views/home/index.vue

8
src/api/activity.js

@ -13,7 +13,13 @@ export function detail(id) {
return request({
url: `/actual/base/communityActivity/detail/${id}`,
method: 'get',
})
}
export function getById(id) {
return request({
url: `/actual/base/communityActivity/getById/${id}`,
method: 'get',
})
}

38
src/views/activity/detail.vue

@ -60,7 +60,7 @@
</template>
<script>
import { addActivityRecord, detail, communityActivityApplicationRecordDelete } from "@/api/activity"
import { addActivityRecord, detail, communityActivityApplicationRecordDelete,getById } from "@/api/activity"
import Share from "@/components/Share"
import registerDialog from '@/components/registerDialog';
import { setConfig } from '@/utils/jweixin'
@ -84,11 +84,13 @@ export default {
created() {
},
mounted() {
async mounted() {
setConfig(['updateAppMessageShareData', 'onMenuShareAppMessage', 'updateTimelineShareData'])
if (this.$route.query.id) {
this.detail(this.$route.query.id)
this.share()
await this.detail(this.$route.query.id)
if(this.$route.query.flag === 'share'){
await this.getById(this.$route.query.id)
}
}
},
methods: {
@ -97,9 +99,9 @@ export default {
if (wx.updateAppMessageShareData) {
wx.ready(function () {
wx.updateAppMessageShareData({
title: than.info.activityName,
title: than.info.activityName || '活动详情',
desc: '',
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/activityDetail?id=${than.$route.query.id}&appId=${than.$store.state.app.appId}`,
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/activityDetail?id=${than.$route.query.id}&appId=${than.$store.state.app.appId}&flag=share`,
imgUrl: than.info.coverPic || 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240710/617f7fb327064d89892823b81b11cd70.png',
success: function () {}
})
@ -151,6 +153,27 @@ export default {
let res = await detail(id);
handleResponse(res);
},
async getById(id) {
const handleResponse = (res) => {
if (res.code === 0) {
this.info = res.data;
this.info.participants = res.data.participants;
this.info.currentParticipants = res.data.currentParticipants;
if (res.data.recordList && res.data.recordList.length > 0) {
this.signUp = res.data.recordList;
}
if (res.data.cutOffTime) {
this.checkIfPast();
}
}
};
if (delId) {
this.signUp = this.signUp.filter(item => item.id != delId);
}
let res = await getById(id);
handleResponse(res);
},
handelAddResi() {
this.signUp.push({ name: "", mobile: "", remark: "", })
},
@ -217,6 +240,9 @@ export default {
height: 50px;
bottom:8vh;
}
:deep img{
max-width: 100%;
}
:deep(.p0>.van-cell) {
padding: 0;
}

31
src/views/communityPublicity/detail.vue

@ -79,22 +79,29 @@ export default {
if (wx.updateAppMessageShareData) {
wx.ready(function () {
wx.updateAppMessageShareData({
title: 'e智社区',
desc: than.info.title,
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/communityPublicityDetail?item=${encodeURIComponent(than.info)}&appId=${than.$store.state.app.appId}`,
imgUrl: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240710/617f7fb327064d89892823b81b11cd70.png',
title: than.info.title || '讯息详情',
desc: '',
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/communityPublicityDetail?item=${encodeURIComponent(JSON.stringify(than.info))}&appId=${than.$store.state.app.appId}`,
imgUrl: than.info.coverPic || 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240710/617f7fb327064d89892823b81b11cd70.png',
success: function () {}
})
wx.updateTimelineShareData({
title: than.info.title,
desc: '',
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/communityPublicityDetail?item=${encodeURIComponent(JSON.stringify(than.info))}&appId=${than.$store.state.app.appId}`,
imgUrl: than.info.coverPic || 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240710/617f7fb327064d89892823b81b11cd70.png',
success: function () {}
})
});
} else {
wx.onMenuShareAppMessage({
title: 'e智社区',
desc: than.info.title,
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/communityPublicityDetail?item=${encodeURIComponent(than.info)}&appId=${than.$store.state.app.appId}`,
imgUrl: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240710/617f7fb327064d89892823b81b11cd70.png',
success: function () {}
})
wx.updateAppMessageShareData({
title: than.info.title || '讯息详情',
desc: '',
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/communityPublicityDetail?item=${encodeURIComponent(JSON.stringify(than.info))}&appId=${than.$store.state.app.appId}`,
imgUrl: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240710/617f7fb327064d89892823b81b11cd70.png',
success: function () {}
})
}
}
},

3
src/views/communityPublicity/index.vue

@ -101,7 +101,8 @@ export default {
tagId: this.tagId,
startTime: '',
endTime: '',
agencyId: this.agencyId
agencyId: this.agencyId,
status:1
}
let res = await communityPublicity(parm)
if (res.code === 0) {

3
src/views/home/index.vue

@ -303,7 +303,8 @@ export default {
tagId: this.tagId,
startTime: '',
endTime: '',
agencyId: this.agencyId
agencyId: this.agencyId,
status:1
}
let res = await communityPublicity(parm)
if (res.code === 0) {

Loading…
Cancel
Save