Showing
1 changed file
with
99 additions
and
49 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-21 16:04:10 | 2 | * @Date: 2022-09-21 16:04:10 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-10-17 17:25:54 | 4 | + * @LastEditTime: 2022-10-17 18:30:58 |
| 5 | * @FilePath: /swx/src/pages/createActivity/index.vue | 5 | * @FilePath: /swx/src/pages/createActivity/index.vue |
| 6 | * @Description: 创建活动页面 | 6 | * @Description: 创建活动页面 |
| 7 | --> | 7 | --> |
| ... | @@ -83,10 +83,10 @@ | ... | @@ -83,10 +83,10 @@ |
| 83 | :right-icon="icon_sel" input-align="right" placeholder="请选择" placeholder-style="color: #999;" customStyle="" | 83 | :right-icon="icon_sel" input-align="right" placeholder="请选择" placeholder-style="color: #999;" customStyle="" |
| 84 | maxlength="" type="" :border="true" @tap="show_activity_type_popup=true" :required="false" :disabled="true" /> | 84 | maxlength="" type="" :border="true" @tap="show_activity_type_popup=true" :required="false" :disabled="true" /> |
| 85 | <!-- 活动地址 --> | 85 | <!-- 活动地址 --> |
| 86 | - <van-field :value="message1" label-class="label-class-super" input-class="input-class" label="活动地址" | 86 | + <van-field :value="address" label-class="label-class-super" input-class="input-class" label="活动地址" |
| 87 | type="textarea" placeholder="请输入地址或位置说明" placeholder-style="color: #999;" customStyle="" inputAlign="right" | 87 | type="textarea" placeholder="请输入地址或位置说明" placeholder-style="color: #999;" customStyle="" inputAlign="right" |
| 88 | rightIcon="" :required="false" maxlength="" :border="false" :autosize="{ maxHeight: 80, minHeight: 20 }" | 88 | rightIcon="" :required="false" maxlength="" :border="false" :autosize="{ maxHeight: 80, minHeight: 20 }" |
| 89 | - @change="onChange1" /> | 89 | + @change="onAddressChange" /> |
| 90 | </view> | 90 | </view> |
| 91 | <view class="divide-line"></view> | 91 | <view class="divide-line"></view> |
| 92 | <view> | 92 | <view> |
| ... | @@ -117,7 +117,7 @@ | ... | @@ -117,7 +117,7 @@ |
| 117 | 允许内部人员报名活动 | 117 | 允许内部人员报名活动 |
| 118 | <van-icon :name="icon_vip" size="1rem" color="" class="vip-icon" /> | 118 | <van-icon :name="icon_vip" size="1rem" color="" class="vip-icon" /> |
| 119 | </view> | 119 | </view> |
| 120 | - <van-switch style="float: right; padding-top: 0.5rem;" :checked="limit_number" @change="onChangeLimit" | 120 | + <van-switch style="float: right; padding-top: 0.5rem;" :checked="is_inner" @change="onInnerChange" |
| 121 | size="1.5rem" active-color="#199A74" inactive-color="#FFFFFF" /> | 121 | size="1.5rem" active-color="#199A74" inactive-color="#FFFFFF" /> |
| 122 | </view> | 122 | </view> |
| 123 | </view> | 123 | </view> |
| ... | @@ -127,24 +127,24 @@ | ... | @@ -127,24 +127,24 @@ |
| 127 | 屏蔽黑名单用户 | 127 | 屏蔽黑名单用户 |
| 128 | <van-icon :name="icon_vip" size="1rem" color="" class="vip-icon" /> | 128 | <van-icon :name="icon_vip" size="1rem" color="" class="vip-icon" /> |
| 129 | </view> | 129 | </view> |
| 130 | - <van-switch style="float: right; padding-top: 0.5rem;" :checked="limit_number" @change="onChangeLimit" | 130 | + <van-switch style="float: right; padding-top: 0.5rem;" :checked="is_black" @change="onBlackChange" |
| 131 | size="1.5rem" active-color="#199A74" inactive-color="#FFFFFF" /> | 131 | size="1.5rem" active-color="#199A74" inactive-color="#FFFFFF" /> |
| 132 | </view> | 132 | </view> |
| 133 | </view> | 133 | </view> |
| 134 | <view class="form-item server-sub"> | 134 | <view class="form-item server-sub"> |
| 135 | <van-row> | 135 | <van-row> |
| 136 | - <van-col span="12"> | 136 | + <van-col span="10"> |
| 137 | <view class="form-item-title fix"> | 137 | <view class="form-item-title fix"> |
| 138 | 服务岗位报名 | 138 | 服务岗位报名 |
| 139 | <van-icon :name="icon_vip" size="1rem" color="" class="vip-icon" /> | 139 | <van-icon :name="icon_vip" size="1rem" color="" class="vip-icon" /> |
| 140 | </view> | 140 | </view> |
| 141 | </van-col> | 141 | </van-col> |
| 142 | - <van-col span="12"> | 142 | + <van-col span="14"> |
| 143 | <view style=""> | 143 | <view style=""> |
| 144 | - <van-field :value="message1" label-class="label-class-super" input-class="input-class" label="" | 144 | + <van-field :value="job_post" label-class="label-class-super" input-class="input-class" label="" |
| 145 | type="textarea" placeholder="岗位名以逗号分隔" placeholder-style="color: #999;" customStyle="" | 145 | type="textarea" placeholder="岗位名以逗号分隔" placeholder-style="color: #999;" customStyle="" |
| 146 | - inputAlign="right" rightIcon="" :required="false" maxlength="" :border="false" | 146 | + inputAlign="left" rightIcon="" :required="false" maxlength="" :border="false" |
| 147 | - :autosize="{ maxHeight: 80, minHeight: 20 }" @change="onChange1" /> | 147 | + :autosize="{ maxHeight: 80, minHeight: 20 }" @change="onExtendChange" @blur="onExtendBlur" /> |
| 148 | </view> | 148 | </view> |
| 149 | 149 | ||
| 150 | </van-col> | 150 | </van-col> |
| ... | @@ -276,16 +276,31 @@ import BASE_URL from '@/utils/config'; | ... | @@ -276,16 +276,31 @@ import BASE_URL from '@/utils/config'; |
| 276 | import Toast from '@/components/vant-weapp/toast/toast'; | 276 | import Toast from '@/components/vant-weapp/toast/toast'; |
| 277 | import { randomId } from '@/utils/tools' | 277 | import { randomId } from '@/utils/tools' |
| 278 | 278 | ||
| 279 | - | ||
| 280 | -const message1 = ref(''); | ||
| 281 | - | ||
| 282 | const activity_name = ref(''); | 279 | const activity_name = ref(''); |
| 283 | const onChange = ({ detail }) => { | 280 | const onChange = ({ detail }) => { |
| 284 | activity_name.value = detail | 281 | activity_name.value = detail |
| 285 | } | 282 | } |
| 286 | -const onChange1 = ({ detail }) => { | 283 | + |
| 287 | - // console.warn(detail); | 284 | +/***** 主办方选择弹框列表 *****/ |
| 288 | - // message1.value = detail | 285 | +const show_org_popup = ref(false); |
| 286 | +const org_type = ref(''); | ||
| 287 | +const host_id = ref(''); | ||
| 288 | +// const org_type_columns = ref([]); | ||
| 289 | +const onOrgTypeChange = (event) => { | ||
| 290 | + // const { picker, value, index } = event.detail; | ||
| 291 | + // console.warn(value); | ||
| 292 | + // console.warn(index); | ||
| 293 | + // org_type.value = value.text; | ||
| 294 | + // host_id.value = value.id; // 主办方ID | ||
| 295 | +} | ||
| 296 | +const onOrgTypeConfirm = (event) => { // 主办方弹框确认按钮回调 | ||
| 297 | + const detail = event.detail; | ||
| 298 | + org_type.value = detail.value.text; // 主办方名称 | ||
| 299 | + host_id.value = detail.value.id; // 主办方ID | ||
| 300 | + show_org_popup.value = false; | ||
| 301 | +} | ||
| 302 | +const onOrgTypeCancel = (event) => { | ||
| 303 | + show_org_popup.value = false; | ||
| 289 | } | 304 | } |
| 290 | 305 | ||
| 291 | /**************** 上传模块 ******************/ | 306 | /**************** 上传模块 ******************/ |
| ... | @@ -511,78 +526,113 @@ const confirmEditLimit = () => { // 提交人数限制 | ... | @@ -511,78 +526,113 @@ const confirmEditLimit = () => { // 提交人数限制 |
| 511 | } | 526 | } |
| 512 | } | 527 | } |
| 513 | 528 | ||
| 529 | +/******* 是否发布 *******/ | ||
| 514 | const show_publish_popup = ref(false); | 530 | const show_publish_popup = ref(false); |
| 531 | +const status = ref('disable'); // disable=未发布,enable=已发布 | ||
| 515 | const publish_status = ref('暂不发布'); | 532 | const publish_status = ref('暂不发布'); |
| 516 | const columns = ref(['暂不发布', '立即发布']); | 533 | const columns = ref(['暂不发布', '立即发布']); |
| 517 | const onPublishChange = (event) => { | 534 | const onPublishChange = (event) => { |
| 518 | - const { picker, value, index } = event.detail; | 535 | + // const { picker, value, index } = event.detail; |
| 519 | - console.warn(value); | 536 | + // console.warn(value); |
| 520 | - console.warn(index); | 537 | + // console.warn(index); |
| 521 | - publish_status.value = value; | 538 | + // publish_status.value = value; |
| 522 | } | 539 | } |
| 523 | const onPublishConfirm = (event) => { | 540 | const onPublishConfirm = (event) => { |
| 541 | + const { picker, value, index } = event.detail; | ||
| 542 | + // console.warn(value); | ||
| 543 | + // console.warn(index); | ||
| 544 | + if (index) { // 已发布 | ||
| 545 | + status.value = 'enable'; | ||
| 546 | + } else { // 未发布 | ||
| 547 | + status.value = 'disable'; | ||
| 548 | + } | ||
| 549 | + publish_status.value = value; | ||
| 524 | show_publish_popup.value = false; | 550 | show_publish_popup.value = false; |
| 525 | } | 551 | } |
| 526 | const onPublishCancel = (event) => { | 552 | const onPublishCancel = (event) => { |
| 527 | show_publish_popup.value = false; | 553 | show_publish_popup.value = false; |
| 528 | } | 554 | } |
| 529 | 555 | ||
| 556 | +/***** 活动方法 *****/ | ||
| 530 | const show_activity_type_popup = ref(false); | 557 | const show_activity_type_popup = ref(false); |
| 531 | const activity_type = ref('现场活动'); | 558 | const activity_type = ref('现场活动'); |
| 559 | +const mode = ref('offline'); // offline=现场活动,online=线上活动 | ||
| 532 | const activity_type_columns = ref(['现场活动', '线上活动']); | 560 | const activity_type_columns = ref(['现场活动', '线上活动']); |
| 533 | const onActivityTypeChange = (event) => { | 561 | const onActivityTypeChange = (event) => { |
| 534 | - const { picker, value, index } = event.detail; | 562 | + // const { picker, value, index } = event.detail; |
| 535 | - console.warn(value); | 563 | + // console.warn(value); |
| 536 | - console.warn(index); | 564 | + // console.warn(index); |
| 537 | - activity_type.value = value; | 565 | + // activity_type.value = value; |
| 538 | } | 566 | } |
| 539 | const onActivityTypeConfirm = (event) => { | 567 | const onActivityTypeConfirm = (event) => { |
| 568 | + const { picker, value, index } = event.detail; | ||
| 569 | + if (index) { // 已发布 | ||
| 570 | + mode.value = 'online'; | ||
| 571 | + } else { // 现场活动 | ||
| 572 | + mode.value = 'offline'; | ||
| 573 | + } | ||
| 574 | + activity_type.value = value; | ||
| 540 | show_activity_type_popup.value = false; | 575 | show_activity_type_popup.value = false; |
| 541 | } | 576 | } |
| 542 | const onActivityTypeCancel = (event) => { | 577 | const onActivityTypeCancel = (event) => { |
| 543 | show_activity_type_popup.value = false; | 578 | show_activity_type_popup.value = false; |
| 544 | } | 579 | } |
| 545 | 580 | ||
| 581 | +const address = ref(''); | ||
| 582 | +const onAddressChange = ({ detail }) => { | ||
| 583 | + address.value = detail | ||
| 584 | +} | ||
| 585 | + | ||
| 586 | + | ||
| 587 | +/****** 是否公开显示 ******/ | ||
| 546 | const show_public_popup = ref(false); | 588 | const show_public_popup = ref(false); |
| 547 | const public_type = ref('不公开'); | 589 | const public_type = ref('不公开'); |
| 590 | +const is_public = ref(0); | ||
| 548 | const public_type_columns = ref(['不公开', '公开']); | 591 | const public_type_columns = ref(['不公开', '公开']); |
| 549 | const onPublicTypeChange = (event) => { | 592 | const onPublicTypeChange = (event) => { |
| 550 | - const { picker, value, index } = event.detail; | 593 | + // const { picker, value, index } = event.detail; |
| 551 | - console.warn(value); | 594 | + // console.warn(value); |
| 552 | - console.warn(index); | 595 | + // console.warn(index); |
| 553 | - public_type.value = value; | 596 | + // public_type.value = value; |
| 554 | } | 597 | } |
| 555 | const onPublicTypeConfirm = (event) => { | 598 | const onPublicTypeConfirm = (event) => { |
| 599 | + const { picker, value, index } = event.detail; | ||
| 600 | + if (index) { // 公开 | ||
| 601 | + is_public.value = 1; | ||
| 602 | + } else { // 不公开 | ||
| 603 | + is_public.value = 0; | ||
| 604 | + } | ||
| 605 | + public_type.value = value; | ||
| 556 | show_public_popup.value = false; | 606 | show_public_popup.value = false; |
| 557 | } | 607 | } |
| 558 | const onPublicTypeCancel = (event) => { | 608 | const onPublicTypeCancel = (event) => { |
| 559 | show_public_popup.value = false; | 609 | show_public_popup.value = false; |
| 560 | } | 610 | } |
| 561 | 611 | ||
| 562 | -/***** 主办方选择弹框列表 *****/ | 612 | +const is_inner = ref(0); // 是否允许内部人员报名。1=允许,0=不允许 |
| 563 | -const show_org_popup = ref(false); | 613 | +const is_black = ref(0); // 是否屏蔽黑名单。1=屏蔽,0=不屏蔽 |
| 564 | -const org_type = ref(''); | 614 | +const onInnerChange = ({ detail }) => { |
| 565 | -const host_id = ref(''); | 615 | + is_inner.value = detail |
| 566 | -// const org_type_columns = ref([]); | 616 | +}; |
| 567 | -const onOrgTypeChange = (event) => { | 617 | +const onBlackChange = ({ detail }) => { |
| 568 | - // const { picker, value, index } = event.detail; | 618 | + is_black.value = detail |
| 569 | - // console.warn(value); | 619 | +}; |
| 570 | - // console.warn(index); | ||
| 571 | - // org_type.value = value.text; | ||
| 572 | - // host_id.value = value.id; // 主办方ID | ||
| 573 | -} | ||
| 574 | -const onOrgTypeConfirm = (event) => { // 主办方弹框确认按钮回调 | ||
| 575 | - const detail = event.detail; | ||
| 576 | - org_type.value = detail.value.text; // 主办方名称 | ||
| 577 | - host_id.value = detail.value.id; // 主办方ID | ||
| 578 | - show_org_popup.value = false; | ||
| 579 | -} | ||
| 580 | -const onOrgTypeCancel = (event) => { | ||
| 581 | - show_org_popup.value = false; | ||
| 582 | -} | ||
| 583 | 620 | ||
| 621 | +const extend = ref(''); // 义工岗位 | ||
| 622 | +const job_post = ref(''); // 义工岗位 | ||
| 623 | +const onExtendChange = ({ detail }) => { | ||
| 624 | + job_post.value = detail; | ||
| 625 | + extend.value = detail.split(','); | ||
| 626 | +} | ||
| 627 | +const onExtendBlur = () => { // TODO:提交时可以才检查一次 | ||
| 628 | + console.warn(job_post.value.indexOf(',')); | ||
| 629 | + if (job_post.value.indexOf(',') >= 0) { | ||
| 630 | + Toast('请使用中文标点逗号'); | ||
| 631 | + } | ||
| 632 | +} | ||
| 584 | 633 | ||
| 585 | const onSubmit = () => { | 634 | const onSubmit = () => { |
| 635 | + console.warn(extend.value); | ||
| 586 | } | 636 | } |
| 587 | </script> | 637 | </script> |
| 588 | 638 | ... | ... |
-
Please register or login to post a comment