123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701 |
- <!--<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>-->
|