Authored by 郝肖肖

Merge branch 'feature/registerYas' of git.yoho.cn:fe/yohobuywap-node into feature/registerYas

1 -<div class="top"></div>  
2 -<div class="foot"></div>  
1 -<div id="app">  
2 - <app></app>  
3 -</div>  
1 -/**  
2 - * vue前端渲染的公共方法  
3 - * @author: 陈峰<feng.chen@yoho.cn>  
4 - * @date: 2016/11/07  
5 - */  
6 -  
7 -'use strict';  
8 -  
9 -module.exports = () => {  
10 - return (req, res, next) => {  
11 - res.vueRender = (params) => {  
12 - res.render('vue/index', params);  
13 - }  
14 - next();  
15 - };  
16 -};  
1 -<div id="app">  
2 - <app></app>  
3 -</div>  
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "5.1.7", 3 + "version": "5.1.9",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
1 -require('../vue-render')(Vue => {  
2 - //注册子组件  
3 - require('../vue-component/app-child')(Vue);  
4 - //注册父组件  
5 - Vue.component('app', {  
6 - template: require('activity/demo/index.html'),  
7 - data() {  
8 - return {  
9 - msg: 'app'  
10 - }  
11 - },  
12 - methods: {  
13 - click() {  
14 - alert(this.msg)  
15 - }  
16 - }  
17 - });  
18 -})  
@@ -127,6 +127,8 @@ var singleDay = { @@ -127,6 +127,8 @@ var singleDay = {
127 $swiperTab.on('click', function() { 127 $swiperTab.on('click', function() {
128 var index = $(this).index(); 128 var index = $(this).index();
129 129
  130 + $('body').scrollTop(0);
  131 +
130 $swiperTab.removeClass('active').eq(index).addClass('active'); 132 $swiperTab.removeClass('active').eq(index).addClass('active');
131 133
132 if (self.$productTab.eq(index).find('li').length > 0) { 134 if (self.$productTab.eq(index).find('li').length > 0) {
@@ -398,6 +398,8 @@ function givePoint(parameter) { @@ -398,6 +398,8 @@ function givePoint(parameter) {
398 } 398 }
399 break; 399 break;
400 } 400 }
  401 + } else {
  402 + header.removeClass('girls', 'life-style', 'kids');
401 } 403 }
402 }()); 404 }());
403 405
@@ -242,6 +242,7 @@ seckillObj = { @@ -242,6 +242,7 @@ seckillObj = {
242 data = $.extend(data, {isApp: yoho.isApp}); 242 data = $.extend(data, {isApp: yoho.isApp});
243 $('.product-list').html(self.listTemplate(data)); 243 $('.product-list').html(self.listTemplate(data));
244 lazyload('img.lazy'); 244 lazyload('img.lazy');
  245 + window.scrollTo(0, 0);
245 window.rePosFooter(); 246 window.rePosFooter();
246 }, 247 },
247 error: function(data) { 248 error: function(data) {
1 -//组件声明  
2 -module.exports = (Vue) => {  
3 - Vue.component('app-child', {  
4 - template: require('component/compont1.html'),  
5 - props: ['msg'],  
6 - data() {  
7 - return {  
8 -  
9 - }  
10 - }  
11 - })  
12 -  
13 -}  
1 -module.exports = (component) => {  
2 - let Vue = require('vue');  
3 -  
4 - //注册组件  
5 - component(Vue);  
6 -  
7 - //创建Vue实例  
8 - new Vue({  
9 - el: '#app'  
10 - });  
11 -}  
1 -  
2 -.input {  
3 - border: solid 1px #ccc;  
4 -}  
5 -button {  
6 - display: block;  
7 - width: 100px;  
8 - height: 40px;  
9 - color: #fff;  
10 - background-color: green;  
11 -}  
12 -* {  
13 - margin-top: 10px !important;  
14 - margin-bottom: 10px !important;  
15 -}  
16 -.parent, .child {  
17 - padding: 20px;  
18 - border: solid 1px #ccc;  
19 -}  
20 -h4{  
21 - color: red;  
22 -}  
1 -<div class="parent">  
2 - <h4>父组件</h4>  
3 - <p>{{msg}}</p>  
4 - <input type="text" class="input" v-model="msg">  
5 - <button v-on:click="click()">点我</button>  
6 - <app-child :msg="msg"></app-child>  
7 -</div>  
1 -<div class="child">  
2 - <h4>子组件</h4>  
3 - <div>{{msg}}</div>  
4 - <input type="text" class="input" v-model="msg">  
5 -</div>