Authored by zhangxiaoru

merge

@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 6
7 'use strict'; 7 'use strict';
8 8
9 -const service = global.yoho.ServiceAPI; 9 +const service = global.yoho.StoreAPI;
10 const moment = require('moment'); 10 const moment = require('moment');
11 11
12 // 格式年月日 12 // 格式年月日
@@ -21,6 +21,9 @@ const index = (req, res) => { @@ -21,6 +21,9 @@ const index = (req, res) => {
21 signurl: helpers.urlFormat('/signin.html') 21 signurl: helpers.urlFormat('/signin.html')
22 }; 22 };
23 23
  24 + // 唤起 APP 的路径
  25 + res.locals.appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shopcart","params":{}}';
  26 +
24 res.render('index', Object.assign(pageData, { 27 res.render('index', Object.assign(pageData, {
25 title: '购物车', 28 title: '购物车',
26 module: 'cart', 29 module: 'cart',
@@ -29,6 +29,9 @@ let index = (req, res, next) => { @@ -29,6 +29,9 @@ let index = (req, res, next) => {
29 }; 29 };
30 let channel; 30 let channel;
31 31
  32 + // 唤起 APP 的路径
  33 + res.locals.appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.attention","params":{"actiontype":"1"}}';
  34 +
32 if (!req.query.channel) { 35 if (!req.query.channel) {
33 channel = '1'; 36 channel = '1';
34 } else if (!typeLib.channels[req.query.channel]) { 37 } else if (!typeLib.channels[req.query.channel]) {
@@ -7,6 +7,8 @@ const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab @@ -7,6 +7,8 @@ const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab
7 const helpers = global.yoho.helpers; 7 const helpers = global.yoho.helpers;
8 8
9 let index = (req, res, next) => { 9 let index = (req, res, next) => {
  10 + // 唤起 APP 的路径
  11 + res.locals.appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.attention","params":{"actiontype":"0"}}';
10 12
11 cateModel.getCateData(req.yoho.channel).then((result) => { 13 cateModel.getCateData(req.yoho.channel).then((result) => {
12 res.render('cate', { 14 res.render('cate', {
@@ -210,6 +210,10 @@ const index = (req, res, next) => { @@ -210,6 +210,10 @@ const index = (req, res, next) => {
210 res.set('Cache-Control', 'no-cache'); 210 res.set('Cache-Control', 'no-cache');
211 } 211 }
212 } 212 }
  213 +
  214 + // 唤起 APP 的路径
  215 + res.locals.appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy= {"action":"go.guangchannel","params":{"id":${param.type}}}`;
  216 +
213 res.render('guang', Object.assign(responseData, result, { 217 res.render('guang', Object.assign(responseData, result, {
214 localCss: true 218 localCss: true
215 })); 219 }));
@@ -26,6 +26,9 @@ exports.index = (req, res, next) => { @@ -26,6 +26,9 @@ exports.index = (req, res, next) => {
26 26
27 let studentSwitch = !_.get(req.app.locals.wap, 'user.removeStudentIdentification', true); 27 let studentSwitch = !_.get(req.app.locals.wap, 'user.removeStudentIdentification', true);
28 28
  29 + // 唤起 APP 的路径
  30 + res.locals.appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy= {"action":"go.mine"}';
  31 +
29 indexModel.index(params).then(result => { 32 indexModel.index(params).then(result => {
30 if (result) { 33 if (result) {
31 res.render('home', Object.assign(result, { 34 res.render('home', Object.assign(result, {
@@ -69,6 +69,9 @@ const shop = { @@ -69,6 +69,9 @@ const shop = {
69 69
70 params.brand = brandId; 70 params.brand = brandId;
71 71
  72 + // 唤起 APP 的路径
  73 + res.locals.appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.brand","params":{"brand_id":"${brandId}"}}`;
  74 +
72 let searchParam = Object.assign({ 75 let searchParam = Object.assign({
73 isApp: req.yoho.isApp, 76 isApp: req.yoho.isApp,
74 brand: brandId, 77 brand: brandId,
@@ -17,6 +17,7 @@ const domains = { @@ -17,6 +17,7 @@ const domains = {
17 api: 'http://api-test3.yohops.com:9999/', 17 api: 'http://api-test3.yohops.com:9999/',
18 service: 'http://service-test3.yohops.com:9999/', 18 service: 'http://service-test3.yohops.com:9999/',
19 global: 'http://api-global.yohobuy.com', 19 global: 'http://api-global.yohobuy.com',
  20 + store: 'http://192.168.102.210:8080/portal-gateway/',
20 21
21 // liveApi: 'http://api.live.yoho.cn/', 22 // liveApi: 'http://api.live.yoho.cn/',
22 // singleApi: 'http://single.yoho.cn/', 23 // singleApi: 'http://single.yoho.cn/',
@@ -114,6 +115,7 @@ if (isProduction) { @@ -114,6 +115,7 @@ if (isProduction) {
114 api: 'http://api.yoho.yohoops.org/', 115 api: 'http://api.yoho.yohoops.org/',
115 service: 'http://service.yoho.yohoops.org/', 116 service: 'http://service.yoho.yohoops.org/',
116 global: 'http://api-global.yohobuy.com', 117 global: 'http://api-global.yohobuy.com',
  118 + store: '', // 线上域名尚未确定
117 liveApi: 'http://api.live.yoho.cn/', 119 liveApi: 'http://api.live.yoho.cn/',
118 singleApi: 'http://single.yoho.cn/', 120 singleApi: 'http://single.yoho.cn/',
119 imSocket: 'wss://imsocket.yohobuy.com:443', 121 imSocket: 'wss://imsocket.yohobuy.com:443',
@@ -162,7 +164,8 @@ if (isProduction) { @@ -162,7 +164,8 @@ if (isProduction) {
162 domains: { 164 domains: {
163 api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/', 165 api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
164 service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/', 166 service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',
165 - global: process.env.TEST_GLOBAL || 'http://global-test-soa.yohops.com:9999', 167 + global: process.env.TEST_GLOBAL || 'http://global-test-soa.yohops.com:9999/',
  168 + store: process.env.TEST_STORE || 'http://192.168.102.210:8080/portal-gateway/',
166 liveApi: process.env.TEST_LIVE || 'http://testapi.live.yohops.com:9999/', 169 liveApi: process.env.TEST_LIVE || 'http://testapi.live.yohops.com:9999/',
167 singleApi: process.env.TEST_SINGLE || 'http://api-test1.yohops.com:9999/', 170 singleApi: process.env.TEST_SINGLE || 'http://api-test1.yohops.com:9999/',
168 imSocket: process.env.TEST_IM_SOCKET || 'ws://socket.yohobuy.com:10240', 171 imSocket: process.env.TEST_IM_SOCKET || 'ws://socket.yohobuy.com:10240',
@@ -22,6 +22,9 @@ @@ -22,6 +22,9 @@
22 </span> 22 </span>
23 {{/if}} 23 {{/if}}
24 </p> 24 </p>
  25 + {{#if appearDate}}
  26 + <span class="appear-date">上市期:{{appearDate}}</span>
  27 + {{/if}}
25 <p class="row price-wrap"> 28 <p class="row price-wrap">
26 <span class="price"> 29 <span class="price">
27 ¥{{price}} 30 ¥{{price}}
@@ -29,9 +32,6 @@ @@ -29,9 +32,6 @@
29 <span class="count"> 32 <span class="count">
30 ×{{count}} 33 ×{{count}}
31 </span> 34 </span>
32 - {{#if appearDate}}  
33 - <span class="appear-date">上市期:{{appearDate}}</span>  
34 - {{/if}}  
35 </p> 35 </p>
36 </div> 36 </div>
37 </div> 37 </div>
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "5.6.4", 3 + "version": "5.7.0",
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": {
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 "body-parser": "^1.16.1", 26 "body-parser": "^1.16.1",
27 "captchapng": "0.0.1", 27 "captchapng": "0.0.1",
28 "cheerio": "^0.22.0", 28 "cheerio": "^0.22.0",
29 - "client-sessions": "^0.7.0", 29 + "client-sessions": "^0.8.0",
30 "compression": "^1.6.2", 30 "compression": "^1.6.2",
31 "connect-memcached": "^0.2.0", 31 "connect-memcached": "^0.2.0",
32 "connect-multiparty": "^2.0.0", 32 "connect-multiparty": "^2.0.0",
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 "lodash": "^4.17.4", 37 "lodash": "^4.17.4",
38 "memory-cache": "^0.1.6", 38 "memory-cache": "^0.1.6",
39 "moment": "^2.18.1", 39 "moment": "^2.18.1",
40 - "oneapm": "^1.2.20", 40 + "oneapm": "^2.0.0",
41 "passport": "^0.3.2", 41 "passport": "^0.3.2",
42 "passport-local": "^1.0.0", 42 "passport-local": "^1.0.0",
43 "passport-qq": "0.0.3", 43 "passport-qq": "0.0.3",
@@ -45,20 +45,20 @@ @@ -45,20 +45,20 @@
45 "passport-strategy": "^1.0.0", 45 "passport-strategy": "^1.0.0",
46 "passport-weixin": "^0.1.0", 46 "passport-weixin": "^0.1.0",
47 "request": "^2.81.0", 47 "request": "^2.81.0",
48 - "request-promise": "^3.0.0", 48 + "request-promise": "^4.2.0",
49 "uuid": "^3.0.1", 49 "uuid": "^3.0.1",
50 "xml2js": "^0.4.17", 50 "xml2js": "^0.4.17",
51 "yoho-express-session": "^2.0.0", 51 "yoho-express-session": "^2.0.0",
52 "yoho-md5": "^2.0.0", 52 "yoho-md5": "^2.0.0",
53 - "yoho-node-lib": "=0.2.22", 53 + "yoho-node-lib": "=0.2.25",
54 "yoho-zookeeper": "^1.0.8" 54 "yoho-zookeeper": "^1.0.8"
55 }, 55 },
56 "devDependencies": { 56 "devDependencies": {
57 "autoprefixer": "^6.7.4", 57 "autoprefixer": "^6.7.4",
58 "babel-core": "^6.24.1", 58 "babel-core": "^6.24.1",
59 - "babel-loader": "^6.4.1", 59 + "babel-loader": "^7.0.0",
60 "babel-polyfill": "^6.23.0", 60 "babel-polyfill": "^6.23.0",
61 - "babel-preset-env": "^1.3.3", 61 + "babel-preset-env": "^1.4.0",
62 "css-loader": "^0.28.0", 62 "css-loader": "^0.28.0",
63 "cssnano": "^3.10.0", 63 "cssnano": "^3.10.0",
64 "eslint": "^3.19.0", 64 "eslint": "^3.19.0",
@@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
66 "eslint-loader": "^1.7.1", 66 "eslint-loader": "^1.7.1",
67 "eslint-plugin-html": "^2.0.1", 67 "eslint-plugin-html": "^2.0.1",
68 "extract-text-webpack-plugin": "^2.1.0", 68 "extract-text-webpack-plugin": "^2.1.0",
69 - "handlebars-loader": "^1.4.0", 69 + "handlebars-loader": "^1.5.0",
70 "happypack": "^3.0.3", 70 "happypack": "^3.0.3",
71 "husky": "^0.13.3", 71 "husky": "^0.13.3",
72 "nodemon": "^1.11.0", 72 "nodemon": "^1.11.0",
@@ -78,24 +78,24 @@ @@ -78,24 +78,24 @@
78 "postcss-import": "^9.1.0", 78 "postcss-import": "^9.1.0",
79 "postcss-loader": "^1.3.1", 79 "postcss-loader": "^1.3.1",
80 "postcss-position": "^0.5.0", 80 "postcss-position": "^0.5.0",
81 - "postcss-pxtorem": "^4.0.0", 81 + "postcss-pxtorem": "^4.0.1",
82 "postcss-scss": "^0.4.1", 82 "postcss-scss": "^0.4.1",
83 "postcss-short": "^3.0.3", 83 "postcss-short": "^3.0.3",
84 - "postcss-sprites": "^4.2.0", 84 + "postcss-sprites": "^4.2.1",
85 "postcss-use": "^2.3.0", 85 "postcss-use": "^2.3.0",
86 "precss": "^1.4.0", 86 "precss": "^1.4.0",
87 "shelljs": "^0.7.6", 87 "shelljs": "^0.7.6",
88 - "style-loader": "^0.16.1", 88 + "style-loader": "^0.17.0",
89 "stylelint": "^7.10.1", 89 "stylelint": "^7.10.1",
90 "stylelint-config-yoho": "^1.2.8", 90 "stylelint-config-yoho": "^1.2.8",
91 "stylelint-formatter-table": "^1.0.2", 91 "stylelint-formatter-table": "^1.0.2",
92 "stylelint-processor-html": "^1.0.0", 92 "stylelint-processor-html": "^1.0.0",
93 "stylelint-webpack-plugin": "^0.7.0", 93 "stylelint-webpack-plugin": "^0.7.0",
94 - "vue": "^2.2.6",  
95 - "vue-loader": "^11.3.4",  
96 - "vue-template-compiler": "^2.2.6",  
97 - "webpack": "^2.3.3",  
98 - "webpack-dev-server": "^2.4.2", 94 + "vue": "^2.3.0",
  95 + "vue-loader": "^12.0.2",
  96 + "vue-template-compiler": "^2.3.0",
  97 + "webpack": "^2.4.1",
  98 + "webpack-dev-server": "^2.4.5",
99 "webpack-uglify-parallel": "^0.1.3", 99 "webpack-uglify-parallel": "^0.1.3",
100 "yoho-cookie": "^1.2.0", 100 "yoho-cookie": "^1.2.0",
101 "yoho-fastclick": "^1.0.6", 101 "yoho-fastclick": "^1.0.6",
@@ -27,7 +27,7 @@ _.mergeWith(baseConfig, { @@ -27,7 +27,7 @@ _.mergeWith(baseConfig, {
27 }] 27 }]
28 }, 28 },
29 devServer: { 29 devServer: {
30 - host: '0.0.0.0', 30 + host: devInfo.host,
31 port: devInfo.port, 31 port: devInfo.port,
32 publicPath: devInfo.publicPath, 32 publicPath: devInfo.publicPath,
33 contentBase: [path.join(__dirname, './bundle/'), path.join(__dirname, '../')], 33 contentBase: [path.join(__dirname, './bundle/'), path.join(__dirname, '../')],
@@ -235,7 +235,9 @@ function pullPicBig(cIndex) { @@ -235,7 +235,9 @@ function pullPicBig(cIndex) {
235 $('.swiper-pagination-bullet:eq(' + cIndex + ')').click(); 235 $('.swiper-pagination-bullet:eq(' + cIndex + ')').click();
236 mySwiper.slideTo(cIndex, 1000, false); 236 mySwiper.slideTo(cIndex, 1000, false);
237 $('.big-pic').show(); 237 $('.big-pic').show();
  238 + if ($('.share-photography').length === 0) {
238 $('.foot-btn').hide(); 239 $('.foot-btn').hide();
  240 + }
239 $('.swiper-slide img').each( 241 $('.swiper-slide img').each(
240 function() { 242 function() {
241 let newTop = (w_height - $(this).height()) / 2; 243 let newTop = (w_height - $(this).height()) / 2;
@@ -298,7 +300,10 @@ $( @@ -298,7 +300,10 @@ $(
298 } 300 }
299 301
300 if ($('.clearCookie').length > 0) { 302 if ($('.clearCookie').length > 0) {
  303 + $('.foot-btn').on('click', function() {
301 clearCookieArr(3); 304 clearCookieArr(3);
  305 + chosenDefault();
  306 + });
302 } 307 }
303 308
304 // 默认选中菜单 309 // 默认选中菜单
@@ -360,6 +360,8 @@ @@ -360,6 +360,8 @@
360 360
361 .appear-date { 361 .appear-date {
362 color: #f00; 362 color: #f00;
  363 + float: right;
  364 + margin-right: 30px;
363 } 365 }
364 } 366 }
365 367