Authored by 梁志锋

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

... ... @@ -32,7 +32,7 @@ class IndexData
* @param string $client_type
* @return array
*/
public static function getResourceData($content_code, $client_type = 'web')
public static function getResourceData($content_code, $client_type = 'web')
{
// 构建必传参数
$params = Yohobuy::param();
... ... @@ -68,4 +68,33 @@ class IndexData
unset($param['v']);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 意见反馈
*
* @param int $feedback_id
* @param int $question_id
* @param string $answer
* @param int $solution
* @return array
*/
public static function suggestFeedback($feedback_id, $question_id, $answer, $solution)
{
//TODO 走老接口
$param = Yohobuy::param();
$param['page'] = 1;
$param['open_key'] = '12345';
$param['method'] = 'open.feedback.submit';
$param['feedback_id'] = $feedback_id;
$param['question_id'] = $question_id;
$param['answer'] = $answer;
$param['solution'] = $solution;
unset($param['app_version']);
unset($param['client_type']);
unset($param['os_version']);
unset($param['screen_size']);
unset($param['v']);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -110,6 +110,7 @@ class HelperSearch
*/
public static function getProductList($product,$imgSize)
{
$params = self::$params;
$goods = array();
foreach($product as $key => $val){
//NEW
... ... @@ -125,6 +126,10 @@ class HelperSearch
// 年中大促
foreach($val['goods_list'] as $k => $v){
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
//筛选符合颜色条件的封面图片
if (isset($params['color']) && $params['color'] == $v['color_id']) {
$val['default_images'] = Images::getImageUrl($v['images_url'],$imgSize[0],$imgSize[1]);
}
}
if (!empty($val['default_images'])) {
$val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]);
... ... @@ -439,6 +444,10 @@ class HelperSearch
if (self::checkSearch('brand')) {
return array();
}
//品牌数量小于等于10,隐藏更多按钮
if (count($result['brandsShow']) < 11) {
$result['hideMore'] = true;
}
return $result;
}
/**
... ... @@ -613,18 +622,18 @@ class HelperSearch
}
$result = array();
$style = $filter['style'];
$styleNum = 0;
$styleName = '';
foreach ($style as $v) {
//选中的筛选条件
if (in_array($v['style_id'], $styleIds)) {
$selectedStyle = explode(',', self::$params['style']);
$selectedKey = array_search($v['style_id'], $selectedStyle);
unset($selectedStyle[$selectedKey]);
$selectedParams = $params;
$selectedParams['style'] = implode(',', $selectedStyle);
self::$selected['style'][] = array(
'name' => $v['style_name'],
'href' => self::buildUrl($selectedParams)
);
if (!$styleNum) {
$styleName = $v['style_name']."";
}
elseif ($styleNum ===1){
$styleName .= substr($v['style_name'], 0, 3).'...';
}
$styleNum ++;
}
$selectedStyle = isset(self::$params['style']) && !empty(self::$params['style']) ? explode(',', self::$params['style']) : array();
//风格id在提交的参数中,构造url参数去除该风格id
... ... @@ -648,9 +657,11 @@ class HelperSearch
'href' => $url,
);
}
//搜索页已选中,返回空
if (self::checkSearch('style')) {
return array();
if (isset(self::$params['style']) && !empty(self::$params['style'])) {
self::$selected['style'] = array(
'name' => rtrim($styleName, '、'),
'href' => self::buildUrl($params)
);
}
$data[0] = array(
'attr' => 'style',
... ... @@ -668,6 +679,10 @@ class HelperSearch
$style = self::style($filter);
$other = self::standard($filter);
$result = array_merge($style,$other);
//搜索页已选中,返回空
if (self::checkSearch('style') || self::checkSearch('parameter')) {
return array();
}
return $result;
}
... ... @@ -926,7 +941,6 @@ class HelperSearch
if ($data) {
$result['conditions'] = $data;
}
// print_r($result); exit;
return $result;
}
... ... @@ -992,7 +1006,7 @@ class HelperSearch
*/
public static function current()
{
$url = explode('?', $_SERVER['REQUEST_URI']);
$url = explode('?', 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
self::$listNav[0]['href'] = $url[0];
return $url[0];
}
... ... @@ -1102,8 +1116,12 @@ class HelperSearch
public static function checkSearch($param)
{
if (isset(self::$params[$param]) && isset(self::$options['controller']) && self::$options['controller'] == 'Search') {
return true;
if (isset(self::$options['controller']) && self::$options['controller'] == 'Search') {
foreach (self::$params as $key =>$val) {
if (strpos($key, $param) !== false) {
return true;
}
}
}
}
... ... @@ -1354,7 +1372,9 @@ class HelperSearch
//清除选中
$result['checkedConditions']['clearUrl'] = self::current();
//频道
$result['channel'] = self::gender(self::$filter);
$result['channel'] = array();
//性别
$result['gender'] = self::gender(self::$filter);
//品牌
$result['brand'] = self::brand(self::$filter);
//价格
... ...
... ... @@ -35,13 +35,18 @@ module.exports = function(specificGender) {
} else if (lifestyleType) {
//有货币页面加载男生首页的数据
url = specificGender ? '/product/recom/maylike?gender=1,3' : '/product/recom/maylikelife';
url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3' : '/product/recom/maylikelife';
} else {
gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
'1,3' : '2,3',
url = '/product/recom/maylike?gender=' + gender;
}
//以防cookie异常,强制加载男首
if (specificGender === 'boys') {
url = '/product/recom/maylike?gender=1,3';
}
$curNav = $navList.children('.focus');
if (lifestyleType) {
... ...
... ... @@ -345,28 +345,28 @@ class HomeModel
$build = array();
switch (intval($value['channel_id'])) {
case 1:
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['href'] = '/boys';
$build['title'] = '男生';
$build['entitle'] = 'BOYS';
break;
case 2:
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['href'] = '/girls';
$build['title'] = '女生';
$build['entitle'] = 'GIRLS';
break;
case 3:
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['href'] = '/kids';
$build['title'] = '潮童';
$build['entitle'] = 'KIDS';
break;
case 4:
$build['href'] = Helpers::getFilterUrl($value['url']);
$build['href'] = '/lifestyle';
$build['title'] = '创意生活';
$build['entitle'] = 'LIFESTYLE';
break;
case 5:
$result['showYohood'] = true;
$result['yohoodHref'] = Helpers::getFilterUrl($value['url']);
$result['yohoodHref'] = 'http://yohood.cn';
break;
default:
continue;
... ...
... ... @@ -139,4 +139,24 @@ class CommonController extends WebAction
return $this->helpJsonCallbackResult($callback, 403, '订阅失败', '');
}
}
/**
* 意见反馈
*
* @return jsonp
*/
public function suggestfeedbackAction()
{
$callback = $this->get('callback', '');
$feedback_id = intval($this->get('feedback_id', 0));
$question_id = intval($this->get('question_id', 0));
$answer = trim($this->get('answer'));
$solution = intval($this->get('solution', 0));
if(!empty($feedback_id) || !empty($question_id) || !empty($answer) || !empty($solution)) {
$data = IndexData::suggestFeedback($feedback_id, $question_id, $answer, $solution);
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $data['data']);
} else {
return $this->helpJsonCallbackResult($callback, 403, '意见反馈失败', '');
}
}
}
\ No newline at end of file
... ...