Authored by ccbikai

优化程序

... ... @@ -20,20 +20,15 @@ module.exports = {
domains: {
// api: 'http://192.168.102.202:8080/gateway/',
// service: 'http://192.168.102.202:8080/gateway/',
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/'
// api: 'http://testapi.yoho.cn:28078/',
// service: 'http://testservice.yoho.cn:28077/'
// api: 'http://devapi.yoho.cn:58078/',
// service: 'http://devservice.yoho.cn:58077/'
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
},
subDomains: {
host: '.m.yohoblk.com',
default: '//m.yohoblk.com',
guang: '//guang.m.yohoblk.com',
list: '//list.m.yohoblk.com',
search: '//search.m.yohoblk.com',
huodong: '//huodong.m.yohoblk.com',
activity: '//activity.yohoblk.com',
index: '//m.yohoblk.com'
},
useOneapm: false,
... ... @@ -87,7 +82,7 @@ if (isProduction) {
master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
slave: ['memcache1.yohoops.org:12112', 'memcache2.yohoops.org:12112', 'memcache3.yohoops.org:12112'],
session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
timeout: 1000,
timeout: 100,
retries: 0
},
useOneapm: true,
... ... @@ -97,14 +92,17 @@ if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohoblk.com for test',
domains: {
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/'
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
// api: 'http://testapi.yoho.cn:28078/',
// service: 'http://testservice.yoho.cn:28077/'
},
memcache: {
master: ['127.0.0.1:12111'],
slave: ['127.0.0.1:12112'],
session: ['127.0.0.1:12111'],
timeout: 1000,
timeout: 100,
retries: 0
},
useOneapm: true,
... ...
... ... @@ -15,9 +15,9 @@
(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);
</script>
{{#if devEnv}}
<link rel="stylesheet" href="//localhost:5004/css/index.css">
<link rel="stylesheet" href="//172.16.10.123:5004/css/index.css">
{{#unless noLocalCSS}}
<link rel="stylesheet" href="//localhost:5004/{{module}}.{{page}}.css">
<link rel="stylesheet" href="//172.16.10.123:5004/{{module}}.{{page}}.css">
{{/unless}}
{{^}}
<link rel="stylesheet" href="//cdn.yoho.cn/yohoblk-wap/{{version}}/index.css">
... ... @@ -35,9 +35,9 @@
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
{{/wechatShare}}
{{#if devEnv}}
<script src="//localhost:5004/libs.js"></script>
<script src="//172.16.10.123:5004/libs.js"></script>
{{#unless noLocalJS}}
<script src="//localhost:5004/{{module}}.{{page}}.js"></script>
<script src="//172.16.10.123:5004/{{module}}.{{page}}.js"></script>
{{/unless}}
{{^}}
<script src="//cdn.yoho.cn/yohoblk-wap/{{version}}/libs.js"></script>
... ...
... ... @@ -8,6 +8,11 @@ const parse = require('yoho-qs/parse'); // 提供解析函数
const origin = location.origin;
/**
* TODO: 结构优化
*/
/**
* 跳转 App 头部参数
* 文档 http://git.yoho.cn/mobile/AppJSBridge/blob/master/HeaderType.md
* @type {Object}
... ... @@ -33,7 +38,8 @@ const titleMap = {
action: ''
},
right: {
action: origin + '/home'
icon: 'chat',
action: 'goToService'
}
},
3: {
... ... @@ -47,7 +53,7 @@ const titleMap = {
},
right: {
des: '提交',
action: 'submitForm'
action: 'test'
}
},
4: {
... ... @@ -188,7 +194,7 @@ module.exports = (url) => {
// 资讯
if (/\/news$/.test(path)) {
return yoho.goTab({index: 3});
return yoho.goTab({index: 2});
}
// 品牌 品类
... ...
... ... @@ -4,8 +4,8 @@
<button class="button" @click="yoho.goLogout()">退出登录</button>
<button class="button" @click='yoho.goShopingKey({"shoppingkey":"123456789"})'>设置ShopingKey</button>
<button class="button" @click="yoho.goShopingCart()">跳转购物车</button>
<button class="button" @click='yoho.goAddress({"type":"1"})'>地址选择页面</button>
<button class="button" @click='yoho.goAddress({"type":"2"})'>地址管理页面</button>
<button class="button" @click='yoho.goAddress({"type":"1"}, addressCallback)'>地址选择页面</button>
<button class="button" @click='yoho.goAddress({"type":"2"}, addressCallback)'>地址管理页面</button>
<button class="button" @click='yoho.goImageBrowser({"images":["http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg"], "index": "1"})'>图片浏览</button>
<button class="button" @click='yoho.goNewPage({"url":"http://m.yohoblk.com"})'>新页面</button>
<button class="button" @click="yoho.goPay()">支付</button>
... ... @@ -41,6 +41,11 @@
modal.alert('传递的信息是:' + data);
}
});
},
methods: {
addressCallback(info) {
alert(JSON.stringify(info));
}
}
};
</script>
... ...