add.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. <!--<template>-->
  2. <!-- <div class="app-body-white">-->
  3. <!-- <div class="form-box form-box-label-width">-->
  4. <!-- <div class="item-box">-->
  5. <!-- <div class="input-tit">-->
  6. <!-- <p class="tit">社区名称</p>-->
  7. <!-- </div>-->
  8. <!-- <div class="input-item-box blue">-->
  9. <!-- <div class="one-selcet-box">-->
  10. <!-- <input-->
  11. <!-- type="text"-->
  12. <!-- v-model="communityName"-->
  13. <!-- placeholder="请选择社区"-->
  14. <!-- @click="chose = true"-->
  15. <!-- readonly-->
  16. <!-- />-->
  17. <!-- <i class="iconfont icon-down"></i>-->
  18. <!-- </div>-->
  19. <!-- </div>-->
  20. <!-- </div>-->
  21. <!-- <div class="item-box">-->
  22. <!-- <div class="input-tit">-->
  23. <!-- <p class="tit">活动名称</p>-->
  24. <!-- </div>-->
  25. <!-- <div class="input-item-box blue">-->
  26. <!-- <div class="one-selcet-box">-->
  27. <!-- <input-->
  28. <!-- type="text"-->
  29. <!-- v-model="form.activityName"-->
  30. <!-- placeholder="请输入活动名称"-->
  31. <!-- />-->
  32. <!-- </div>-->
  33. <!-- </div>-->
  34. <!-- </div>-->
  35. <!-- <div class="item-box">-->
  36. <!-- <div class="input-tit">-->
  37. <!-- <p class="tit">活动类型</p>-->
  38. <!-- </div>-->
  39. <!-- <div class="input-item-box blue">-->
  40. <!-- <div class="one-selcet-box">-->
  41. <!-- <input-->
  42. <!-- type="text"-->
  43. <!-- placeholder="请选择类型"-->
  44. <!-- @click="choseActiveType = true"-->
  45. <!-- v-model="activeTypeName"-->
  46. <!-- readonly-->
  47. <!-- />-->
  48. <!-- &lt;!&ndash; <van-popup v-model="choseActiveType" round position="bottom">&ndash;&gt;-->
  49. <!-- &lt;!&ndash; <van-picker&ndash;&gt;-->
  50. <!-- &lt;!&ndash; show-toolbar&ndash;&gt;-->
  51. <!-- &lt;!&ndash; @confirm="(value) => typeConfirm(value)"&ndash;&gt;-->
  52. <!-- &lt;!&ndash; @cancel="chose = false"&ndash;&gt;-->
  53. <!-- &lt;!&ndash; />&ndash;&gt;-->
  54. <!-- &lt;!&ndash; </van-popup>&ndash;&gt;-->
  55. <!-- <i class="iconfont icon-down"></i>-->
  56. <!-- </div>-->
  57. <!-- </div>-->
  58. <!-- </div>-->
  59. <!-- <div class="item-box">-->
  60. <!-- <div class="input-tit">-->
  61. <!-- <p class="tit">参与可得</p>-->
  62. <!-- </div>-->
  63. <!-- <div class="input-item-box blue">-->
  64. <!-- <div class="one-selcet-box">-->
  65. <!-- <input-->
  66. <!-- type="number"-->
  67. <!-- placeholder="请输入积分值"-->
  68. <!-- v-model="form.integral"-->
  69. <!-- />-->
  70. <!-- </div>-->
  71. <!-- </div>-->
  72. <!-- </div>-->
  73. <!-- <div class="upload-group">-->
  74. <!-- <div class="video-name">-->
  75. <!-- 主题图片 <span>(支持图片上传限20M内,最多6张)</span>-->
  76. <!-- </div>-->
  77. <!-- <van-uploader-->
  78. <!-- v-model="fileList"-->
  79. <!-- :max-count="6"-->
  80. <!-- :after-read="afterRead"-->
  81. <!-- :before-delete="beforeDelete"-->
  82. <!-- multiple-->
  83. <!-- class="upload-style"-->
  84. <!-- />-->
  85. <!-- </div>-->
  86. <!-- <div class="item-box">-->
  87. <!-- <div class="input-tit">-->
  88. <!-- <p class="tit">联系电话</p>-->
  89. <!-- </div>-->
  90. <!-- <div class="input-item-box blue">-->
  91. <!-- <div class="one-selcet-box">-->
  92. <!-- <input-->
  93. <!-- type="text"-->
  94. <!-- v-model="form.activityPhone"-->
  95. <!-- placeholder="请输入联系电话"-->
  96. <!-- />-->
  97. <!-- </div>-->
  98. <!-- </div>-->
  99. <!-- </div>-->
  100. <!-- <div class="item-box">-->
  101. <!-- <div class="input-tit">-->
  102. <!-- <p class="tit">举办方</p>-->
  103. <!-- </div>-->
  104. <!-- <div class="input-item-box blue">-->
  105. <!-- <div class="one-selcet-box">-->
  106. <!-- <input-->
  107. <!-- type="text"-->
  108. <!-- v-model="form.activitiesNotice"-->
  109. <!-- placeholder="请输入活动举办"-->
  110. <!-- />-->
  111. <!-- </div>-->
  112. <!-- </div>-->
  113. <!-- </div>-->
  114. <!-- <div class="item-box">-->
  115. <!-- <div class="input-tit">-->
  116. <!-- <p class="tit">活动内容</p>-->
  117. <!-- </div>-->
  118. <!-- <div class="input-item-box blue">-->
  119. <!-- <van-field-->
  120. <!-- v-model="form.activityContent"-->
  121. <!-- style="padding: 0px"-->
  122. <!-- autosize-->
  123. <!-- rows="4"-->
  124. <!-- type="textarea"-->
  125. <!-- placeholder="请输入内容"-->
  126. <!-- ></van-field>-->
  127. <!-- </div>-->
  128. <!-- </div>-->
  129. <!-- <div class="item-box">-->
  130. <!-- <div class="input-tit">-->
  131. <!-- <p class="tit">活动开始</p>-->
  132. <!-- </div>-->
  133. <!-- <div class="input-item-box blue">-->
  134. <!-- <div-->
  135. <!-- class="date-selcet-box"-->
  136. <!-- @click="activityStartDateShow = true"-->
  137. <!-- >-->
  138. <!-- <input-->
  139. <!-- type="text"-->
  140. <!-- v-model="form.activityStartTime"-->
  141. <!-- placeholder="请选择活动开始时间"-->
  142. <!-- disabled-->
  143. <!-- />-->
  144. <!-- <img src="@/assets/image/date-icon.png" alt="" />-->
  145. <!-- </div>-->
  146. <!-- </div>-->
  147. <!-- </div>-->
  148. <!-- <div class="item-box">-->
  149. <!-- <div class="input-tit">-->
  150. <!-- <p class="tit">活动结束</p>-->
  151. <!-- </div>-->
  152. <!-- <div class="input-item-box blue">-->
  153. <!-- <div-->
  154. <!-- class="date-selcet-box"-->
  155. <!-- @click="activityEndDateShow = true"-->
  156. <!-- >-->
  157. <!-- <input-->
  158. <!-- type="text"-->
  159. <!-- v-model="form.activityEndTime"-->
  160. <!-- placeholder="请选择活动结束时间"-->
  161. <!-- disabled-->
  162. <!-- />-->
  163. <!-- <img src="@/assets/image/date-icon.png" alt="" />-->
  164. <!-- </div>-->
  165. <!-- </div>-->
  166. <!-- </div>-->
  167. <!-- <div class="item-box">-->
  168. <!-- <div class="input-tit">-->
  169. <!-- <p class="tit">活动地址</p>-->
  170. <!-- </div>-->
  171. <!-- <div class="input-item-box blue">-->
  172. <!-- <div class="one-selcet-box">-->
  173. <!-- <input-->
  174. <!-- type="text"-->
  175. <!-- v-model="form.activityAddress"-->
  176. <!-- placeholder="请输入活动地址"-->
  177. <!-- />-->
  178. <!-- </div>-->
  179. <!-- </div>-->
  180. <!-- </div>-->
  181. <!-- <div class="item-box">-->
  182. <!-- <div class="input-tit">-->
  183. <!-- <p class="tit">报名条件</p>-->
  184. <!-- </div>-->
  185. <!-- <div class="input-item-box blue">-->
  186. <!-- <van-field-->
  187. <!-- v-model="form.registrationConditions"-->
  188. <!-- style="padding: 0px"-->
  189. <!-- autosize-->
  190. <!-- rows="4"-->
  191. <!-- type="textarea"-->
  192. <!-- placeholder="请输入报名条件"-->
  193. <!-- ></van-field>-->
  194. <!-- </div>-->
  195. <!-- </div>-->
  196. <!-- <div class="item-box">-->
  197. <!-- <div class="input-tit">-->
  198. <!-- <p class="tit">报名开始</p>-->
  199. <!-- </div>-->
  200. <!-- <div class="input-item-box blue">-->
  201. <!-- <div-->
  202. <!-- class="date-selcet-box"-->
  203. <!-- @click="registrationStartDateShow = true"-->
  204. <!-- >-->
  205. <!-- <input-->
  206. <!-- type="text"-->
  207. <!-- v-model="form.registrationStartTime"-->
  208. <!-- placeholder="请选择报名开始时间"-->
  209. <!-- disabled-->
  210. <!-- />-->
  211. <!-- <img src="@/assets/image/date-icon.png" alt="" />-->
  212. <!-- </div>-->
  213. <!-- </div>-->
  214. <!-- </div>-->
  215. <!-- <div class="item-box">-->
  216. <!-- <div class="input-tit">-->
  217. <!-- <p class="tit">报名结束</p>-->
  218. <!-- </div>-->
  219. <!-- <div class="input-item-box blue">-->
  220. <!-- <div-->
  221. <!-- class="date-selcet-box"-->
  222. <!-- @click="registrationEndDateShow = true"-->
  223. <!-- >-->
  224. <!-- <input-->
  225. <!-- type="text"-->
  226. <!-- v-model="form.registrationEndTime"-->
  227. <!-- placeholder="请选择报名结束时间"-->
  228. <!-- disabled-->
  229. <!-- />-->
  230. <!-- <img src="@/assets/image/date-icon.png" alt="" />-->
  231. <!-- </div>-->
  232. <!-- </div>-->
  233. <!-- </div>-->
  234. <!-- <div class="item-box">-->
  235. <!-- <div class="input-tit">-->
  236. <!-- <p class="tit">参与人数</p>-->
  237. <!-- </div>-->
  238. <!-- <div class="input-item-box blue">-->
  239. <!-- <div class="one-selcet-box">-->
  240. <!-- <input-->
  241. <!-- v-model="form.activityQuota"-->
  242. <!-- type="text"-->
  243. <!-- placeholder="请输入限制人数"-->
  244. <!-- />-->
  245. <!-- </div>-->
  246. <!-- </div>-->
  247. <!-- </div>-->
  248. <!-- &lt;!&ndash; <div class="button-group" v-if="form.id&&form.id!==''&&form.isValid==='0'">-->
  249. <!-- <van-button color="#3b7aff" size="small" plain round @click="commit()">保存</van-button>-->
  250. <!-- <van-button color="#3b7aff" size="small" round @click="commit('0')">发布</van-button>-->
  251. <!-- </div>&ndash;&gt;-->
  252. <!-- <div class="button-group" v-if="type !== 'view'">-->
  253. <!-- <van-button-->
  254. <!-- color="#3b7aff"-->
  255. <!-- size="small"-->
  256. <!-- plain-->
  257. <!-- round-->
  258. <!-- @click="commit('1')"-->
  259. <!-- >暂存</van-button-->
  260. <!-- >-->
  261. <!-- <van-button-->
  262. <!-- color="#3b7aff"-->
  263. <!-- size="small"-->
  264. <!-- round-->
  265. <!-- @click="commit('0')"-->
  266. <!-- >发布</van-button-->
  267. <!-- >-->
  268. <!-- </div>-->
  269. <!-- </div>-->
  270. <!-- <van-popup v-model="chose" round position="bottom">-->
  271. <!-- <van-picker-->
  272. <!-- show-toolbar-->
  273. <!-- :columns="communityList"-->
  274. <!-- @confirm="onConfirm"-->
  275. <!-- @cancel="chose = false"-->
  276. <!-- />-->
  277. <!-- </van-popup>-->
  278. <!-- <van-popup v-model="choseActiveType" round position="bottom">-->
  279. <!-- <van-picker-->
  280. <!-- show-toolbar-->
  281. <!-- :columns="activeTypeList"-->
  282. <!-- @confirm="onConfirmType"-->
  283. <!-- @cancel="choseActiveType = false"-->
  284. <!-- />-->
  285. <!-- </van-popup>-->
  286. <!-- &lt;!&ndash; 时间选择器 &ndash;&gt;-->
  287. <!-- <van-popup v-model="activityStartDateShow" position="bottom">-->
  288. <!-- <van-datetime-picker-->
  289. <!-- type="datetime"-->
  290. <!-- :min-date="minDate"-->
  291. <!-- @confirm="onActivityStartDateConfirm"-->
  292. <!-- @cancel="activityStartDateShow = false"-->
  293. <!-- />-->
  294. <!-- </van-popup>-->
  295. <!-- <van-popup v-model="activityEndDateShow" position="bottom">-->
  296. <!-- <van-datetime-picker-->
  297. <!-- type="datetime"-->
  298. <!-- :min-date="minDate"-->
  299. <!-- @confirm="onActivityEndDateConfirm"-->
  300. <!-- @cancel="activityEndDateShow = false"-->
  301. <!-- />-->
  302. <!-- </van-popup>-->
  303. <!-- &lt;!&ndash; <van-calendar v-model="activityDateShow" type="range" @confirm="onActivityDateConfirm" />&ndash;&gt;-->
  304. <!-- <van-popup v-model="registrationStartDateShow" position="bottom">-->
  305. <!-- <van-datetime-picker-->
  306. <!-- type="datetime"-->
  307. <!-- :min-date="minDate"-->
  308. <!-- @confirm="onRegistrationStartDateConfirm"-->
  309. <!-- @cancel="registrationStartDateShow = false"-->
  310. <!-- />-->
  311. <!-- </van-popup>-->
  312. <!-- <van-popup v-model="registrationEndDateShow" position="bottom">-->
  313. <!-- <van-datetime-picker-->
  314. <!-- type="datetime"-->
  315. <!-- :min-date="minDate"-->
  316. <!-- @confirm="onRegistrationEndDateConfirm"-->
  317. <!-- @cancel="registrationEndDateShow = false"-->
  318. <!-- />-->
  319. <!-- </van-popup>-->
  320. <!-- </div>-->
  321. <!--</template>-->
  322. <!--<script>-->
  323. <!--// import {-->
  324. <!--// listPubCommunityByFrameUser,-->
  325. <!--// insertHomeCommunityActivity,-->
  326. <!--// getHomeCommunityActivityIsValid,-->
  327. <!--// getHomeCommunityActivityById-->
  328. <!--// } from "@/service/api_community";-->
  329. <!--// import auth from "@/service/auth";-->
  330. <!--// import { compareDate } from "../../../common/js/util";-->
  331. <!--// import { getByCodes } from "@/service/api_data";-->
  332. <!--// import Base from "@/pages/base/base";-->
  333. <!--// import { upload } from "@/service/api_file";-->
  334. <!--// import axios from "axios";-->
  335. <!--// import { Toast } from "vant";-->
  336. <!--export default {-->
  337. <!-- data() {-->
  338. <!-- return {-->
  339. <!-- dc_key: ["activity_type"],-->
  340. <!-- id: "",-->
  341. <!-- type: "",-->
  342. <!-- chose: false,-->
  343. <!-- choseActiveType: false,-->
  344. <!-- activityStartDateShow: false,-->
  345. <!-- activityEndDateShow: false,-->
  346. <!-- activityDateShow: false,-->
  347. <!-- registrationStartDateShow: false,-->
  348. <!-- registrationEndDateShow: false,-->
  349. <!-- activeTypeList: [],-->
  350. <!-- activeTypeName: "",-->
  351. <!-- communityList: [],-->
  352. <!-- minDate: new Date(2022, 3, 1),-->
  353. <!-- communityName: "",-->
  354. <!-- activityStartDate: "",-->
  355. <!-- activityEndDate: "",-->
  356. <!-- activityDate: "",-->
  357. <!-- registrationDate: "",-->
  358. <!-- form: this.initForm(),-->
  359. <!-- fileList: [-->
  360. <!-- // { url: 'https://img.yzcdn.cn/vant/leaf.jpg' },-->
  361. <!-- // { url: 'https://cloud-image', isImage: true }-->
  362. <!-- ],-->
  363. <!-- fileUrlList: []-->
  364. <!-- };-->
  365. <!-- },-->
  366. <!-- mixins: [Base],-->
  367. <!-- mounted() {-->
  368. <!-- this.id = this.$route.params.id;-->
  369. <!-- this.type = this.$route.params.type;-->
  370. <!-- this.selectCommunityByFrameUser();-->
  371. <!-- this.getDictData(this.dc_key);-->
  372. <!-- },-->
  373. <!-- methods: {-->
  374. <!-- onActivityStartDateConfirm(date) {-->
  375. <!-- this.activityStartDateShow = false;-->
  376. <!-- this.form.activityStartTime = this.$common.transServDate(date);-->
  377. <!-- },-->
  378. <!-- onActivityEndDateConfirm(date) {-->
  379. <!-- this.activityEndDateShow = false;-->
  380. <!-- this.form.activityEndTime = this.$common.transServDate(date);-->
  381. <!-- },-->
  382. <!-- onRegistrationStartDateConfirm(date) {-->
  383. <!-- this.registrationStartDateShow = false;-->
  384. <!-- this.form.registrationStartTime = this.$common.transServDate(date);-->
  385. <!-- },-->
  386. <!-- onRegistrationEndDateConfirm(date) {-->
  387. <!-- this.registrationEndDateShow = false;-->
  388. <!-- this.form.registrationEndTime = this.$common.transServDate(date);-->
  389. <!-- },-->
  390. <!-- getActivityById() {-->
  391. <!-- const _this = this;-->
  392. <!-- getHomeCommunityActivityById({ id: _this.id }).then(res => {-->
  393. <!-- if (res.data) {-->
  394. <!-- _this.form = res.data;-->
  395. <!-- _this.activeTypeName =-->
  396. <!-- _this.dc_map.activity_type[res.data.activityType];-->
  397. <!-- const fileList = [];-->
  398. <!-- if (_this.form.annex && _this.form.annex.length > 2) {-->
  399. <!-- const annex = _this.$common.castEval(_this.form.annex);-->
  400. <!-- _this.fileUrlList = annex;-->
  401. <!-- annex.forEach(item => {-->
  402. <!-- fileList.push({-->
  403. <!-- url:-->
  404. <!-- process.env.VUE_APP_API_URL +-->
  405. <!-- item.url.substring(7, item.url.length),-->
  406. <!-- isImage: true-->
  407. <!-- });-->
  408. <!-- });-->
  409. <!-- }-->
  410. <!-- _this.fileList = fileList;-->
  411. <!-- _this.communityList.forEach(item => {-->
  412. <!-- if (item.id === res.data.communityId) {-->
  413. <!-- _this.communityName = item.label;-->
  414. <!-- }-->
  415. <!-- });-->
  416. <!-- _this.form.activityStartTime = this.$common.transServDate(-->
  417. <!-- res.data.activityStartTime-->
  418. <!-- );-->
  419. <!-- _this.form.activityEndTime = this.$common.transServDate(-->
  420. <!-- res.data.activityEndTime-->
  421. <!-- );-->
  422. <!-- _this.form.registrationStartTime = this.$common.transServDate(-->
  423. <!-- res.data.registrationStartTime-->
  424. <!-- );-->
  425. <!-- _this.form.registrationEndTime = this.$common.transServDate(-->
  426. <!-- res.data.registrationEndTime-->
  427. <!-- );-->
  428. <!-- }-->
  429. <!-- });-->
  430. <!-- },-->
  431. <!-- getActivityIsValid() {-->
  432. <!-- const _this = this;-->
  433. <!-- getHomeCommunityActivityIsValid({-->
  434. <!-- createdBy: auth.currUser().id-->
  435. <!-- }).then(res => {-->
  436. <!-- if (res.data && res.data.id) {-->
  437. <!-- _this.form = res.data;-->
  438. <!-- _this.activeTypeName =-->
  439. <!-- _this.dc_map.activity_type[res.data.activityType];-->
  440. <!-- const fileList = [];-->
  441. <!-- if (_this.form.annex && _this.form.annex.length > 2) {-->
  442. <!-- const annex = _this.$common.castEval(_this.form.annex);-->
  443. <!-- _this.fileUrlList = annex;-->
  444. <!-- annex.forEach(item => {-->
  445. <!-- fileList.push({-->
  446. <!-- name: item.name,-->
  447. <!-- url:-->
  448. <!-- process.env.VUE_APP_API_URL +-->
  449. <!-- item.url.substring(7, item.url.length),-->
  450. <!-- isImage: true-->
  451. <!-- });-->
  452. <!-- });-->
  453. <!-- }-->
  454. <!-- _this.fileList = fileList;-->
  455. <!-- _this.communityList.forEach(item => {-->
  456. <!-- if (item.id === res.data.communityId) {-->
  457. <!-- _this.communityName = item.label;-->
  458. <!-- }-->
  459. <!-- });-->
  460. <!-- _this.form.activityStartTime = this.$common.transServDate(-->
  461. <!-- res.data.activityStartTime-->
  462. <!-- );-->
  463. <!-- _this.form.activityEndTime = this.$common.transServDate(-->
  464. <!-- res.data.activityEndTime-->
  465. <!-- );-->
  466. <!-- _this.form.registrationStartTime = this.$common.transServDate(-->
  467. <!-- res.data.registrationStartTime-->
  468. <!-- );-->
  469. <!-- _this.form.registrationEndTime = this.$common.transServDate(-->
  470. <!-- res.data.registrationEndTime-->
  471. <!-- );-->
  472. <!-- }-->
  473. <!-- });-->
  474. <!-- },-->
  475. <!-- getDictData(codes) {-->
  476. <!-- const _this = this;-->
  477. <!-- const postData = {-->
  478. <!-- codes: JSON.stringify(codes)-->
  479. <!-- };-->
  480. <!-- getByCodes(postData).then(res => {-->
  481. <!-- if (res.data) {-->
  482. <!-- _this.dc_key.forEach(key => {-->
  483. <!-- const dictValue = _this.getDictValue(-->
  484. <!-- res.data,-->
  485. <!-- key,-->
  486. <!-- false-->
  487. <!-- );-->
  488. <!-- _this.dc_data[key] = dictValue;-->
  489. <!-- _this.dc_map[key] = _this.$common.transDcMap(dictValue);-->
  490. <!-- });-->
  491. <!-- _this.activeTypeList = _this.dc_data.activity_type;-->
  492. <!-- }-->
  493. <!-- _this.getActivityById();-->
  494. <!-- });-->
  495. <!-- },-->
  496. <!-- commit(val) {-->
  497. <!-- const _this = this;-->
  498. <!-- if (_this.form.activityName === "") {-->
  499. <!-- Toast("请填写活动名称");-->
  500. <!-- return;-->
  501. <!-- }-->
  502. <!-- if (_this.form.communityId === "") {-->
  503. <!-- Toast("请选择社区");-->
  504. <!-- return;-->
  505. <!-- }-->
  506. <!-- if (_this.form.activityType === "") {-->
  507. <!-- Toast("请选择活动类型");-->
  508. <!-- return;-->
  509. <!-- }-->
  510. <!-- if (_this.form.integral === ""||_this.form.integral < 1) {-->
  511. <!-- Toast("请填写参与积分");-->
  512. <!-- return;-->
  513. <!-- }-->
  514. <!-- if (_this.form.registrationStartTime === "") {-->
  515. <!-- Toast("请选择报名开始时间");-->
  516. <!-- return;-->
  517. <!-- }-->
  518. <!-- if (_this.form.registrationEndTime === "") {-->
  519. <!-- Toast("请选择报名结束时间");-->
  520. <!-- return;-->
  521. <!-- }-->
  522. <!-- if (_this.form.activityStartTime === "") {-->
  523. <!-- Toast("请选择活动开始时间");-->
  524. <!-- return;-->
  525. <!-- }-->
  526. <!-- if (_this.form.activityEndTime === "") {-->
  527. <!-- Toast("请选择活动结束时间");-->
  528. <!-- return;-->
  529. <!-- }-->
  530. <!-- if (_this.fileUrlList.length === 0) {-->
  531. <!-- Toast("请上传主题图");-->
  532. <!-- return;-->
  533. <!-- }-->
  534. <!-- if (_this.form.activityPhone === "") {-->
  535. <!-- Toast("请输入联系电话");-->
  536. <!-- return;-->
  537. <!-- }-->
  538. <!-- if (_this.form.activityAddress === "") {-->
  539. <!-- Toast("请输入活动地址");-->
  540. <!-- return;-->
  541. <!-- }-->
  542. <!-- if (-->
  543. <!-- compareDate(-->
  544. <!-- _this.form.registrationStartTime,-->
  545. <!-- _this.form.registrationEndTime-->
  546. <!-- )-->
  547. <!-- ) {-->
  548. <!-- Toast("报名开始时间不能大于结束时间");-->
  549. <!-- return;-->
  550. <!-- }-->
  551. <!-- if (-->
  552. <!-- compareDate(-->
  553. <!-- _this.form.activityStartTime,-->
  554. <!-- _this.form.activityEndTime-->
  555. <!-- )-->
  556. <!-- ) {-->
  557. <!-- Toast("活动开始时间不能大于结束时间");-->
  558. <!-- return;-->
  559. <!-- }-->
  560. <!-- if (-->
  561. <!-- compareDate(-->
  562. <!-- _this.form.registrationEndTime,-->
  563. <!-- _this.form.activityEndTime-->
  564. <!-- )-->
  565. <!-- ) {-->
  566. <!-- Toast("报名结束时间不能大于活动结束时间");-->
  567. <!-- return;-->
  568. <!-- }-->
  569. <!-- _this.form.isValid = val;-->
  570. <!-- if (val == "0") {-->
  571. <!-- _this.form.releaseStatus = "1";-->
  572. <!-- }-->
  573. <!-- this.$delete(this.form, "updatedAt");-->
  574. <!-- this.$delete(this.form, "createdAt");-->
  575. <!-- _this.form.annex = JSON.stringify(_this.fileUrlList);-->
  576. <!-- insertHomeCommunityActivity(_this.form).then(res => {-->
  577. <!-- this.$router.push({-->
  578. <!-- path: "/admin/activities/list",-->
  579. <!-- query: {}-->
  580. <!-- });-->
  581. <!-- });-->
  582. <!-- },-->
  583. <!-- onConfirm(value) {-->
  584. <!-- this.form.communityId = value.id;-->
  585. <!-- this.communityName = value.label;-->
  586. <!-- this.chose = false;-->
  587. <!-- },-->
  588. <!-- onConfirmType(value) {-->
  589. <!-- this.form.activityType = value.value;-->
  590. <!-- this.activeTypeName = value.label;-->
  591. <!-- this.choseActiveType = false;-->
  592. <!-- },-->
  593. <!-- initForm: function() {-->
  594. <!-- return {-->
  595. <!-- id: "",-->
  596. <!-- communityId: "",-->
  597. <!-- activityName: "",-->
  598. <!-- activityType: "",-->
  599. <!-- registrationStartTime: "",-->
  600. <!-- registrationEndTime: "",-->
  601. <!-- activityStartTime: "",-->
  602. <!-- activityEndTime: "",-->
  603. <!-- collectorsNumbers: "",-->
  604. <!-- registrationNumbers: "",-->
  605. <!-- releaseTime: "",-->
  606. <!-- status: "0",-->
  607. <!-- activityQuota: "",-->
  608. <!-- releaseStatus: "",-->
  609. <!-- activityPhone: "",-->
  610. <!-- activityAddress: "",-->
  611. <!-- activityContent: "",-->
  612. <!-- registrationConditions: "",-->
  613. <!-- annex: "",-->
  614. <!-- isValid: "",-->
  615. <!-- integral:'',-->
  616. <!-- createdBy: auth.uid()-->
  617. <!-- };-->
  618. <!-- },-->
  619. <!-- selectCommunityByFrameUser() {-->
  620. <!-- const _this = this;-->
  621. <!-- listPubCommunityByFrameUser({ userId: auth.currUser().id }).then(-->
  622. <!-- res => {-->
  623. <!-- if (res.data) {-->
  624. <!-- this.communityList = [];-->
  625. <!-- res.data.forEach(item => {-->
  626. <!-- const i = {-->
  627. <!-- id: item.id,-->
  628. <!-- text: item.communityName,-->
  629. <!-- label: item.communityName,-->
  630. <!-- value: item.id-->
  631. <!-- };-->
  632. <!-- _this.communityList.push(i);-->
  633. <!-- });-->
  634. <!-- }-->
  635. <!-- }-->
  636. <!-- );-->
  637. <!-- },-->
  638. <!-- afterRead(file) {-->
  639. <!-- // logo-->
  640. <!-- if (file instanceof Array) {-->
  641. <!-- file.map(v => {-->
  642. <!-- this.uploadImg(v);-->
  643. <!-- });-->
  644. <!-- } else {-->
  645. <!-- this.uploadImg(file);-->
  646. <!-- }-->
  647. <!-- },-->
  648. <!-- /**-->
  649. <!-- * 上传图片-->
  650. <!-- */-->
  651. <!-- uploadImg(file, type) {-->
  652. <!-- const _this = this;-->
  653. <!-- Toast.loading({-->
  654. <!-- message: "上传中...",-->
  655. <!-- forbidClick: true,-->
  656. <!-- duration: 0-->
  657. <!-- });-->
  658. <!-- const formParam = new FormData(); // 创建form对象-->
  659. <!-- formParam.append("file", file.file); // 通过append向form对象添加数据-->
  660. <!-- console.log(formParam.get("file")); // FormData私有类对象,访问不到,可以通过get判断值是否传进去-->
  661. <!-- const config = {-->
  662. <!-- headers: {-->
  663. <!-- "Content-Type": "multipart/form-data",-->
  664. <!-- "MVVM-Key": String(new Date().getTime()),-->
  665. <!-- xx: "anything"-->
  666. <!-- } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值-->
  667. <!-- }; // 添加请求头-->
  668. <!-- return new Promise((resolve, reject) => {-->
  669. <!-- upload(formParam, config)-->
  670. <!-- .then(response => {-->
  671. <!-- let files = response.data.substring(-->
  672. <!-- 1,-->
  673. <!-- response.data.length-->
  674. <!-- );-->
  675. <!-- files = files.substring(0, files.length - 1);-->
  676. <!-- _this.fileUrlList.push(_this.$common.castEval(files));-->
  677. <!-- Toast.clear();-->
  678. <!-- })-->
  679. <!-- .catch((err, x) => {-->
  680. <!-- reject(err, x);-->
  681. <!-- Toast.clear();-->
  682. <!-- });-->
  683. <!-- });-->
  684. <!-- },-->
  685. <!-- beforeDelete(file, detail) {-->
  686. <!-- const vm = this;-->
  687. <!-- vm.fileUrlList.splice(detail.index, 1);-->
  688. <!-- // name.index代表图片的索引-->
  689. <!-- return (file, name) => {};-->
  690. <!-- }-->
  691. <!-- }-->
  692. <!--};-->
  693. <!--</script>-->
  694. <!--<style lang="scss" scoped></style>-->