Browse Source

Merge branch 'xiaowang-feature' of http://120.46.222.128:10021/elink-star/epmet-wx-pa-chengyang into xiaowang-feature

feature
duanliangtao 10 months ago
parent
commit
59fb2020f0
  1. 1
      .env.development
  2. 87
      package-lock.json
  3. 1
      package.json
  4. 16
      src/api/activity.js
  5. 2
      src/api/home.js
  6. BIN
      src/assets/images/home/jianyi.png
  7. BIN
      src/assets/images/peoSuggestion/1.png
  8. BIN
      src/assets/images/peoSuggestion/daily.png
  9. BIN
      src/assets/images/peoSuggestion/special.png
  10. 6
      src/router/router.config.js
  11. 113
      src/utils/wgs84_to_gcj02.js
  12. 49
      src/views/activity/detail.vue
  13. 45
      src/views/activity/sing.vue
  14. 2
      src/views/event/index.vue
  15. 18
      src/views/home/index.vue
  16. 3
      src/views/livingCircle/index.vue
  17. 525
      src/views/peoSuggestion/index.vue
  18. 5
      src/views/register/index.vue
  19. 4
      vue.config.js

1
.env.development

@ -2,5 +2,4 @@ NODE_ENV='development'
# must start with VUE_APP_ # must start with VUE_APP_
VUE_APP_ENV = 'development' VUE_APP_ENV = 'development'
VUE_APP_BASE_URL = http://192.168.1.140/api' VUE_APP_BASE_URL = http://192.168.1.140/api'
# VUE_APP_BASE_URL = 'http://192.168.1.144/api'
outputDir = 'epmet-work-wx-dev' outputDir = 'epmet-work-wx-dev'

87
package-lock.json

