hookehuyr

feat: 添加加载状态提示以提升用户体验

在活动创建和我的创建活动页面中添加加载状态提示
当数据加载时显示loading,加载完成后隐藏
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: 2025-08-18 23:11:40 4 + * @LastEditTime: 2025-08-18 23:16:58
5 * @FilePath: /swx/src/pages/createActivity/index.vue 5 * @FilePath: /swx/src/pages/createActivity/index.vue
6 * @Description: 创建活动页面 6 * @Description: 创建活动页面
7 --> 7 -->
...@@ -428,6 +428,7 @@ onMounted(async () => { ...@@ -428,6 +428,7 @@ onMounted(async () => {
428 }); 428 });
429 const { code, data } = await activityInfoAPI({ i: getCurrentPageParam().id }); 429 const { code, data } = await activityInfoAPI({ i: getCurrentPageParam().id });
430 if (code) { 430 if (code) {
431 + Taro.showLoading({ mask: true, title: "加载中..." })
431 // 更新活动信息 432 // 更新活动信息
432 updateActivityInfo(data); 433 updateActivityInfo(data);
433 } 434 }
...@@ -974,6 +975,8 @@ const updateActivityInfo = async ({ activity, host }) => { ...@@ -974,6 +975,8 @@ const updateActivityInfo = async ({ activity, host }) => {
974 // 义工岗位 975 // 义工岗位
975 job_post.value = activity.extend.length ? activity.extend.join(',') : ''; 976 job_post.value = activity.extend.length ? activity.extend.join(',') : '';
976 extend.value = activity.extend; 977 extend.value = activity.extend;
978 + // 隐藏loading
979 + Taro.hideLoading();
977 } 980 }
978 } 981 }
979 982
......
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-12-08 09:44:01 4 + * @LastEditTime: 2025-08-18 23:20:34
5 * @FilePath: /swx/src/pages/myCreateActivity/index.vue 5 * @FilePath: /swx/src/pages/myCreateActivity/index.vue
6 * @Description: 创建的活动页面 6 * @Description: 创建的活动页面
7 --> 7 -->
...@@ -198,6 +198,7 @@ export default { ...@@ -198,6 +198,7 @@ export default {
198 name: "myCreateActivityPage", 198 name: "myCreateActivityPage",
199 mixins: [mixin.init], 199 mixins: [mixin.init],
200 async onShow () { 200 async onShow () {
201 + Taro.showLoading({ mask: true, title: "加载中..." })
201 // 先看一下有没有缓存过主办方ID 202 // 先看一下有没有缓存过主办方ID
202 const id = hostStore().id; 203 const id = hostStore().id;
203 let host_id = ''; 204 let host_id = '';
...@@ -240,6 +241,7 @@ export default { ...@@ -240,6 +241,7 @@ export default {
240 this.volunteer_count = data.volunteer_count ? data.volunteer_count : 0; 241 this.volunteer_count = data.volunteer_count ? data.volunteer_count : 0;
241 this.player_count = data.player_count ? data.player_count : 0; 242 this.player_count = data.player_count ? data.player_count : 0;
242 this.page = this.page + 1; 243 this.page = this.page + 1;
244 + Taro.hideLoading()
243 } 245 }
244 }, 246 },
245 onHide () { // 离开当前页面 247 onHide () { // 离开当前页面
......