hookehuyr

fix 修复主办方默认选中下标问题

<!--
* @Date: 2022-09-21 16:04:10
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-19 17:52:40
* @LastEditTime: 2022-10-19 18:06:30
* @FilePath: /swx/src/pages/createActivity/index.vue
* @Description: 创建活动页面
-->
......@@ -163,6 +163,7 @@
<!-- 活动主办方弹出框 -->
<van-popup :show="show_org_popup" position="bottom" custom-style="height: 40%;" :lock-scroll="true">
<van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="org_type_columns"
:default-index="defaultIndex"
toolbar-class="picker-toolbar" @confirm="onOrgTypeConfirm" @cancel="onOrgTypeCancel" @change="onOrgTypeChange" />
</van-popup>
<!-- 报名信息弹出框 -->
......@@ -730,6 +731,7 @@ const formatInfoDate = (date) => {
}
// 获取活动信息,还原
const defaultIndex = ref(0);
const html_content = ref('');
const activity_id = ref('');
const updateActivityInfo = async ({ activity, host }) => {
......@@ -740,6 +742,12 @@ const updateActivityInfo = async ({ activity, host }) => {
activity_id.value = activity.id;
// 主办方
org_type.value = my_hosts.filter(item => item.id === host.id)[0]['name'];
// 主办方默认选中下标
my_hosts.forEach((item, index) => {
if (item.id === host.id) {
defaultIndex.value = index;
}
});
host_id.value = host.id;
// 活动主题
activity_name.value = activity.name;
......