Authored by yyq

Merge branch 'master' of git.yoho.cn:fe/yoho-community-web

@@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
17 </template> 17 </template>
18 18
19 <script> 19 <script>
  20 +import {mapState} from 'vuex';
  21 +
20 export default { 22 export default {
21 name: 'LayoutHeader', 23 name: 'LayoutHeader',
22 props: { 24 props: {
@@ -29,6 +31,9 @@ export default { @@ -29,6 +31,9 @@ export default {
29 default: 1 31 default: 1
30 } 32 }
31 }, 33 },
  34 + computed: {
  35 + ...mapState(['yoho'])
  36 + },
32 watch: { 37 watch: {
33 transparentSeek(value) { 38 transparentSeek(value) {
34 this.animeEl && this.animeEl.seek(this.animeEl.duration * value); 39 this.animeEl && this.animeEl.seek(this.animeEl.duration * value);
@@ -48,7 +53,11 @@ export default { @@ -48,7 +53,11 @@ export default {
48 }, 53 },
49 methods: { 54 methods: {
50 onBack() { 55 onBack() {
51 - this.$router.go(-1); 56 + if (this.yoho.ssrLoad) {
  57 + this.$yoho.finishPage({});
  58 + } else {
  59 + this.$router.go(-1);
  60 + }
52 } 61 }
53 } 62 }
54 }; 63 };
1 <template> 1 <template>
2 <div 2 <div
3 class="product-item" 3 class="product-item"
4 - :class="{single}"  
5 - @click="onClick"  
6 - > 4 + :class="{single}">
7 <div class="product-content"> 5 <div class="product-content">
8 <ImageFormat :lazy="lazy" class="product-image" :src="product.productImage" :width="136" :height="180"></ImageFormat> 6 <ImageFormat :lazy="lazy" class="product-image" :src="product.productImage" :width="136" :height="180"></ImageFormat>
9 <div class="product-info"> 7 <div class="product-info">
@@ -97,11 +95,11 @@ export default { @@ -97,11 +95,11 @@ export default {
97 white-space: initial; 95 white-space: initial;
98 96
99 &:last-child { 97 &:last-child {
100 - margin-right: 30px; 98 + margin-right: 50px;
101 } 99 }
102 100
103 &.single { 101 &.single {
104 - width: 690px; 102 + width: 670px;
105 } 103 }
106 } 104 }
107 105
@@ -145,6 +145,7 @@ export default { @@ -145,6 +145,7 @@ export default {
145 padding-top: 0; 145 padding-top: 0;
146 padding-bottom: 0; 146 padding-bottom: 0;
147 margin: 40px 0; 147 margin: 40px 0;
  148 + overflow: initial;
148 } 149 }
149 150
150 /deep/ .product-item { 151 /deep/ .product-item {
@@ -9,7 +9,6 @@ export function createRouter() { @@ -9,7 +9,6 @@ export function createRouter() {
9 mode: 'history', 9 mode: 'history',
10 routes, 10 routes,
11 scrollBehavior(to, from, savedPosition) { 11 scrollBehavior(to, from, savedPosition) {
12 - console.log(to.name)  
13 if (savedPosition) { 12 if (savedPosition) {
14 return savedPosition; 13 return savedPosition;
15 } else { 14 } else {
@@ -26,6 +26,7 @@ export default function() { @@ -26,6 +26,7 @@ export default function() {
26 }, 26 },
27 historys: [], 27 historys: [],
28 direction: 'forword', 28 direction: 'forword',
  29 + ssrLoad: true, // 是否是ssr直出的页面
29 }, 30 },
30 mutations: { 31 mutations: {
31 [Types.SET_ENV](state, {context}) { 32 [Types.SET_ENV](state, {context}) {
@@ -39,6 +40,7 @@ export default function() { @@ -39,6 +40,7 @@ export default function() {
39 state.context.title = title; 40 state.context.title = title;
40 }, 41 },
41 [Types.ROUTE_CHANGE](state, {to, from}) { 42 [Types.ROUTE_CHANGE](state, {to, from}) {
  43 + state.ssrLoad = false;
42 if (!state.historys.length) { 44 if (!state.historys.length) {
43 state.historys.push({ 45 state.historys.push({
44 name: from.name, 46 name: from.name,