123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <view class="fui-wrap">
- <!-- <view class="search-content">-->
- <!-- <u-search placeholder="请输入关键字" v-model="keyword" @custom="onSearch" @search="onSearch"></u-search>-->
- <!-- </view>-->
- <u-swiper :list="list" imgMode="aspectFit" :radius='10' :height="240" />
- <u-notice-bar :text="msg" direction="column" :more-icon="false" color="#5af" bg-color="#d6e8f7"></u-notice-bar>
- <view style="width: 100%; margin-top: 20rpx">
- <u-grid
- :border="false"
- :col="3"
- @click="click"
- >
- <u-grid-item
- v-for="(baseListItem,baseListIndex) in baseList"
- :key="baseListIndex"
- @click="$u.throttle(()=>onItemClick(baseListItem), 500)"
- >
- <view class="grid-item-icon" :style="[baseListItem.style]">
- <image :src="baseListItem.icon"></image>
- </view>
- <text class="grid-text">{{ baseListItem.title }}</text>
- </u-grid-item>
- </u-grid>
- </view>
- <u-gap height="10" bgColor="#bbb"></u-gap>
- <view class="u-page">
- <view class="u-page-title">
- <view class="line"></view>
- <view class="rectangle"></view>
- <view class="rectangle"></view>
- <view class="title-content">主题研讨报名</view>
- <view class="rectangle"></view>
- <view class="rectangle"></view>
- <view class="line"></view>
- </view>
- <item-list :ds="indexList" :onItemClick="onContentClick" />
- </view>
- </view>
- </template>
- <script>
- import { fetchContentInfo, fetchMsgList, fetchViewCfgList } from '@/common/api';
- import { COMP_CODE, MEETING_TYPE } from '@/common/EnumConst';
- import ItemList from '@/components/ItemList/index.vue';
- import { getImageUrl, setStorageObj, storageKey } from '@/util';
- export default {
- components: {
- ItemList,
- },
- data() {
- return {
- keyword: '',
- list: [],
- msg: [],
- baseList: [],
- indexList: [],
- styleObj: {
- 'backgroundColor': '#000',
- },
- };
- },
- onLoad() {
- this.loadMsg();
- this.loadmore();
- this.viewCfg();
- },
- methods: {
- click() {
- },
- onContentClick(item) {
- setStorageObj(storageKey.regtheme, {
- type: MEETING_TYPE.theme.value,
- id: item.id,
- });
- uni.navigateTo({
- url: `/pasbrg/pages/regtheme/index?type=${MEETING_TYPE.theme.value}&id=${item.id}`,
- });
- },
- async loadmore() {
- const res = await fetchContentInfo({
- pageNum: 1,
- pageSize: 99,
- contentType: 4,
- });
- this.indexList = res.rows.map(item => {
- return {
- id: item.id,
- imgUrl: getImageUrl(item.thumbnail),
- title: item.title,
- date: item.createTime,
- };
- });
- },
- async loadMsg() {
- let result = [];
- const res = await fetchMsgList({
- pageNum: 1,
- pageSize: 99,
- });
- if (res.rows.length > 0) {
- result = res.rows.map(item => item.msg);
- }
- this.msg = result;
- },
- async viewCfg() {
- let result = [];
- const res = await fetchViewCfgList({
- pageNum: 1,
- pageSize: 99,
- });
- if (res.rows.length > 0) {
- result = res.rows.map(item => item.msg);
- const index_ctl = res.rows.filter((item) => item.compCode === COMP_CODE.index_ctl);
- const index_swip = res.rows.filter((item) => item.compCode === COMP_CODE.index_swip);
- this.list = index_swip.map(item => getImageUrl(item.iconUri));
- this.baseList = index_ctl.map(item => {
- return {
- icon: getImageUrl(item.iconUri),
- style: JSON.parse(item.style),
- title: item.labelTxt,
- url: item.url,
- };
- });
- }
- },
- // onSearch(val) {
- // uni.reLaunch({
- // url: `/pages/tabbar/news/index?keyword=${val}`,
- // });
- // },
- onItemClick(item) {
- if (item.url) {
- uni.navigateTo({
- url: item.url,
- });
- }
- },
- },
- onShareAppMessage() {
- return {
- title: 'First UI组件库',
- };
- },
- };
- </script>
- <style lang="scss" src="./index.scss">
- </style>
|