Authored by hf

do fixes bugs to product detail show tags

Showing 39 changed files with 471 additions and 253 deletions
... ... @@ -107,7 +107,7 @@
}
## 首页
{
headerDownload: {
img: '',
... ... @@ -249,7 +249,7 @@
## 逛
### 资讯(公用)
{
id: 1,
showTags: true/false, //是否显示标签
... ... @@ -305,9 +305,9 @@
}
### 逛列表页
{
infos:
infos:
[
{...}, //标签
...
... ... @@ -724,7 +724,7 @@
},
...
]
}
## 商品列表页
... ... @@ -987,14 +987,14 @@
canceled: true, //已取消
unpaid: true, //or 未支付
unreceived: '', //or 待收货(未发货/未收货),查看物流URL
//待收货时传递物流参数
logisticsUrl: ''
}
### 订单详情页
{
orderDetail: {
orderNum: '', //订单号
... ... @@ -1006,7 +1006,7 @@
orderStatus: '订单成功', //订单取消...等订单状态
orderNum: '',
orderTime: '',
//订单状态
canceled: true, //是否是取消的订单
completed: true, //是否是已完成订单
... ... @@ -1060,7 +1060,7 @@
'navHome': 'sss ',
'navTitle': '商品详情'
},
'bannerTop': {
'list': [
{
... ... @@ -1090,7 +1090,7 @@
is_soon_sold_out: true //即将售罄
}
],
'goodsName' : 'Stussy No. 4 BOX TEE ',
'goodsSubtitle' : '【全民拼抢购】经典印花T恤,满4件免一件!',
... ... @@ -1166,25 +1166,25 @@
'detail' : {
'list' : [
{
{
'params' : [
{
{
'param' : '尺寸'
},
...
...
]
},
...
]
}
},
'measurementMethod' : {
'title': '测量方式',
'enTitle': 'MEASUREMENT METHOD',
'img' : '',
},
'reference' : {
'title' : '模特试穿',
'enTitle' : '',
... ... @@ -1243,6 +1243,32 @@
'cartInfo' : {
'numInCart' : 3,
'goodsInstore' : 0,
'isCollect':true//
'isCollect':true//
}
}
### 支付中心
{
'payAppInfo' : {
'appIcon' : 'http://static.yohobuy.com/images/icon.png',
'payLink' : '/weixin/pay/'
'app' : '微信支付',
'hint' : '需下载微信客户端',
'subHint' : '推荐使用'
}
}
### 物流详情
{
'logisticImg' : 'http://static.yohobuy.com/images/icon.png',
'logisticUrl' : 'http://www.shunfeng.com',
'logisticCompany' : '顺丰',
'logisticNumber' : '1231231231',
'logisticDetail' : {
'status' : '南京市 派送中',
'date' : '2015-12-03'
}
}
... ...
... ... @@ -27,10 +27,8 @@ class Yohobuy
const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const YOHOBUY_ORDER = 'http://192.168.102.209:8084/order/'; //我的订单
const API_URL_MYCENTER = 'http://192.168.102.207:8081/users/'; // 我的个人中心接口URL
const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
const API_URL_PRODUCTDETAIL = 'http://192.168.102.212:8083/product/'; // 商品详情页
const API_URL_LOGISTICS = 'http://192.168.102.205:8080/gateway'; //查看物流接口URL
const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/';
/**
* 私钥列表
... ...
<?php
namespace LibModels\Wap\Passport;
use Api\Sign;
... ... @@ -15,7 +16,7 @@ use Api\Yohobuy;
*/
class LoginData
{
/**
* 登录
*
... ... @@ -32,10 +33,10 @@ class LoginData
$param['profile'] = $profile;
$param['password'] = $password;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
* 用户信息
*
... ... @@ -48,7 +49,7 @@ class LoginData
$param['method'] = 'app.passport.profile';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ... @@ -68,7 +69,38 @@ class LoginData
$param['openId'] = $openId;
$param['source_type'] = $sourceType;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 写入SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public static function signinSession($uid)
{
$param = array();
$param['uid'] = $uid;
$param['token'] = md5($uid . '#@!@#');
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/index', $param);
}
/**
* 写入SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public static function checkSession($uid)
{
$param = array();
$param['uid'] = $uid;
$param['token'] = md5($uid . '#@!@#');
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/val', $param);
}
}
... ...
... ... @@ -31,9 +31,13 @@ class DetailData
*/
public static function baseInfo($productId, $uid)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array(
'param' => intval($productId), 'userId' => intval($uid)
));
$param = Yohobuy::param();
$param['method'] = 'h5.product.data';
$param['product_id'] = $productId;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
... ... @@ -44,7 +48,12 @@ class DetailData
*/
public static function sizeInfo($productSkn)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn)));
$param = Yohobuy::param();
$param['method'] = 'h5.product.intro';
$param['productskn'] = $productSkn;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
... ... @@ -57,11 +66,14 @@ class DetailData
*/
public static function consultList($productId, $pageNum, $pageSize)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_CONSULT_LIST, array(
'productId' => intval($productId),
'pageNum' => intval($pageNum),
'pageSize' => intval($pageSize),
));
$param = Yohobuy::param();
$param['method'] = 'h5.consult.li';
$param['product_id'] = $productId;
$param['page'] = $pageNum;
$param['limit'] = $pageSize;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
... ... @@ -74,25 +86,22 @@ class DetailData
*/
public static function commentList($productId, $pageNum, $pageSize)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_COMMENT_LIST, array(
'productId' => intval($productId),
'pageNum' => intval($pageNum),
'pageSize' => intval($pageSize),
));
// 暂未提供提口
}
/**
* 为你优选的商品列表
*
* @todo 需要替换成JAVA接口
* @param int $productSkn 商品SKN号
* @return array
*/
public static function preference($productSkn)
public static function preference($productSkn, $channel, $brandId)
{
$param = Yohobuy::param();
$param['method'] = 'app.product.topreference';
$param['product_skn'] = $productSkn;
$param['method'] = 'h5.preference.Search';
$param['productskn'] = $productSkn;
$param['yhchannel'] = $channel;
$param['brandId'] = $brandId;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时
... ... @@ -108,7 +117,7 @@ class DetailData
public static function addConsult($uid, $productId, $content)
{
$param = Yohobuy::param();
$param['method'] = 'app.consult.add';
$param['method'] = 'h5.consult.add';
$param['product_id'] = $productId;
$param['content'] = $content;
$param['uid'] = $uid;
... ...
... ... @@ -95,9 +95,9 @@ class NewsaleData
});
$param = Yohobuy::param();
if(!is_null($dayLimit)) {
if (!is_null($dayLimit)) {
$param['method'] = 'app.search.newProduct';
}else {
} else {
$param['method'] = 'app.search.sales';
}
$param['page'] = $page;
... ... @@ -178,30 +178,29 @@ class NewsaleData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取热销排行榜商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 新品到着商品数据
*/
public static function getTopProducts($gender, $sort = null, $tab_id = null, $limit = 50, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.top';
$param['gender'] = $gender;
!empty($sort) && $param['sort'] = $sort;
!empty($tab_id) && $param['tab_id'] = $tab_id;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
/**
* 获取热销排行榜商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 新品到着商品数据
*/
public static function getTopProducts($gender, $sort = null, $tab_id = null, $limit = 50, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.top';
$param['gender'] = $gender;
!empty($sort) && $param['sort'] = $sort;
!empty($tab_id) && $param['tab_id'] = $tab_id;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -30,8 +30,13 @@ class SearchData
switch (APPLICATION_ENV) {
case 'release':
return 'http://100.98.132.63/yohosearch/search.json';
<<<<<<< HEAD
case 'preview':
case 'test':
=======
case 'test':
case 'preview':
>>>>>>> develop
case 'developer':
default:
return 'http://101.200.31.165/yohosearch/search.json';
... ...
... ... @@ -81,4 +81,4 @@ exports.showDialog = function(data, callback) {
exports.hideDialog = function() {
$dialogWrapper.fadeOut();
};
\ No newline at end of file
};
... ...
... ... @@ -15,3 +15,5 @@ require('./address');
require('./suggest');
require('./browse-record');
require('./address-act');
require('./logistic');
require('./pay');
... ...
... ... @@ -127,10 +127,22 @@ orderHammer.on('tap', function(e) {
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '删除订单成功',
autoHide: true,
fast: true
});
//删除订单页面刷新
history.go(0);
}
},
error: function() {
dialog.showDialog({
dialogText: '删除订单失败',
autoHide: true,
fast: true
});
}
});
});
... ... @@ -152,10 +164,22 @@ orderHammer.on('tap', function(e) {
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '取消订单成功',
autoHide: true,
fast: true
});
//取消订单页面刷新
history.go(0);
}
},
error: function() {
dialog.showDialog({
dialogText: '取消订单失败',
autoHide: true,
fast: true
});
}
});
});
... ... @@ -184,4 +208,4 @@ $(window).scroll(function() {
});
//初始化请求第一页数据
getOrders();
\ No newline at end of file
getOrders();
... ...
... ... @@ -3,12 +3,11 @@
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/12/03
*/
var loading = require('../plugin/loading');
function isWXOpen() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) === 'micromessenger') {
return true;
} else {
... ... @@ -19,7 +18,6 @@ function isWXOpen() {
function hideWeChatPay() {
var payApps = document.getElementsByClassName('app');
[].forEach.call(payApps, function(app, index) {
if (app.innerHTML.indexOf('微信') !== -1) {
app.parentNode.style.display = 'none';
... ... @@ -29,9 +27,61 @@ function hideWeChatPay() {
}
function handleForWX() {
if (isWXOpen()) {
if (!isWXOpen()) {
hideWeChatPay();
}
}
window.onload = handleForWX;
function setIcon(div, appName) {
if (appName.indexOf('百度') !== -1) {
div.style.backgroundPositionY = '-2.7rem';
return false;
}
if (appName.indexOf('微信') !== -1) {
div.style.backgroundPositionY = '-1.2rem';
return false;
}
if (appName.indexOf('银联') !== -1) {
div.style.backgroundPositionY = '-4rem';
return false;
}
if (appName.indexOf('QQ') !== -1) {
div.style.backgroundPositionY = '-5.4rem';
return false;
}
}
function loadIcon() {
var boxs = document.getElementsByClassName('box');
var div = null;
var appName = null;
[].forEach.call(boxs, function(box, index) {
div = box.getElementsByClassName('icon')[0].getElementsByTagName('div')[0];
if (div) {
appName = box.getElementsByClassName('app')[0].innerHTML;
setIcon(div, appName);
}
});
}
function showPage() {
var pageList = document.getElementsByClassName('payapp-list')[0];
pageList.style.visibility = 'visible';
}
function main() {
handleForWX();
loading.hideLoadingMask();
showPage();
loadIcon();
}
loading.showLoadingMask();
window.onload = main;
... ...
... ... @@ -82,6 +82,9 @@ headerNavHammer.on('tap', function(e) {
autoHide: true,
dialogText: '提交成功'
});
setTimeout(function() {
location.pathname = 'home/suggest';
}, 2000);
}
}).fail(function() {
... ...
... ... @@ -5,9 +5,8 @@
* @date: 2015/10/19
*/
var $ = require('jquery');
// Hammer = require('yoho.hammer');
var $ = require('jquery'),
Hammer = require('yoho.hammer');
var $filter;
... ... @@ -113,8 +112,7 @@ function subClassifyTapEvt($this) {
//初始化筛选
function initFilter(opt) {
// var filterHammer;
var filterHammer;
//注册回调
fCbFn = opt.fCbFn;
... ... @@ -127,8 +125,8 @@ function initFilter(opt) {
$filter = $('.filter-mask');
// filterHammer = new Hammer($filter[0]);
$filter.on('touchend', function(e) {
filterHammer = new Hammer($filter[0]);
filterHammer.on('tap', function(e) {
var $this = $(e.target),
$cur;
... ... @@ -147,7 +145,7 @@ function initFilter(opt) {
//tap classify
$cur = $this.closest('.classify-item');
e.stopPropagation();
e.srcEvent.stopPropagation();
classifyTapEvt($cur);
}
... ... @@ -183,4 +181,4 @@ exports.showFilter = showFilter;
exports.hideFilter = hideFilter;
exports.resetFilter = resetFilter;
\ No newline at end of file
exports.resetFilter = resetFilter;
... ...
/**
* 我要咨询提交页面
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/12/01
*/
var $ = require('jquery'),
tip = require('../../plugin/tip'),
loading = require('../../plugin/loading');
var $consultForm = $('.consult-form'),
$submit = $('#submit'),
$content = $('#content'),
productId = $('#product_id').val(),
isSubmiting;
$submit.on('touchend', function() {
$content.blur();
$consultForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
$content.on('focus', function() {
if ($content.val() === '请输入咨询内容') {
$content.val('');
}
}).on('blur', function() {
if ($content.val() === '') {
$content.val('请输入咨询内容');
}
});
// 提交表单请求
$consultForm.on('submit', function() {
var content;
if (isSubmiting) {
return false;
}
// 简单的表单校验
content = $content.val();
if (!content || content === '请输入咨询内容') {
tip.show('咨询内容不能为空');
return false;
}
isSubmiting = true;
loading.showLoadingMask();
$.ajax({
method: 'POST',
url: '/product/detail/consultsubmit',
data: {
product_id: productId,
content: content
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
isSubmiting = false;
loading.hideLoadingMask();
} else {
window.history.go(-1);
}
}).fail(function() {
tip.show('网络出了点问题~');
isSubmiting = false;
});
return false;
});
... ...
... ... @@ -9,10 +9,9 @@ var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
var likeHammer = new Hammer(document.getElementById('likeBtn'));
var addToCartHammer = new Hammer(document.getElementById('addtoCart'));
var productId = $('#productId').val();
var likeHammer = new Hammer(document.getElementById('likeBtn')),
addToCartHammer = new Hammer(document.getElementById('addtoCart')),
productId = $('#productId').val();
likeHammer.on('tap', function(e) {
var opt,
... ...
... ... @@ -8,4 +8,5 @@ require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
require('./detail/desc');
\ No newline at end of file
require('./detail/loadmore');
require('./detail/consultform');
\ No newline at end of file
... ...
... ... @@ -157,6 +157,9 @@
margin-top: -$height / 2;
}
.del-fav {
text-indent: 0;
}
}
span {
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "pay";
... ...
.pay-page {
padding: (40rem / $pxConvertRem) (20rem / $pxConvertRem) 0;
.payapp-list {
visibility: hidden;
}
.box {
border: 1px solid #eee;
border-radius: 10rem / $pxConvertRem;
... ... @@ -16,31 +20,37 @@
}
.icon {
flex-grow: 0.3;
width: 15%;
img {
width: 60rem / $pxConvertRem;
margin: 0;
}
> div {
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
background-image: url(http://localhost:8000/img/layout/pay-icon.png);
background-size: 90%;
background-position-y: 8rem / $pxConvertRem;
background-position-x: center;
background-repeat: no-repeat;
}
}
.app {
flex-grow: 3;
width: 40%;
font-size: 32rem / $pxConvertRem;
color: #414141;
//padding-left: 20rem/$pxConvertRem
}
.hint {
flex-grow: 4;
width: 40%;
font-size: 24rem / $pxConvertRem;
color: #4b4b4b;
}
.iconfont {
flex-grow: 1;
width: 5%;
justify-content: flex-end;
color: #e0e0e0;
font-size: 28rem / $pxConvertRem;
... ...
... ... @@ -114,6 +114,10 @@ $basicBtnC:#eb0313;
background-color: #000;
color: #fff;
}
.yohood-tag {
background-color: #000;
color: #fff;
}
.limit-tag {
border: 1px solid #000;
background-color: #fff;
... ... @@ -131,7 +135,7 @@ $basicBtnC:#eb0313;
// overflow: hidden;
}
.banner-top-single{
height:pxToRem(600px);
width: pxToRem(448px);
margin:pxToRem(30px) pxToRem(72px);
overflow: hidden;
... ...
... ... @@ -130,9 +130,10 @@
div {
text-align: center;
&.cell {
line-height: pxToRem(53px);
font-size: pxToRem(24px);
background-color: $tableCellC;
padding: pxToRem(15px) pxToRem(40px);
padding: 0 pxToRem(40px);
border: 1px solid #fff;
}
}
... ... @@ -143,14 +144,15 @@
#reference-swiper-container {
.first-group {
width: pxToRem(70px);
margin-top: pxToRem(66px);
.avatar {
// line-height: pxToRem(40px);
display: inline-block;
width: pxToRem(40px);
border-radius: 50%;
height: pxToRem(40px);
margin: pxToRem(12px) 0;
margin-top: pxToRem(55px);
div{
height: pxToRem(55px);
.avatar {
display: inline-block;
width: pxToRem(40px);
border-radius: 50%;
margin-top:pxToRem(7px);
}
}
}
}
... ...
{{> layout/header}}
<div class="logistic-page yoho-page">
<div class="overview">
<div class="left" >
<div class="icon" style='background-image:url("{{logisticImg}}")'> </div>
</div>
<div class="right">
<div>
<span class='info'>物流公司:</span>
<span >{{logisticCompany}}</span>
</div>
<div>
<span class='info'>快递单号:</span>
<span>{{logisticNumber}}</span>
</div>
</div>
</div>
<div class="title">
<span>物流详情</span>
</div>
<div class="detail">
{{# logisticDetail}}
<div class="timeline-box ">
<span class="timeline-node"></span>
<div class="timeline-info">
<div class="timeline-info-row">
{{ city}}&nbsp;&nbsp;&nbsp;{{ status}}
</div>
<div class="timeline-info-row">
{{date}}
</div>
</div>
</div>
{{/ logisticDetail}}
</div>
</div>
{{> layout/footer}}
{{> layout/header}}
<div class="pay-page yoho-page">
{{# payAppInfo}}
<div class="box">
<div class="icon">
<img src="{{appIcon}}" alt="app图标">
</div>
<div class="app">{{app}}</div>
<div class="hint">
{{hint}}
{{#if subHint}}
<br>
{{subHint}}
{{/if}}
</div>
<div class="iconfont">&#xe604</div>
<div class="payapp-list">
{{# payAppInfo}}
<a href="{{payLink}}">
<div class="box">
<div class="icon">
{{#if appIcon}}
<img src="{{appIcon}}" alt="app图标">
{{else}}
<div></div>
{{/if}}
</div>
<div class="app">{{app}}</div>
<div class="hint">
{{hint}}
{{#if subHint}}
<br>
{{subHint}}
{{/if}}
</div>
<div class="iconfont">&#xe604</div>
</div>
</a>
{{/ payAppInfo}}
</div>
{{/ payAppInfo}}
</div>
{{> layout/footer}}
... ...
... ... @@ -3,7 +3,7 @@
<form class="consult-form" url="{{formUrl}}">
<textarea id="content" name="content">请输入咨询内容</textarea>
<input type="hidden" id="product_id" value="{{productId}}">
<a type="submit">提交</a>
<a type="submit" id="submit">提交</a>
</form>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,7 @@
<p class="good-tag sale-tag">SALE</p>
{{/ is_discount}}
{{# is_yohoood}}
<div class="good-tag yohood-tag"></div>
<div class="good-tag yohood-tag">新品节</div>
{{/ is_yohoood}}
{{# is_limited}}
<p class="good-tag limit-tag">限量商品</p>
... ... @@ -95,7 +95,7 @@
{{else}}
<div class="nodata">
<span>暂无商品评价和咨询</span>
<a href="/product/detail/consultform" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
<a href="{{link}}" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{/if}}
... ... @@ -113,6 +113,7 @@
{{/ enterStore}}
<div id="productDesc"> </div>
<!-- {{> product/product-description}} -->
{{> product/recommend-for-you}}
{{#cartInfo}}
... ... @@ -130,10 +131,10 @@
</div>
{{/cartInfo}}
{{#if introUrl}}
<input id="introUrl" type="hidden" value={{introUrl}}>
<input id="introUrl" type="hidden" value='{{introUrl}}'>
{{/if}}
{{#if id}}
<input id="productId" type="hidden" value={{id}}>
<input id="productId" type="hidden" value='{{id}}'>
{{/if}}
</div>
... ...
{{> layout/header}}
<div class="newarrival-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
<script>
seajs.use('js/common');
</script>
{{!-- 逛(PLUS+STAR) --}}
{{!-- 逛(PLUS+STAR) --}}
{{#if psList}}
<script>
seajs.use('js/guang/plus-star/list');
... ... @@ -175,6 +175,12 @@
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 商品详情我要咨询 --}}
{{#if consultformPage}}
<script>
seajs.use('js/product/detail/consultform');
</script>
{{/if}}
{{!-- 品类 --}}
{{#if categoryPage}}
<script>
... ... @@ -282,7 +288,10 @@
</script>
{{/if}}
{{#if logisticInfoPage}}
<script>
seajs.use('js/me/logistic');
{{/if}}
{{#if payCenterPage}}
<script>
seajs.use('js/me/pay');
</script>
{{/if}}
... ...
... ... @@ -59,7 +59,7 @@
<span class="iconfont">&#xe63d;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="/product/detail/consultform">
<a href="{{link}}">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -72,7 +72,9 @@
{{#params}}
{{#if @first}}
{{else}}
<img class="avatar lazy" data-original="{{param}}" alt="">
<div>
<img class="avatar lazy" data-original="{{param}}" alt="">
</div>
{{/if}}
{{/params}}
</div>
... ...
... ... @@ -23,7 +23,7 @@ class OrderModel
{
$result = array();
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
// 判断是否还有数据, 没有数据则返回空
if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
return $result;
... ... @@ -33,7 +33,7 @@ class OrderModel
foreach ($data['data']['order_list'] as $key => $vo) {
//订单号,支付状态,订单商品数量,订单总价格
$result[$key]['orderNum'] = $vo['order_code'];
$result[$key]['orderStatus'] = $vo['status_str'];
$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $vo['status_str'];
$result[$key]['count'] = count($vo['order_goods']);
$result[$key]['sumCost'] = $vo['amount'];
//类内调用格式化订单商品数据方法
... ...
... ... @@ -104,7 +104,7 @@ class SideModel
'textCn' => '查看全部',
'textEn' => '',
'back' => false,
'isSelect' => ($guangChoosed === 'all') ? true : false,
'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,
'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')
),
2 => array(
... ...
... ... @@ -239,8 +239,8 @@ class UserModel
$product = array();
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0;
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0;
$brand['productList'][] = $product;
}
... ...
... ... @@ -96,8 +96,8 @@ class DetailModel
if (isset($baseInfo['promotionBoList'])) {
$build = array();
foreach ($baseInfo['promotionBoList'] as $value) {
$build['title'] = $value['promotionTitle'];
$build['type'] = $value['promotionType'];
$build['text'] = $value['promotionTitle'];
//$build['type'] = $value['promotionType'];
$result['goodsDiscount']['list'][] = $build;
}
}
... ... @@ -146,6 +146,8 @@ class DetailModel
'storeName' => $baseInfo['brand']['brandName'],
'url' => Helpers::url('', array(), $baseInfo['brand']['brandDomain'])
);
// 为你优选的链接
$result['preferenceUrl'] = Helpers::url('/product/detail/preference', array('productSkn' => $baseInfo['erpProductId'], 'brandId' => $baseInfo['brand']['id']));
}
// 商品信息
... ... @@ -448,12 +450,12 @@ class DetailModel
* @param int $productSkn 商品SKN
* @return array
*/
public static function getPreference($productSkn)
public static function getPreference($productSkn, $channel, $brandId)
{
$result = array();
if (is_numeric($productSkn)) {
$preference = DetailData::preference($productSkn);
$preference = DetailData::preference($productSkn, $channel, $brandId);
if (!empty($preference['data'])) {
foreach ($preference['data'] as $value) {
$result['recommendList'][] = Helpers::formatProduct($value, false, true, true, 299, 388, false, false);
... ...
... ... @@ -21,6 +21,7 @@ use Plugin\Cache;
class NewsaleModel
{
/* 男生频道取新品到着及折扣专区数据的位置码 */
const CODE_TOP_NEW_BOYS = '3cf2c1be5217fbab6009ce83959e1e12';
const CODE_TOP_SALE_BOYS = '153180b9a88c0b565848850c523bb637';
/* 女生频道取新品到着及折扣专区数据的位置码 */
... ... @@ -125,7 +126,6 @@ class NewsaleModel
return $result;
}
/**
* 获取折扣专区的商品列表
*
... ... @@ -162,7 +162,6 @@ class NewsaleModel
return $result;
}
/**
* 顶部焦点图缓存控制
* @param const $cacheKey 缓存常量值
... ... @@ -184,12 +183,12 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) {
if(count($newsale['data'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
if (count($newsale['data']['list']) === 1) {
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
foreach ($newsale['data']['list'] as $one) {
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
}
}
}
... ... @@ -217,41 +216,40 @@ class NewsaleModel
public static function selectData($data)
{
$result = array();
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
foreach ($data['data']['product_list'] as $val) {
$result['goods'][] = Helpers::formatProduct($val, true, false, false, 299,388);
$result['goods'][] = Helpers::formatProduct($val, true, false, false, 299, 388);
}
}
return $result;
}
/**
* 筛选出来的热销排行榜商品数据处理
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param boolean $notab 时候返回顶部tab的数据,默认返回
* @param integer $limit 查询返回的最大限制数
* @param integer $page 分页第几页
* @return array 处理之后的数据
*/
/**
* 筛选出来的热销排行榜商品数据处理
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param boolean $notab 时候返回顶部tab的数据,默认返回
* @param integer $limit 查询返回的最大限制数
* @param integer $page 分页第几页
* @return array 处理之后的数据
*/
public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
{
$result = array();
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
$result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
$result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
}
return $result;
}
/**
* 获取筛选数据
* @param array $data 接口返回的数据
... ... @@ -269,4 +267,5 @@ class NewsaleModel
return $result;
}
}
... ...
... ... @@ -19,6 +19,9 @@ class LoginController extends AbstractAction
{
$this->setTitle('登录');
$refer = $this->get('refer', SITE_MAIN . '/?go=1');
$this->setCookie('refer', $refer);
$data = array(
'loginIndex' => true, // 模板中使用JS的标识
'backUrl' => '/', // 返回的URL链接
... ... @@ -33,8 +36,6 @@ class LoginController extends AbstractAction
'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接
);
// 生成HTML(signin.html)
$this->_view->html('signin');
// 渲染模板
$this->_view->display('index', $data);
}
... ... @@ -53,13 +54,11 @@ class LoginController extends AbstractAction
$data['isPassportPage'] = true; // 模板中模块标识
$data['areaCode'] = '+86'; // 默认区号
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
//
// 生成HTML(login.html)
$this->_view->html('login');
// 渲染模板
$this->_view->display('international', $data);
}
/**
* 退出
*
... ... @@ -68,7 +67,7 @@ class LoginController extends AbstractAction
public function outAction()
{
$this->setCookie('_UID', '');
headers_sent() || header('Location: /');
}
... ... @@ -124,8 +123,7 @@ class LoginController extends AbstractAction
// $name = $profile['data']['mobile'];
// }
$data['data'] = '/'; // @todo
}
while (false);
} while (false);
$this->echoJson($data);
}
... ... @@ -188,8 +186,7 @@ class LoginController extends AbstractAction
$nickname = $userInfo['response']['user_info']['user_name'];
// $alipayEmail = $userInfo['response']['user_info']['email'];
}
}
else {
} else {
$nickname = $_GET['real_name'];
// $alipayEmail = isset($_GET['email']) ? $_GET['email'] : '';
}
... ...
... ... @@ -272,7 +272,7 @@ class RegController extends AbstractAction
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
}
$data['data'] = $refer;
$data['data'] = rawurldecode($refer);
}
} while (false);
... ...
... ... @@ -182,7 +182,9 @@ class DetailController extends AbstractAction
if ($this->isAjax()) {
$productSkn = $this->get('productSkn'); // 50000058
$result = \Product\DetailModel::getPreference($productSkn);
$brandId = $this->get('brandId');
$channel = Helpers::getChannelByCookie();
$result = \Product\DetailModel::getPreference($productSkn, $channel, $brandId);
}
if (empty($result)) {
... ...
... ... @@ -79,11 +79,11 @@ class NewsaleController extends AbstractAction
$this->setTitle('热销排行榜');
$this->setNavHeader('热销排行榜');
$channel = Helpers::getChannelByCookie();
$channel = Helpers::getChannelByCookie();
// 设置一些默认参数
$data = array(
'hotrankPage' => true,
'headerBanner' => \Product\NewsaleModel::getNewFocus($channel),
'headerBanner' => \Product\NewsaleModel::getNewFocus($channel),
'showDownloadApp' => true,
'pageFooter' => true,
'cartUrl' => Helpers::url('/product/newsale/selectHotrank', null),
... ... @@ -92,32 +92,32 @@ class NewsaleController extends AbstractAction
$this->_view->display('hotrank', $data);
}
/**
* Ajax方式获取热销排行榜商品
*
* @return array 根据指定条件筛选之后的商品
*/
public function selectHotrankAction()
{
$result = array();
if ($this->isAjax()) {
$sort = $this->get('sort', null);
$tab_id = $this->get('tab_id', null);
$limit = $this->get('limit', 50);
$page = $this->get('page', 1);
$notab = (boolean)$this->get('notab', false);
// 获取性别
$gender = Helpers::getGenderByCookie();
$result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page);
}
if (empty($result)) {
echo ' ';
} else {
$this->_view->display('hotlist', $result);
}
}
/**
* Ajax方式获取热销排行榜商品
*
* @return array 根据指定条件筛选之后的商品
*/
public function selectHotrankAction()
{
$result = array();
if ($this->isAjax()) {
$sort = $this->get('sort', null);
$tab_id = $this->get('tab_id', null);
$limit = $this->get('limit', 50);
$page = $this->get('page', 1);
$notab = (boolean) $this->get('notab', false);
// 获取性别
$gender = Helpers::getGenderByCookie();
$result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page);
}
if (empty($result)) {
echo ' ';
} else {
$this->_view->display('hotlist', $result);
}
}
/**
* Ajax方式筛选新品到着、折扣专区商品
... ... @@ -127,7 +127,7 @@ class NewsaleController extends AbstractAction
public function selectNewSaleAction()
{
$result = array();
if ($this->isAjax()) {
$gender = $this->get('gender', null);
$brand = $this->get('brand', null);
... ... @@ -149,7 +149,7 @@ class NewsaleController extends AbstractAction
$channel = Helpers::getChannelByCookie();
$data = NewsaleData::selectNewSaleProducts(
$gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
$gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
);
$result = \Product\NewsaleModel::selectData($data);
}
... ...