Authored by Aiden Xu

Merge remote-tracking branch 'origin/develop' into develop

@@ -3,6 +3,5 @@ @@ -3,6 +3,5 @@
3 <div class="suggest-sub-form"> 3 <div class="suggest-sub-form">
4 <textarea name="" id="suggest-textarea" placeholder="请写下对于BLK的意见和建议,我们将及时根据您的意见作出改进"></textarea> 4 <textarea name="" id="suggest-textarea" placeholder="请写下对于BLK的意见和建议,我们将及时根据您的意见作出改进"></textarea>
5 </div> 5 </div>
6 - <input id="submit-button" type="button" value="提交" />  
7 {{/ suggestSub}} 6 {{/ suggestSub}}
8 </div> 7 </div>
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 <span class="num">{{send_cargo_num}}</span> 35 <span class="num">{{send_cargo_num}}</span>
36 {{/if}} 36 {{/if}}
37 </a> 37 </a>
38 - <a class="type-item" href="/home/orders?type=5"> 38 + <a class="type-item" href="/home/refund/orders">
39 <span class="icon icon-refund-exchange"></span> 39 <span class="icon icon-refund-exchange"></span>
40 <br>退换货 40 <br>退换货
41 {{#if refund_exchange_num}} 41 {{#if refund_exchange_num}}
@@ -3,8 +3,9 @@ @@ -3,8 +3,9 @@
3 * @return {[type]} 3 * @return {[type]}
4 */ 4 */
5 const yoho = require('yoho'); 5 const yoho = require('yoho');
  6 +const parse = require('yoho-qs/parse'); // 提供解析函数
6 7
7 -const origin = 'http://m.yohoblk.com'; 8 +const origin = location.origin;
8 9
9 /** 10 /**
10 * 跳转 App 头部参数 11 * 跳转 App 头部参数
@@ -104,21 +105,97 @@ const matchHeader = (url) => { @@ -104,21 +105,97 @@ const matchHeader = (url) => {
104 return header; 105 return header;
105 } 106 }
106 107
107 - if (/\/product\/new/.test(url)) { 108 + if (/\/home\/mydetails$/.test(url)) {
108 header = titleMap[1]; 109 header = titleMap[1];
  110 + header.title.des = '个人信息';
  111 + return header;
  112 + }
109 113
110 - // header.xxx = '111';// 匹配到头类型以后,可修改里边的内容 114 + if (/\/home\/orders/.test(url)) {
  115 + var des = '',
  116 + u = url.split('?')[1],
  117 + u = parse(u);
  118 +
  119 + if (u.type === '1') {
  120 + des = '我的订单';
  121 + } else if (u.type === '2') {
  122 + des = '待付款';
  123 + } else if (u.type === '3') {
  124 + des = '待发货';
  125 + } else if (u.type === '4') {
  126 + des = '待收货';
  127 + }
  128 + header = titleMap[1];
  129 + header.title.des = des;
  130 + return header;
  131 + }
  132 +
  133 + if (/\/home\/refund\/orders/.test(url)) {
  134 + header = titleMap[1];
  135 + header.title.des = '退/换货';
  136 + return header;
  137 + }
  138 +
  139 + if (/\/home\/favorite/.test(url)) {
  140 + header = titleMap[5];
  141 + header.ltitle = {
  142 + des: '商品',
  143 + action: origin + '/home/favorite'
  144 + }
  145 + header.rtitle = {
  146 + des: '品牌',
  147 + action: origin + '/home/favorite?tab=brand'
  148 + }
  149 + header.right = {
  150 + des: '编辑',
  151 + action: 'editModel'
  152 + }
  153 + return header;
  154 + }
  155 +
  156 + if (/\/home\/mycurrency/.test(url)) {
  157 + header = titleMap[1];
  158 + header.title.des = '有货币';
  159 + return header;
  160 + }
  161 +
  162 + if (/\/home\/help$/.test(url)) {
  163 + header = titleMap[1];
  164 + header.title.des = '帮助中心';
  165 + return header;
  166 + }
  167 +
  168 + if (/chat8.live800.com/.test(url)) {
  169 + header = titleMap[1];
  170 + header.title.des = 'Yoho!Blk在线客服';
  171 + return header;
  172 + }
  173 +
  174 + if (/\/home\/feedback/.test(url)) {
  175 + header = titleMap[3];
  176 + header.title.des = '意见反馈';
  177 + header.right = {
  178 + des: '提交',
  179 + action: 'saveFeedback'
  180 + }
  181 + return header;
  182 + }
  183 +
  184 + if (/\/home\/about/.test(url)) {
  185 + header = titleMap[1];
  186 + header.title.des = '关于';
111 return header; 187 return header;
112 } 188 }
113 189
114 return header; 190 return header;
115 }; 191 };
116 192
  193 +
117 module.exports = (url) => { 194 module.exports = (url) => {
118 if (yoho.isApp) { 195 if (yoho.isApp) {
119 let data = { 196 let data = {
120 header: matchHeader(url), 197 header: matchHeader(url),
121 - url: /^(https?:)?\/\//i.test(url) ? url : location.origin + url 198 + url: /^(https?:)?\/\//i.test(url) ? url : origin + url
122 }; 199 };
123 200
124 // console.log(data); 201 // console.log(data);
@@ -5,11 +5,10 @@ @@ -5,11 +5,10 @@
5 */ 5 */
6 6
7 var $ = require('yoho-jquery'), 7 var $ = require('yoho-jquery'),
8 - tip = require('../common/tip'); 8 + tip = require('../common/tip'),
  9 + yoho = require('yoho');
9 10
10 -var submitButton = $('#submit-button');  
11 -  
12 -submitButton.on('click', function() { 11 +yoho.addNativeMethod('saveFeedback', function() {
13 var suggestText = $('#suggest-textarea').val(), 12 var suggestText = $('#suggest-textarea').val(),
14 textReg = /\S+/; 13 textReg = /\S+/;
15 14
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
32 <script> 32 <script>
33 const $ = require('yoho-jquery'); 33 const $ = require('yoho-jquery');
34 const tip = require('common/tip'); 34 const tip = require('common/tip');
  35 + const yoho = require('yoho');
35 36
36 module.exports = { 37 module.exports = {
37 props: ['brandUrl'], 38 props: ['brandUrl'],
@@ -73,12 +74,6 @@ @@ -73,12 +74,6 @@
73 tip('网络错误'); 74 tip('网络错误');
74 }); 75 });
75 }, 76 },
76 - editModel(action) {  
77 - this.editmodel = action;  
78 - if (!action) {  
79 - this.hideDelBth();  
80 - }  
81 - },  
82 showDelBtn(index) { 77 showDelBtn(index) {
83 this.hideDelBth(); 78 this.hideDelBth();
84 let delBtn = $('#del-' + index); 79 let delBtn = $('#del-' + index);
@@ -116,6 +111,16 @@ @@ -116,6 +111,16 @@
116 tip('网络错误'); 111 tip('网络错误');
117 }); 112 });
118 } 113 }
  114 + },
  115 + created: function() {
  116 + let _this = this;
  117 +
  118 + yoho.addNativeMethod('editModel', function(action) {
  119 + _this.editmodel = action;
  120 + if (!action) {
  121 + _this.hideDelBth();
  122 + }
  123 + });
119 } 124 }
120 }; 125 };
121 </script> 126 </script>
@@ -79,12 +79,6 @@ @@ -79,12 +79,6 @@
79 tip('网络错误'); 79 tip('网络错误');
80 }); 80 });
81 }, 81 },
82 - editModel(action) {  
83 - this.editmodel = action;  
84 - if (!action) {  
85 - this.hideDelBth();  
86 - }  
87 - },  
88 showDelBtn(index) { 82 showDelBtn(index) {
89 this.hideDelBth(); 83 this.hideDelBth();
90 let delBtn = $('#del-' + index); 84 let delBtn = $('#del-' + index);
@@ -122,6 +116,16 @@ @@ -122,6 +116,16 @@
122 tip('网络错误'); 116 tip('网络错误');
123 }); 117 });
124 } 118 }
  119 + },
  120 + created: function() {
  121 + let _this = this;
  122 +
  123 + yoho.addNativeMethod('editModel', function(action) {
  124 + _this.editmodel = action;
  125 + if (!action) {
  126 + _this.hideDelBth();
  127 + }
  128 + });
125 } 129 }
126 }; 130 };
127 </script> 131 </script>