hookehuyr

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

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-19 17:52:40 4 + * @LastEditTime: 2022-10-19 18:06:30
5 * @FilePath: /swx/src/pages/createActivity/index.vue 5 * @FilePath: /swx/src/pages/createActivity/index.vue
6 * @Description: 创建活动页面 6 * @Description: 创建活动页面
7 --> 7 -->
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
163 <!-- 活动主办方弹出框 --> 163 <!-- 活动主办方弹出框 -->
164 <van-popup :show="show_org_popup" position="bottom" custom-style="height: 40%;" :lock-scroll="true"> 164 <van-popup :show="show_org_popup" position="bottom" custom-style="height: 40%;" :lock-scroll="true">
165 <van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="org_type_columns" 165 <van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="org_type_columns"
166 + :default-index="defaultIndex"
166 toolbar-class="picker-toolbar" @confirm="onOrgTypeConfirm" @cancel="onOrgTypeCancel" @change="onOrgTypeChange" /> 167 toolbar-class="picker-toolbar" @confirm="onOrgTypeConfirm" @cancel="onOrgTypeCancel" @change="onOrgTypeChange" />
167 </van-popup> 168 </van-popup>
168 <!-- 报名信息弹出框 --> 169 <!-- 报名信息弹出框 -->
...@@ -730,6 +731,7 @@ const formatInfoDate = (date) => { ...@@ -730,6 +731,7 @@ const formatInfoDate = (date) => {
730 } 731 }
731 732
732 // 获取活动信息,还原 733 // 获取活动信息,还原
734 +const defaultIndex = ref(0);
733 const html_content = ref(''); 735 const html_content = ref('');
734 const activity_id = ref(''); 736 const activity_id = ref('');
735 const updateActivityInfo = async ({ activity, host }) => { 737 const updateActivityInfo = async ({ activity, host }) => {
...@@ -740,6 +742,12 @@ const updateActivityInfo = async ({ activity, host }) => { ...@@ -740,6 +742,12 @@ const updateActivityInfo = async ({ activity, host }) => {
740 activity_id.value = activity.id; 742 activity_id.value = activity.id;
741 // 主办方 743 // 主办方
742 org_type.value = my_hosts.filter(item => item.id === host.id)[0]['name']; 744 org_type.value = my_hosts.filter(item => item.id === host.id)[0]['name'];
745 + // 主办方默认选中下标
746 + my_hosts.forEach((item, index) => {
747 + if (item.id === host.id) {
748 + defaultIndex.value = index;
749 + }
750 + });
743 host_id.value = host.id; 751 host_id.value = host.id;
744 // 活动主题 752 // 活动主题
745 activity_name.value = activity.name; 753 activity_name.value = activity.name;
......