Authored by ccbikai

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop


guang.m.yohobuy.com/guang/index/clear?type=boys
guang.m.yohobuy.com/guang/index/clear?type=girls
guang.m.yohobuy.com/guang/index/clear?type=kids
guang.m.yohobuy.com/guang/index/clear?type=lifestyle
http://new.yohobuy.com/cache/clear?key=Default_Kids_index&token=yoho9646abcdef
http://new.yohobuy.com/cache/clear?key=Default_Lifestyle_index&token=yoho9646abcdef
http://new.yohobuy.com/cache/clear?key=Default_Woman_index&token=yoho9646abcdef
##http://new.yohobuy.com/cache/clear?key=Default_Default_index&token=yoho9646abcdef
其中token就按照上述中去填写,key代表具体要清的缓存的键
具体key的对应关系如下:
key 说明
Default_Kids_index 潮童页面缓存
Default_Lifestyle_index 创意生活页面缓存
Default_Woman_index 女生页面缓存
Default_Default_index 男生
\ No newline at end of file
... ...
No preview for this file type
No preview for this file type
framework @ 75bbc3b0
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -261,6 +261,7 @@ class AbstractAction extends Controller_Abstract
* 获取Session
*
* @param string $name 名称
* @return mixed
*/
public function getSession($name)
{
... ... @@ -270,18 +271,25 @@ class AbstractAction extends Controller_Abstract
/**
* 获取当前登录的用户ID
*
* @param bool $useSession 是否使用Session会话
* @return int
* @todo
*/
protected function getUid()
protected function getUid($useSession = false)
{
if (!$this->_uid) {
$cookie = $this->getCookie('_UID');
if (!empty($cookie)) {
$cookieList = explode('::', $cookie);
if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
$this->_uid = $cookieList[1];
$this->_uname = $cookieList[0];
// 从SESSION获取
if ($useSession) {
$this->_uid = $this->getSession('_UID');
}
// 从COOKIE获取
else {
$cookie = $this->getCookie('_UID');
if (!empty($cookie)) {
$cookieList = explode('::', $cookie);
if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
$this->_uid = $cookieList[1];
$this->_uname = $cookieList[0];
}
}
}
}
... ...
<?php
namespace LibModels\Wap\Home;
use Api\Sign;
use Api\Yohobuy;
/**
* 我的逛数据模型
*
* @name GuangData
* @package LibModels/Wap/Home
* @copyright yoho.inc
* @version 1.0 (2015-11-13)
* @author xiaowei
*/
class GuangData
{
const GUANG_URI = 'guang/api/v1/favorite/';
//我的guang
public static function getGuangInfo($uid, $page, $yh_channel = 1, $gender = '1,3', $limit = 10)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['page'] = $page;
$param['gender'] = $gender;
$param['limit'] = $limit;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
// return Yohobuy::post(Yohobuy::API_URL, $param);
return Yohobuy::post(Yohobuy::SERVICE_URL . self::GUANG_URI . 'getUserFavArticleList', $param);
}
}
... ...
... ... @@ -2,7 +2,6 @@
namespace LibModels\Wap\Home;
use Api\Sign;
use Api\Yohobuy;
/**
... ... @@ -18,16 +17,23 @@ class OnlineData
{
const ONLINE_URI = 'operations/api/v1/help/';
//获取帮助列表(分类)
/*
* 获取帮助列表(分类),缓存1h
* clientType客户端
*/
public static function getOnlineServiceInfo($clientType='iphone')
{
return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getCategory', array('client_type'=>$clientType));
return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getCategory', array('client_type'=>$clientType),3600);
}
//获取问题详情
/*
* 获取问题详情,缓存1h
* cateId问题分类ID
* clientType客户端
*/
public static function getOnlineServiceDetail($cateId, $clientType = 'iphone')
{
return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getHelp', array('category_id'=>$cateId,'client_type'=>$clientType));
return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getHelp', array('category_id'=>$cateId,'client_type'=>$clientType),3600);
}
}
... ...
... ... @@ -24,7 +24,7 @@ class OrderData
* and open the template in the editor.
*/
public function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
//构建必传参数
$param = Yohobuy::param();
$param['gender'] = $gender;
... ... @@ -36,7 +36,7 @@ class OrderData
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL2, $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
... ... @@ -45,7 +45,7 @@ class OrderData
* and open the template in the editor.
*/
public function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) {
static function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) {
$param = Yohobuy::param();
$param['order_code'] = $order_code;
$param['uid'] = $uid;
... ... @@ -62,7 +62,7 @@ class OrderData
* and open the template in the editor.
*/
public function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) {
static function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) {
$param = Yohobuy::param();
$param['order_code'] = $order_code;
$param['uid'] = $uid;
... ... @@ -74,4 +74,20 @@ class OrderData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
* 支付订单
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
static function getPaymentData($contentCode, $gender, $yh_channel) {
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['gender'] = $gender;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//print_r($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
}
}
... ...
... ... @@ -130,6 +130,24 @@ class UserData
}
/**
* 取消收藏的商品数据
*
* @param int $uid 用户ID
* @param int $fav_id 要取消的收藏id
* @return array 接口返回的数据
*/
public static function favoriteDelete($uid, $fav_id)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.cancel';
$param['type'] = 'product';
$param['fav_id'] = $fav_id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* YOHO币数据
*
* @param int $uid 用户ID
... ... @@ -267,6 +285,24 @@ class UserData
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public static function deleteAddress($uid, $id)
{
$param = Yohobuy::param();
$param['id'] = $id;
$param['method'] = 'app.address.del';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 意见反馈数据
*
* @param string $udid 客户端唯一标识
... ...
... ... @@ -133,14 +133,8 @@ class Images
{
$images[$files['name']] = $files['tmp_name'];
}
if($_SERVER['HTTP_HOST'] != 'test.service.api.yohobuy.com') //代理转接
{
return self::agentCurlImage($images);
}
else
{
return self::uploadStreamImage($images);
}
return self::uploadStreamImage($images);
}
/**
... ... @@ -199,43 +193,6 @@ class Images
}
}
/**
* 代理上传图片
*
* @param array|string $files
* @return array
*/
private static function agentCurlImage($file)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, 'http://test.service.api.yohobuy.com/sns/ajax/uploadimg');
curl_setopt($ch, CURLOPT_POST, true);
$params = array();
$files = is_array($file) ? $file : array($file);
foreach($files as $key => $name)
{
$key = is_numeric($key) ? $key.'.jpg' : $key;
$filename = dirname($name).'/'.$key;
rename($name, $filename);
if (@class_exists('\CURLFile'))
{
$params["images[$key]"] = new \CURLFile(realpath($filename));
}
else
{
$params["images[$key]"] = '@' . realpath($filename);
}
}
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$response = json_decode(curl_exec($ch), true);
return $response['data'];
}
/**
* 获取模板的图片地址
* @param $fileName
... ...
... ... @@ -55,16 +55,19 @@ function initInfosEvt($container) {
cHammer = new Hammer($container[0]);
//点赞或者收藏事件
cHammer.on('tap', function(e) {
var $this = $(e.target),
opt = 'ok',
$likeBtn,
$collectBtn,
$btn,
$info;
$likeBtn = $this.closest('.like-btn');
if ($likeBtn.length > 0) {
if ($likeBtn.hasClass('like')) {
e.preventDefault();
//点赞
$btn = $this.closest('.like-btn');
if ($btn.length > 0) {
if ($btn.hasClass('like')) {
opt = 'cancel';
}
... ... @@ -80,22 +83,23 @@ function initInfosEvt($container) {
var code = data.code;
if (code === 200) {
$likeBtn.next('.like-count').text(data.data);
$btn.next('.like-count').text(data.data);
//切换点赞状态
$likeBtn.toggleClass('like');
$btn.toggleClass('like');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
return;
}
// 2015/11/03 hf: 增加APP里的收藏资讯功能. 写得不对的地方还请大神修改!
$collectBtn = $this.closest('.collect-btn');
if ($collectBtn.length > 0) {
if ($collectBtn.hasClass('collected')) {
//APP收藏
$btn = $this.closest('.collect-btn');
if ($btn.length > 0) {
if ($btn.hasClass('collected')) {
opt = 'cancel';
}
... ... @@ -111,7 +115,7 @@ function initInfosEvt($container) {
if (data.code && data.code === 200) {
//切换收藏状态
$collectBtn.toggleClass('collected');
$btn.toggleClass('collected');
}
},
error: function() {
... ...
... ... @@ -6,6 +6,22 @@
var $ = require('jquery');
var info = require('../guang/info');
var $infoList = $('#info-list');
info.initInfoEvt($('#info-list'));
\ No newline at end of file
var winH = $(window).height();
var info = require('../guang/info'),
loadMore = info.loadMore;
var setting = {
page: 2,
end: false
};
info.initInfoEvt($infoList);
$(window).scroll(function() {
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $infoList.height()) {
loadMore($infoList, setting);
}
});
\ No newline at end of file
... ...
... ... @@ -136,8 +136,8 @@ orderHammer.on('tap', function(e) {
success: function(data) {
if (data.code === 200) {
//取消订单
alert('order cancel');
//取消订单页面刷新
location.href = location.href;
}
}
});
... ...
... ... @@ -6,8 +6,11 @@
var $ = require('jquery'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload'),
Handlebars = require('yoho.handlebars'),
goodsSwiper,
Handlebars = require('yoho.handlebars');
var goodsSwiper,
// winH = $(window).height(),
sizeSwiper,
refSwiper,
handleHelper;
... ... @@ -57,7 +60,9 @@ handleHelper = Handlebars.registerHelper('addOne', function(index) {
return index + 1;
});
// $('#iframe').load(function() {
// var mainheight = $(this).contents().find('body').height() + 30;
// $(this).height(mainheight);
// });
\ No newline at end of file
//srcoll to load more
// $(window).scroll(function () {
// if ($(window).scrollTop() + winH >= $(document).height() - 50) {
// }
// });
... ...
... ... @@ -5,7 +5,7 @@ $tableCellC:#eee;
$basicBtnC:#eb0313;
.good-detail-page {
overflow: hidden;
/* basic component */
.page-block{
box-sizing:border-box;
... ... @@ -14,7 +14,6 @@ $basicBtnC:#eb0313;
border-top: 1px solid $borderC;
padding: 0 pxToRem(28px);
>.title{
min-height: pxToRem(88px);
line-height: pxToRem(88px);
color: $mainFontC;
font-size : pxToRem(28px);
... ... @@ -23,7 +22,6 @@ $basicBtnC:#eb0313;
span{
color:#a0a0a0;
font-size:pxToRem(18px);
// vertical-align: baseline;
}
}
.detail{
... ... @@ -38,26 +36,17 @@ $basicBtnC:#eb0313;
.row{
display: table-row;
.column{
display: table-cell;
padding: 0.4em 0.8em;
border:1px solid white;
font-size: pxToRem(24px);
background-color: $tableCellC;
}
}
}
// table {
// width: 100%;
// tbody td{
// padding: 0.4em 0.8em;
// border:3px solid white;
// font-size: pxToRem(24px);
// background-color: $tableCellC;
// }
// }
display: table-cell;
padding: 0.4em 0.8em;
border:1px solid #fff;
font-size: pxToRem(24px);
background-color: $tableCellC;
}
}
}
}
}
.gap-block{
min-height: 30rem/$pxConvertRem;
background-color: #f0f0f0;
... ... @@ -162,23 +151,25 @@ $basicBtnC:#eb0313;
}
}
.periodOfMarket{
font-size: pxToRem(24px);
float: right;
h1{
display: inline-block;
line-height: pxToRem(88px);
}
font-size: pxToRem(24px);
float: right;
h1{
display: inline-block;
line-height: pxToRem(88px);
}
}
.goodsName,
.goodsSubtitle{
// width: 100%;
display:table;
span{
display: table-cell;
vertical-align: middle;
}
display: table-cell;
vertical-align: middle;
}
}
.vipLevel {
.vipLevel {
width: 100%;
box-sizing:border-box;
display: table;
min-height: pxToRem(88px);
padding-left:pxToRem(28px);
... ... @@ -213,17 +204,21 @@ $basicBtnC:#eb0313;
color: $mainFontC;
line-height: pxToRem(88px);
border-bottom: 2px solid $borderC;
border-bottom: 1px solid $borderC;
.iconfont{
// padding-right:28rem/$pxConvertRem;
font-size: inherit;
display: inline-block;
width: pxToRem(35px);
font-size: pxToRem(45px);
float: right;
color:#e0e0e0;
text-align: right;
// padding-left:pxToRem(50px);
}
}
.goodsSubtitle,
.goodsDiscount{
text-indent: pxToRem(-14px);
}
.feedback-list-page {
padding-top: pxToRem(30px);
background-color: #f0f0f0;
... ... @@ -254,30 +249,28 @@ $basicBtnC:#eb0313;
color: #000;
}
}
.comment-nav {
border-right: 1px solid #ccc;
}
.comment-content{
.comment-content-main{
.comment-content-main{
background-color: #fff;
border-bottom: 1px solid $borderC;
.user-name{
font-size: px2rem(24);
line-height: px2rem(62);
font-size: pxToRem(24px);
line-height: pxToRem(62px);
color:$mainFontC;
padding-left: px2rem(28);
padding-right: px2rem(18);
padding-left: pxToRem(28px);
padding-right: pxToRem(18px);
}
.goods-spec,
.comment-time{
font-size: px2rem(24);
line-height: px2rem(62);
font-size: pxToRem(24px);
line-height: pxToRem(62px);
}
.detail-content{
font-size: px2rem(28);
line-height: px2rem(36);
font-size: pxToRem(28px);
line-height: pxToRem(36px);
font-size: pxToRem(24px);
line-height: pxToRem(62px);
color:$mainFontC;
... ... @@ -299,17 +292,15 @@ $basicBtnC:#eb0313;
}
.detail-content,
.comment-time{
padding-left: px2rem(28);
padding-left: pxToRem(28px);
}
.detail-content{
padding-right: px2rem(28);
padding-right: pxToRem(28px);
padding-left: pxToRem(28px);
}
.detail-content{
padding-right: pxToRem(28px);
}
.comment-time{
color:#c1c1c1;
... ... @@ -318,21 +309,21 @@ $basicBtnC:#eb0313;
.comment-content-footer{
min-height: pxToRem(88px);
text-align: center;
background-color: #fff;
min-height: pxToRem(88px);
text-align: center;
background-color: #fff;
border-bottom: 2px solid $borderC;
line-height: pxToRem(88px);
font-size: pxToRem(28px);
border-bottom: 1px solid $borderC;
line-height: pxToRem(88px);
font-size: pxToRem(28px);
a{
color: #e0e0e0;
.iconfont{
font-size: inherit;
}
}
}
a{
color: #e0e0e0;
.iconfont{
font-size: inherit;
}
}
}
}
... ... @@ -353,10 +344,8 @@ $basicBtnC:#eb0313;
.store-logo{
// padding-right: 35rem/$pxConvertRem;
img{
width: pxToRem(109px);
height: pxToRem(68px);
margin-left: 0;
margin-right: pxToRem(-25px);
}
... ... @@ -374,33 +363,37 @@ $basicBtnC:#eb0313;
}
}
}
.goods-desc{
.service{
margin-top: pxToRem(22px);
}
.goods-desc{
.service{
width: pxToRem(489px);
height: pxToRem(28px);
margin-top: pxToRem(22px);
}
.tips{
color:$subFontC;
font-size: pxToRem(18px);
margin-top: pxToRem(20px);
}
.materials{
.detail{
img{
display: block;
overflow: hidden;
width: pxToRem(90px);
height: pxToRem(120px);
padding-right: pxToRem(20px);
float: left;
}
.material-desc{
// float: left;
}
.tips{
color:$subFontC;
font-size: pxToRem(18px);
margin-top: pxToRem(20px);
}
.materials{
.detail{
img{
display: block;
overflow: hidden;
width: pxToRem(90px);
height: pxToRem(120px);
padding-right: pxToRem(20px);
float: left;
}
.material-desc{
font-size: pxToRem(24px);
overflow: hidden;
}
}
.material-type{
width: pxToRem(581px);
height: pxToRem(99px);
border-top: 1px solid $borderC;
padding: pxToRem(17px) 0;
}
... ... @@ -435,10 +428,15 @@ $basicBtnC:#eb0313;
}
#reference-swiper-container{
.first-group{
width: pxToRem(58px);
>div{
height: pxToRem(67px);
width: pxToRem(70px);
margin-top: pxToRem(66px);
.avatar{
line-height: pxToRem(40px);
width: pxToRem(40px);
height: pxToRem(40px);
margin: pxToRem(18px) 0;
}
}
}
... ... @@ -446,103 +444,96 @@ $basicBtnC:#eb0313;
.measurement-method{
.detail{
width: 100%;
height: pxToRem(300px);
// height: pxToRem(300px);
img{
float:left;
width: pxToRem(270px);
height: pxToRem(239px);
margin-top: pxToRem(18px);
margin-right: pxToRem(28px);
float:left;
width: pxToRem(270px);
height: pxToRem(239px);
margin-top: pxToRem(18px);
margin-right: pxToRem(28px);
}
.right-part{
overflow: hidden;
.title{
>h1{
margin-top: pxToRem(10px);
display: inline-block;
padding-right: pxToRem(10px);
border-right: 1px solid $borderC;
line-height: 100%;
}
.right-part{
float:left;
.title{
>h1{
margin-top: pxToRem(10px);
display: inline-block;
padding-right: pxToRem(10px);
border-right: 1px solid $borderC;
line-height: 100%;
}
>span{
font-size: pxToRem(12px);
}
}
ul.items{
margin-top: pxToRem(20px);
padding: 0;
line-height: pxToRem(30px);
font-size: pxToRem(13px);
li{
span{
display: inline-block;
width: pxToRem(15px);
height: pxToRem(15px);
background-color: $basicBtnC;
border-radius: 50%;
color:white;
text-align: center;
line-height: pxToRem(15px);
font-size: pxToRem(13px);
margin-right: pxToRem(12px);
vertical-align: text-bottom;
}
}
}
>span{
font-size: pxToRem(12px);
}
clear:both;
}
}
.cart-bar{
position: relative;
box-sizing:border-box;
width: 100%;
height: pxToRem(120px);
position:fixed;
bottom: 0;
background-color: white;
z-index: 64;
padding:pxToRem(20px) pxToRem(28px);
text-align: center;
a{
display: inline-block;
&.num-incart{
width: pxToRem(45px);
height: pxToRem(45px);
background: url(../img/product/cart.png) no-repeat;
}
&.favorite{
width: pxToRem(34px);
height: pxToRem(32px);
background:url(../img/product/favorite.png) no-repeat;
}
&.addto-cart{
height: pxToRem(80px);
width: pxToRem(260px);
margin:0 pxToRem(100px) 0 pxToRem(128px);
color: #fff;
background-color: $basicBtnC;
font-size: pxToRem(40px);
line-height: pxToRem(80px);
text-align: center;
}
ul.items{
margin-top: pxToRem(20px);
padding: 0;
line-height: pxToRem(30px);
font-size: pxToRem(13px);
li{
span{
display: inline-block;
width: pxToRem(15px);
height: pxToRem(15px);
background-color: $basicBtnC;
border-radius: 50%;
color:#fff;
text-align: center;
line-height: pxToRem(15px);
font-size: pxToRem(13px);
margin-right: pxToRem(12px);
vertical-align: text-bottom;
}
}
}
}
clear:both;
}
}
.cart-bar{
position: relative;
box-sizing:border-box;
width: 100%;
height: pxToRem(120px);
position:fixed;
bottom: 0;
background-color: #fff;
z-index: 64;
padding:pxToRem(20px) pxToRem(28px);
text-align: center;
a{
display: inline-block;
&.num-incart{
font-size: pxToRem(47px);
color:#444;
}
.num-tag{
position: absolute;
left:pxToRem(66px);
height: pxToRem(20px);
display: block;
width: pxToRem(36px);
height: pxToRem(36px);
background-color: $basicBtnC;
border-radius: 50%;
color:white;
font-size: pxToRem(24px);
&.favorite{
font-size: pxToRem(34px);
color:$basicBtnC;
}
&.addto-cart{
height: pxToRem(80px);
width: pxToRem(260px);
margin:0 pxToRem(100px) 0 pxToRem(115px);
color: #fff;
background-color: $basicBtnC;
font-size: pxToRem(40px);
line-height: pxToRem(80px);
text-align: center;
}
}
.num-tag{
position: absolute;
left:pxToRem(66px);
height: pxToRem(20px);
display: block;
width: pxToRem(36px);
height: pxToRem(36px);
background-color: $basicBtnC;
border-radius: 50%;
color:#fff;
font-size: pxToRem(24px);
}
}
}
... ...
{{> layout/header}}
<div class="my-page yoho-page">
<div class="my-header">
<div class="user-info">
<div class="user-info"><!--/home/personaldetails-->
<img class="user-avatar" src="{{head_ico}}">
<span class="username">{{profile_name}}</span>
{{#vip_info}}
... ... @@ -11,11 +11,11 @@
</div>
</div>
<div class="my-link clearfix">
<a class="link-item" href="/home/">
<a class="link-item" href="/home/favorite">
{{product_favorite_total}}
<p>收藏的商品</p>
</a>
<a class="link-item" href="/home/">
<a class="link-item" href="/home/favorite?tab=brand">
{{brand_favorite_total}}
<p>收藏的品牌</p>
</a>
... ... @@ -54,26 +54,26 @@
</a>
</div>
<div class="group-list">
<a class="list-item" href="/home/">
<a class="list-item" href="/home/coupons">
<span class="iconfont icon">&#xe63a;</span>
优惠券
<span class="iconfont num">{{coupon_num}} &#xe604;</span>
</a>
<a class="list-item" href="/home/">
<a class="list-item" href="/home/currency">
<span class="iconfont icon">&#xe635;</span>
YOHO
<span class="iconfont num">{{yoho_coin_num}} &#xe604;</span>
</a>
</div>
<div class="group-list">
<a class="list-item" href="/home/">
<a class="list-item" href="/home/message">
<span class="iconfont icon">&#xe636;</span>
消息
<span class="iconfont num">{{inbox_total}} &#xe604;</span>
</a>
</div>
<div class="group-list">
<a class="list-item" href="/home/">
<a class="list-item" href="/home/onlineService">
<span class="iconfont icon">&#xe63c;</span>
在线客服
<span class="iconfont num">&#xe604;</span>
... ...
{{> layout/header}}
<div class="my-guang-page yoho-page">
<div class="info-list">
<div id="info-list" class="info-list">
{{# myGuang}}
{{> guang/info}}
{{/ myGuang}}
... ...
{{> layout/header}}
<div class="good-detail-page yoho-page">
<div class="banner-container">
<h1 class="is-new-lable">NEW</h1>
{{# bannerTop}}
{{> product/banner_swiper_arrow}}
{{/ bannerTop}}
</div>
{{# goodsName}}
<h2 class="goodsName"><span>{{.}}</span></h2>
{{/ goodsName}}
... ... @@ -21,272 +15,249 @@
<h1 class="goodsSubtitle"><span>{{.}}</span></h1>
{{/ goodsSubtitle}}
<!-- {{# goodsTitle}}
<h1 class="goodsTitle">{{.}}</h1>
{{/ goodsTitle}} -->
<div class="price-date">
{{#goodsPrice}}
<div class="goodsPrice">
<h1 class="currentPrice">{{currentPrice}}</h1>
<h1 class="previousPrice">{{previousPrice}}</h1>
</div>
{{/goodsPrice}}
{{#periodOfMarket}}
<div class="periodOfMarket">
<h1>上市期:</h1>
<h1 >{{.}}</h1>
</div>
{{/periodOfMarket}}
<div class="price-date">
{{#goodsPrice}}
<div class="goodsPrice">
<h1 class="currentPrice">{{currentPrice}}</h1>
<h1 class="previousPrice">{{previousPrice}}</h1>
</div>
<!-- {{# vipLevel}}
<div class="vipLevel">
{{# list}}
{{#if @last}}
<span>{{text}}</span>
{{^}}
<span>{{text}}</span> |
{{/if}}
{{/ list}}
</div>
{{/ vipLevel}} -->
{{# vipLevel}}
<div class="vipLevel">
{{# list}}
<span class="vip-img"><img src="{{img}}" alt=""></span>
<span class="vip-price">{{text}}</span>
{{/ list}}
</div>
{{/ vipLevel}}
{{#goodsDiscount}}
<div class="goodsDiscount">
<h1>{{.}}<span class="iconfont">&#xe609;</span></h1>
{{/goodsPrice}}
{{#periodOfMarket}}
<div class="periodOfMarket">
<h1>上市期:</h1>
<h1 >{{.}}</h1>
</div>
{{/goodsDiscount}}
{{/periodOfMarket}}
</div>
{{# vipLevel}}
<div class="vipLevel">
{{# list}}
<span class="vip-img">
<img class="lazy" data-original="{{img}}" alt="">
</span>
<span class="vip-price">{{text}}</span>
{{/ list}}
</div>
{{/ vipLevel}}
<div class="feedback-list-page ">
{{# feedbacks}}
<ul id="nav-tab" class="nav-tab clearfix">
<li class="comment-nav focus">{{commentName}}</li>
<li class="consult-nav">{{consultName}}</li>
</ul>
<div id="feedback-content" >
<div class="comment-content content ">
<div class="comment-content-main">
{{# comments}}
<span class="user-name">
{{userName}}
</span>
<span class="goods-spec">
{{desc}}
</span>
<p class="detail-content">
{{content}}
</p>
<span class="comment-time">
{{time}}
</span>
{{/ comments}}
</div>
<div class="comment-content-footer">
<a href="{{moreComments}}">查看更多 <span class="iconfont">&#xe604;</span></a>
</div>
{{#goodsDiscount}}
<div class="goodsDiscount">
<h1>{{.}}<span class="iconfont">&#xe609;</span></h1>
</div>
{{/goodsDiscount}}
<div class="feedback-list-page ">
{{# feedbacks}}
<ul id="nav-tab" class="nav-tab clearfix">
<li class="comment-nav focus">{{commentName}}</li>
<li class="consult-nav">{{consultName}}</li>
</ul>
<div id="feedback-content" >
<div class="comment-content content ">
<div class="comment-content-main">
{{# comments}}
<span class="user-name">
{{userName}}
</span>
<span class="goods-spec">
{{desc}}
</span>
<p class="detail-content">
{{content}}
</p>
<span class="comment-time">
{{time}}
</span>
{{/ comments}}
</div>
<div class="consult-content content hide">
{{# consults}}
<!-- {{> guang/ps_item}} -->
{{/ consults}}
<div class="comment-content-footer">
<a href="{{moreComments}}">查看更多 <span class="iconfont">&#xe604;</span></a>
</div>
</div>
{{/ feedbacks}}
<div class="consult-content content hide">
{{# consults}}
<!-- {{> guang/ps_item}} -->
{{/ consults}}
</div>
</div>
<div class="gap-block"></div>
{{/ feedbacks}}
</div>
<div class="gap-block"></div>
{{# enterStore}}
<div class="enter-store page-block">
<a class="store-logo" href="{{url}}" style="">
<img class="lazy" data-original="{{img}}" alt="{{storeName}}">
</a>
<a class="store-name" href="{{url}}">{{storeName}}</a>
<a class="store-link" href="{{url}}">进入店铺<span class="iconfont">&#xe604;</span></a>
</div>
{{/ enterStore}}
{{# enterStore}}
<div class="enter-store page-block">
<a class="store-logo" href="{{url}}" style="">
<img src="{{img}}" alt="{{storeName}}">
</a>
<a class="store-name" href="{{url}}">{{storeName}}</a>
<a class="store-link" href="{{url}}">进入店铺<span class="iconfont">&#xe604;</span></a>
<div class="gap-block"></div>
{{#goodsDescription}}
<div class="goods-desc page-block">
<img class="service lazy" data-original="http://static.dev.yohobuy.com/img/product/service.png" alt="">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<div class="detail table">
<div class="row">
<div class="column">编号:{{nubmer}}</div>
<div class="column">帽型:{{hatType}}</div>
</div>
<div class="row">
<div class="column">颜色:{{color}}</div>
<div class="column">帽檐:{{bongrace}}</div>
</div>
{{/ enterStore}}
<div class="gap-block"></div>
<!-- <iframe src="http://www.baidu.com" id="main" width="320" height="300" frameborder="0" scrolling="auto"></iframe> -->
<div class="row">
<div class="column">类型:{{type}}</div>
<div class="column">细节:{{goodsDetail}}</div>
</div>
<div class="row">
<div class="column">性别:{{gender}}</div>
<div class="column">风格:{{style}}</div>
</div>
</div>
{{/detail}}
</div>
{{/goodsDescription}}
{{#goodsDescription}}
<div class="goods-desc page-block">
<img class="service" src="http://static.dev.yohobuy.com/img/product/service.png" alt="">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<div class="detail table">
<div class="row">
<div class="column">编号:{{nubmer}}</div>
<div class="column">帽型:{{hatType}}</div>
</div>
<div class="row">
<div class="column">颜色:{{color}}</div>
<div class="column">帽檐:{{bongrace}}</div>
</div>
<div class="row">
<div class="column">类型:{{type}}</div>
<div class="column">细节:{{goodsDetail}}</div>
</div>
<div class="row">
<div class="column">性别:{{gender}}</div>
<div class="column">风格:{{style}}</div>
</div>
<div class="gap-block"></div>
{{#sizeInfo}}
<div class="size-info page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<div class="detail">
<div class="swiper-container detail-swiper" id="size-swiper-container">
<div class="swiper-wrapper">
{{#list}}
<div class="swiper-slide blue-slide" >
<div class="size-name cell">{{name}}</div>
<div class="size-m cell">{{sizem}}</div>
<div class="size-xl cell">{{sizexl}}</div>
</div>
{{/detail}}
</div>
{{/goodsDescription}}
{{/list}}
</div>
</div>
<p class="tips">提示:左滑查看完整表格信息</p>
</div>
{{/detail}}
</div>
{{/sizeInfo}}
<div class="gap-block"></div>
<div class="gap-block"></div>
{{#sizeInfo}}
<div class="size-info page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<div class="detail">
<div class="swiper-container detail-swiper" id="size-swiper-container">
<div class="swiper-wrapper">
{{#list}}
<div class="swiper-slide blue-slide" >
<div class="size-name cell">{{name}}</div>
<div class="size-m cell">{{sizem}}</div>
<div class="size-xl cell">{{sizexl}}</div>
</div>
{{/list}}
</div>
{{#measurementMethod}}
<div class="measurement-method page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<div class="detail" style="width:100%">
<img class="lazy" data-original="{{img}}" alt="">
<div class="right-part">
<div class="title">
<h1 >{{sort}}</h1>
<span>{{enSort}}</span>
</div>
<p class="tips">提示:左滑查看完整表格信息</p>
</div>
{{/detail}}
</div>
{{/sizeInfo}}
<div class="gap-block"></div>
{{#measurementMethod}}
<div class="measurement-method page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<div class="detail" style="width:100%">
<img src="{{img}}" alt="">
<div class="right-part">
<div class="title">
<h1 >{{sort}}</h1>
<span>{{enSort}}</span>
</div>
<ul class="items">
{{#each items}}
<li>
<span>{{@index}}</span>
{{this}}</li>
{{/items}}
<ul class="items">
{{#each items}}
<li>
<span>{{@index}}</span>
{{this}}</li>
{{/items}}
</ul>
</div>
</div>
{{/detail}}
</div>
{{/measurementMethod}}
</div>
{{/measurementMethod}}
<div class="gap-block"></div>
<div class="gap-block"></div>
{{#reference}}
<div class="size-info page-block">
<h1 class="title">
{{#reference}}
<div class="size-info page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<div class="detail">
<div class="swiper-container detail-swiper" id="reference-swiper-container">
<div class="swiper-wrapper">
{{#list}}
{{#if @first}}
<div class="swiper-slide first-group" >
<div class="model-field" >{{fieldName}}</div>
<div class="first-model">
<img src="{{firstModel}}" alt="">
</div>
<div class="second-model">
<img src="{{secondModel}}" alt="">
</div>
</div>
{{^}}
<div class="swiper-slide" >
<div class="model-field cell">{{fieldName}}</div>
<div class="first-model cell">{{firstModel}}</div>
<div class="second-model cell">{{secondModel}}</div>
</div>
{{/if}}
{{/list}}
<div class="swiper-container detail-swiper" id="reference-swiper-container">
<div class="swiper-wrapper">
{{#list}}
{{#if @first}}
<div class="swiper-slide first-group" >
<img class="lazy avatar" data-original="{{firstModel}}" alt="">
<img class="lazy avatar" data-original="{{secondModel}}" alt="">
</div>
{{^}}
<div class="swiper-slide" >
<div class="model-field cell">{{fieldName}}</div>
<div class="first-model cell">{{firstModel}}</div>
<div class="second-model cell">{{secondModel}}</div>
</div>
{{/if}}
{{/list}}
</div>
<p class="tips">提示:左滑查看完整表格信息</p>
</div>
{{/detail}}
</div>
{{/reference}}
<div class="gap-block"></div>
{{#materials}}
<div class="materials page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
<div class="detail">
<img src="{{img}}" alt="">
<p class="material-desc">
</div>
<p class="tips">提示:左滑查看完整表格信息</p>
</div>
{{/detail}}
</div>
{{/reference}}
{{desc}}
</p>
<div class="gap-block"></div>
</div>
<img src="{{materialType}}" alt="" class="material-type">
</div>
{{/materials}}
{{#materials}}
<div class="materials page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
<div class="detail">
<img class="lazy" data-original="{{img}}" alt="">
<p class="material-desc">
{{desc}}
</p>
</div>
<img class="lazy material-type" data-original="{{materialType}}" alt="" >
</div>
{{/materials}}
<div class="gap-block"></div>
<div class="gap-block"></div>
{{#productDetail}}
<div class="product-detail page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
<div class="detail">
<p>{{desc}}</p>
<img src="{{img}}" alt="">
</div>
</div>
{{/productDetail}}
{{#productDetail}}
<div class="product-detail page-block">
<h1 class="title">
{{title}}
<span class="en-title">{{enTitle}}</span>
</h1>
<div class="detail">
<p>{{desc}}</p>
<img class="lazy" data-original="{{img}}" alt="">
</div>
</div>
{{/productDetail}}
{{#cartInfo}}
<div class="cart-bar">
<span class="num-tag">{{numInCart}}</span>
<a href="" class="num-incart"></a>
<a href="" class="addto-cart">加入购物车</a>
<a href="" class="favorite"></a>
</div>
{{/cartInfo}}
{{#cartInfo}}
<div class="cart-bar">
<span class="num-tag">{{numInCart}}</span>
<a href="" class="num-incart iconfont">&#xe62c;</a>
<a href="" class="addto-cart ">加入购物车</a>
<a href="" class="favorite iconfont">&#xe605;</a>
</div>
{{/cartInfo}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -242,4 +242,9 @@
<script>
seajs.use('js/me/address');
</script>
{{/if}}
{{#if myGuangPage}}
<script>
seajs.use('js/me/my-guang');
</script>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -18,10 +18,27 @@ use LibModels\Wap\Home\OrderData;
class HomeController extends AbstractAction
{
protected $_uid;
// /**
// * 初始化
// */
// public function init()
// {
// // 检查用户是否登录, 未登录则跳转到登录页
// $uid = $this->getUid(true);
// if (!$uid) {
// $this->go(Helpers::url('/signin.html'));
// }
//
// parent::init();
// }
/**
* 个人中心入口
*/
public function indexAction() {
public function indexAction()
{
// 设置网站标题
$this->setTitle('个人中心');
$this->setNavHeader('个人中心', true, SITE_MAIN);
... ... @@ -30,7 +47,7 @@ class HomeController extends AbstractAction
$uid = 8826435;
$data = \Index\UserModel::getUserProfileData($uid);
$data += \Index\UserModel::getInfoNumData($uid);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
... ... @@ -45,143 +62,60 @@ class HomeController extends AbstractAction
/**
* 用户收藏的商品
*/
public function favoriteAction() {
public function favoriteAction()
{
// 设置网站标题
$this->setTitle('我的收藏');
$this->setNavHeader('我的收藏', true, SITE_MAIN);
$tab = $this->get('tab', '');
$uid = $this->getUid();
$uid = 8826435;
$gender = Helpers::getGenderByCookie();
$favProducts = \Index\UserModel::getFavProductData($uid);
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
$data = array(
'favPage' => true, //加载js
'pageFooter' => true,
'favorite' => true,
'hasFavProduct' => $favProducts,
'hasFavBrand' => $favBrands
);
// 判断时候为品牌页
if ($tab === 'brand') {
$data['brandTab'] = true;
}
//print_r($favProducts);
$this->_view->display('favorite', array(
'favPage' => true, //加载js
'pageHeader' => array(
'navBack' => true,
'navTitle' => '我的收藏',
'navHome' => true
),
'pageFooter' => true,
'favorite' => true,
'hasFavProduct' => array(
'0' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'title' => 'adidas Originals ZX FLUXM22508 ',
'price' => '¥800',
'discountPrice' => false,
'savePrice' => false,
'sellOut' => true
),
'1' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'title' => 'adidas Originals ZX FLUXM22508 ',
'price' => '¥800',
'discountPrice' => '¥500',
'savePrice' => '¥300',
'sellOut' => false
)
),
'hasFavBrand' => array(
'0' => array(
'id' => '1',
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'brandName' => 'VANS',
'update' => 12,
'discount' => 10,
'link' => '#',
'productList' => array(
'0' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'1' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'2' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'3' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
)
)
),
'1' => array(
'id' => '2',
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'brandName' => 'VANS',
'update' => 12,
'discount' => 10,
'link' => '#',
'productList' => array(
'0' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'1' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'2' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'3' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
)
)
),
'2' => array(
'id' => '3',
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'brandName' => 'VANS',
'update' => 12,
'discount' => 10,
'link' => '#',
'productList' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => false
)
)
)
));
$this->_view->display('favorite', $data);
}
/**
* 用户收藏的商品-删除
*/
public function favoriteDelAction() {
//$this->echoJson();
}
public function favoriteDelAction()
{
$result = array();
/**
* 用户收藏的品牌
*/
public function favoritebrandAction() {
$uid = $this->getUid();
$gender = Helpers::getGenderByCookie();
if ($this->isAjax()) {
$uid = $this->getUid();
$fav_id = $this->post('fav_id', 0);
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
$result = \Index\UserModel::favoriteDelete($uid, $fav_id);
}
print_r($favBrands);
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 个人信息
*/
public function personalDetailsAction() {
public function personalDetailsAction()
{
$this->setTitle('个人信息');
$this->setNavHeader('个人信息', true, SITE_MAIN);
... ... @@ -195,12 +129,13 @@ class HomeController extends AbstractAction
/**
* YOHO币
*/
public function currencyAction() {
$this->setTitle('YOHO币');
public function currencyAction()
{
$this->setTitle('YOHO币');
$this->setNavHeader('YOHO币', true, false);
// $uid = $this->getUid();
$uid = 967016;
// $uid = $this->getUid();
$uid = 8826435;
$currency = \Index\UserModel::getYohoCoinData($uid);
$currency['pageFooter'] = true;
... ... @@ -210,7 +145,8 @@ class HomeController extends AbstractAction
/**
* 优惠券
*/
public function couponsAction() {
public function couponsAction()
{
$this->setTitle('优惠券');
$this->setNavHeader('优惠券', true, SITE_MAIN);
... ... @@ -227,12 +163,13 @@ class HomeController extends AbstractAction
/**
* 我的消息
*/
public function messageAction() {
public function messageAction()
{
// $uid = $this->getUid();
$page = $this->get('page', 0);
$size = $this->get('size', 10);
$uid = 967016;
$uid = 8826435;
$messages = \Index\UserModel::getMessageData($uid, $page, $size);
print_r($messages);
... ... @@ -241,13 +178,14 @@ class HomeController extends AbstractAction
/**
* 地址管理
*/
public function addressAction() {
public function addressAction()
{
// 设置网站标题
$this->setTitle('地址管理');
$this->setNavHeader('地址管理', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$uid = 8826435;
$address = \Index\UserModel::getAddressData($uid);
$addressList = \Index\UserModel::getAddressListData($uid);
... ... @@ -265,12 +203,13 @@ class HomeController extends AbstractAction
/**
* 修改地址或者添加新地址
*/
public function saveAddressAction() {
public function saveAddressAction()
{
$result = array();
if ($this->isAjax()) {
// $uid = $this->getUid();
$uid = 967016;
$uid = 8826435;
$address = $this->post('address', '');
$area_code = $this->post('area_code', '');
$consignee = $this->post('consignee', '');
... ... @@ -292,12 +231,13 @@ class HomeController extends AbstractAction
/**
* 设置默认地址
*/
public function defaultAddressAction() {
public function defaultAddressAction()
{
$result = array();
if ($this->isAjax()) {
// $uid = $this->getUid();
$uid = 967016;
$uid = 8826435;
$id = $this->post('id', '');
$result = \Index\UserModel::setDefaultAddress($uid, $id);
... ... @@ -310,8 +250,31 @@ class HomeController extends AbstractAction
}
}
/**
* 删除地址
*/
public function addressDelAction()
{
$result = array();
if ($this->isAjax()) {
// $uid = $this->getUid();
$uid = 8826435;
$id = $this->post('id', '');
$result = \Index\UserModel::deleteAddress($uid, $id);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
//在线客服
public function onlineServiceAction() {
public function onlineServiceAction()
{
// 设置网站标题
$this->setTitle('在线客服');
$this->setNavHeader('在线客服', true, SITE_MAIN);
... ... @@ -326,7 +289,8 @@ class HomeController extends AbstractAction
}
//在线客服-具体详情
public function onlineServiceDetailAction() {
public function onlineServiceDetailAction()
{
$service = array();
$cateId = $this->get('cateId', 0);
$cateName = $this->get('cateName', '');
... ... @@ -341,14 +305,23 @@ class HomeController extends AbstractAction
/**
* 我的逛
*/
public function myGuangAction() {
echo 'My Guang';
public function myGuangAction()
{
$page = $this->get('page', 1);
$limit = $this->get('limit', 10);
$uid = $this->getUid();
$yh_channel = Helpers::getChannelByCookie();
$uid=5687179;
$gender = Helpers::getGenderByCookie();
$guangInfo = \home\GuangModel::getMyGuang($uid, $page,$yh_channel,$gender, $limit);
$this->_view->display('my-guang', array('myGuang'=>$guangInfo));
}
/**
* 意见反馈
*/
public function suggestAction() {
public function suggestAction()
{
// 设置网站标题
$this->setTitle('意见反馈');
$this->setNavHeader('意见反馈', true, SITE_MAIN);
... ... @@ -370,27 +343,28 @@ class HomeController extends AbstractAction
/**
* 意见反馈-提交表单页面
*/
public function suggestSubAction() {
public function suggestSubAction()
{
// 设置网站标题
$this->setTitle('反馈问题');
// 设置网站标题
$this->setTitle('反馈问题');
$param = \Api\Yohobuy::param();
unset($param['private_key']);
$param['project'] = 'suggest';
$param['client_secret'] = 'e7807a9522ab99af8b8fd926e1ebbd9a';
$data = array(
'suggestPage' => true, //加载js
'pageHeader' => array(
'navBack' => true,
'navTitle' => '反馈问题',
'navBtn' => '提交'
),
'param' => $param,
'suggestSub' => true,
'pageFooter' => true
);
//print_r($data);
$param = \Api\Yohobuy::param();
unset($param['private_key']);
$param['project'] = 'suggest';
$param['client_secret'] = 'e7807a9522ab99af8b8fd926e1ebbd9a';
$data = array(
'suggestPage' => true, //加载js
'pageHeader' => array(
'navBack' => true,
'navTitle' => '反馈问题',
'navBtn' => '提交'
),
'param' => $param,
'suggestSub' => true,
'pageFooter' => true
);
//print_r($data);
$this->_view->display('suggest_sub', $data);
}
... ... @@ -398,19 +372,19 @@ class HomeController extends AbstractAction
/**
* 异步上传图片
*/
public function suggestimgUploadAction() {
if ($this->isAjax()) {
$filename = $this->get('filename', '');
$result = \Plugin\Images::saveImage($filename);
public function suggestimgUploadAction()
{
$filename = $this->post('filename', '');
$result = \Index\UserModel::saveSuggestImg($filename);
$this->echoJson($result);
}
$this->echoJson($result);
}
/**
* 异步保存意见反馈数据
*/
public function savesuggestAction() {
public function savesuggestAction()
{
if ($this->isAjax()) {
$uid = $this->getUid();
$content = $this->post('content', '');
... ... @@ -424,7 +398,8 @@ class HomeController extends AbstractAction
/**
* 会员等级展示页
*/
public function gradeAction() {
public function gradeAction()
{
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
... ... @@ -433,7 +408,7 @@ class HomeController extends AbstractAction
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$uid = $this->getUid();
$uid = '7566245'; //临时测试用
$uid = '10267443'; //临时测试用
$data = GradeModel::getGrade($gender, $channel, $uid);
$data['pageFooter'] = true;
$this->_view->display('vip-grade', $data);
... ... @@ -443,7 +418,8 @@ class HomeController extends AbstractAction
* 会员特权查看页
*/
public function preferentialAction() {
public function preferentialAction()
{
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
... ... @@ -460,7 +436,8 @@ class HomeController extends AbstractAction
* 我的订单页面
*/
public function orderAction() {
public function orderAction()
{
//获得type值
$type = $this->get('type', 1);
$this->setTitle('我的订单');
... ... @@ -480,7 +457,8 @@ class HomeController extends AbstractAction
}
//ajax请求订单页面
public function getOrdersAction() {
public function getOrdersAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
$this->error();
... ... @@ -492,7 +470,7 @@ class HomeController extends AbstractAction
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
$uid = $this->getUid();
$uid = '7566245'; //测试用
$uid = '10267443'; //测试用
//调用模型层getOrder方法获得并处理数据
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
//如果没有订单数据,就给一个随便逛逛链接
... ... @@ -514,7 +492,8 @@ class HomeController extends AbstractAction
* 我的订单-取消订单
*/
public function cancelOrderAction() {
public function cancelOrderAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
... ... @@ -528,37 +507,35 @@ class HomeController extends AbstractAction
$yh_channel = $this->get('yh_channel', 1);
$method = 'app.SpaceOrders.close';
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
if ($data['code'] == 200) {
echo $data['message'];
}
$this->echoJson($data);
}
/*
* 我的订单-删除订单
*/
public function deleteOrderAction() {
public function delOrderAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
$this->error();
}
//传入order_code和uid以删除订单
$order_code = $this->get('orderCode');
$order_code = $this->get('id');
$uid = $this->getUid();
$uid = '10267443'; //测试用
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
$method = 'app.SpaceOrders.delOrderByCode';
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
if ($data['code'] == 200) {
echo $data['message'];
}
$this->echoJson($data);
}
/**
* 订单详情页
*/
public function orderDetailAction() {
public function orderDetailAction()
{
$data = array(
'name' => '毛毛莉Lydia',
'phoneNum' => '18600001133',
... ...
<?php
namespace home;
namespace Home;
use LibModels\Wap\Home\GradeData;
use Action\AbstractAction;
use Plugin\Helpers;
/**
... ... @@ -15,7 +14,8 @@ class GradeModel
* 获取个人中心-会员等级数据
*/
public static function getGrade($gender, $channel, $uid) {
public static function getGrade($gender, $channel, $uid)
{
$result = array();
if (USE_CACHE) {
... ... @@ -28,41 +28,41 @@ class GradeModel
//调用接口获取数据
$data = GradeData::getGradeData($gender, $channel, $uid);
if (!empty($data['grade'])) {
switch (intval($data['grade']['current_vip_level'])) {
case 0://普通会员
$result['vipGrade']['vip0'] = true;
break;
case 1://银卡会员
$result['vipGrade']['vip1'] = true;
break;
case 2://金卡会员
$result['vipGrade']['vip2'] = true;
break;
case 3://白金会员
$result['vipGrade']['vip3'] = true;
break;
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost'];
//升级下一等级会员的进度;
$result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2));
//距离升级所需消费金额
if ($data['grade']['current_vip_level'] != 3) {
$result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost'];
}
//消费总计
$result['vipGrade']['sumCost'] = $data['grade']['current_total_cost'];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = $data['userProfile']['username'];
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null);
//当前vip等级享受的特权
$result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
}
if (!empty($data['grade'])) {
switch (intval($data['grade']['current_vip_level'])) {
case 0://普通会员
$result['vipGrade']['vip0'] = true;
break;
case 1://银卡会员
$result['vipGrade']['vip1'] = true;
break;
case 2://金卡会员
$result['vipGrade']['vip2'] = true;
break;
case 3://白金会员
$result['vipGrade']['vip3'] = true;
break;
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost'];
//升级下一等级会员的进度;
$result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2));
//距离升级所需消费金额
if ($data['grade']['current_vip_level'] != 3) {
$result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost'];
}
//消费总计
$result['vipGrade']['sumCost'] = $data['grade']['current_total_cost'];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = $data['userProfile']['username'];
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null);
//当前vip等级享受的特权
$result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
... ... @@ -82,7 +82,8 @@ class GradeModel
* 获取个人中心-会员特权详情页
*/
public function getPreferential($channel, $uid) {
public function getPreferential($channel, $uid)
{
$result = array();
if (USE_CACHE) {
... ...
<?php
namespace Home;
use LibModels\Wap\Home\GuangData;
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 我的逛数据处理
*/
class GuangModel
{
//获取我的逛列表
public static function getMyGuang($uid, $page,$yh_channel=1, $gender = '1,3', $limit = 10)
{
$result = array();
//调用接口获取数据
$res = GuangData::getGuangInfo($uid, $page, $yh_channel,$gender, $limit);
$guangInfo = $res['data']['data'];
if ($guangInfo)
{
foreach ($guangInfo as $k => $v)
{
$result[$k]['id'] = $v['id'];
$result[$k]['author'] = $v['author'];
$tag = self::getTag(TRUE, intval($v['category_id']));
$result[$k]['url'] = $v['url'];
$result[$k]['img'] = $v['src'];
$result[$k]['title'] = $v['title'];
$result[$k]['text'] = $v['intro'];
$result[$k]['pageView'] = $v['views_num'];
$result[$k]['publish_time'] = $v['publish_time'];
$like = ($v['isPraise'] == "Y") ? true : false;
$collect = ($v['isFavor'] == "Y") ? true : false;
$result[$k]['like'] = array('isLiked' => $like, 'count' => $v['praise_num']);
$result[$k]['collect'] = array('isCollected' => $collect, 'url' => $v['url']);
$result[$k] += $tag;
$result[$k]['share'] = $v['url'];
}
}
return $result;
}
//【标签】isTip-小贴士;isCollocation-搭配 isFashionMan-潮人 isFashionGood-潮品 isTopic-话题
private static function getTag($isShow, $tagId)
{
$ret['showTags'] = $isShow;
$ret['isTopic'] = false;
$ret['isCollocation'] = false;
$ret['isFashionMan'] = false;
$ret['isFashionGood'] = false;
$ret['isTip'] = false;
switch ($tagId)
{
case 1:
$ret['isTopic'] = true;
break;
case 2:
$ret['isCollocation'] = true;
break;
case 3:
$ret['isFashionMan'] = true;
break;
case 4:
$ret['isFashionGood'] = true;
break;
case 5:
$ret['isTip'] = true;
break;
default:
$ret['showTags'] = FALSE;
break;
}
return $ret;
}
}
... ...
... ... @@ -174,5 +174,8 @@ class OrderModel
}
return $nav;
}
//获得支付链接
}
... ...
... ... @@ -59,7 +59,11 @@ class UserModel
foreach ($infoNumData['data'] as &$val) {
empty($val) && $val = 0;
}
$result = $infoNumData['data'];
// 默认没有返回用户地址的数据,添加这块儿数据
$result['address_num'] = count(self::getAddressData($uid));
}
return $result;
... ... @@ -150,7 +154,19 @@ class UserModel
// 处理用户收藏的商品数据
if (isset($favProduct['data']) && !empty($favProduct['data'])) {
$result = $favProduct['data'];
$product = array();
foreach ($favProduct['data']['product_list'] as $val) {
$product = array();
$product['imgUrl'] = $val['image'];
$product['title'] = $val['product_name'];
$product['price'] = '¥'.$val['market_price'];
$product['discountPrice'] = '¥'.$val['sales_price'];
$product['savePrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.($val['market_price'] - $val['sales_price']) : false;
$product['sellOut'] = (bool)($val['price_down']);
$result[] = $product;
}
}
return $result;
... ... @@ -172,7 +188,43 @@ class UserModel
// 处理用户收藏的品牌数据
if (isset($favBrand['data']) && !empty($favBrand['data'])) {
$result = $favBrand['data'];
$brand = array();
foreach ($favBrand['data']['brand_list'] as $val) {
$brand = array();
$brand['id'] = $val['brand_id'];
$brand['brandImg'] = Images::getImageUrl($val['brand_ico'], 235, 314);
$brand['brandName'] = $val['brand_name'];
$brand['update'] = $val['new_product_num'];
$brand['discount'] = $val['product_discount_num'];
$brand['link'] = '#';
// 处理品牌产品
$product = array();
foreach ($val['new_product'] as $one) {
$product = array();
$product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314);
$product['price'] = '¥'.$one['market_price'];
$product['discount'] = '¥'.$one['sales_price'];
$brand['productList'][] = $product;
}
$result[] = $brand;
}
}
return $result;
}
public static function favoriteDelete($uid, $fav_id)
{
$result = array();
if (empty($fav_id)) {
$result['code'] = 400;
$result['message'] = '取消的商品不可用';
} else {
$result = UserData::favoriteDelete($uid, $fav_id);
}
return $result;
... ... @@ -336,6 +388,27 @@ class UserModel
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public static function deleteAddress($uid, $id)
{
$result = array('code' => 400, 'message' => '错误');
// 调用接口删除地址
$address = UserData::deleteAddress($uid, $id);
// 处理返回结果
if ($address && isset($address['code'])) {
$result = $address;
}
return $result;
}
/**
* 处理意见反馈数据
*
* @param string $udid 客户端唯一标识
... ... @@ -359,7 +432,7 @@ class UserModel
$one['imgUrl'] = Helpers::getImageUrl($val['cover_image'], 640, 240);
$one['title'] = $val['filter_content'];
$one['content'] = $val['reply_content'];
$one['good'] = boolval($val['is_reliable']);
$one['good'] = (bool)($val['is_reliable']);
$one['bad'] = !$one['good'];
$result[] = $one;
... ... @@ -370,6 +443,25 @@ class UserModel
}
/**
* 图片上传
*
* @return array|mixed 保存意见反馈数据之后的返回
*/
public static function saveSuggestImg($filename)
{
$result = array();
if (!isset($_FILES[$filename])) {
$result['code'] = 400;
$result['message'] = '文件上传错误';
} else {
$result = Images::saveImage($filename);
}
return $result;
}
/**
* 保存意见反馈数据
*
* @param int $uid 用户ID
... ...
<?php
namespace home;
namespace Home;
use LibModels\Wap\Home\OnlineData;
use Action\AbstractAction;
use Plugin\Helpers;
/**
... ... @@ -12,7 +11,10 @@ use Plugin\Helpers;
class OnlineModel
{
//获取在线帮助分类
/*
* 获取在线帮助分类
* $clientType客户端类型
*/
public static function getOnlineServiceInfo($clientType = 'iphone')
{
//调用接口获取数据
... ... @@ -42,7 +44,7 @@ class OnlineModel
foreach ($sub as $sk => $sv)
{
$qTmp[$sk]['title'] = $sv['category_name'];
$qTmp[$sk]['link'] = '/home/onlineservicedetail?cateId=' . $sv['id'].'&cateName='.$sv['category_name'];
$qTmp[$sk]['link'] = Helpers::url('/home/onlineservicedetail',array('cateId'=>$sv['id'],'cateName'=>$sv['category_name']));
}
}
$question[$key]['list'] = $qTmp;
... ... @@ -60,7 +62,11 @@ class OnlineModel
return $result;
}
//加载分类下的问题和解决方法
/*
* 加载分类下的问题和解决方法
* cateId问题分类ID
* clientType客户端
*/
public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone')
{
$result = array();
... ...
... ... @@ -105,7 +105,7 @@ SHOE BQT KEN BLOCK',
'sizeInfo'=>array(
'title' => '尺码信息',
'enTitle' =>'SIZE INFO',
'enTitle' =>'xSIZE INFO',
'detail' =>array(
'list'=>array(
... ... @@ -169,7 +169,7 @@ SHOE BQT KEN BLOCK',
'detail' =>array(
'list'=>array(
array(
'fieldName'=>' ',
'fieldName'=>'1 ',
'firstModel'=>'http://static.dev.yohobuy.com/img/product/avatar1.png',
'secondModel' =>'http://static.dev.yohobuy.com/img/product/avatar2.png'
),
... ...