Authored by Tao

modify channel parmas

... ... @@ -77,9 +77,9 @@ const xianyu = {
for (let key in pageParams) {
arr.push(pageParams[key]);
}
}
pageParams = JSON.parse(arr[0]).params;
console.log(JSON.parse(arr[0]).params);
}
// console.log(JSON.parse(arr[0]).params);
if (pageParams.pagename) {
switch (pageParams.pagename) {
case 'productList':
... ... @@ -104,9 +104,17 @@ const xianyu = {
}
if (pageName) {
let paramsV = {};
if (pageName === 'List') {
paramsV.query = pageParams;
} else {
paramsV.params = pageParams;
}
console.log(paramsV);
return this.$router.push({
name: pageName,
params: pageParams
...paramsV,
});
}
}
... ...
<template>
<div class="hot" v-if="list.length > 0">
<ul>
<li v-for="(item, index) in list" :key="index" @click="goProduct(item)">
<li v-for="(item, index) in list" :key="index">
<LayoutLink :href="item.url" class="img-link">
<div class="hot-image">
<ImageFormat :lazy="false" class="item-imge" :src="item.src" :alt="item.alt" :width="100" :height="100"></ImageFormat>
</div>
<div class="hot-name">{{item.title}}</div>
</LayoutLink>
</li>
<li @click="goMore" class="goMore">
<div class="hot-image">更多</div>
... ... @@ -31,12 +33,14 @@ export default {
ImgSize,
},
methods: {
goProduct(item) {
this.$router.push({
path: 'List',
query: {series: item.series_id }
});
},
// goProduct(item) {
// console.log(item);
// return false;
// this.$router.push({
// name: 'List',
// query: {series: item.series_id }
// });
// },
goMore() {
this.$router.push({ path: 'category' });
... ...
... ... @@ -3,9 +3,9 @@
<div class="news-list-title" v-if="isTitle">最新消息</div>
<ul class="news-list-content">
<li v-for="(item, key) in list" :key="key">
<LayoutLink :href="item.action || ''" class="img-link">
<div class="news-list-name">{{ item.content }}</div>
<div class="news-list-time">{{ item.createTime }}</div>
<LayoutLink :href="item && item.action || ''" class="img-link">
<div class="news-list-name">{{ item && item.content }}</div>
<div class="news-list-time">{{ item && item.createTime }}</div>
</LayoutLink>
</li>
</ul>
... ...
... ... @@ -41,7 +41,7 @@ export default {
computed: {
...mapState(['newsList']),
},
mounted() {
activated() {
let params = {
type: '',
isPage: true
... ...
... ... @@ -8,7 +8,7 @@
:data="newsDeatilList.list">
<div class="news-content">
<Title :title="title"></Title>
<List v-if="newsDeatilList.list.length > 0" :list="newsDeatilList && newsDeatilList.list || []" :isTitle="false"></List>
<List v-if="newsDeatilList.list && newsDeatilList.list.length > 0" :list="newsDeatilList && newsDeatilList.list || []" :isTitle="false"></List>
<UfoNoItem v-else :tip="`暂无数据`"></UfoNoItem>
</div>
</Scroll>
... ... @@ -40,7 +40,7 @@ export default {
computed: {
...mapState(['newsList','newsDeatilList']),
},
mounted() {
activated() {
let params = {
type: this.type,
isPage: true
... ...
... ... @@ -24,7 +24,7 @@ export default function() {
},
mutations: {
[Types.FETCH_NEWS_LIST](state, { list }) {
state.newsList.list = state.newsList.list.concat(list.list);
state.newsList.list = list.page > 1 ? state.newsList.list.concat(list.list) : list.list;
state.newsList.page = list.page;
state.newsList.totalPage = list.totalPage;
list.page < list.totalPage ? state.newsList.isMoreData = true : state.newsList.isMoreData = false;
... ... @@ -45,23 +45,23 @@ export default function() {
async fetchNewsList({ commit, state }, obj) {
let page = state.newsList.page + 1;
let limit = state.newsList.limit;
let totalPage = state.newsList.totalPage;
let type = obj && obj.type;
let isPage = obj && obj.isPage;
// 页面跳转重置page页码
isPage ? page = 1 : state.newsList.page + 1;
const result = await this.$api.post('/api/ufo/home/newsList', {
page, type: type || '', limit, uid: 500031928
page, type: type || '', limit
});
if (result.code === 200) {
result.data.list && result.data.list.map((res) => {
res.createTime = moment(new Date(res.createTime * 1000)).format('YYYY.MM.DD HH:mm');
});
commit(Types.FETCH_NEWS_LIST, {list: result.data});
if (obj.type == 1 || obj.type == 2 || obj.type == 3) {
if (type) {
commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});
} else {
commit(Types.FETCH_NEWS_LIST, {list: result.data});
}
}
},
... ...
... ... @@ -98,9 +98,9 @@ module.exports = {
ufo: true,
api: 'ufo.users.listInboxs',
params: {
uid: {type: Number}
// uid: {type: Number}
},
// auth: true,
auth: true,
},
'/api/ufo/home/newsListTab': {
ufo: true,
... ...