Browse Source

人民意见征集

xiaowang-feature
是小王呀\24601 9 months ago
parent
commit
f2feed8bcf
  1. 3
      package.json
  2. 17
      src/api/reservationService.js
  3. 6
      src/components/Share/index.vue
  4. 2
      src/router/router.config.js
  5. 68
      src/utils/jweixin.js
  6. 20
      src/views/peoSuggestion/explain.vue
  7. 37
      src/views/peoSuggestion/index.vue
  8. 8
      src/views/peoSuggestion/topicListDetail.vue
  9. 130
      src/views/serviceList/reservationService.vue

3
package.json

@ -1,5 +1,5 @@
{
"name": "epmet-wx-pa",
"name": "epmet-wx-pa-140-proxy",
"version": "1.0.0",
"description": "",
"author": "",
@ -28,6 +28,7 @@
"eslint-plugin-vue": "^8.4.0",
"filemanager-webpack-plugin": "^8.0.0",
"html-webpack-plugin": "^5.5.3",
"jweixin-module": "^1.6.0",
"less-loader": "^11.1.0",
"postcss-pxtorem": "^6.0.0",
"qrcodejs2": "0.0.2",

17
src/api/reservationService.js

@ -5,4 +5,19 @@ export function userdemandAdd(data) {
method: 'post',
data
})
}
}
export function residentBaseInfo(data) {
return request({
url: `/actual/base/residentBaseInfo/page`,
method: 'post',
data
})
}
export function agencygridtree(data) {
return request({
url: `/gov/org/customeragency/agencygridtree`,
method: 'post',
data
})
}

6
src/components/Share/index.vue

@ -8,9 +8,8 @@
</div>
</template>
<script>
import { setConfig } from '@/utils/jweixin'
export default {
name: 'SvgIcon',
data() {
@ -26,7 +25,8 @@ export default {
},
},
created(){
console.log("sdlkfjlsdf");
setConfig(['updateAppMessageShareData', 'onMenuShareAppMessage', 'updateTimelineShareData'])
},
computed: {

2
src/router/router.config.js

@ -6,7 +6,7 @@ export const constantRouterMap = [
{
path: '/',
name: 'home',
component: () => import('@/views/peoSuggestion'),
component: () => import('@/views/home'),
meta: { title: '首页', keepAlive: false }
},
{

68
src/utils/jweixin.js

@ -1,15 +1,69 @@
import { getAutograph } from '@/api/basic'
import { getAutograph } from '@/api/basic';
export const setConfig = function (jsApiList = []) {
getAutograph({ url: location.href.split('#')[0] }).then(res => {
console.log(res)
wx.config({
debug: false,
appId: res.data.appId,
timestamp: res.data.timestamp,
nonceStr: res.data.nonceStr,
signature: res.data.signature,
jsApiList,
openTagList:['wx-open-launch-weapp']
})
})
}
openTagList: ['wx-open-launch-weapp'], // 使用开放标签
// jsApiList: jsApiList // 动态传入需要使用的 JS 接口
jsApiList: [
'updateAppMessageShareData',
'updateTimelineShareData'
]
});
wx.ready(function(){
wx.updateAppMessageShareData({
title: '城阳社会工作人民意见征集', // 分享标题
desc: '倾听民声,汇集民智,期待您的好建议、金点子。', // 分享描述
link: 'https://epmet-test.elinkservice.cn', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/prod/internal/20241125/34366b70362646bdb13a88c3b94e7ad7.jpg', // 分享图标
success: function () {
console.log("设置成功");
// 设置成功
},
});
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
});
// wx.checkJsApi({
// jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareTimeline', 'onMenuShareAppMessage'],
// success: function (res) { }
// });
// const title = "sdklfjlksdf";
// const urlLink = "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/prod/internal/20241125/477d7f76b5c743d8a0de64d16be2cf8b.jpg";
// const imgUrl = "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/prod/internal/20241125/477d7f76b5c743d8a0de64d16be2cf8b.jpg"
// 必须放在 wx.ready 中调用微信接口
// wx.ready(() => {
// const shareData = {
// link: urlLink,
// title: title,
// imgUrl: imgUrl,
// // desc: weixinSummary
// };
// const shareDateLine = {
// link: urlLink,
// title: title,
// imgUrl: imgUrl
// }
// wx.onMenuShareTimeline(shareDateLine);
// wx.onMenuShareAppMessage(shareData);
// wx.updateAppMessageShareData(shareData);
// wx.updateTimelineShareData(shareDateLine);
// // 捕获 wx.config 配置失败
// wx.error((err) => {
// console.error('wx.config 失败!', err);
// });
// });
});
};
// // 使用配置
// setConfig([
// 'updateAppMessageShareData', // 分享到好友
// 'onMenuShareAppMessage', // 老版分享接口(兼容性)
// 'updateTimelineShareData', // 分享到朋友圈
// 'onMenuShareTimeline', // 老版朋友圈分享接口(兼容性)
// ]);

