123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <template>
- <auth-wrap class="usr-collect-info-container" ref="authWrap">
- <template slot="content">
- <view class="search-content">
- <u-search placeholder="请输入关键字" v-model="keyword" @custom="onSearch" @search="onSearch"></u-search>
- </view>
- <view class="u-page" v-if="indexList&&indexList.length>0">
- <item-list :ds="indexList" :onItemClick="onContentClick" />
- </view>
- <u-empty
- v-else
- mode="data"
- text="还没有收藏,赶紧去收藏吧!"
- >
- </u-empty>
- </template>
- </auth-wrap>
- </template>
- <script>
- import { fetchUsrContentInfo } from '@/common/api';
- import AuthWrap from '@/components/AuthComp/index.vue';
- import ItemList from '@/components/ItemList/index.vue';
- import { getImageUrl } from '@/util';
- export default {
- components: {
- AuthWrap,
- ItemList,
- },
- data() {
- return {
- keyword: '',
- indexList: [],
- };
- },
- onLoad() {
- this.$refs.authWrap.reloadPage();
- this.loadmore();
- },
- methods: {
- onContentClick(item) {
- uni.navigateTo({
- url: `/pasb/pages/detail/index?id=${item.id}`,
- });
- },
- async loadmore(keyword = '') {
- const res = await fetchUsrContentInfo({
- pageNum: 1,
- pageSize: 999,
- contentType: 3,
- title: keyword,
- });
- this.indexList = res.rows.map(item => {
- return {
- id: item.id,
- imgUrl: getImageUrl(item.thumbnail),
- title: item.title,
- date: item.updateTime,
- };
- });
- },
- onSearch(val) {
- this.loadmore(val);
- },
- },
- onShareAppMessage() {
- return {
- title: 'First UI组件库',
- };
- },
- };
- </script>
- <style lang="scss" src="./index.scss" />
|