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-11-16 17:05:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f83fd21bcbf224ddd628f79c283dd1476332494e
f83fd21b
1 parent
6d2772eb
新增默认banner图
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
10 deletions
src/assets/images/icon/banner@2x.png
src/pages/index/index.vue
src/utils/config.js
vantComponentConf.js
src/assets/images/icon/banner@2x.png
0 → 100644
View file @
f83fd21
77.2 KB
src/pages/index/index.vue
View file @
f83fd21
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-16 1
3:20:46
* @LastEditTime: 2022-11-16 1
7:03:03
* @FilePath: /swx/src/pages/index/index.vue
* @Description: 首页
-->
...
...
@@ -16,17 +16,17 @@
</swiper-item>
</swiper>
</view>
<view v-
else><image :src="icon_no_join_recommend" class="slide-image
" /></view>
<view v-
if="no_carousel"><image :src="icon_banner" class="slide-image" style="width: 100%;
" /></view>
<view style="padding: 1rem 1rem 0.5rem 1rem;">
<text class="bg-gradient" style="font-size: 1.15rem;">推荐活动</text>
</view>
</view>
<scroll-view :scroll-y="true" :style="scrollStyle" @scrolltolower="onScrollToLower" style="
background-color: white;
">
<view v-if="activity_list.length" style="padding: 0 1rem;">
<scroll-view :scroll-y="true" :style="scrollStyle" @scrolltolower="onScrollToLower" style="">
<view v-if="activity_list.length" style="padding: 0 1rem;
background-color: white;
">
<activity-card v-for="(item, index) in activity_list" :key="index" :data="item" status="join"></activity-card>
</view>
<!-- T
ODO
: 缺省页 -->
<van-empty v-
else
description="暂无推荐活动" class="custom-image" :image="icon_no_join_recommend" />
<!-- T
AG
: 缺省页 -->
<van-empty v-
if="no_activity"
description="暂无推荐活动" class="custom-image" :image="icon_no_join_recommend" />
</scroll-view>
<view style="height: 6rem;"></view>
<navbar activated="home" />
...
...
@@ -39,6 +39,7 @@ import Taro from '@tarojs/taro'
import { ref } from 'vue';
import activityCard from '@/components/activity-card.vue'
import icon_no_join_recommend from '@/images/icon/no-tuijian@2x.png'
import icon_banner from '@/images/icon/banner@2x.png'
import navbar from '@/components/navbar.vue'
import Toast from '@/components/vant-weapp/toast/toast';
// import { useDidShow } from '@/hooks/life'
...
...
@@ -110,6 +111,7 @@ export default {
});
},
async onShow () {
Taro.showLoading({ mask: true, title: "加载中..." })
// 获取活动和轮播信息
const { code, data } = await activityHomeAPI({ page: this.page, limit: this.limit });
if (code) {
...
...
@@ -127,6 +129,10 @@ export default {
this.activity_list = data.activity_list;
this.carousel = data.carousel;
this.page = this.page + 1;
// 缺省页判断
this.no_activity = this.activity_list.length ? false : true;
this.no_carousel = this.carousel.length ? false : true;
Taro.hideLoading()
}
},
onHide () { // 离开当前页面
...
...
@@ -154,6 +160,8 @@ export default {
hasIndicatorDots: true,
activity_list: [],
carousel: [],
no_activity: false,
no_carousel: false,
flag: true,
page: 0,
limit: 10,
...
...
src/utils/config.js
View file @
f83fd21
/*
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-16 1
0:41:25
* @LastEditTime: 2022-11-16 1
7:04:29
* @FilePath: /swx/src/utils/config.js
* @Description: 文件描述
*/
// TAG:服务器环境配置
const
BASE_URL
=
"http://wenxuan.onwall.cn"
;
// 测试服务器
//
const BASE_URL = "https://oa.onwall.cn"; // 正式服务器
//
const BASE_URL = "http://wenxuan.onwall.cn"; // 测试服务器
const
BASE_URL
=
"https://oa.onwall.cn"
;
// 正式服务器
export
default
BASE_URL
...
...
vantComponentConf.js
View file @
f83fd21
/*
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-
03 14:15:39
* @LastEditTime: 2022-11-
16 16:02:30
* @FilePath: /swx/vantComponentConf.js
* @Description: 文件描述
*/
...
...
@@ -38,6 +38,7 @@ const vantComponentNames = [
"radio-group"
,
"tag"
,
"datetime-picker"
,
"skeleton"
,
];
module
.
exports
=
vantComponentNames
;
...
...
Please
register
or
login
to post a comment