Authored by Rock Zhang

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

Conflicts:
	library/LibModels/Wap/Home/CartData.php
	yohobuy/m.yohobuy.com/application/controllers/ShoppingCart.php
	yohobuy/m.yohobuy.com/application/models/Index/Cart.php
Showing 47 changed files with 782 additions and 216 deletions
... ... @@ -802,19 +802,23 @@
{
id: 1,
chosed: true,
name: '黄色'
},
...
],
sizes: [
{
id: 2,
chosed: true,
name: 'X'
name: '黄色',
colorNum:10,
shortUrl:'',
sizes: [
{
id: 2,
chosed: true,
name: 'X',
sizeNum: 2
},
...
]
},
...
],
num: 2
totalNum: 20
}
### 购物车商品
... ... @@ -1113,7 +1117,8 @@
'feedbacks' : {
'commentsNum' : 0,
'consultsNum' : 1,
'link' : '',
'commentsUrl' : '',
'consultsUrl' : '',
'comments' : [
{
'userName' : 'Lynnic',
... ... @@ -1243,6 +1248,20 @@
'id' : '',
'preferenceUrl' :''
}
### 评价列表页面
{
'comments':{
'list' : [
{
'userName':'',
'desc':'',
'content':'',
'time':''
}
...
]
}
}
### 咨询列表页面
{
'link' : '咨询表单跳转url',
... ... @@ -1297,3 +1316,29 @@
]
}
### 频道选择页
{
'background' : 'http://img11.static.yhbimg.com/yhb-img01/2015/12/14/03/0189f7499bcb98cbeb4d18d61275606716.png?imageView/2/w/640/h/800',
'searchUrl' : 'http://search.dev.yohobuy.com',
'channelList' : [
{
'href' : '/boys',
'title' : '男生',
'entitle' : 'BOYS',
}, {
'href' : '/girls',
'title' : ' 女生',
'entitle' : 'GIRLS',
}, {
'href' : '/kids',
'title' : '潮童',
'entitle' : KIDS'',
}, {
'href' : '/lifestyle',
'title' : '创意生活',
'entitle' : 'LIFESTYLE',
}
],
'showYohood' : true/false
}
... ...
framework @ 75bbc3b0
Subproject commit e9d066dd88a8e7e37103021c427a205a5cfcdcec
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -442,7 +442,7 @@ class AbstractAction extends Controller_Abstract
break;
}
}
$this->_view->assign('pageHeader', $header);
}
... ...
<?php
namespace LibModels\Wap\Home;
use Api\Yohobuy;
use Api\Sign;
/**
* 帮助中心数据模型
*
*/
class HelpData
{
/*
* 获取帮助列表(分类),缓存1h
* clientType客户端
*/
public static function serviceInfo()
{
//构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.help.li';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param, $param);
}
}
... ...
<?php
namespace LibModels\Wap\Passport;
use Api\Sign;
use Api\Yohobuy;
/**
* 绑定手机号 数据模型
*
* @name BindData
* @package LibModels/Wap/Passport
* @copyright yoho.inc
* @version 1.0 (2015-12-14 10:00:00)
* @author xiaowei
*/
class BindData
{
/**
* 绑定前检查
* @param string $openId 第三方唯一识别码
* @param string $sourceType 登录方式
* @param string $clientType 所属客户端类型
* @return array 登录返回结果
*/
public static function bindCheck($openId, $sourceType)
{
$param = Yohobuy::param();
$param['v'] = '7';
$param['method'] = 'app.passport.check';
$param['open_id'] = $openId;
$param['source_type'] = $sourceType;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 发送、重发送验证码
* @param string $mobile 手机号
*
*/
public static function sendBindMsg($mobile)
{
$param = Yohobuy::param();
$param['v'] = '7';
$param['method'] = 'app.passport.smsbind';
$param['mobile'] = $mobile;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 验证验证码是否正确
*
*/
public static function checkBindCode($mobile, $code)
{
$param = Yohobuy::param();
$param['v'] = '7';
$param['method'] = 'app.register.validRegCode';
$param['mobile'] = $mobile;
$param['code'] = $code;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 第三方绑定手机号
* @param string $nickname 姓名
* @param string $openId 第三方唯一识别码
* @param string $sourceType 登录方式
* @param string $mobile 手机号
* @param string $password 密码
*/
public static function bindMobile($openId, $nickname, $sourceType, $mobile, $password)
{
$param = Yohobuy::param();
$param['v'] = '7';
$param['method'] = 'app.passport.bind';
$param['mobile'] = $mobile;
$param['passport'] = $password;
$param['open_id'] = $openId;
$param['nickname'] = $nickname;
$param['source_type'] = $sourceType;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -66,7 +66,7 @@ class LoginData
// 构建必传参数
$param = Yohobuy::param();
$param['v'] = '4'; // 只有早期的V4版本才有直接生成UID
$param['v'] = '7'; // 只有早期的V4版本才有直接生成UID
$param['method'] = 'app.passport.signinByOpenID';
$param['openId'] = $openId;
$param['source_type'] = $sourceType;
... ...
... ... @@ -73,6 +73,7 @@ class DetailData
$param['limit'] = $pageSize;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ... @@ -86,7 +87,15 @@ class DetailData
*/
public static function commentList($productId, $pageNum, $pageSize)
{
// 暂未提供提口
$param = Yohobuy::param();
$param['method'] = 'app.comment.li';
$param['product_id'] = $productId;
$param['page'] = $pageNum;
$param['limit'] = $pageSize;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ...
... ... @@ -123,6 +123,17 @@ class Helpers
}
/**
* 从用户加入购物车的COOKIE取出购物车凭证
*
* @return string
*/
public static function getShoppingKeyByCookie()
{
$cookie = isset($_COOKIE['_spk']) ? $_COOKIE['_spk'] : '';
return $cookie;
}
/**
* 获取商品的ICON
*
* @param int $type
... ... @@ -171,16 +182,16 @@ class Helpers
return $result;
}
/**
* 转换价格
*
* @param float|string $price 价格
* @return float|string 转换之后的价格
*/
public static function transPrice($price)
{
return (!empty($price) && !is_float($price)) ? $price . '.00' : $price;
}
/**
* 转换价格
*
* @param float|string $price 价格
* @return float|string 转换之后的价格
*/
public static function transPrice($price)
{
return (!empty($price) && !is_float($price)) ? $price . '.00' : $price;
}
/**
* 格式化商品信息
... ... @@ -225,8 +236,8 @@ class Helpers
}
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = self::url('/product/pro_' . $productData['product_id'] . '_'
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html');
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html');
// APP访问需要加附加的参数
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
if ($isApp) {
... ... @@ -515,7 +526,7 @@ class Helpers
public static function formatOrderGoods($orderGoods, &$count = 0, $haveLink = false)
{
$arr = array();
foreach ($orderGoods as $key => $vo) {
$arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);
$arr[$key]['name'] = $vo['product_name'];
... ... @@ -540,7 +551,7 @@ class Helpers
// 累计购买数
$count += intval($vo['buy_number']);
}
return $arr;
}
... ...
... ... @@ -184,6 +184,10 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() {
$(this).removeClass('highlight');
});
$('.nav-home').on('touchstart', function() {
$('.homebuttom').toggleClass('none');
});
(function() {
var lastTime = 0,
prefixes = 'webkit moz ms o'.split(' '),
... ... @@ -227,6 +231,23 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() {
window.cancelAnimationFrame = cancelAnimationFrame;
}());
// 给jQuery 扩展 queryString函数
$.extend({
queryString: function() {
var vars = [],
hash,
i;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
});
//暴露公共接口
window.cookie = cookie;
... ...
... ... @@ -20,7 +20,8 @@ var $addressForm = $('.edit-address'),
$area = $('.area'),
isSubmiting,
currentPage = 'edit',
newArea = [];
newArea = [],
queryString = $.queryString();
$($editAddressPage, $addressListPage).css('min-height', function() {
return $(window).height() - $('#yoho-header').height();
... ... @@ -91,7 +92,11 @@ $addressForm.on('submit', function() {
isSubmiting = false;
loading.hideLoadingMask();
} else {
window.location.href = '/home/address';
if (queryString.refer === 'shopping') {
window.location.href = '/shoppingCart/selectAddress';
} else {
window.location.href = '/home/address';
}
}
}).fail(function() {
tip.show('网络出了点问题~');
... ...
... ... @@ -69,4 +69,5 @@ $addAddress.on('touchend', function() {
$action.on('touchend', '.del', function() {
deleteId = $(this).data('id');
$confim.fadeIn();
return false;
});
... ...
... ... @@ -9,10 +9,7 @@ var $ = require('jquery'),
var commentsNum,consultsNum;
var consultFooterEle = $('.consult-content-footer')[0],
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
navtabEle = document.getElementById('nav-tab'),
var navtabEle = document.getElementById('nav-tab'),
navtabHammer = navtabEle && new Hammer(navtabEle),
gotoConsultEle = document.getElementById('goto-consult'),
... ... @@ -66,12 +63,6 @@ if (navtabHammer) {
});
}
if (consultFooterHammer) {
consultFooterHammer.on('tap', function() {
location.href = $(consultFooterEle).data('href');
});
}
if (gotoConsultHammer) {
gotoConsultHammer.on('tap', function() {
location.href = $(gotoConsultEle).data('href');
... ...
... ... @@ -6,4 +6,6 @@
require('./cart');
require('./gift-advance');
require('./order-ensure');
\ No newline at end of file
require('./order-ensure');
require('./select-coupon');
require('./select-address');
... ...
/**
* 订单信息读取
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/12/14
*/
var info = window.cookie('order-info'),
orderInfo;
// info 必须是 JSON 字符串
try {
info = JSON.parse(orderInfo);
} catch (e) {
info = {};
}
exports.orderInfo = function(key, value) {
if (value === undefined) {
return info[key];
}
info[key] = value;
window.setCookie('order-info', JSON.stringify(info));
};
... ...
/**
* 购物车 地址选择
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('jquery'),
orderInfo = require('./order-info').orderInfo;
$('.address-item').on('touchend', function() {
orderInfo('addressId', $(this).data('address-id'));
}).on('touchend', '.edit', function() {
window.location.href = $(this).data('href');
return false;
});
... ...
/**
* 优惠券选择
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/12/10
*/
var $ = require('jquery'),
Handlebars = require('yoho.handlebars'),
ellipsis = require('mlellipsis'),
loading = require('../plugin/loading'),
tip = require('../plugin/tip');
tip = require('../plugin/tip'),
orderInfo = require('./order-info').orderInfo;
var page = 1,
canGetCoupon = true,
... ... @@ -16,43 +23,48 @@ ellipsis.init();
$('#search-coupon').on('submit', function() {
$.ajax({
method: 'POST',
url: '',
url: '/shoppingCart/coupon',
data: $(this).serialize()
}).then(function(res) {
if (res.avaliable) {
$('#coupon-list').html(conponTmpl({
coupons: res.coupons
}));
$('#coupon-list-not').html('');
if (res.code === 200) {
tip.show('优惠券可用');
orderInfo('couponCode', res.data.coupon_code);
window.location.href = '/shoppingCart/orderEnsure?coupon_code=' + res.data.coupon_code;
} else {
tip.show(res.msg);
tip.show(res.message);
}
}).fail(function() {
tip.show('网络错误');
});
return false;
});
$('#coupon-list').on('touchend', 'employ-main', function() {
orderInfo('couponCode', $(this).data('coupon-code'));
});
function getCouponHandle(coupons) {
var notAvailableCoupons = [];
// 后端需要返回一个 coupons 列表,如下
// notAvailable 表示不可用的优惠券
coupons = [{
money: '99',
coupon_name: '满XX-减去吴悠右腿有益于有2222',
couponValidity: '20150129-20150430',
coupon_id: '22222'
}, {
money: '99',
coupon_name: '满XX-减去吴悠右腿有益于有2222',
couponValidity: '20150129-20150430',
coupon_id: '2222233'
}, {
money: '99',
coupon_name: 'NONO满XX-减去吴悠右腿有益于有2222',
couponValidity: '20150129-20150430',
coupon_id: '2222233',
notAvailable: 1
}];
// coupons = [{
// money: '99',
// coupon_name: '满XX-减去吴悠右腿有益于有2222',
// couponValidity: '20150129-20150430',
// coupon_id: '22222'
// }, {
// money: '99',
// coupon_name: '满XX-减去吴悠右腿有益于有2222',
// couponValidity: '20150129-20150430',
// coupon_id: '2222233'
// }, {
// money: '99',
// coupon_name: 'NONO满XX-减去吴悠右腿有益于有2222',
// couponValidity: '20150129-20150430',
// coupon_id: '2222233',
// notAvailable: 1
// }];
// coupons 是个列表,如果不是列表,可能是服务器错误,这次翻页加载不算
if (!$.isArray(coupons)) {
... ... @@ -106,9 +118,8 @@ function getCouponDate() {
$.ajax({
type: 'POST',
url: '/home/couponData',
dataType: 'html',
dataType: 'json',
data: {
statuss: status,
page: page
}
}).then(getCouponHandle).fail(function() {
... ...
... ... @@ -117,7 +117,7 @@
overflow: hidden;
padding: 0 10rem / $pxConvertRem;;
}
.index-channel {
... ... @@ -143,7 +143,7 @@
font-size: 16px;
line-height: 52px;
color: #fff;
background: #000;
background-color: #000;
border: 4px solid #fff;
font-weight: bold;
&:last-child {
... ... @@ -162,11 +162,11 @@
.homestyle {
margin-bottom: 50rem / $pxConvertRem;
width: 287.3rem / $pxConvertRem;
}
}
}
}
}
}
@import "search","footer", "error";
... ...
... ... @@ -123,4 +123,47 @@
padding-top: 90rem / $pxConvertRem;
}
}
}
.homebuttom{
display: block;
width: 100%;
height: 90rem / $pxConvertRem;
overflow: hidden;
@include background-image(linear-gradient(#323232, #414141));
border-top: 1px solid #444;
color: #fff;
// position: absolute;
// top: 90rem / $pxConvertRem;
// left: 0;
// z-index: 10;
ul{
width: 100%;
height: 90%;
overflow: hidden;
padding-top: 12rem / $pxConvertRem;
li{
width: 25%;
height: 100%;
overflow: hidden;
float: left;
text-align: center;
i{
width: 100%;
height: 40%;
overflow: hidden;
display: block;
}
span{
width: 100%;
height: auto;
overflow: hidden;
display: block;
line-height: 40rem / $pxConvertRem;
}
}
}
}
.none{
display: none;
}
\ No newline at end of file
... ...
... ... @@ -2,28 +2,6 @@
width: 100%;
height: auto;
overflow: hidden;
.helpSearch{
width: 90%;
height: 84rem / $pxConvertRem;
overflow: hidden;
position: relative;
margin: 0 auto;
input{
width: 100%;
height: 100%;
overflow: hidden;
border:none;
font-size: 54em / $pxConvertRem;
}
i{
height: 100%;
line-height: 88rem / $pxConvertRem;
position: absolute;
right: 20rem / $pxConvertRem;
top: 0;
color: #e0e0e0;
}
}
ul{
width: 100%;
height: auto;
... ... @@ -31,7 +9,7 @@
display: block;
border-top: 1px solid #e0e0e0;
li{
width: 95%;
width: 100%;
height: 80rem / $pxConvertRem;
line-height: 84rem / $pxConvertRem;
overflow: hidden;
... ... @@ -43,10 +21,11 @@
border-bottom:none;
}
span{
width: 88%;
width: 85%;
height: 100%;
overflow: hidden;
float: left;
padding-left: 5%;
}
i{
color: #e0e0e0;
... ...
.bind-page
.bind-tip {
color: #fff;
font-size: 15px;
}
... ...
@import "common", "register", "login", "back", "code";
\ No newline at end of file
@import "common", "register", "login", "back", "code", "bind";
... ...
... ... @@ -168,9 +168,6 @@
&.focus {
color: #000;
}
.comments-num {
display: none;
}
}
.comment-nav {
border-right: 1px solid #ccc;
... ... @@ -286,17 +283,16 @@
.comment-content-footer,
.consult-content-footer {
display: block;
min-height: pxToRem(88px);
text-align: center;
background-color: #fff;
border-bottom: 1px solid $borderC;
line-height: pxToRem(88px);
font-size: pxToRem(28px);
a {
color: #b0b0b0;
.iconfont {
font-size: inherit;
}
color: #b0b0b0;
.iconfont {
font-size: inherit;
}
}
... ...
... ... @@ -250,8 +250,15 @@ $basicBtnC:#eb0313;
padding-right: pxToRem(28px);
border-bottom: 1px solid $borderC;
background-color: $pageBgC;
display: flex;
align-items: center;
@include flexbox((
box-flex: 1.0,
display: box,
box-align: center
), $version: 1);
@include flexbox((
display: flex,
align-items: center
));
span{
// display: table-cell;
display: -webkit-box;
... ...
@import "good", "chose-panel", "gift-advance-good", "order-ensure", "select-coupon";
@import "good", "chose-panel", "gift-advance-good", "order-ensure", "select-coupon", "select-address";
.icon-checkbox:before { content: "\e61c"; }
... ...
... ... @@ -163,6 +163,20 @@
}
}
#msg {
padding-top: pxToRem(20px);
input {
padding: pxToRem(10px);
width: pxToRem(580px);
height: pxToRem(50px);
outline: 0;
border: 0;
border: 1px solid #f7f7f7;
border-radius: pxToRem(4px);
}
}
.total {
font-size: 22rem / $pxConvertRem;
margin-top: 20rem / $pxConvertRem;
... ... @@ -197,13 +211,10 @@
font-size: 32rem / $pxConvertRem;
color: #fff;
text-align: center;
}
.cod {
background: #000;
}
.pay-online {
.default {
background: #57b038;
}
... ...
.select-address-page {
padding-bottom: pxToRem(20px);
.add-address {
margin-bottom: 0;
}
}
... ...
{{> layout/header}}
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="iHelp">
<div class="helpSearch">
<input type="text" placeholder="查找关键字">
<i class="iconfont">&#xe60f;</i>
</div>
<ul>
{{# iHelp}}
<li><a href="{{ url }}"><span>{{ name }}</span><i class="iconfont num">&#xe604;</i></a></li>
<li><a href="/home/helpDetail?code={{ code}}"><span>{{ name}}</span><i class="iconfont num">&#xe604;</i></a></li>
{{/ iHelp}}
</ul>
</div>
... ...
... ... @@ -19,12 +19,14 @@
<div class="index-channel">
<img class="img" src="{{background}}">
<div class="index-channel-list">
<a href="/boys" class="list-item">男生 <span class="lighter">BOYS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/girls" class="list-item">女生 <span class="lighter">GIRLS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/kids" class="list-item">潮童 <span class="lighter">KIDS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/lifestyle" class="list-item">创意生活 <span class="lighter">LIFESTYLE</span> <span class="iconfont right-icon">&#xe614;</span></a>
</div>
{{#channelList}}
<a href="{{href}}" class="list-item">{{title}} <span class="lighter">{{entitle}}</span> <span class="iconfont right-icon">&#xe614;</span></a>
{{/channelList}}
{{#showYohood}}
<a href="/yohood" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
{{/showYohood}}
</div>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
... ...
... ... @@ -78,7 +78,7 @@
</li>
{{/ yohoCoin}}
{{# invoice}}
{{#if invoice}}
<li class="invoice">
<span class="title">发票</span>
<span class="iconfont checkbox icon-checkbox"></span>
... ... @@ -87,15 +87,22 @@
<label>
发票类型
<select class="invoice-type" name="invoice-type">
<option value ="A">服装</option>
<option value ="B">图书</option>
{{# invoice}}
<option value="{{id}}">{{name}}</option>
{{/ invoice}}
</select>
</label>
</form>
</li>
{{/ invoice}}
{{/if}}
</ul>
<form id="msg" action="" method="post">
<input type="text" name="msg" value="" placeholder="留言">
</form>
</section>
<section class="block">
<ul class="total">
<li>
<span>总价</span>
... ... @@ -120,14 +127,18 @@
</section>
<ul class="pay-mode">
<li class="cod">
<span class="iconfont">&#xe62e;</span>
货到付款
</li>
<li class="pay-online">
<span class="iconfont">&#xe62f;</span>
在线支付
{{# paymentWay}}
<li class="{{#if default}}default{{/if}}" data-pay-id={{id}}>
<span class="iconfont">
{{#if default}}
&#xe62f;
{{else}}
&#xe62e;
{{/if}}
</span>
{{name}}
</li>
{{/ paymentWay}}
</ul>
{{/ orderEnsure}}
</div>
... ...
... ... @@ -2,12 +2,36 @@
<div class="my-address-page select-address-page yoho-page">
<div class="page-wrap">
{{# address}}
<a class="address-item" href="/shoppingCart/orderEnsure?address_id={{address_id}}">
<a class="address-item" data-address-id="{{address_id}}" href="/shoppingCart/orderEnsure?address_id={{address_id}}">
<span class="name">{{consignee}}</span>
<span class="tel">{{mobile}}</span>
<p class="address-info">{{area}} {{address}}</p>
<div class="action iconfont">
<span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=shopping">&#xe61e;</span>
<span class="del" data-id="{{address_id}}">&#xe621;</span>
</div>
</a>
{{/ address}}
<a class="add-address" data-href="/home/addressAct?refer=shopping">
添加新地址
</a>
<div class="confim-mask hide">
<div class="confim-box">
<div class="content">
您确定要删除地址?
</div>
<div class="action">
<span class="cancel">
取消
</span>
<span class="confim">
确认
</span>
</div>
</div>
</div>
</div>
</div>
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="yoho-page select-coupon-page my-coupon-page">
<form id="search-coupon" method="POST" action="">
<input type="text" name="coupon-code" value="" placeholder="输入优惠券码">
<input type="text" name="couponCode" value="" placeholder="输入优惠券码">
<button type="submit" class="submit">确定</button>
</form>
<div id="coupon-list" class="coupon-list"></div>
... ... @@ -11,7 +11,7 @@
<script id="tmpl-coupon" type="text/tmpl">
\{{#coupons}}
\{{^ notAvailable}}
<a class="employ-main" href="/shoppingCart/orderEnsure?coupon_id={{ coupon_id}}">
<a class="employ-main" data-coupon-code="{{ coupon_code}}" href="/shoppingCart/orderEnsure?coupon_code={{ coupon_code}}">
<span>\{{ money}}</span>
<p class="coupon-name">\{{ coupon_name}}</p>
<p>有效期:\{{ couponValidity}}</p>
... ...
{{> layout/header}}
<div class="bind-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
{{> passport/country_list}}
<div class="input-container phone-container row has-clear">
<span id="area-code" class="area-code">{{areaCode}}</span>
<input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
</div>
<span id="btn-next" class="btn btn-next disable row">下一步</span>
<p class="bind-tip">YOHO!Family账号可登录Yoho!Buy有货、YOHO!Boys、YOHO!Girls及SHOW</p>
</div>
</div>
{{> layout/footer}}
... ...
... ... @@ -8,7 +8,7 @@
{{userName}}
</span>
<span class="goods-spec">
{{desc}}
&nbsp;购买了&nbsp;&nbsp;{{desc}}
</span>
<p class="detail-content">
{{content}}
... ...
... ... @@ -49,4 +49,4 @@
<span>X</span>
</div>
{{/if}}
{{> layout/page_header}}
\ No newline at end of file
{{> layout/page_header}}
\ No newline at end of file
... ...
... ... @@ -4,13 +4,34 @@
<a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back">&#xe610;</a>
{{/navBack}}
{{#navHome}}
<a href="{{.}}" class="iconfont nav-home">&#xe611;</a>
<a class="iconfont nav-home">&#xe611;</a>
{{/navHome}}
{{#navTitle}}
<p class="nav-title">{{.}}</p>
{{/navTitle}}
{{# navBtn}}
<span class="nav-btn">{{.}}</span>
<!-- <span class="nav-btn">{{.}}</span> -->
<i class="iconfont nav-home">&#xe638;</i>
{{/ navBtn}}
</header>
<div class="homebuttom none">
<ul>
<li>
<i class="iconfont">&#xe62e;</i>
<span>首页</span>
</li>
<li>
<i class="iconfont">&#xe62e;</i>
<span>分类</span>
</li>
<li>
<i class="iconfont">&#xe62e;</i>
<span>购物车</span>
</li>
<li>
<i class="iconfont">&#xe62e;</i>
<span>我的</span>
</li>
</ul>
</div>
{{/pageHeader}}
\ No newline at end of file
... ...
... ... @@ -218,6 +218,12 @@
seajs.use('js/shopping-cart/order-ensure');
</script>
{{/if}}
{{#if selectAddressPage}}
<script>
seajs.use('js/me/address');
seajs.use('js/shopping-cart/select-address');
</script>
{{/if}}
{{#if selectCouponPage}}
<script>
seajs.use('js/shopping-cart/select-coupon');
... ...
<ul id="nav-tab" class="nav-tab clearfix">
<li class="comment-nav tap-hightlight">商品评价<span class="comments-num">{{commentsNum}}</span></li>
<li class="comment-nav tap-hightlight">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li>
<li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
</ul>
<div id="feedback-content" >
... ... @@ -21,6 +21,10 @@
</span>
{{/ comments}}
</div>
<a class="comment-content-footer tap-hightlight" href="{{commentsUrl}}">
查看更多
<span class="iconfont">&#xe604;</span>
</a>
{{^}}
<div class="comment-content-main content-main no-item">
<span class="iconfont">&#xe63d;</span>暂无评论
... ... @@ -46,17 +50,16 @@
</div>
{{/ consults}}
</div>
<div class="consult-content-footer tap-hightlight" data-href="{{link}}">
<a href="javascript:;">
查看更多
<span class="iconfont">&#xe604;</span></a>
</div>
<a class="consult-content-footer tap-hightlight" href="{{consultsUrl}}">
查看更多
<span class="iconfont">&#xe604;</span>
</a>
{{else}}
<div class="consult-content-main content-main no-item">
<span class="iconfont">&#xe63f;</span>暂无咨询
</div>
<div class="consult-content-footer tap-hightlight" data-href="{{link}}">
<div class="consult-content-footer tap-hightlight" data-href="{{commentsLink}}">
<a href="javascript:;">
我要咨询
<span class="iconfont">&#xe604;</span></a>
... ...
... ... @@ -41,14 +41,14 @@ class HomeController extends AbstractAction
{
// 设置网站标题
$this->setTitle('个人中心');
$this->setNavHeader('个人中心', SITE_MAIN . '/?go=1');
$this->setNavHeader('个人中心', SITE_MAIN . '/?go=1', '', true);
$data = array(
'myIndexPage' => true,
'showDownloadApp' => true,
'pageFooter' => true,
'cartUrl' => Helpers::url('/cart/index/index', null),
'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))),
'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home')) ),
);
$uid = $this->getUid(false);
if ($uid) {
... ... @@ -781,14 +781,14 @@ class HomeController extends AbstractAction
// 审判跳转登录页
$this->auditJumpLogin();
$this->setTitle('支付中心');
$this->setNavHeader('支付中心');
$orderCode = $this->get('order_code');
if (empty($orderCode)) {
$this->error();
}
$this->setTitle('支付中心');
$this->setNavHeader('支付中心');
$this->_view->display('pay', array(
'payCenterPage' => true,
'payAppInfo' => array(
... ... @@ -814,40 +814,89 @@ class HomeController extends AbstractAction
));
}
// /*
// * 我的订单-确认收货
// */
// private function confirmAction(){
// //
// $gender = Helpers::getGenderByCookie();
// $order_code = $this->get('id');
// $order_code = '';
// $yh_channel = $this->get('yh_channel', 1);
// $data = OrderData::confirmData($gender,$order_code,$yh_channel,$this->_uid);
// $this->echoJson($data);
// }
/**
* 订单详情页
*/
public function orderDetailAction()
{
// 审判跳转登录页
$this->auditJumpLogin();
$orderCode = $this->get('order_code', 1507880870);
if (empty($orderCode)) {
$this->error();
}
$this->setTitle('订单详情');
$this->setNavHeader('订单详情');
$this->_view->display('order-detail', array(
'orderDetailPage' => true,
'orderDetail' => OrderModel::orderDetail($orderCode, 967016/*$this->_uid*/, 'a3aadd4cce408f8ee062a9add02e8faa'/*$this->_session*/),
));
$data = array(
'name' => '毛毛莉Lydia',
'phoneNum' => '18600001133',
'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼',
'orderStatus' => '订单取消',
'orderNum' => '418358063',
'orderTime' => '2014-03-10 17:25:10',
'orderCancel' => true,
'goods' => array(
array(
'id' => 1,
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'Adidas Originals ZX FLUXM22508',
'color' => '黄',
'size' => '43',
'price' => '699.00',
'count' => '2'
),
array(
'id' => 1,
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'B.Duck浴室玩伴mini浮水鸭',
'gift' => true,
'color' => '黄',
'size' => '43',
'price' => '0.00',
'count' => '1'
)
),
'sumPrice' => 799,
'salePrice' => 80,
'freight' => 5,
'coupon' => 0,
'yohoCoin' => 5,
'price' => 719
);
$this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
}
// /**
// * 帮助列表页
// */
// public function helpAction()
// {
// $this->setTitle('帮助中心');
// $this->setNavHeader('帮助中心');
// $data = array(
// 'iHelp' => array(
// array('name' => '新用户注册', 'url' => 'http://m.dev.yohobuy.com/'),
// )
// );
// $this->_view->display('i-help', $data);
// }
/**
* 帮助列表页
*/
public function helpAction()
{
$service = Home\HelpModel::serviceInfo();
$this->setTitle('帮助中心');
$this->setNavHeader('帮助中心');
$data = array(
'iHelp' =>$service,
);
$this->_view->display('i-help', $data);
}
/**
* 帮助列表页
*/
public function helpDetailAction()
{
$this->setTitle('帮助中心');
$this->setNavHeader('帮助中心');
$data = array(
'iHelp' => array(
array('name' => '新用户注册'),
)
);
$this->_view->display('helpDetail', $data);
}
}
... ...
... ... @@ -10,21 +10,21 @@ use Plugin\Helpers;
*/
class ShoppingCartController extends AbstractAction
{
/*
* 购物车首页
*/
/*
* 购物车首页
*/
public function indexAction()
{
$this->setTitle('购物车');
$this->setNavHeader('购物车');
$shoppingKey = $this->getSession('shoppingKey');
$uid = $this->getUid(true);
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(true);
$data = array(
'shoppingCartPage' => true,
'shoppingCart' => CartModel::getCartData($uid, $shoppingKey)
'shoppingCartPage' => true,
'shoppingCart' => CartModel::getCartData($uid, $shoppingKey)
);
// 渲染模板
... ... @@ -203,7 +203,6 @@ class ShoppingCartController extends AbstractAction
/**
* 下单流程 选择地址
*/
public function selectAddressAction()
{
// 设置网站标题
... ... @@ -218,26 +217,20 @@ class ShoppingCartController extends AbstractAction
'pageFooter' => true,
'address' => $address
));
}
/**
* 下单流程 选择优惠券
*/
public function selectCouponAction()
{
// 设置网站标题
$this->setTitle('选择优惠券');
$this->setNavHeader('选择优惠券', Helpers::url('/shoppingCart/orderEnsure'));
$uid = $this->_uid;
$this->_view->display('select-coupon', array(
'selectCouponPage' => true,
'pageFooter' => true
));
}
/**
... ...
<?php
namespace Home;
use LibModels\Wap\Home\HelpData;
use Plugin\Helpers;
/**
* 帮助中心相关数据处理
*/
class HelpModel
{
/*
* 获取帮助中心列表
*/
public static function serviceInfo()
{
//调用接口获取数据
$res = json_decode(HelpData::serviceInfo(), TRUE);
$cateInfo = $res['data'];
$iHelp = array();
$list = array();
if ($cateInfo) {
foreach ($cateInfo as $key => $value) {
$iHelp[$key]['name'] = $value['caption'];
$iHelp[$key]['code'] = $value['code'];
}
}
return $iHelp;
}
}
... ...
... ... @@ -3,7 +3,6 @@
namespace Index;
use LibModels\Wap\Home\CartData;
use LibModels\Wap\Home\UserData;
use Plugin\Helpers;
use Plugin\Images;
... ...
... ... @@ -121,11 +121,11 @@ class DetailModel
$build['answer'] = $value['answer'];
$result['feedbacks']['consults'][] = $build;
}
$result['feedbacks']['link'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
$result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
}
// 暂无咨询
else {
$result['feedbacks']['link'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
$result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
}
// 商品评价
... ... @@ -141,8 +141,8 @@ class DetailModel
$build['time'] = $value['createTime'];
$result['feedbacks']['comments'][] = $build;
}
//$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
}
$result['feedbacks']['commentsUrl'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
}
// 品牌信息
if (!empty($baseInfo['brand'])) {
... ... @@ -449,6 +449,11 @@ class DetailModel
/**
* 获取评价列表
*
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public static function getComments($productId, $pageNum = 1, $pageSize = 300)
{
... ... @@ -456,13 +461,13 @@ class DetailModel
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$commentList = DetailData::commentList($productId, $pageNum, $pageSize);
if (!empty($commentList)) {
if (!empty($commentList['data'])) {
$build = array();
foreach ($commentList as $value) {
$build['userName'] = '';
$build['desc'] = '';
$build['content'] = '';
$build['time'] = '';
foreach ($commentList['data'] as $value) {
$build['userName'] = $value['nickname'];
$build['desc'] = $value['color_name'] . '/' . $value['size_name'];
$build['content'] = $value['content'];
$build['time'] = $value['create_time'];
$result[] = $build;
}
}
... ...
<?php
use Action\AbstractAction;
use LibModels\Wap\Passport\LoginData;
use LibModels\Wap\Passport\RegData;
use Plugin\Helpers;
use Plugin\Partner\Factory;
/**
* 登录的控制器
*/
class BindController extends AbstractAction
{
/**
* 登录到bind页面
*/
public function indexAction()
{
$this->setTitle('绑定手机号');
$data = array(
'loginIndex' => true, // 模板中使用JS的标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
'registerUrl' => '/reg.html', // 注册的URL链接
'aliLoginUrl' => '/passport/login/alipay', // 支付宝快捷登录的URL链接
'weiboLoginUrl' => '/passport/login/sina', // 微博登录的URL链接
'qqLoginUrl' => '/passport/login/qq', // 腾讯QQ登录的URL链接
'internationalUrl' => '/login.html', // 国际号登录的URL链接
'phoneRetriveUrl' => '/passport/back/mobile', // 通过手机号找回密码的URL链接
'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接
);
// 渲染模板
$this->_view->display('index', $data);
}
// /**
// * 支付宝账号登录:回调方法
// */
// public function alipaycallbackAction()
// {
// $realName = $this->_request->get('real_name');
// $email = $this->_request->get('email');
// $userId = $this->_request->get('user_id');
//
// $result = array();
// if (isset($realName, $email, $userId)) {
// $result = LoginData::signinByOpenID($realName, $userId, 'alipay');
// }
//
// $refer = $this->getCookie('refer');
// if (empty($refer)) {
// $refer = SITE_MAIN . '/?go=1';
// } else {
// $refer = rawurldecode($refer);
// }
//
// if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
// $token = Helpers::makeToken($result['data']['uid']);
// $this->setCookie('_TOKEN', $token);
// $this->setSession('_TOKEN', $token);
// $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
// } else {
// $this->go($refer);
// }
// }
}
... ...
... ... @@ -206,27 +206,41 @@ class LoginController extends AbstractAction
public function qqcallbackAction()
{
$qqconnect = Factory::create('qqconnect');
$access = $qqconnect->getAccessToken();
$access = $qqconnect->getAccessToken();
/* 获取QQ腾讯用户的详细信息 */
$partnerInfo = $qqconnect->getUserInfo($access);
$result = array();
if (!empty($partnerInfo) && isset($partnerInfo['nickname'])) {
if (!empty($partnerInfo) && isset($partnerInfo['nickname']))
{
$result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq');
}
//判定是否需要绑定手机号
$isBind = $result['data']['is_bind'];
if ($isBind == 'N')
{
$this->go(Helpers::url('/passport/bind/index'));
}
$refer = $this->getCookie('refer');
if (empty($refer)) {
if (empty($refer))
{
$refer = SITE_MAIN . '/?go=1';
} else {
}
else
{
$refer = rawurldecode($refer);
}
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid']))
{
$token = Helpers::makeToken($result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
}
else
{
$this->go($refer);
}
}
... ... @@ -262,5 +276,5 @@ class LoginController extends AbstractAction
$this->go($refer);
}
}
}
... ...
... ... @@ -90,7 +90,7 @@ class DetailController extends AbstractAction
'goodsCommentsPage' => true,
'pageFooter' => true,
'comments' => array(
'list' => \Product\DetailModel::getConsults($productId),
'list' => \Product\DetailModel::getComments($productId),
),
);
... ...