20
src/views/peoSuggestion/explain.vue

@ -39,7 +39,9 @@ import { Toast, Dialog } from 'vant'
export default {
data() {
return {
title:"",
subjectContent:"",
id:""
};
},
@ -47,17 +49,29 @@ export default {
},
async mounted() {
if (this.$route.query.title) {
if (this.$route.query.id) {
this.title = this.$route.query.title
this.subjectContent = this.$route.query.subjectContent
this.id = this.$route.query.id
}
console.log(this.$route.query.subjectContent, this.$route.query.id,this.$route.query.title);
},
methods: {
//
onClickdaily(){
this.$router.push({path:`solicitationDaily`})
if (this.id) {
this.$router.push({
path: `SpecialsolicitationFill`, query: {
title: this.title, subjectContent: this.title, id: this.id
}
},)
}else{
this.$router.push({path:`solicitationDaily`})
}
},

37
src/views/peoSuggestion/index.vue

@ -172,14 +172,47 @@ export default {
created() {
},
async mounted() {
// setConfig(['updateAppMessageShareData', 'onMenuShareAppMessage', 'updateTimelineShareData'])
const currentUrl = window.location.href;
//
this.generateQRCode(currentUrl);
// this.share(window.location.href)
this.icEventSpecialSubject()
this.icEventSpecialSubjectGold()
this.ideaList()
},
methods: {
// share() {
// let than = this
// if (wx.updateAppMessageShareData) {
// wx.ready(function () {
// wx.updateAppMessageShareData({
// title: than.info.title || '',
// desc: '',
// link: `window.location.href`,
// 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=${than.detailId}&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.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 () {}
// })
// }
// },
//tabs
onClickTab(){
console.log(this.tagActive,"sdklfds;lf");
@ -204,7 +237,8 @@ export default {
subjectTitle:"",
goldenIdeaFlag:0,
agencyId:"",
reportUserId:""
reportUserId:"",
status:1
}
let res = await icEventSpecialSubject(parm)
if (res.code === 0) {
@ -334,6 +368,7 @@ export default {
this.showShare = false
},
onClickShare() {
setConfig(['updateAppMessageShareData', 'onMenuShareAppMessage', 'updateTimelineShareData'])
this.showShare = true
console.log(this.showShare);

8
src/views/peoSuggestion/topicListDetail.vue

@ -5,7 +5,7 @@
<h2>{{ ProblemDescription.subjectTitle }}</h2>
<div class="m-bottom5">{{ ProblemDescription.subjectContent }}</div>
<div class="font-size13 gray">{{ ProblemDescription.updatedTime }}</div>
<div class="image-grid" v-for="item in ProblemDescription.imageList" >
<div class="image-grid" v-for="item in ProblemDescription.attachmentList" >
<div class="grid-item ">
<img :src="item" style="width: 105px; height: 75px;">
</div>
@ -36,8 +36,8 @@
反对
</van-button>
</div> -->
<div class="flex flex-center1 ">
<van-button block color="linear-gradient(to right, #81B5FB, #3E92FF)" style="width: 300px;" round @click="onClickdaily">我要征集</van-button>
<div class="flex flex-center1 " style="position: fixed; bottom: 10px; left: 10px;">
<van-button block color="linear-gradient(to right, #81B5FB, #3E92FF)" style="width: 300px;" round @click="onClickdaily">开始填写</van-button>
</div>
</div>
<Android/>
@ -86,7 +86,7 @@ export default {
},
methods: {
onClickdaily(){
this.$router.push({path:'explainSpecial',query: { title:this.ProblemDescription.subjectTitle,
this.$router.push({path:'peoSuggestionexplain',query: { title:this.ProblemDescription.subjectTitle,
subjectContent: this.ProblemDescription.subjectContent,id:this.eventId
} })
},

130
src/views/serviceList/reservationService.vue

@ -9,10 +9,14 @@
<div class="textarea"> <van-field v-model="formData.content" autosize label="诉求描述" maxlength="500"
placeholder="不超过500字" required rows="6" type="textarea">
</van-field></div>
<van-field required label="需求人" v-model="formData.reportUserName" placeholder="请输入" />
<van-field required label="身份证号" v-model="formData.idNum" placeholder="请输入" @blur="onInputBlur" />
<van-field v-if="showRegistered" required label="需求人" v-model="formData.name" placeholder="请输入" />
<template>
<van-field required label="联系电话" v-model="formData.reportUserMobile" placeholder="请输入" />
<van-field v-if="showRegistered" required label="联系电话" v-model="formData.mobile"
placeholder="请输入" />
</template>
<van-field v-model="fieldValue" is-link readonly label="地区" placeholder="请选择所在地区"
@click="showgridId = true" />
</div>
</div>
<van-popup v-model="showserviceTime" position="bottom">
@ -24,20 +28,23 @@
<van-button style="width: 200px;" round block @click="submit"
color="linear-gradient(to right, #81B5FB, #3E92FF)">提交</van-button>
</div>
<van-popup v-model="showgridId" round position="bottom">
<van-cascader v-model="cascaderValue" title="请选择所在地区" :options="options" @close="showgridId = false"
@finish="onFinish" />
</van-popup>
</div>
</template>
<script>
import dayjs from 'dayjs'
import { userdemandAdd } from '@/api/reservationService';
import { userdemandAdd,residentBaseInfo,agencygridtree} from '@/api/reservationService';
import Picker from '@/components/Picker'
import Perfect from '@/components/Perfect'
export default {
data() {
return {
options:[],
formData:{
finishAttachments: [],
reportTime:dayjs().format('YYYY-MM-DD HH:mm:ss'),
@ -49,10 +56,73 @@ export default {
demandUserName: "",//
reportUserMobile: "",//
reportUserName:"",//
demandUserId:"" //id
demandUserId:"", //id
idNum:"",
nationality:"0",
idType:1,
mobile:"",
name:"",
gridId:"",
villageId:"",
buildId:"",
unitId:"",
homeId:"",
},
baseInfoDto:{
idNum:"",
name:"",
nationality:"0",
},
resideInfoDtos: {
agencyId: "1844966002506010626",
agencyName
:
"市北区",
buildId
:
"1846068032825708545",
currentResidence
:
null,
gridId
:
"1844966092251533313",
homeId
:
"1846112470167965697",
houseHolderRel
:
null,
householdSituation
:
null,
moveOutFlag
:
null,
orgOptions
:
[],
outOfTime
:
null,
placeOfDomicile
:
null,
resiHouseRel
:
null,
unitId
:
"1846068032834097154",
villageId
:
"1846014725230940162",
},
minDate: new Date(2020, 0, 1),
maxDate: new Date(2025, 10, 1),
currentDate: "请选择",
@ -63,6 +133,8 @@ export default {
ServiceProject:"",
eventContent:"",
customerId:"",
showRegistered:false,
showgridId:false,
// activeId: 1,
// activeIndex: 0,
// items: [{ text: ' 1', children: [{ text: '', id: 2, },{ text: '', id: 1, },{ text: '', id: 3, }] }, { text: ' 2', children: [] }],
@ -84,7 +156,7 @@ export default {
},
mounted() {
console.log(this.$store.state.app,"sdkljsdfkl");
this.getOrgTreeList()
console.log(this.$store.state.app.userInfo.id,this.$store.state.app.userInfo.id,"dsklfjklsd");
this.formData.gridId =this.$store.state.app.userInfo.id;
this.formData.demandUserId = this.$store.state.app.userInfo.id;
@ -101,6 +173,50 @@ export default {
},
methods: {
//
getOrgTreeList() {
agencygridtree({}).then(res=>{
console.log("sdvj;lvxkl;",res);
})
// this.$http
// .post("gov/org/customeragency/agencygridtree", {})
// .then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg);
// } else {
// this.orgOptions = [];
// this.orgOptions.push(res.data);
// }
// })
// .catch(() => {
// return this.$message.error("");
// });
},
onInputBlur() {
console.log('输入完成,当前值为:', this.formData.idNum);
//
if (!this.validateIdNumber(this.formData.idNum)) {
this.$toast.fail('请输入有效的身份证号');
}
const parms={
idNum:this.formData.idNum,
pageSize:10,
pageNo:1
}
residentBaseInfo(parms).then(res=>{
console.log(res,"sdgljvsd");
if (res.data.total==0) {
this.showRegistered=true
}
})
},
validateIdNumber(idNum) {
//
const idCardRegex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9Xx])$/;
return idCardRegex.test(idNum);
},
submit() {
this.formData.demandUserName = this.formData.reportUserName
const parms={

Loading…
Cancel
Save