Authored by lea guo

发现好货标题自定义

@@ -29,11 +29,11 @@ export default { @@ -29,11 +29,11 @@ export default {
29 sceneId: YAS.scene.list 29 sceneId: YAS.scene.list
30 }; 30 };
31 }, 31 },
32 - created() {  
33 - this.setTitle();  
34 - },  
35 mounted() { 32 mounted() {
36 - this.setTitle(); 33 + // 自定义title
  34 + const { title = '' } = this.$route.query || {};
  35 +
  36 + this.title = title || '发现好货';
37 }, 37 },
38 async serverPrefetch() { 38 async serverPrefetch() {
39 return this.fetchFindNiceGoodsArticles({ 39 return this.fetchFindNiceGoodsArticles({
@@ -51,12 +51,6 @@ export default { @@ -51,12 +51,6 @@ export default {
51 }, 51 },
52 methods: { 52 methods: {
53 ...mapActions(['fetchFindNiceGoodsArticles']), 53 ...mapActions(['fetchFindNiceGoodsArticles']),
54 - setTitle() {  
55 - // 自定义title  
56 - const { title = '' } = this.yoho.context;  
57 -  
58 - this.title = title || '发现好货';  
59 - },  
60 init() { 54 init() {
61 this.page = 1; 55 this.page = 1;
62 this.$refs.article.init(); 56 this.$refs.article.init();
@@ -61,12 +61,9 @@ const asyncLoadScripts = renderScripts => { @@ -61,12 +61,9 @@ const asyncLoadScripts = renderScripts => {
61 }; 61 };
62 62
63 const getContext = req => { 63 const getContext = req => {
64 - // title 为'发现好货'标题自定义字段  
65 - const { share_title = '', title = '' } = req.query;  
66 -  
67 return { 64 return {
68 url: req.url, 65 url: req.url,
69 - title: share_title || title || '', 66 + title: req.query.share_title || '',
70 user: req.user, 67 user: req.user,
71 env: { 68 env: {
72 isApp: req.yoho.isApp, 69 isApp: req.yoho.isApp,