Showing
4 changed files
with
19 additions
and
10 deletions
src/assets/images/icon/banner@2x.png
0 → 100644
77.2 KB
| 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-11-16 13:20:46 | 4 | + * @LastEditTime: 2022-11-16 17:03:03 |
| 5 | * @FilePath: /swx/src/pages/index/index.vue | 5 | * @FilePath: /swx/src/pages/index/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -16,17 +16,17 @@ | ... | @@ -16,17 +16,17 @@ |
| 16 | </swiper-item> | 16 | </swiper-item> |
| 17 | </swiper> | 17 | </swiper> |
| 18 | </view> | 18 | </view> |
| 19 | - <view v-else><image :src="icon_no_join_recommend" class="slide-image" /></view> | 19 | + <view v-if="no_carousel"><image :src="icon_banner" class="slide-image" style="width: 100%;" /></view> |
| 20 | <view style="padding: 1rem 1rem 0.5rem 1rem;"> | 20 | <view style="padding: 1rem 1rem 0.5rem 1rem;"> |
| 21 | <text class="bg-gradient" style="font-size: 1.15rem;">推荐活动</text> | 21 | <text class="bg-gradient" style="font-size: 1.15rem;">推荐活动</text> |
| 22 | </view> | 22 | </view> |
| 23 | </view> | 23 | </view> |
| 24 | - <scroll-view :scroll-y="true" :style="scrollStyle" @scrolltolower="onScrollToLower" style="background-color: white;"> | 24 | + <scroll-view :scroll-y="true" :style="scrollStyle" @scrolltolower="onScrollToLower" style=""> |
| 25 | - <view v-if="activity_list.length" style="padding: 0 1rem;"> | 25 | + <view v-if="activity_list.length" style="padding: 0 1rem; background-color: white;"> |
| 26 | <activity-card v-for="(item, index) in activity_list" :key="index" :data="item" status="join"></activity-card> | 26 | <activity-card v-for="(item, index) in activity_list" :key="index" :data="item" status="join"></activity-card> |
| 27 | </view> | 27 | </view> |
| 28 | - <!-- TODO: 缺省页 --> | 28 | + <!-- TAG: 缺省页 --> |
| 29 | - <van-empty v-else description="暂无推荐活动" class="custom-image" :image="icon_no_join_recommend" /> | 29 | + <van-empty v-if="no_activity" description="暂无推荐活动" class="custom-image" :image="icon_no_join_recommend" /> |
| 30 | </scroll-view> | 30 | </scroll-view> |
| 31 | <view style="height: 6rem;"></view> | 31 | <view style="height: 6rem;"></view> |
| 32 | <navbar activated="home" /> | 32 | <navbar activated="home" /> |
| ... | @@ -39,6 +39,7 @@ import Taro from '@tarojs/taro' | ... | @@ -39,6 +39,7 @@ import Taro from '@tarojs/taro' |
| 39 | import { ref } from 'vue'; | 39 | import { ref } from 'vue'; |
| 40 | import activityCard from '@/components/activity-card.vue' | 40 | import activityCard from '@/components/activity-card.vue' |
| 41 | import icon_no_join_recommend from '@/images/icon/no-tuijian@2x.png' | 41 | import icon_no_join_recommend from '@/images/icon/no-tuijian@2x.png' |
| 42 | +import icon_banner from '@/images/icon/banner@2x.png' | ||
| 42 | import navbar from '@/components/navbar.vue' | 43 | import navbar from '@/components/navbar.vue' |
| 43 | import Toast from '@/components/vant-weapp/toast/toast'; | 44 | import Toast from '@/components/vant-weapp/toast/toast'; |
| 44 | // import { useDidShow } from '@/hooks/life' | 45 | // import { useDidShow } from '@/hooks/life' |
| ... | @@ -110,6 +111,7 @@ export default { | ... | @@ -110,6 +111,7 @@ export default { |
| 110 | }); | 111 | }); |
| 111 | }, | 112 | }, |
| 112 | async onShow () { | 113 | async onShow () { |
| 114 | + Taro.showLoading({ mask: true, title: "加载中..." }) | ||
| 113 | // 获取活动和轮播信息 | 115 | // 获取活动和轮播信息 |
| 114 | const { code, data } = await activityHomeAPI({ page: this.page, limit: this.limit }); | 116 | const { code, data } = await activityHomeAPI({ page: this.page, limit: this.limit }); |
| 115 | if (code) { | 117 | if (code) { |
| ... | @@ -127,6 +129,10 @@ export default { | ... | @@ -127,6 +129,10 @@ export default { |
| 127 | this.activity_list = data.activity_list; | 129 | this.activity_list = data.activity_list; |
| 128 | this.carousel = data.carousel; | 130 | this.carousel = data.carousel; |
| 129 | this.page = this.page + 1; | 131 | this.page = this.page + 1; |
| 132 | + // 缺省页判断 | ||
| 133 | + this.no_activity = this.activity_list.length ? false : true; | ||
| 134 | + this.no_carousel = this.carousel.length ? false : true; | ||
| 135 | + Taro.hideLoading() | ||
| 130 | } | 136 | } |
| 131 | }, | 137 | }, |
| 132 | onHide () { // 离开当前页面 | 138 | onHide () { // 离开当前页面 |
| ... | @@ -154,6 +160,8 @@ export default { | ... | @@ -154,6 +160,8 @@ export default { |
| 154 | hasIndicatorDots: true, | 160 | hasIndicatorDots: true, |
| 155 | activity_list: [], | 161 | activity_list: [], |
| 156 | carousel: [], | 162 | carousel: [], |
| 163 | + no_activity: false, | ||
| 164 | + no_carousel: false, | ||
| 157 | flag: true, | 165 | flag: true, |
| 158 | page: 0, | 166 | page: 0, |
| 159 | limit: 10, | 167 | limit: 10, | ... | ... |
| 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-11-16 10:41:25 | 4 | + * @LastEditTime: 2022-11-16 17:04:29 |
| 5 | * @FilePath: /swx/src/utils/config.js | 5 | * @FilePath: /swx/src/utils/config.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| 8 | // TAG:服务器环境配置 | 8 | // TAG:服务器环境配置 |
| 9 | -const BASE_URL = "http://wenxuan.onwall.cn"; // 测试服务器 | 9 | +// const BASE_URL = "http://wenxuan.onwall.cn"; // 测试服务器 |
| 10 | -// const BASE_URL = "https://oa.onwall.cn"; // 正式服务器 | 10 | +const BASE_URL = "https://oa.onwall.cn"; // 正式服务器 |
| 11 | 11 | ||
| 12 | export default BASE_URL | 12 | export default BASE_URL | ... | ... |
| 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-11-03 14:15:39 | 4 | + * @LastEditTime: 2022-11-16 16:02:30 |
| 5 | * @FilePath: /swx/vantComponentConf.js | 5 | * @FilePath: /swx/vantComponentConf.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -38,6 +38,7 @@ const vantComponentNames = [ | ... | @@ -38,6 +38,7 @@ const vantComponentNames = [ |
| 38 | "radio-group", | 38 | "radio-group", |
| 39 | "tag", | 39 | "tag", |
| 40 | "datetime-picker", | 40 | "datetime-picker", |
| 41 | + "skeleton", | ||
| 41 | ]; | 42 | ]; |
| 42 | 43 | ||
| 43 | module.exports = vantComponentNames; | 44 | module.exports = vantComponentNames; | ... | ... |
-
Please register or login to post a comment