@ -1985,6 +1985,27 @@
"whatwg-fetch": "^3.6.2" "whatwg-fetch": "^3.6.2"
}, },
"dependencies": { "dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"fs-extra": { "fs-extra": {
"version": "9.1.0", "version": "9.1.0",
"resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz",
@ -1996,6 +2017,26 @@
"jsonfile": "^6.0.1", "jsonfile": "^6.0.1",
"universalify": "^2.0.0" "universalify": "^2.0.0"
} }
},
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
} }
} }
}, },
@ -2159,47 +2200,6 @@
"integrity": "sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==", "integrity": "sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==",
"dev": true "dev": true
}, },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
},
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
}
},
"@vue/web-component-wrapper": { "@vue/web-component-wrapper": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz", "resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",
@ -3407,6 +3407,11 @@
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==",
"dev": true "dev": true
}, },
"coordtransform": {
"version": "2.1.2",
"resolved": "https://registry.npmmirror.com/coordtransform/-/coordtransform-2.1.2.tgz",
"integrity": "sha512-0xLJApBlrUP+clyLJWIaqg4GXE5JTbAJb5d/CDMqebIksAMMze8eAyO6YfHEIxWJ+c42mXoMHBzWTeUrG7RFhw=="
},
"copy-anything": { "copy-anything": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-2.0.6.tgz", "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-2.0.6.tgz",

1
package.json

@ -20,6 +20,7 @@
"@vue-office/pdf": "^1.0.0", "@vue-office/pdf": "^1.0.0",
"amfe-flexible": "^2.2.1", "amfe-flexible": "^2.2.1",
"axios": "^0.27.2", "axios": "^0.27.2",
"coordtransform": "^2.1.2",
"core-js": "^3.23.3", "core-js": "^3.23.3",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"eslint": "^8.12.0", "eslint": "^8.12.0",

16
src/api/activity.js

@ -15,6 +15,22 @@ export function detail(id) {
method: 'get', method: 'get',
}) })
} }
//取消报名
export function clockIn(data) {
return request({
url: '/voluntary/activitySignIn/clockIn',
method: 'post',
data
})
}
//发布实况
export function cancelSignUp1(id) {
return request({
url: `voluntary/activityApply/cancelSignUp/${id}`,
method: 'post',
})
}
//活动报名 //活动报名
export function activityApplySave(id) { export function activityApplySave(id) {
return request({ return request({

2
src/api/home.js

@ -37,7 +37,7 @@ export function icEventOldDiscuss(data) {
// 【办事指南】菜单 // 【办事指南】菜单
export function listAllCategory(data) { export function listAllCategory(data) {
return request({ return request({
url: `/govrnance/guide/list`, url: `/governance/guidecategory/page`,
method: 'post', method: 'post',
data data
}) })

BIN
src/assets/images/home/jianyi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

BIN
src/assets/images/peoSuggestion/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

BIN
src/assets/images/peoSuggestion/daily.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
src/assets/images/peoSuggestion/special.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

6
src/router/router.config.js

@ -125,6 +125,12 @@ export const constantRouterMap = [
component: () => import('@/views/activity/detail'), component: () => import('@/views/activity/detail'),
meta: { title: '活动详情', keepAlive: false } meta: { title: '活动详情', keepAlive: false }
}, },
{
path: '/peoSuggestion',
name: 'peoSuggestion',
component: () => import('@/views/peoSuggestion'),
meta: { title: '人民意见征集', keepAlive: false }
},
{ {
path: '/sing', path: '/sing',
name: 'sing', name: 'sing',

113
src/utils/wgs84_to_gcj02.js

@ -0,0 +1,113 @@
var x_PI = (3.14159265358979324 * 3000.0) / 180.0;
var PI = 3.1415926535897932384626;
var a = 6378245.0; //卫星椭球坐标投影到平面地图坐标系的投影因子。
var ee = 0.00669342162296594323; //椭球的偏心率。
//判断是否在国内,在中国国内的经纬度才需要做偏移
function out_of_china(lng, lat) {
return (
lng < 72.004 ||
lng > 137.8347 ||
(lat < 0.8293 || lat > 55.8271 || false)
);
}
//转化经度
function transformlng(lng, lat) {
var ret =
300.0 +
lng +
2.0 * lat +
0.1 * lng * lng +
0.1 * lng * lat +
0.1 * Math.sqrt(Math.abs(lng));
ret +=
((20.0 * Math.sin(6.0 * lng * PI) +
20.0 * Math.sin(2.0 * lng * PI)) *
2.0) /
3.0;
ret +=
((20.0 * Math.sin(lng * PI) +
40.0 * Math.sin((lng / 3.0) * PI)) *
2.0) /
3.0;
ret +=
((150.0 * Math.sin((lng / 12.0) * PI) +
300.0 * Math.sin((lng / 30.0) * PI)) *
2.0) /
3.0;
return ret;
}
//转化纬度
function transformlat(lng, lat) {
var ret =
-100.0 +
2.0 * lng +
3.0 * lat +
0.2 * lat * lat +
0.1 * lng * lat +
0.2 * Math.sqrt(Math.abs(lng));
ret +=
((20.0 * Math.sin(6.0 * lng * PI) +
20.0 * Math.sin(2.0 * lng * PI)) *
2.0) /
3.0;
ret +=
((20.0 * Math.sin(lat * PI) +
40.0 * Math.sin((lat / 3.0) * PI)) *
2.0) /
3.0;
ret +=
((160.0 * Math.sin((lat / 12.0) * PI) +
320 * Math.sin((lat * PI) / 30.0)) *
2.0) /
3.0;
return ret;
}
//wgs84 to gcj02 地球坐标系 转 火星坐标系
export function wgs84_to_gcj02(lng, lat) {
if (out_of_china(lng, lat)) {
return [lng, lat];
} else {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0);
var radlat = (lat / 180.0) * PI;
var magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat =
(dlat * 180.0) /
(((a * (1 - ee)) / (magic * sqrtmagic)) * PI);
dlng =
(dlng * 180.0) / ((a / sqrtmagic) * Math.cos(radlat) * PI);
var mglat = lat + dlat;
var mglng = lng + dlng;
return [mglng, mglat];
}
}
//gcj02 to wgs84 火星坐标系 转 地球坐标系
export function gcj02_to_wgs84(lng, lat) {
if (out_of_china(lng, lat)) {
return [lng, lat]
}
else {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI;
var magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
mglat = lat + dlat;
mglng = lng + dlng;
return [lng * 2 - mglng, lat * 2 - mglat]
}
}

49
src/views/activity/detail.vue

@ -165,7 +165,8 @@
</template> </template>
<script> <script>
import { activitySignIn,activityApply,addActivityRecord,cancelSignUp, detail, communityActivityApplicationRecordDelete,getById,activityApplySave} from "@/api/activity" import { activitySignIn,activityApply,addActivityRecord,cancelSignUp1, detail,
communityActivityApplicationRecordDelete,getById,activityApplySave} from "@/api/activity"
import Share from "@/components/Share" import Share from "@/components/Share"
import registerDialog from '@/components/registerDialog'; import registerDialog from '@/components/registerDialog';
import { setConfig } from '@/utils/jweixin' import { setConfig } from '@/utils/jweixin'
@ -225,20 +226,54 @@ export default {
// //
cancelSignUp() { cancelSignUp() {
Dialog.confirm({ Dialog.confirm({
title: '提示', title: '标题',
message: '确定取消报名吗?', message: '弹窗内容',
}) })
.then(() => { .then(() => {
cancelSignUp(this.data.activityId).then(res=>{ console.log("用户点击了确认");
cancelSignUp1(this.activityId).then(res => {
console.log(res, "取消报名返回结果");
if (res.code === 0) { if (res.code === 0) {
this.setData({ this.applyType = true; //
applyType:true this.$toast.success("取消报名成功"); //
}) } else {
this.$toast.fail(res.message || "取消报名失败");
} }
}) })
}) })
.catch(() => { .catch(() => {
console.log("取消");
}); });
// Dialog.confirm({
// title: '',
// message: '',
// })
// .then(() => {
// //
// console.log("");
// cancelSignUp1(this.data.activityId)
// .then(res => {
// console.log(res, "");
// if (res.code === 0) {
// this.applyType = true; //
// this.$toast.success(""); //
// } else {
// this.$toast.fail(res.message || "");
// }
// })
// .catch(error => {
// console.error("", error);
// this.$toast.fail("");
// })
// .finally(() => {
// // loading
// });
// })
// .catch(() => {
// //
// console.log("");
// });
}, },
// //
toApply() { toApply() {

45
src/views/activity/sing.vue

@ -3,20 +3,20 @@
<div class="content"> <div class="content">
<div class="card"> <div class="card">
<div class="title"> {{type==='sign'?'打卡描述':'实况描述'}}</div> <div class="title"> {{type==='sign'?'打卡描述':'实况描述'}}</div>
<textarea style="width: 100%; height: 300px; border: none; resize: none; margin-top: 10px;" v-model="content" bind:input="handelChangTextarea" placeholder="请输入500字以内" maxlength="500px"/> <textarea style="width: 100%; height: 260px; border: none; resize: none; margin-top: 10px;" v-model="content" bind:input="handelChangTextarea" placeholder="请输入500字以内" maxlength="500px"/>
</div> </div>
<div class="card"> <div class="card">
<div class="title">上传图片或视频</div> <div class="title">上传图片或视频</div>
<van-uploader v-model="fileList" :after-read="afterRead" :max-count="3" :max-size="10 * 1024 * 1024" /> <van-uploader v-model="fileList" :after-read="afterRead" :max-count="3" :max-size="10 * 1024 * 1024" style="margin-top: 10px;" />
</div> </div>
<div class="card flex flex-sb address flex-center-i"> <div class="card flex flex-sb address flex-center-i" style="margin-top: 20px;" >
<image src="../../../../images/icon/address.png" mode="" /> <image src="../../../../images/icon/address.png" mode="" />
<span class="flex-1">{{address}}</span> <span class="flex-1">{{address}}</span>
<van-icon name="replay" color="#0d957f"/> <van-icon name="replay" color="#0d957f"/>
</div> </div>
</div> </div>
<div class="bot-btn"> <div class="bot-btn">
<van-button slot="button" size="small" type="primary" round color="#f53e1f" bind:tap="submit"> <van-button style="width: 120px; margin-top: 20px;" slot="button" size="small" type="primary" round color="#f53e1f"@click="submit">
{{type==='sign'?'打卡签到':'发布实况'}} {{type==='sign'?'打卡签到':'发布实况'}}
</van-button> </van-button>
</div> </div>
@ -26,7 +26,7 @@
</template> </template>
<script> <script>
import { activitySignIn,activityApply,addActivityRecord,cancelSignUp, detail, communityActivityApplicationRecordDelete,getById,activityApplySave} from "@/api/activity" import {clockIn,activitySignIn,activityApply,addActivityRecord,cancelSignUp, detail, communityActivityApplicationRecordDelete,getById,activityApplySave} from "@/api/activity"
import Share from "@/components/Share" import Share from "@/components/Share"
import registerDialog from '@/components/registerDialog'; import registerDialog from '@/components/registerDialog';
import { setConfig } from '@/utils/jweixin' import { setConfig } from '@/utils/jweixin'
@ -37,6 +37,7 @@ import {mapKey} from '@/config'
export default { export default {
data() { data() {
return { return {
content:"",
address:"", address:"",
fileList: [], fileList: [],
applyedTimeType:false, applyedTimeType:false,
@ -65,6 +66,7 @@ export default {
}, },
async mounted() { async mounted() {
// //
this.geolocation = new qq.maps.Geolocation(mapKey, 'myapp') this.geolocation = new qq.maps.Geolocation(mapKey, 'myapp')
// //
@ -83,6 +85,39 @@ export default {
} }
}, },
methods: { methods: {
//
submit(){
if (!this.content || this.content==='undefined') {
Dialog.alert({
// title: '',
message: '实况描述不能为空',
}).then(() => {
return
});
}
if (!this.fileList) {
Dialog.alert({
// title: '',
message: '请上传图片或视频',
}).then(() => {
return
});
}
let parm = {
activityId: this.activityId,
address: this.address,
content: this.content,
longitude: this.longitude,
latitude: this.latitude,
attrs: this.fileList
}
clockIn(parm).then(res => {
if (res.code === 0) {
}
}).catch(err => {
console.log(err);
})
},
getMyLocation() { getMyLocation() {
this.geolocation.getLocation(this.showPosition, this.errorPosition) // this.geolocation.getLocation(this.showPosition, this.errorPosition) //
}, },

2
src/views/event/index.vue

@ -77,6 +77,7 @@ import appeal from '@/views/appeal'
import {uploadvariedfile} from '@/api/basic' import {uploadvariedfile} from '@/api/basic'
import {saveOfficialAccountEvent,checkAreaPoint,getCategoryTree} from '@/api/event' import {saveOfficialAccountEvent,checkAreaPoint,getCategoryTree} from '@/api/event'
import {mapKey} from '@/config' import {mapKey} from '@/config'
import { wgs84_to_gcj02 } from "@/utils/wgs84_to_gcj02"
export default { export default {
name: 'event', name: 'event',
@ -178,6 +179,7 @@ export default {
}, },
// //
showPosition(position) { showPosition(position) {
// const1= wgs84_to_gcj02(Number(position.lng),Number(position.lat));
this.longitude = position.lng this.longitude = position.lng
this.latitude = position.lat this.latitude = position.lat
this.address = position.city + position.addr this.address = position.city + position.addr

18
src/views/home/index.vue

@ -52,6 +52,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="flex flex-center1 flex-center2 m-top10">
<img style="width: 400px;" src="../../assets/images/home/jianyi.png" @click="topeoSuggestion"></img>
</div >
<div class="card m-top10"> <div class="card m-top10">
<div class="title"> <div class="title">
<div class="flex flex-center2"> <div class="flex flex-center2">
@ -65,12 +68,16 @@
<div style="width: 100px; height: 100px;" <div style="width: 100px; height: 100px;"
class="flex-y flex flex-center1 flex-center2 font-size13 " class="flex-y flex flex-center1 flex-center2 font-size13 "
v-for="(item, index) in activityList" :key="index"> v-for="(item, index) in activityList" :key="index">
<div class="img_100" :style="{ backgroundImage: `url(${item.imgs})` }" @click="$router.push({name:'activityDetail',query:{id:item.id}})"> <div class="img_100" :style="{ backgroundImage: `url(${item.imgs})` }"
@click="$router.push({name:'activityDetail',query:{id:item.id}})">
<div class="content-wrapper"> <div class="content-wrapper">
<!-- 顶部图片 --> <!-- 顶部图片 -->
<img v-if="index==0" style="height: 23px; width: 60px;" src="@/assets/images/home/how1.png" /> <img v-if="index==0" style="height: 23px; width: 60px;"
<img v-if="index==1" style="height: 23px; width: 80px;" src="@/assets/images/home/how2.png" /> src="@/assets/images/home/how1.png" />
<img v-if="index==2" style="height: 23px; width: 80px;" src="@/assets/images/home/how3.png" /> <img v-if="index==1" style="height: 23px; width: 80px;"
src="@/assets/images/home/how2.png" />
<img v-if="index==2" style="height: 23px; width: 80px;"
src="@/assets/images/home/how3.png" />
<!-- 底部标题 --> <!-- 底部标题 -->
<div class="title1">{{ item.title }}111</div> <div class="title1">{{ item.title }}111</div>
</div> </div>
@ -371,6 +378,9 @@ export default {
this.$router.push({name:'dynamic',query:{id:item.id}}) this.$router.push({name:'dynamic',query:{id:item.id}})
}, },
topeoSuggestion(){
this.$router.push({name:'peoSuggestion'})
},
async querystaffmessage(){ async querystaffmessage(){
let parm = { let parm = {
agencyId: this.agencyId, agencyId: this.agencyId,

3
src/views/livingCircle/index.vue

@ -39,8 +39,11 @@
<script> <script>
import {Popup } from '@/plugins/vant' import {Popup } from '@/plugins/vant'
import coordtransform from 'coordtransform'
import Map from '@/components/Map' import Map from '@/components/Map'
import { sphereLifeSearchList } from '@/api/lingCircle'; import { sphereLifeSearchList } from '@/api/lingCircle';
import { wgs84_to_gcj02 } from "../../utils/wgs84_to_gcj02";
export default { export default {
data() { data() {
return { return {

525
src/views/peoSuggestion/index.vue

@ -0,0 +1,525 @@
<template>
<div>
<div class="flex flex-mean" style="background-color: #FFFFFF; height: 150px;">
<!-- <van-search class=".flex flex-1" v-model="searchValue" left-icon="" shape="round" placeholder="请输入搜索关键词" />
<van-button round type="info" class="custom-button font-size13 m-top10 m-right12" @click="onSearch()">查询</van-button> -->
<!-- <van-image src="../../assets/images/servicePhone/" /> -->
<img src="../../assets/images/peoSuggestion/1.png" style="width: 100%; height:300px ;" />
</div>
<div class='container' style="position: relative;top: -35px;">
<div class="flex flex-x flex-end">
<img src="../../assets/images/peoSuggestion/special.png" style="width: 180px;">
<img src="../../assets/images/peoSuggestion/daily.png" style="width: 180px;">
</div>
</div>
<div class='container' style="position: relative;top: -40px;">
<div class="card">
<div class="title">
<div class="flex flex-center2">
<img style="height:20px;" src="@/assets/images/home/biaoqian.png" alt="">
<span class="m-left5" style=" color: black; font-family:pingfang-bold;
font-size: 20px;">最新专题 </span>
</div>
<span @click="$router.push('/activity')">更多</span>
</div>
<div class="activity_content flex m-top10" v-for="(item, index) in eventList" :key="index"
@click="$router.push({ path: `/discusionDetail`, query: { eventId: item.eventId } })">
<div class="flex flex-y flex1 flex-end" style="overflow: hidden;">
<span class="van-multi-ellipsis--l2">
{{ item.title }}
</span>
<div class="flex flex-end flex-end gray m-top10 font-size13">
<div class="flex flex-center">
<span>{{ item.total }} 人参与 </span>
</div>
<div class="flex flex-x">
<div class="flex flex-center">
<span> {{ item.data }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='container' style="position: relative;top: -50px;">
<div class="card">
<div class="title">
<div class="flex flex-center2">
<img style="height:20px;" src="@/assets/images/home/biaoqian.png" alt="">
<span class="m-left5" style=" color: black; font-family:pingfang-bold;
font-size: 20px;">金点子 </span>
</div>
<span @click="$router.push('/activity')">更多</span>
</div>
<van-tabs v-model="tagActive" style="width: 100%;" @change="handelChangeTags" :title-style="titleStyle" title-class="custom-title-class">
<van-tab v-for="item in tagList" :key="item.id" :title="item.tagName">
</van-tab>
</van-tabs>
<div class="activity_content flex m-top10" v-for="(item, index) in eventList" :key="index"
@click="$router.push({ path: `/discusionDetail`, query: { eventId: item.eventId } })">
<div class="flex flex-y flex1 flex-end" style="overflow: hidden;">
<span class="van-multi-ellipsis--l2">
{{ item.title }}
</span>
<div class="flex flex-end flex-end gray m-top10 font-size13">
<div class="flex flex-center">
<span>{{ item.total }} 人参与 </span>
</div>
<div class="flex flex-x">
<div class="flex flex-center">
<span> {{ item.data }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<Android @send-number="handleNumber" />
</div>
</template>
<script>
import { activitySignIn,activityApply,addActivityRecord,cancelSignUp1, detail,
communityActivityApplicationRecordDelete,getById,activityApplySave} from "@/api/activity"
import Share from "@/components/Share"
import registerDialog from '@/components/registerDialog';
import { setConfig } from '@/utils/jweixin'
import { Toast, Dialog } from 'vant'
export default {
data() {
return {
titleStyle: {
color: "#007FF1", //
fontSize: "16px", //
},
tagList:[{
id:"1",
tagName:"标签1"
},
{
id:"2",
tagName:"标签1"
},
{
id:"3",
tagName:"标签1"
}],
eventList:[{
title:"70岁以上高龄老人补贴发放定在1月1日",
total:1,
data:"2000-00-00 13:00:00"
},
{
title:"70岁以上高龄老人补贴发放定在1月1日",
total:1,
data:"2000-00-00 13:00:00"
}],
applyedTimeType:false,
ActName:"",
info: null,
signInList: [],
applyType: false,
activityId: null,
realTimeList: [],
projectList: [],
realTimeList:[],
signInList:[],
applyList:[],
activityList: [],
signUp: [
{ name: "", mobile: "", remark: "" },
],
info: {},
isPast: false,
showShare: false,
showRegister: false,
phone:""
};
},
created() {
},
async mounted() {
setConfig(['updateAppMessageShareData', 'onMenuShareAppMessage', 'updateTimelineShareData'])
if (this.$route.query.id) {
this.activityId= this.$route.query.id
await this.detail(this.$route.query.id)
if(this.$route.query.flag === 'share'){
await this.getById(this.$route.query.id)
}
await this.share()
this.activityApplyList()
this.activitySignIn(1)
this.activitySignIn(0)
}
},
methods: {
toSign(e) {
console.log(e.currentTarget.dataset, "e.currentTarget.dataset ");
this.$router.push({ path: `/sing`, query: { id: this.activityId,type:e.currentTarget.dataset.type } });
// wx.navigateTo({
// url: `/subpages/activity/pages/sign/sign?activityId=${this.data.activityId}&type=${e.currentTarget.dataset.type}&latitude=${e.currentTarget.dataset.latitude}&longitude=${e.currentTarget.dataset.longitude}`,
// })
},
//
cancelSignUp() {
Dialog.confirm({
title: '标题',
message: '弹窗内容',
})
.then(() => {
console.log("用户点击了确认");
cancelSignUp1(this.activityId).then(res => {
console.log(res, "取消报名返回结果");
if (res.code === 0) {
this.applyType = true; //
this.$toast.success("取消报名成功"); //
} else {
this.$toast.fail(res.message || "取消报名失败");
}
})
})
.catch(() => {
console.log("取消");
});
// Dialog.confirm({
// title: '',
// message: '',
// })
// .then(() => {
// //
// console.log("");
// cancelSignUp1(this.data.activityId)
// .then(res => {
// console.log(res, "");
// if (res.code === 0) {
// this.applyType = true; //
// this.$toast.success(""); //
// } else {
// this.$toast.fail(res.message || "");
// }
// })
// .catch(error => {
// console.error("", error);
// this.$toast.fail("");
// })
// .finally(() => {
// // loading
// });
// })
// .catch(() => {
// //
// console.log("");
// });
},
//
toApply() {
console.log("dsklfjklsf");
Dialog.confirm({
title: '提示',
message: '您确定要报名吗?',
})
.then(() => {
activityApplySave(this.activityId).then(res => {
console.log(res,"sdflkjlsfjd");
Dialog.alert({
// title: '',
message: '报名成功',
})
// wx.showToast({
// title: '',
// duration: 2000,
// success: () => {
// setTimeout(() => {
// wx.navigateBack()
// }, 2000)
// }
// })
}).catch(err => {
console.log(err);
})
})
.catch(() => {
// on cancel
});
},
share() {
let than = this
if (wx.updateAppMessageShareData) {
wx.ready(function () {
wx.updateAppMessageShareData({
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}&flag=share`,
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.activityName,
desc: '',
link: `https://epmet-preview.elinkservice.cn/epmet-wx-pa/#/activityDetail?id=${than.$route.query.id}&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: 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}`,
imgUrl: than.info.coverPic || 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240710/617f7fb327064d89892823b81b11cd70.png',
success: function () {}
})
}
},
//
activitySignIn(whether) {
let parm = {
pageNo: 1,
pageSize: 100,
activityId: this.activityId,
whether: whether
}
activitySignIn(parm).then(res => {
if (res.code === 0) {
if (whether === 1) {
this.signInList=res.data.list
} else {
this.realTimeList=res.data.list
}
}
}).catch(err => {
})
},
//
activityApplyList() {
let parm = {
pageNo: 1,
pageSize: 100,
activityId: this.activityId
}
activityApply(parm).then(res => {
if (res.code === 0) {
this.applyList=res.data.list
}
}).catch(err => {
})
},
handleNumber(value){
console.log(value,"wl kgnsl, ");
this.phone=value
},
checkIfPast() {
const currentTimestamp = Date.now();
const specifiedTimestamp = new Date(this.info.cutOffTime.replace(/-/g, '/')).getTime();
this.isPast = specifiedTimestamp < currentTimestamp;
},
//
async detail(id, delId) {
const handleResponse = (res) => {
if (res.code === 0) {
this.info = res.data;
this.info.signInTime=res.data.signInTime.slice(0, 16),
this.info.signOutTime=res.data.signOutTime.slice(0, 16),
console.log(this.info,"wl info");
// this.applyType = res.data.applyed === 0 ? true : false,
this.applyedTimeType = this.isCurrentTimeBefore(res.data.deadline),
console.log(this.applyedTimeType,"sdfkjdskfl");
this.signOutTimeType = this.isCurrentTimeBetween(res.data.signInTime, res.data.signOutTime)
// 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 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: "", })
},
isCurrentTimeBetween(startTime, endTime) {
const current = new Date().getTime();
const startTimestamp = new Date(startTime).getTime();
const endTimestamp = new Date(endTime).getTime();
return current >= startTimestamp && current <= endTimestamp;
},
isCurrentTimeBefore(targetTime) {
const current = new Date().getTime();
const targetTimestamp = new Date(targetTime).getTime();
return current < targetTimestamp;
},
handelDelResi(item, index) {
if (item.id) {
let than = this
communityActivityApplicationRecordDelete([item.id]).then(res => {
if (res.code === 0) {
than.detail(this.$route.query.id, item.id);
}
}).catch(err => {
console.log(err);
})
} else {
this.signUp.splice(index, 1)
}
},
async save() {
if (this.$store.state.app.userInfo.mobile) {
this.signUp.forEach((item) => {
item.activityId = this.info.id;
item.applicationId = this.$store.state.app.userInfo.id;
item.customerId = this.$store.state.app.userInfo.customerId;
})
if(this.signUp.findIndex(item=>!item.name) != -1){
this.$toast('人员姓名不能为空')
return
}
if(this.signUp.findIndex(item=>!item.mobile) != -1){
this.$toast('联系电话不能为空')
return
}
let parm = {
formDTOList: this.signUp
}
let res = await addActivityRecord(parm)
if (res.code === 0) {
this.$toast.success(res.data)
this.signUp = [{ name: "", mobile: "", remark: "" }]
this.detail(this.$route.query.id)
}
} else {
this.showRegister = true;
}
},
},
components: { Share, registerDialog },
computed: {
disabledRecord() {
return (item) => {
if (!item.cutOffTime || item.online != 1) return true
let flag = new Date(item.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || item.currentParticipants >= item.participants || item.currentParticipants >= item.participants;
return flag || false
}
},
},
watch: {},
}
</script>
<style lang='less' scoped>
.phone{
height: 50px;
bottom:8vh;
}
:deep img{
max-width: 100%;
}
:deep(.p0>.van-cell) {
padding: 0;
}
:deep(.van-cell) {
padding: 16px 8px;
}
:deep(.van-cell__title) {
color: #666666;
display: flex;
&>span {
flex: 1;
}
}
:deep(.van-cell__value) {
text-align: left;
}
:deep(.van-cell--required) {
&::before {
left: -5px;
}
}
.activity_content{
padding-bottom: 15px;
box-sizing: border-box;
width: 100%;
border-bottom: 1px solid #EAEAEA;
margin-top: 14px;
.img{
width: 231px;
height: 33px;
}
&:last-child{
border-bottom: none;
}
}
/* 基础标签样式 */
::v-deep .custom-title-class {
border: 1px solid #007FF1; /* 设置边框颜色 */
border-radius: 16px; /* 圆角边框 */
padding: 4px 12px; /* 内边距 */
background-color: transparent; /* 默认背景透明 */
color: #007FF1; /* 默认文字颜色 */
font-size: 14px;
}
/* 激活状态的标签样式 */
::v-deep .van-tab--active .custom-title-class {
background-color: #e6f2ff; /* 激活背景色 */
color: #007FF1; /* 激活文字颜色 */
font-weight: bold; /* 加粗字体 */
}
</style>

5
src/views/register/index.vue

@ -25,7 +25,7 @@
<span v-else class="blue">{{ time }}s后重试</span> <span v-else class="blue">{{ time }}s后重试</span>
</template> </template>
</van-field> </van-field>
<van-button block class="button" type="info" round @click="submit">提交</van-button> <van-button block class="button" type="info" round @click="submitA">提交</van-button>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
@ -71,6 +71,9 @@ export default {
this.idNum = this.$store.state.app.userInfo.idNum; this.idNum = this.$store.state.app.userInfo.idNum;
this.gender = this.userInfo.gender; this.gender = this.userInfo.gender;
this.realName = this.userInfo.realName || this.userInfo.nickname this.realName = this.userInfo.realName || this.userInfo.nickname
},
submitA(){
}, },
submit() { submit() {
let params = { let params = {

4
vue.config.js

@ -32,8 +32,8 @@ module.exports = defineConfig({
//配置跨域 //配置跨域
'/api': { '/api': {
// target: `https://epmet-preview.elinkservice.cn`, // target: `https://epmet-preview.elinkservice.cn`,
// target: `http://219.146.91.110:30801`, target: `http://219.146.91.110:30801`,
target: `http://192.168.1.140`, // target: `http://192.168.1.140`,
// target: `http://127.0.0.1:8080`, // target: `http://127.0.0.1:8080`,
changeOrigin: true, changeOrigin: true,
ws: false, ws: false,

Loading…
Cancel
Save