Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-10-19 16:08:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8aa1f765feaba50ca1629b13811940a10d932270
8aa1f765
1 parent
e5db5582
✨ feat(修改活动): 人数限制数据写入逻辑调整
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
9 deletions
src/pages/createActivity/index.vue
src/pages/createActivity/index.vue
View file @
8aa1f76
<!--
* @Date: 2022-09-21 16:04:10
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-19 1
5:33:5
6
* @LastEditTime: 2022-10-19 1
6:07:0
6
* @FilePath: /swx/src/pages/createActivity/index.vue
* @Description: 创建活动页面
-->
...
...
@@ -73,7 +73,7 @@
<!-- 人数限制 -->
<van-field :value="reg_max" label-class="label-class-super" input-class="input-class" label="人数限制"
:right-icon="icon_sel" input-align="right" placeholder="请选择" placeholder-style="color: #999;" customStyle=""
maxlength="" type="" :border="true" @tap="
show_popup=true
" :required="false" :disabled="true" />
maxlength="" type="" :border="true" @tap="
onShowRegMax
" :required="false" :disabled="true" />
<!-- 是否发布 -->
<van-field :value="publish_status" label-class="label-class-super" input-class="input-class" label="是否发布"
:right-icon="icon_sel" input-align="right" placeholder="请选择" placeholder-style="color: #999;" customStyle=""
...
...
@@ -500,23 +500,37 @@ const onEndTime = (arr) => {
/********* 人数限制 *********/
const reg_max = ref('')
const temp_reg_max = ref('')
const reg_max = ref('')
; // 表单显示人数绑定
const temp_reg_max = ref('')
; // 弹框显示人数绑定
const limit_number = ref(false);
const onRegMaxChange = ({ detail }) => {
temp_reg_max.value = detail
temp_reg_max.value = detail
;
}
const onChangeLimit = ({ detail }) => { // 不限制开关回调
if (detail) {
limit_number.value = detail
if (detail) { // 无限制清空数据
temp_reg_max.value = '';
}
}
let show_popup = ref(false);
const clone_limit_number = ref(false); // 保存原始开关数据
const clone_reg_max = ref(''); // 保存原始人数数据
const onShowRegMax = () => { // 打开弹框
show_popup.value = true;
if (reg_max.value !== '无限制') {
clone_reg_max.value = reg_max.value;
} else {
limit_number.value = detail
temp_reg_max.value = ''
clone_limit_number.value = true;
clone_reg_max.value = '无限制';
}
}
const show_popup = ref(false);
const closeEditLimit = () => {
show_popup.value = false;
// 还原数据
reg_max.value = clone_reg_max.value;
limit_number.value = clone_limit_number.value;
}
const confirmEditLimit = () => { // 提交人数限制
if (limit_number.value) {
...
...
@@ -738,6 +752,15 @@ const updateActivityInfo = async ({ activity, host }) => {
defaultActivityTime = formatInfoDate(activity.activity_time);
defaultStartTime = formatInfoDate(activity.reg_begin_time);
defaultEndTime = formatInfoDate(activity.reg_end_time);
// 人数限制字段
if (activity.reg_max) { // 有人数
limit_number.value = false;
temp_reg_max.value = activity.reg_max;
reg_max.value = activity.reg_max;
} else { // 无限制
limit_number.value = true;
reg_max.value = '无限制';
}
}
}
</script>
...
...
Please
register
or
login
to post a comment