|
@@ -0,0 +1,700 @@
|
|
|
+<!--<template>-->
|
|
|
+<!-- <div class="app-body-white">-->
|
|
|
+<!-- <div class="form-box form-box-label-width">-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">社区名称</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="communityName"-->
|
|
|
+<!-- placeholder="请选择社区"-->
|
|
|
+<!-- @click="chose = true"-->
|
|
|
+<!-- readonly-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <i class="iconfont icon-down"></i>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">活动名称</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.activityName"-->
|
|
|
+<!-- placeholder="请输入活动名称"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">活动类型</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- placeholder="请选择类型"-->
|
|
|
+<!-- @click="choseActiveType = true"-->
|
|
|
+<!-- v-model="activeTypeName"-->
|
|
|
+<!-- readonly-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <!– <van-popup v-model="choseActiveType" round position="bottom">–>-->
|
|
|
+<!-- <!– <van-picker–>-->
|
|
|
+<!-- <!– show-toolbar–>-->
|
|
|
+<!-- <!– @confirm="(value) => typeConfirm(value)"–>-->
|
|
|
+<!-- <!– @cancel="chose = false"–>-->
|
|
|
+<!-- <!– />–>-->
|
|
|
+<!-- <!– </van-popup>–>-->
|
|
|
+<!-- <i class="iconfont icon-down"></i>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">参与可得</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="number"-->
|
|
|
+<!-- placeholder="请输入积分值"-->
|
|
|
+<!-- v-model="form.integral"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+
|
|
|
+<!-- <div class="upload-group">-->
|
|
|
+<!-- <div class="video-name">-->
|
|
|
+<!-- 主题图片 <span>(支持图片上传限20M内,最多6张)</span>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <van-uploader-->
|
|
|
+<!-- v-model="fileList"-->
|
|
|
+<!-- :max-count="6"-->
|
|
|
+<!-- :after-read="afterRead"-->
|
|
|
+<!-- :before-delete="beforeDelete"-->
|
|
|
+<!-- multiple-->
|
|
|
+<!-- class="upload-style"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">联系电话</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.activityPhone"-->
|
|
|
+<!-- placeholder="请输入联系电话"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">举办方</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.activitiesNotice"-->
|
|
|
+<!-- placeholder="请输入活动举办"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">活动内容</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <van-field-->
|
|
|
+<!-- v-model="form.activityContent"-->
|
|
|
+<!-- style="padding: 0px"-->
|
|
|
+<!-- autosize-->
|
|
|
+<!-- rows="4"-->
|
|
|
+<!-- type="textarea"-->
|
|
|
+<!-- placeholder="请输入内容"-->
|
|
|
+<!-- ></van-field>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">活动开始</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div-->
|
|
|
+<!-- class="date-selcet-box"-->
|
|
|
+<!-- @click="activityStartDateShow = true"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.activityStartTime"-->
|
|
|
+<!-- placeholder="请选择活动开始时间"-->
|
|
|
+<!-- disabled-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <img src="@/assets/image/date-icon.png" alt="" />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">活动结束</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div-->
|
|
|
+<!-- class="date-selcet-box"-->
|
|
|
+<!-- @click="activityEndDateShow = true"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.activityEndTime"-->
|
|
|
+<!-- placeholder="请选择活动结束时间"-->
|
|
|
+<!-- disabled-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <img src="@/assets/image/date-icon.png" alt="" />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">活动地址</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.activityAddress"-->
|
|
|
+<!-- placeholder="请输入活动地址"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">报名条件</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <van-field-->
|
|
|
+<!-- v-model="form.registrationConditions"-->
|
|
|
+<!-- style="padding: 0px"-->
|
|
|
+<!-- autosize-->
|
|
|
+<!-- rows="4"-->
|
|
|
+<!-- type="textarea"-->
|
|
|
+<!-- placeholder="请输入报名条件"-->
|
|
|
+<!-- ></van-field>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">报名开始</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div-->
|
|
|
+<!-- class="date-selcet-box"-->
|
|
|
+<!-- @click="registrationStartDateShow = true"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.registrationStartTime"-->
|
|
|
+<!-- placeholder="请选择报名开始时间"-->
|
|
|
+<!-- disabled-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <img src="@/assets/image/date-icon.png" alt="" />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">报名结束</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div-->
|
|
|
+<!-- class="date-selcet-box"-->
|
|
|
+<!-- @click="registrationEndDateShow = true"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- v-model="form.registrationEndTime"-->
|
|
|
+<!-- placeholder="请选择报名结束时间"-->
|
|
|
+<!-- disabled-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <img src="@/assets/image/date-icon.png" alt="" />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="item-box">-->
|
|
|
+<!-- <div class="input-tit">-->
|
|
|
+<!-- <p class="tit">参与人数</p>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="input-item-box blue">-->
|
|
|
+<!-- <div class="one-selcet-box">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- v-model="form.activityQuota"-->
|
|
|
+<!-- type="text"-->
|
|
|
+<!-- placeholder="请输入限制人数"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+
|
|
|
+<!-- <!– <div class="button-group" v-if="form.id&&form.id!==''&&form.isValid==='0'">-->
|
|
|
+<!-- <van-button color="#3b7aff" size="small" plain round @click="commit()">保存</van-button>-->
|
|
|
+<!-- <van-button color="#3b7aff" size="small" round @click="commit('0')">发布</van-button>-->
|
|
|
+<!-- </div>–>-->
|
|
|
+<!-- <div class="button-group" v-if="type !== 'view'">-->
|
|
|
+<!-- <van-button-->
|
|
|
+<!-- color="#3b7aff"-->
|
|
|
+<!-- size="small"-->
|
|
|
+<!-- plain-->
|
|
|
+<!-- round-->
|
|
|
+<!-- @click="commit('1')"-->
|
|
|
+<!-- >暂存</van-button-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <van-button-->
|
|
|
+<!-- color="#3b7aff"-->
|
|
|
+<!-- size="small"-->
|
|
|
+<!-- round-->
|
|
|
+<!-- @click="commit('0')"-->
|
|
|
+<!-- >发布</van-button-->
|
|
|
+<!-- >-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <van-popup v-model="chose" round position="bottom">-->
|
|
|
+<!-- <van-picker-->
|
|
|
+<!-- show-toolbar-->
|
|
|
+<!-- :columns="communityList"-->
|
|
|
+<!-- @confirm="onConfirm"-->
|
|
|
+<!-- @cancel="chose = false"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </van-popup>-->
|
|
|
+<!-- <van-popup v-model="choseActiveType" round position="bottom">-->
|
|
|
+<!-- <van-picker-->
|
|
|
+<!-- show-toolbar-->
|
|
|
+<!-- :columns="activeTypeList"-->
|
|
|
+<!-- @confirm="onConfirmType"-->
|
|
|
+<!-- @cancel="choseActiveType = false"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </van-popup>-->
|
|
|
+
|
|
|
+<!-- <!– 时间选择器 –>-->
|
|
|
+<!-- <van-popup v-model="activityStartDateShow" position="bottom">-->
|
|
|
+<!-- <van-datetime-picker-->
|
|
|
+<!-- type="datetime"-->
|
|
|
+<!-- :min-date="minDate"-->
|
|
|
+<!-- @confirm="onActivityStartDateConfirm"-->
|
|
|
+<!-- @cancel="activityStartDateShow = false"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </van-popup>-->
|
|
|
+<!-- <van-popup v-model="activityEndDateShow" position="bottom">-->
|
|
|
+<!-- <van-datetime-picker-->
|
|
|
+<!-- type="datetime"-->
|
|
|
+<!-- :min-date="minDate"-->
|
|
|
+<!-- @confirm="onActivityEndDateConfirm"-->
|
|
|
+<!-- @cancel="activityEndDateShow = false"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </van-popup>-->
|
|
|
+<!-- <!– <van-calendar v-model="activityDateShow" type="range" @confirm="onActivityDateConfirm" />–>-->
|
|
|
+<!-- <van-popup v-model="registrationStartDateShow" position="bottom">-->
|
|
|
+<!-- <van-datetime-picker-->
|
|
|
+<!-- type="datetime"-->
|
|
|
+<!-- :min-date="minDate"-->
|
|
|
+<!-- @confirm="onRegistrationStartDateConfirm"-->
|
|
|
+<!-- @cancel="registrationStartDateShow = false"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </van-popup>-->
|
|
|
+<!-- <van-popup v-model="registrationEndDateShow" position="bottom">-->
|
|
|
+<!-- <van-datetime-picker-->
|
|
|
+<!-- type="datetime"-->
|
|
|
+<!-- :min-date="minDate"-->
|
|
|
+<!-- @confirm="onRegistrationEndDateConfirm"-->
|
|
|
+<!-- @cancel="registrationEndDateShow = false"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </van-popup>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!--</template>-->
|
|
|
+<!--<script>-->
|
|
|
+<!--// import {-->
|
|
|
+<!--// listPubCommunityByFrameUser,-->
|
|
|
+<!--// insertHomeCommunityActivity,-->
|
|
|
+<!--// getHomeCommunityActivityIsValid,-->
|
|
|
+<!--// getHomeCommunityActivityById-->
|
|
|
+<!--// } from "@/service/api_community";-->
|
|
|
+<!--// import auth from "@/service/auth";-->
|
|
|
+<!--// import { compareDate } from "../../../common/js/util";-->
|
|
|
+<!--// import { getByCodes } from "@/service/api_data";-->
|
|
|
+<!--// import Base from "@/pages/base/base";-->
|
|
|
+<!--// import { upload } from "@/service/api_file";-->
|
|
|
+<!--// import axios from "axios";-->
|
|
|
+<!--// import { Toast } from "vant";-->
|
|
|
+<!--export default {-->
|
|
|
+<!-- data() {-->
|
|
|
+<!-- return {-->
|
|
|
+<!-- dc_key: ["activity_type"],-->
|
|
|
+<!-- id: "",-->
|
|
|
+<!-- type: "",-->
|
|
|
+<!-- chose: false,-->
|
|
|
+<!-- choseActiveType: false,-->
|
|
|
+<!-- activityStartDateShow: false,-->
|
|
|
+<!-- activityEndDateShow: false,-->
|
|
|
+<!-- activityDateShow: false,-->
|
|
|
+<!-- registrationStartDateShow: false,-->
|
|
|
+<!-- registrationEndDateShow: false,-->
|
|
|
+<!-- activeTypeList: [],-->
|
|
|
+<!-- activeTypeName: "",-->
|
|
|
+<!-- communityList: [],-->
|
|
|
+<!-- minDate: new Date(2022, 3, 1),-->
|
|
|
+<!-- communityName: "",-->
|
|
|
+<!-- activityStartDate: "",-->
|
|
|
+<!-- activityEndDate: "",-->
|
|
|
+<!-- activityDate: "",-->
|
|
|
+<!-- registrationDate: "",-->
|
|
|
+<!-- form: this.initForm(),-->
|
|
|
+<!-- fileList: [-->
|
|
|
+<!-- // { url: 'https://img.yzcdn.cn/vant/leaf.jpg' },-->
|
|
|
+<!-- // { url: 'https://cloud-image', isImage: true }-->
|
|
|
+<!-- ],-->
|
|
|
+<!-- fileUrlList: []-->
|
|
|
+<!-- };-->
|
|
|
+<!-- },-->
|
|
|
+<!-- mixins: [Base],-->
|
|
|
+<!-- mounted() {-->
|
|
|
+<!-- this.id = this.$route.params.id;-->
|
|
|
+<!-- this.type = this.$route.params.type;-->
|
|
|
+<!-- this.selectCommunityByFrameUser();-->
|
|
|
+<!-- this.getDictData(this.dc_key);-->
|
|
|
+<!-- },-->
|
|
|
+<!-- methods: {-->
|
|
|
+<!-- onActivityStartDateConfirm(date) {-->
|
|
|
+<!-- this.activityStartDateShow = false;-->
|
|
|
+<!-- this.form.activityStartTime = this.$common.transServDate(date);-->
|
|
|
+<!-- },-->
|
|
|
+<!-- onActivityEndDateConfirm(date) {-->
|
|
|
+<!-- this.activityEndDateShow = false;-->
|
|
|
+<!-- this.form.activityEndTime = this.$common.transServDate(date);-->
|
|
|
+<!-- },-->
|
|
|
+<!-- onRegistrationStartDateConfirm(date) {-->
|
|
|
+<!-- this.registrationStartDateShow = false;-->
|
|
|
+<!-- this.form.registrationStartTime = this.$common.transServDate(date);-->
|
|
|
+<!-- },-->
|
|
|
+<!-- onRegistrationEndDateConfirm(date) {-->
|
|
|
+<!-- this.registrationEndDateShow = false;-->
|
|
|
+<!-- this.form.registrationEndTime = this.$common.transServDate(date);-->
|
|
|
+<!-- },-->
|
|
|
+<!-- getActivityById() {-->
|
|
|
+<!-- const _this = this;-->
|
|
|
+<!-- getHomeCommunityActivityById({ id: _this.id }).then(res => {-->
|
|
|
+<!-- if (res.data) {-->
|
|
|
+<!-- _this.form = res.data;-->
|
|
|
+<!-- _this.activeTypeName =-->
|
|
|
+<!-- _this.dc_map.activity_type[res.data.activityType];-->
|
|
|
+<!-- const fileList = [];-->
|
|
|
+<!-- if (_this.form.annex && _this.form.annex.length > 2) {-->
|
|
|
+<!-- const annex = _this.$common.castEval(_this.form.annex);-->
|
|
|
+<!-- _this.fileUrlList = annex;-->
|
|
|
+<!-- annex.forEach(item => {-->
|
|
|
+<!-- fileList.push({-->
|
|
|
+<!-- url:-->
|
|
|
+<!-- process.env.VUE_APP_API_URL +-->
|
|
|
+<!-- item.url.substring(7, item.url.length),-->
|
|
|
+<!-- isImage: true-->
|
|
|
+<!-- });-->
|
|
|
+<!-- });-->
|
|
|
+<!-- }-->
|
|
|
+<!-- _this.fileList = fileList;-->
|
|
|
+<!-- _this.communityList.forEach(item => {-->
|
|
|
+<!-- if (item.id === res.data.communityId) {-->
|
|
|
+<!-- _this.communityName = item.label;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- });-->
|
|
|
+
|
|
|
+<!-- _this.form.activityStartTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.activityStartTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- _this.form.activityEndTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.activityEndTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- _this.form.registrationStartTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.registrationStartTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- _this.form.registrationEndTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.registrationEndTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- }-->
|
|
|
+<!-- });-->
|
|
|
+<!-- },-->
|
|
|
+<!-- getActivityIsValid() {-->
|
|
|
+<!-- const _this = this;-->
|
|
|
+<!-- getHomeCommunityActivityIsValid({-->
|
|
|
+<!-- createdBy: auth.currUser().id-->
|
|
|
+<!-- }).then(res => {-->
|
|
|
+<!-- if (res.data && res.data.id) {-->
|
|
|
+<!-- _this.form = res.data;-->
|
|
|
+<!-- _this.activeTypeName =-->
|
|
|
+<!-- _this.dc_map.activity_type[res.data.activityType];-->
|
|
|
+<!-- const fileList = [];-->
|
|
|
+<!-- if (_this.form.annex && _this.form.annex.length > 2) {-->
|
|
|
+<!-- const annex = _this.$common.castEval(_this.form.annex);-->
|
|
|
+<!-- _this.fileUrlList = annex;-->
|
|
|
+<!-- annex.forEach(item => {-->
|
|
|
+<!-- fileList.push({-->
|
|
|
+<!-- name: item.name,-->
|
|
|
+<!-- url:-->
|
|
|
+<!-- process.env.VUE_APP_API_URL +-->
|
|
|
+<!-- item.url.substring(7, item.url.length),-->
|
|
|
+<!-- isImage: true-->
|
|
|
+<!-- });-->
|
|
|
+<!-- });-->
|
|
|
+<!-- }-->
|
|
|
+<!-- _this.fileList = fileList;-->
|
|
|
+<!-- _this.communityList.forEach(item => {-->
|
|
|
+<!-- if (item.id === res.data.communityId) {-->
|
|
|
+<!-- _this.communityName = item.label;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- });-->
|
|
|
+<!-- _this.form.activityStartTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.activityStartTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- _this.form.activityEndTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.activityEndTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- _this.form.registrationStartTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.registrationStartTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- _this.form.registrationEndTime = this.$common.transServDate(-->
|
|
|
+<!-- res.data.registrationEndTime-->
|
|
|
+<!-- );-->
|
|
|
+<!-- }-->
|
|
|
+<!-- });-->
|
|
|
+<!-- },-->
|
|
|
+<!-- getDictData(codes) {-->
|
|
|
+<!-- const _this = this;-->
|
|
|
+<!-- const postData = {-->
|
|
|
+<!-- codes: JSON.stringify(codes)-->
|
|
|
+<!-- };-->
|
|
|
+<!-- getByCodes(postData).then(res => {-->
|
|
|
+<!-- if (res.data) {-->
|
|
|
+<!-- _this.dc_key.forEach(key => {-->
|
|
|
+<!-- const dictValue = _this.getDictValue(-->
|
|
|
+<!-- res.data,-->
|
|
|
+<!-- key,-->
|
|
|
+<!-- false-->
|
|
|
+<!-- );-->
|
|
|
+<!-- _this.dc_data[key] = dictValue;-->
|
|
|
+<!-- _this.dc_map[key] = _this.$common.transDcMap(dictValue);-->
|
|
|
+<!-- });-->
|
|
|
+<!-- _this.activeTypeList = _this.dc_data.activity_type;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- _this.getActivityById();-->
|
|
|
+<!-- });-->
|
|
|
+<!-- },-->
|
|
|
+<!-- commit(val) {-->
|
|
|
+<!-- const _this = this;-->
|
|
|
+<!-- if (_this.form.activityName === "") {-->
|
|
|
+<!-- Toast("请填写活动名称");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.communityId === "") {-->
|
|
|
+<!-- Toast("请选择社区");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.activityType === "") {-->
|
|
|
+<!-- Toast("请选择活动类型");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.integral === ""||_this.form.integral < 1) {-->
|
|
|
+<!-- Toast("请填写参与积分");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.registrationStartTime === "") {-->
|
|
|
+<!-- Toast("请选择报名开始时间");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.registrationEndTime === "") {-->
|
|
|
+<!-- Toast("请选择报名结束时间");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.activityStartTime === "") {-->
|
|
|
+<!-- Toast("请选择活动开始时间");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.activityEndTime === "") {-->
|
|
|
+<!-- Toast("请选择活动结束时间");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.fileUrlList.length === 0) {-->
|
|
|
+<!-- Toast("请上传主题图");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.activityPhone === "") {-->
|
|
|
+<!-- Toast("请输入联系电话");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (_this.form.activityAddress === "") {-->
|
|
|
+<!-- Toast("请输入活动地址");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (-->
|
|
|
+<!-- compareDate(-->
|
|
|
+<!-- _this.form.registrationStartTime,-->
|
|
|
+<!-- _this.form.registrationEndTime-->
|
|
|
+<!-- )-->
|
|
|
+<!-- ) {-->
|
|
|
+<!-- Toast("报名开始时间不能大于结束时间");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (-->
|
|
|
+<!-- compareDate(-->
|
|
|
+<!-- _this.form.activityStartTime,-->
|
|
|
+<!-- _this.form.activityEndTime-->
|
|
|
+<!-- )-->
|
|
|
+<!-- ) {-->
|
|
|
+<!-- Toast("活动开始时间不能大于结束时间");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- if (-->
|
|
|
+<!-- compareDate(-->
|
|
|
+<!-- _this.form.registrationEndTime,-->
|
|
|
+<!-- _this.form.activityEndTime-->
|
|
|
+<!-- )-->
|
|
|
+<!-- ) {-->
|
|
|
+<!-- Toast("报名结束时间不能大于活动结束时间");-->
|
|
|
+<!-- return;-->
|
|
|
+<!-- }-->
|
|
|
+<!-- _this.form.isValid = val;-->
|
|
|
+<!-- if (val == "0") {-->
|
|
|
+<!-- _this.form.releaseStatus = "1";-->
|
|
|
+<!-- }-->
|
|
|
+<!-- this.$delete(this.form, "updatedAt");-->
|
|
|
+<!-- this.$delete(this.form, "createdAt");-->
|
|
|
+<!-- _this.form.annex = JSON.stringify(_this.fileUrlList);-->
|
|
|
+<!-- insertHomeCommunityActivity(_this.form).then(res => {-->
|
|
|
+<!-- this.$router.push({-->
|
|
|
+<!-- path: "/admin/activities/list",-->
|
|
|
+<!-- query: {}-->
|
|
|
+<!-- });-->
|
|
|
+<!-- });-->
|
|
|
+<!-- },-->
|
|
|
+<!-- onConfirm(value) {-->
|
|
|
+<!-- this.form.communityId = value.id;-->
|
|
|
+<!-- this.communityName = value.label;-->
|
|
|
+<!-- this.chose = false;-->
|
|
|
+<!-- },-->
|
|
|
+<!-- onConfirmType(value) {-->
|
|
|
+<!-- this.form.activityType = value.value;-->
|
|
|
+<!-- this.activeTypeName = value.label;-->
|
|
|
+<!-- this.choseActiveType = false;-->
|
|
|
+<!-- },-->
|
|
|
+<!-- initForm: function() {-->
|
|
|
+<!-- return {-->
|
|
|
+<!-- id: "",-->
|
|
|
+<!-- communityId: "",-->
|
|
|
+<!-- activityName: "",-->
|
|
|
+<!-- activityType: "",-->
|
|
|
+<!-- registrationStartTime: "",-->
|
|
|
+<!-- registrationEndTime: "",-->
|
|
|
+<!-- activityStartTime: "",-->
|
|
|
+<!-- activityEndTime: "",-->
|
|
|
+<!-- collectorsNumbers: "",-->
|
|
|
+<!-- registrationNumbers: "",-->
|
|
|
+<!-- releaseTime: "",-->
|
|
|
+<!-- status: "0",-->
|
|
|
+<!-- activityQuota: "",-->
|
|
|
+<!-- releaseStatus: "",-->
|
|
|
+<!-- activityPhone: "",-->
|
|
|
+<!-- activityAddress: "",-->
|
|
|
+<!-- activityContent: "",-->
|
|
|
+<!-- registrationConditions: "",-->
|
|
|
+<!-- annex: "",-->
|
|
|
+<!-- isValid: "",-->
|
|
|
+<!-- integral:'',-->
|
|
|
+<!-- createdBy: auth.uid()-->
|
|
|
+<!-- };-->
|
|
|
+<!-- },-->
|
|
|
+<!-- selectCommunityByFrameUser() {-->
|
|
|
+<!-- const _this = this;-->
|
|
|
+<!-- listPubCommunityByFrameUser({ userId: auth.currUser().id }).then(-->
|
|
|
+<!-- res => {-->
|
|
|
+<!-- if (res.data) {-->
|
|
|
+<!-- this.communityList = [];-->
|
|
|
+<!-- res.data.forEach(item => {-->
|
|
|
+<!-- const i = {-->
|
|
|
+<!-- id: item.id,-->
|
|
|
+<!-- text: item.communityName,-->
|
|
|
+<!-- label: item.communityName,-->
|
|
|
+<!-- value: item.id-->
|
|
|
+<!-- };-->
|
|
|
+<!-- _this.communityList.push(i);-->
|
|
|
+<!-- });-->
|
|
|
+<!-- }-->
|
|
|
+<!-- }-->
|
|
|
+<!-- );-->
|
|
|
+<!-- },-->
|
|
|
+
|
|
|
+<!-- afterRead(file) {-->
|
|
|
+<!-- // logo-->
|
|
|
+<!-- if (file instanceof Array) {-->
|
|
|
+<!-- file.map(v => {-->
|
|
|
+<!-- this.uploadImg(v);-->
|
|
|
+<!-- });-->
|
|
|
+<!-- } else {-->
|
|
|
+<!-- this.uploadImg(file);-->
|
|
|
+<!-- }-->
|
|
|
+<!-- },-->
|
|
|
+<!-- /**-->
|
|
|
+<!-- * 上传图片-->
|
|
|
+<!-- */-->
|
|
|
+<!-- uploadImg(file, type) {-->
|
|
|
+<!-- const _this = this;-->
|
|
|
+<!-- Toast.loading({-->
|
|
|
+<!-- message: "上传中...",-->
|
|
|
+<!-- forbidClick: true,-->
|
|
|
+<!-- duration: 0-->
|
|
|
+<!-- });-->
|
|
|
+<!-- const formParam = new FormData(); // 创建form对象-->
|
|
|
+<!-- formParam.append("file", file.file); // 通过append向form对象添加数据-->
|
|
|
+<!-- console.log(formParam.get("file")); // FormData私有类对象,访问不到,可以通过get判断值是否传进去-->
|
|
|
+<!-- const config = {-->
|
|
|
+<!-- headers: {-->
|
|
|
+<!-- "Content-Type": "multipart/form-data",-->
|
|
|
+<!-- "MVVM-Key": String(new Date().getTime()),-->
|
|
|
+<!-- xx: "anything"-->
|
|
|
+<!-- } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值-->
|
|
|
+<!-- }; // 添加请求头-->
|
|
|
+<!-- return new Promise((resolve, reject) => {-->
|
|
|
+<!-- upload(formParam, config)-->
|
|
|
+<!-- .then(response => {-->
|
|
|
+<!-- let files = response.data.substring(-->
|
|
|
+<!-- 1,-->
|
|
|
+<!-- response.data.length-->
|
|
|
+<!-- );-->
|
|
|
+<!-- files = files.substring(0, files.length - 1);-->
|
|
|
+<!-- _this.fileUrlList.push(_this.$common.castEval(files));-->
|
|
|
+<!-- Toast.clear();-->
|
|
|
+<!-- })-->
|
|
|
+<!-- .catch((err, x) => {-->
|
|
|
+<!-- reject(err, x);-->
|
|
|
+<!-- Toast.clear();-->
|
|
|
+<!-- });-->
|
|
|
+<!-- });-->
|
|
|
+<!-- },-->
|
|
|
+<!-- beforeDelete(file, detail) {-->
|
|
|
+<!-- const vm = this;-->
|
|
|
+<!-- vm.fileUrlList.splice(detail.index, 1);-->
|
|
|
+<!-- // name.index代表图片的索引-->
|
|
|
+<!-- return (file, name) => {};-->
|
|
|
+<!-- }-->
|
|
|
+<!-- }-->
|
|
|
+<!--};-->
|
|
|
+<!--</script>-->
|
|
|
+<!--<style lang="scss" scoped></style>-->
|