Authored by whb

index css

@@ -159,8 +159,6 @@ var $ = require("jquery"); @@ -159,8 +159,6 @@ var $ = require("jquery");
159 159
160 var $returnTop = $('.return-top'); 160 var $returnTop = $('.return-top');
161 161
162 -var apiDomain;  
163 -  
164 /** 162 /**
165 * 订阅 163 * 订阅
166 * @return {[type]} [description] 164 * @return {[type]} [description]
@@ -170,41 +168,36 @@ function actionSubscription() { @@ -170,41 +168,36 @@ function actionSubscription() {
170 $subscriberBtn = $('#subscriber-btn'), 168 $subscriberBtn = $('#subscriber-btn'),
171 emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/; 169 emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/;
172 170
173 - var subscribeParam = {  
174 - method: 'open.subscriber.subscriber',  
175 - v: 1,  
176 - return_type: 'jsonp',  
177 - open_key: '12345'  
178 - };  
179 -  
180 var iconCode = { 171 var iconCode = {
181 mail: '', 172 mail: '',
182 tick: '&#xe61a' 173 tick: '&#xe61a'
183 }; 174 };
184 175
185 - var email = $.trim($subscriberBox.val());  
186 -  
187 - var params = {};  
188 -  
189 $subscriberBox.focus(function() { 176 $subscriberBox.focus(function() {
190 $(this).val('').css('color', ''); 177 $(this).val('').css('color', '');
191 $subscriberBtn.removeClass('done').html(iconCode.mail); 178 $subscriberBtn.removeClass('done').html(iconCode.mail);
192 }); 179 });
193 180
194 $subscriberBtn.click(function() { 181 $subscriberBtn.click(function() {
  182 + var email = $.trim($subscriberBox.val());
  183 +
195 if (email !== '' && emailReg.test(email)) { 184 if (email !== '' && emailReg.test(email)) {
196 - $.extend(params, subscribeParam, {  
197 - email: email,  
198 - tmp: Math.random(),  
199 - uid: $.uid('_UID')  
200 - });  
201 try { 185 try {
202 - $.getJSON('http://test.open.yohobuy.com' + '/?callback=?', params, function(data) {  
203 - if (data.data.result === 1) {  
204 - $subscriberBox.val('已订阅到:' + email);  
205 - $subscriberBtn.addClass('done').html(iconCode.tick);  
206 - } else {  
207 - $subscriberBox.css('color', 'red'); 186 + $.ajax({
  187 + url: 'http://www.yohobuy.com/common/emailsubscriber',
  188 + dataType: 'jsonp',
  189 + data: {
  190 + email: email,
  191 + tmp: Math.random(),
  192 + uid: window.getUid()
  193 + },
  194 + success: function(data) {
  195 + if (data.data.result === 1) {
  196 + $subscriberBox.val('已订阅到:' + email);
  197 + $subscriberBtn.addClass('done').html(iconCode.tick);
  198 + } else {
  199 + $subscriberBox.css('color', 'red');
  200 + }
208 } 201 }
209 }); 202 });
210 } catch (e) { 203 } catch (e) {
@@ -241,7 +234,6 @@ function actionhomeFootChange() { @@ -241,7 +234,6 @@ function actionhomeFootChange() {
241 var $this = $(this), 234 var $this = $(this),
242 $li = $this.closest('li'), 235 $li = $this.closest('li'),
243 index = $li.index(), 236 index = $li.index(),
244 - params = {},  
245 _solution = []; 237 _solution = [];
246 238
247 var _answer = $li.find('.feedback-answer').val(), 239 var _answer = $li.find('.feedback-answer').val(),
@@ -252,28 +244,30 @@ function actionhomeFootChange() { @@ -252,28 +244,30 @@ function actionhomeFootChange() {
252 _solution.push($(this).val()); 244 _solution.push($(this).val());
253 }); 245 });
254 246
255 - params = {  
256 - method: 'open.feedback.submit',  
257 - feedback: _feedback || 0,  
258 - question: _question || 0,  
259 - answer: _answer || '',  
260 - solution: _solution.join(',')  
261 - }; 247 + $.ajax({
  248 + url: 'http://www.yohobuy.com/common/suggestfeedback',
  249 + dataType: 'jsonp',
  250 + data: {
  251 + feedback_id: _feedback || 0,
  252 + question_id: _question || 0,
  253 + answer: _answer || '',
  254 + solution: _solution.join(',')
  255 + },
  256 + success: function(data) {
  257 + var next = index + 1;
  258 +
  259 + if (~~data.data.result === 1) {
  260 + if (index === count - 1) {
  261 + alert('感谢您的参与!');
  262 + return;
  263 + }
262 264
263 - $.getData(apiDomain, params, function(data) {  
264 - var next = index + 1; 265 + $li.addClass('hide');
265 266
266 - if (data.result === 1) {  
267 - if (index === count - 1) {  
268 - alert('感谢您的参与!');  
269 - return; 267 + $vote.children(':eq(' + (index + 1) + ')').removeClass('hide');
  268 + $feedBackPage.children('.cur').removeClass('cur');
  269 + $feedBackPage.children(':eq(' + next + ')').addClass('cur');
270 } 270 }
271 -  
272 - $li.addClass('hide');  
273 -  
274 - $vote.eq(index + 1).removeClass('hide');  
275 - $feedBackPage.children('.cur').removeClass('cur');  
276 - $feedBackPage.eq(next).addClass('cur');  
277 } 271 }
278 }); 272 });
279 }); 273 });
@@ -338,7 +332,7 @@ var handlebars = require("handlebars"); @@ -338,7 +332,7 @@ var handlebars = require("handlebars");
338 var json2 = require("index"); 332 var json2 = require("index");
339 var vipInfoCombine = null; //用户信息编译模板 333 var vipInfoCombine = null; //用户信息编译模板
340 var loginInfoCombine = null; //登录信息编译模板 334 var loginInfoCombine = null; //登录信息编译模板
341 -var apiDomain = 'http://api.open.yohobuy.com'; //获取数据的地址 335 +var apiDomain = 'http://test.open.yohobuy.com/'; //获取数据的地址http://api.open.yohobuy.com
342 var cartTpl = ''; //购物车模板 336 var cartTpl = ''; //购物车模板
343 /** 337 /**
344 * 搜寻的时候过滤非法字符(+-/:等非法字符单独出现) 338 * 搜寻的时候过滤非法字符(+-/:等非法字符单独出现)
@@ -5781,11 +5775,10 @@ var $sc = $('#send-captcha'), @@ -5781,11 +5775,10 @@ var $sc = $('#send-captcha'),
5781 itime; 5775 itime;
5782 5776
5783 $sc.click(function() { 5777 $sc.click(function() {
5784 - $.post('/passport/register/authcode', { 5778 + $.post('/passport/back/sendbackmobile', {
5785 mobile: $('#mobile').val(), 5779 mobile: $('#mobile').val(),
5786 area: $('#area').val(), 5780 area: $('#area').val(),
5787 - captcha: $('#captchaPic').val(),  
5788 - project: 'repassword' 5781 + verifyCode: $('#captchaPic').val(),
5789 }, function(jsonData) { 5782 }, function(jsonData) {
5790 if (jsonData.code === 200) { 5783 if (jsonData.code === 200) {
5791 $errTip.hide(); 5784 $errTip.hide();
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.