Authored by ccbikai

优化程序

@@ -20,20 +20,15 @@ module.exports = { @@ -20,20 +20,15 @@ module.exports = {
20 domains: { 20 domains: {
21 // api: 'http://192.168.102.202:8080/gateway/', 21 // api: 'http://192.168.102.202:8080/gateway/',
22 // service: 'http://192.168.102.202:8080/gateway/', 22 // service: 'http://192.168.102.202:8080/gateway/',
23 - api: 'http://testapi.yoho.cn:28078/',  
24 - service: 'http://testservice.yoho.cn:28077/' 23 + // api: 'http://testapi.yoho.cn:28078/',
  24 + // service: 'http://testservice.yoho.cn:28077/'
25 25
26 - // api: 'http://devapi.yoho.cn:58078/',  
27 - // service: 'http://devservice.yoho.cn:58077/' 26 + api: 'http://devapi.yoho.cn:58078/',
  27 + service: 'http://devservice.yoho.cn:58077/'
28 }, 28 },
29 subDomains: { 29 subDomains: {
30 host: '.m.yohoblk.com', 30 host: '.m.yohoblk.com',
31 default: '//m.yohoblk.com', 31 default: '//m.yohoblk.com',
32 - guang: '//guang.m.yohoblk.com',  
33 - list: '//list.m.yohoblk.com',  
34 - search: '//search.m.yohoblk.com',  
35 - huodong: '//huodong.m.yohoblk.com',  
36 - activity: '//activity.yohoblk.com',  
37 index: '//m.yohoblk.com' 32 index: '//m.yohoblk.com'
38 }, 33 },
39 useOneapm: false, 34 useOneapm: false,
@@ -87,7 +82,7 @@ if (isProduction) { @@ -87,7 +82,7 @@ if (isProduction) {
87 master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'], 82 master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
88 slave: ['memcache1.yohoops.org:12112', 'memcache2.yohoops.org:12112', 'memcache3.yohoops.org:12112'], 83 slave: ['memcache1.yohoops.org:12112', 'memcache2.yohoops.org:12112', 'memcache3.yohoops.org:12112'],
89 session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'], 84 session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
90 - timeout: 1000, 85 + timeout: 100,
91 retries: 0 86 retries: 0
92 }, 87 },
93 useOneapm: true, 88 useOneapm: true,
@@ -97,14 +92,17 @@ if (isProduction) { @@ -97,14 +92,17 @@ if (isProduction) {
97 Object.assign(module.exports, { 92 Object.assign(module.exports, {
98 appName: 'm.yohoblk.com for test', 93 appName: 'm.yohoblk.com for test',
99 domains: { 94 domains: {
100 - api: 'http://testapi.yoho.cn:28078/',  
101 - service: 'http://testservice.yoho.cn:28077/' 95 + api: 'http://devapi.yoho.cn:58078/',
  96 + service: 'http://devservice.yoho.cn:58077/'
  97 +
  98 + // api: 'http://testapi.yoho.cn:28078/',
  99 + // service: 'http://testservice.yoho.cn:28077/'
102 }, 100 },
103 memcache: { 101 memcache: {
104 master: ['127.0.0.1:12111'], 102 master: ['127.0.0.1:12111'],
105 slave: ['127.0.0.1:12112'], 103 slave: ['127.0.0.1:12112'],
106 session: ['127.0.0.1:12111'], 104 session: ['127.0.0.1:12111'],
107 - timeout: 1000, 105 + timeout: 100,
108 retries: 0 106 retries: 0
109 }, 107 },
110 useOneapm: true, 108 useOneapm: true,
@@ -15,9 +15,9 @@ @@ -15,9 +15,9 @@
15 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=750){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/750)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window); 15 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=750){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/750)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
16 </script> 16 </script>
17 {{#if devEnv}} 17 {{#if devEnv}}
18 - <link rel="stylesheet" href="//localhost:5004/css/index.css"> 18 + <link rel="stylesheet" href="//172.16.10.123:5004/css/index.css">
19 {{#unless noLocalCSS}} 19 {{#unless noLocalCSS}}
20 - <link rel="stylesheet" href="//localhost:5004/{{module}}.{{page}}.css"> 20 + <link rel="stylesheet" href="//172.16.10.123:5004/{{module}}.{{page}}.css">
21 {{/unless}} 21 {{/unless}}
22 {{^}} 22 {{^}}
23 <link rel="stylesheet" href="//cdn.yoho.cn/yohoblk-wap/{{version}}/index.css"> 23 <link rel="stylesheet" href="//cdn.yoho.cn/yohoblk-wap/{{version}}/index.css">
@@ -35,9 +35,9 @@ @@ -35,9 +35,9 @@
35 <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script> 35 <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
36 {{/wechatShare}} 36 {{/wechatShare}}
37 {{#if devEnv}} 37 {{#if devEnv}}
38 - <script src="//localhost:5004/libs.js"></script> 38 + <script src="//172.16.10.123:5004/libs.js"></script>
39 {{#unless noLocalJS}} 39 {{#unless noLocalJS}}
40 - <script src="//localhost:5004/{{module}}.{{page}}.js"></script> 40 + <script src="//172.16.10.123:5004/{{module}}.{{page}}.js"></script>
41 {{/unless}} 41 {{/unless}}
42 {{^}} 42 {{^}}
43 <script src="//cdn.yoho.cn/yohoblk-wap/{{version}}/libs.js"></script> 43 <script src="//cdn.yoho.cn/yohoblk-wap/{{version}}/libs.js"></script>
@@ -8,6 +8,11 @@ const parse = require('yoho-qs/parse'); // 提供解析函数 @@ -8,6 +8,11 @@ const parse = require('yoho-qs/parse'); // 提供解析函数
8 const origin = location.origin; 8 const origin = location.origin;
9 9
10 /** 10 /**
  11 + * TODO: 结构优化
  12 + */
  13 +
  14 +
  15 +/**
11 * 跳转 App 头部参数 16 * 跳转 App 头部参数
12 * 文档 http://git.yoho.cn/mobile/AppJSBridge/blob/master/HeaderType.md 17 * 文档 http://git.yoho.cn/mobile/AppJSBridge/blob/master/HeaderType.md
13 * @type {Object} 18 * @type {Object}
@@ -33,7 +38,8 @@ const titleMap = { @@ -33,7 +38,8 @@ const titleMap = {
33 action: '' 38 action: ''
34 }, 39 },
35 right: { 40 right: {
36 - action: origin + '/home' 41 + icon: 'chat',
  42 + action: 'goToService'
37 } 43 }
38 }, 44 },
39 3: { 45 3: {
@@ -47,7 +53,7 @@ const titleMap = { @@ -47,7 +53,7 @@ const titleMap = {
47 }, 53 },
48 right: { 54 right: {
49 des: '提交', 55 des: '提交',
50 - action: 'submitForm' 56 + action: 'test'
51 } 57 }
52 }, 58 },
53 4: { 59 4: {
@@ -188,7 +194,7 @@ module.exports = (url) => { @@ -188,7 +194,7 @@ module.exports = (url) => {
188 194
189 // 资讯 195 // 资讯
190 if (/\/news$/.test(path)) { 196 if (/\/news$/.test(path)) {
191 - return yoho.goTab({index: 3}); 197 + return yoho.goTab({index: 2});
192 } 198 }
193 199
194 // 品牌 品类 200 // 品牌 品类
@@ -4,8 +4,8 @@ @@ -4,8 +4,8 @@
4 <button class="button" @click="yoho.goLogout()">退出登录</button> 4 <button class="button" @click="yoho.goLogout()">退出登录</button>
5 <button class="button" @click='yoho.goShopingKey({"shoppingkey":"123456789"})'>设置ShopingKey</button> 5 <button class="button" @click='yoho.goShopingKey({"shoppingkey":"123456789"})'>设置ShopingKey</button>
6 <button class="button" @click="yoho.goShopingCart()">跳转购物车</button> 6 <button class="button" @click="yoho.goShopingCart()">跳转购物车</button>
7 - <button class="button" @click='yoho.goAddress({"type":"1"})'>地址选择页面</button>  
8 - <button class="button" @click='yoho.goAddress({"type":"2"})'>地址管理页面</button> 7 + <button class="button" @click='yoho.goAddress({"type":"1"}, addressCallback)'>地址选择页面</button>
  8 + <button class="button" @click='yoho.goAddress({"type":"2"}, addressCallback)'>地址管理页面</button>
9 <button class="button" @click='yoho.goImageBrowser({"images":["http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg"], "index": "1"})'>图片浏览</button> 9 <button class="button" @click='yoho.goImageBrowser({"images":["http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg"], "index": "1"})'>图片浏览</button>
10 <button class="button" @click='yoho.goNewPage({"url":"http://m.yohoblk.com"})'>新页面</button> 10 <button class="button" @click='yoho.goNewPage({"url":"http://m.yohoblk.com"})'>新页面</button>
11 <button class="button" @click="yoho.goPay()">支付</button> 11 <button class="button" @click="yoho.goPay()">支付</button>
@@ -41,6 +41,11 @@ @@ -41,6 +41,11 @@
41 modal.alert('传递的信息是:' + data); 41 modal.alert('传递的信息是:' + data);
42 } 42 }
43 }); 43 });
  44 + },
  45 + methods: {
  46 + addressCallback(info) {
  47 + alert(JSON.stringify(info));
  48 + }
44 } 49 }
45 }; 50 };
46 </script> 51 </script>