Authored by uedxwg

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

... ... @@ -955,7 +955,7 @@
//订单
{
orderNum: '',
tradingStatus: '',
orderStatus: '',
goods: [
{
id: '',
... ... @@ -974,9 +974,52 @@
sumCost: '199.00',
//status
completed: true, //已完成
canceled: true, //已取消
unpaid: true, //or 未支付
unshipped: true, //or 未发货
unreceived: '', //or 未收货,查看物流URL
unreceived: '', //or 待收货(未发货/未收货),查看物流URL
//待收货时传递物流参数
logisticsUrl: ''
}
### 订单详情页
{
orderDetail: {
orderNum: '', //订单号
name: '', //收货人姓名
phoneNum: '',
address: '',
orderStatus: '订单成功', //订单取消...等订单状态
orderNum: '',
orderTime: '',
//订单状态
canceled: true, //是否是取消的订单
completed: true, //是否是已完成订单
unpaid: true, //是否是未支付订单
unreceived: true, //是否是未收货订单
//如果是待收货(未发货和未收货),传物流信息参数
logisticsUrl: '',
logisticsCompany: '',
logisticsNum: '',
//end
goods: [
{
... //订单商品
}
],
sumPrice: '',
salePrice: '',
freight: '',
yohoCoin: '',
price: ''
}
}
### YOHO币
... ...
<?php
namespace LibModels\Wap\Home;
use Api\Sign;
use Api\Yohobuy;
/**
* 在线客服数据模型
*
* @name OnlineData
* @package LibModels/Wap/Home
* @copyright yoho.inc
* @version 1.0 (2015-11-13)
* @author xiaowei
*/
class OnlineData
{
const ONLINE_URI = 'operations/api/v1/help/';
//获取帮助列表(分类)
public static function getOnlineServiceInfo($clientType='iphone')
{
return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getCategory', array('client_type'=>$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));
}
}
... ...
... ... @@ -161,7 +161,7 @@ class UserData
public static function couponData($uid, $status, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.yohocoin.lists';
$param['method'] = 'app.coupons.li';
$param['uid'] = $uid;
$param['status'] = $status;
$param['page'] = $page;
... ... @@ -188,6 +188,76 @@ class UserData
}
/**
* 获取三级地址列表数据
*
* @param int $uid 用户ID
* @return array 地址接口返回的数据
*/
public static function addressListData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.address.getlist';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 保存地址数据
*
* @param int $uid 用户ID
* @param string $address 地址信息
* @param int $area_code 城市码
* @param string $consignee 收货人
* @param string $email 邮箱地址
* @param int $id 地址唯一标识符id
* @param string $mobile 手机号码
* @param string $zip_code 邮编
* @return array 地址接口返回的数据
*/
public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
{
$param = Yohobuy::param();
$param['address'] = $address;
$param['area_code'] = $area_code;
$param['consignee'] = $consignee;
$param['email'] = $email;
if ($id !== null) { // 修改
$param['id'] = $id;
$param['method'] = 'app.address.update';
} else { // 添加
$param['method'] = 'app.address.add';
}
$param['mobile'] = $mobile;
$param['zip_code'] = $zip_code;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public static function setDefaultAddress($uid, $id)
{
$param = Yohobuy::param();
$param['id'] = $id;
$param['method'] = 'app.address.setdefault';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 意见反馈数据
*
* @param string $udid 客户端唯一标识
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Thu Nov 12 16:17:15 2015
Created by FontForge 20120731 at Mon Nov 16 11:40:15 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Nov 12 16:17:15 2015
bbox="-0.75 -224 3943 812.871"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E62F"
unicode-range="U+0078-E632"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -179,5 +179,22 @@ q0 -66 47 -112.5t113.5 -46.5t113.5 46.5t47 112.5z" />
d="M474 28v161h-167v50h167v74h-167v49h134l-168 265h87l152 -257v386q-48 0 -96.5 4t-83.5 10.5t-63.5 12.5t-42.5 10l-14 4q-2 -43 -16.5 -74t-34 -44t-38.5 -20t-33 -7h-13q0 -110 10.5 -203.5t20.5 -131.5l10 -38q15 -61 45 -120.5t65.5 -105.5t75.5 -87.5t76 -70.5
t66.5 -50.5t47.5 -31.5t18 -10v225h-38zM550 28v161h167v50h-167v74h167v49h-134l168 265h-87l-152 -257v386q35 0 70.5 2t64 6t55.5 8.5t46.5 8.5t34 8t22.5 6l7 2q2 -43 16.5 -74t34 -44t38.5 -20t33 -7h13q0 -110 -10.5 -203.5t-20.5 -131.5l-10 -38q-15 -61 -45 -120.5
t-65.5 -105.5t-75.5 -87.5t-76 -70.5t-66.5 -50.5t-47.5 -31.5t-18 -10v225h38z" />
<glyph glyph-name="uniE630" unicode="&#xe630;"
d="M629 -71h-268v20q0 31 -21.5 53t-52.5 22t-52.5 -22t-21.5 -53v-20h-174v609h590v-609zM400 -30h188v527h-508v-527h94q7 41 39 68t74 27t74 -27t39 -68zM989 -71h-136v20q0 21 -10 38t-27 27t-37 10q-31 0 -52.5 -22t-21.5 -53v-20h-117v476h210q22 0 57 -34
q27 -26 58 -67q31 -40 52 -75q14 -25 19 -39t5 -23v-238zM892 -30h56v197q0 9 -18 40t-46 68q-7 9 -14 17.5t-13.5 16.5t-13 15t-12.5 14q-10 9 -18 16t-11 8.5t-5 1.5h-168v-394h37q7 41 39 68t74 27q28 0 52 -12.5t40.5 -34t20.5 -48.5zM989 137h-287v193h191l6 -8
q35 -43 61 -84q29 -48 29 -71v-30zM743 178h202q-6 15 -21 39q-21 34 -50 72h-131v-111zM779.5 -166q-47.5 0 -81.5 34t-34 81.5t34 81.5t81 34q24 0 45 -9.5t36.5 -25t24.5 -36.5t9 -45q0 -47 -33.5 -81t-81 -34zM779 24q-31 0 -52.5 -22t-21.5 -53q0 -15 6 -28.5t16 -23.5
t23.5 -16t28.5 -6q12 0 23.5 4t20.5 10.5t16 16t10.5 20.5t3.5 23q0 21 -10 38t-27 27t-37 10zM287 -166q-48 0 -81.5 34t-33.5 81.5t33.5 81.5t81.5 34t81.5 -34t33.5 -81.5t-33.5 -81.5t-81.5 -34zM287 24q-31 0 -52.5 -22t-21.5 -52.5t21.5 -52.5t52.5 -22t52.5 22
t21.5 52.5t-21.5 52.5t-52.5 22z" />
<glyph glyph-name="uniE631" unicode="&#xe631;"
d="M24 799zM47 799zM70 799zM94 799zM117 799zM140 799zM163 799zM187 799zM210 799zM233 799zM256 799zM280 799zM303 799zM326 799zM349 799zM373 799zM396 799zM419 799zM442 799zM466 799zM489 799zM512 799zM535 799zM558 799zM582 799zM605 799zM628 799zM651 799z
M675 799zM698 799zM721 799zM744 799zM768 799zM791 799zM814 799zM837 799zM861 799zM884 799zM907 799zM930 799zM954 799zM977 799zM1000 799zM1 776zM1 753zM1 730zM1 706zM1 683zM1 660zM1 637zM1 613zM1 590zM1 567zM1 544zM1 520zM1 497zM1 474zM1 451zM1 427zM1 404
zM1 381zM1 358zM1 334zM1 311zM1 288zM1 265zM1 242zM1 218zM1 195zM1 172zM1 149zM1 125zM1 102zM1 79zM1 56zM1 32zM1 9zM1 -14zM1 -37zM1 -61zM1 -84zM1 -107zM1 -130zM1 -154zM1 -177zM1 -200zM512 -223q-7 8 -18.5 22t-45.5 59t-64.5 91t-68 113.5t-64.5 131.5
t-45.5 139t-18.5 141q0 52 11 96.5t30 75.5t43 56.5t51 41t54 27t51.5 17t43.5 8.5t30 3h11q7 0 18.5 -0.5t45.5 -7t64.5 -17.5t68 -35.5t64.5 -57.5t45.5 -87t18.5 -120t-18 -140.5t-46.5 -140.5t-63 -130t-69.5 -114.5t-63.5 -90t-46.5 -60.5zM740 517q-16 85 -86 140
q-1 1 -4 3.5t-5 3.5q-5 4 -22 13l-4 2q-2 1 -3.5 2t-3.5 2l-4 2l-4 2q-1 0 -20 7q-2 0 -7.5 2t-9 3.5t-7.5 1.5q-24 5 -48 5v0q-24 0 -47 -5q-15 -3 -29.5 -8t-27.5 -11.5t-25 -14.5h-1q-12 -9 -27 -23q-2 -1 -5 -4l-3 -3q-2 -2 -4.5 -5t-4 -4.5t-4 -5t-3.5 -4.5
q-12 -16 -13 -17q-2 -3 -4.5 -7.5t-3.5 -5.5q0 -1 -1 -2q-2 -4 -3 -6.5t-3 -6t-3.5 -6.5t-2.5 -6q-1 -2 -2 -7q-1 -3 -2 -4q-7 -21 -9 -32q-4 -22 -4 -44q0 -183 175 -470l57 -88q9 13 25 36.5t56 92t70.5 133.5t55.5 148t25 148q0 11 -1 21.5t-3 21.5zM373 474
q0 58 40.5 98.5t98.5 40.5t98.5 -40.5t40.5 -98.5t-40.5 -99t-98.5 -41q-28 0 -54 11.5t-44.5 30t-29.5 44.5t-11 54z" />
<glyph glyph-name="uniE632" unicode="&#xe632;"
d="M313 163h397v69h-397v-69zM313 26h397v68h-397v-68zM611 747h-430q-4 0 -7 -0.5t-6 -2t-6 -3.5t-5 -4t-4 -5t-3 -6t-1.5 -6.5t-0.5 -6.5v-825q0 -5 1.5 -10.5t4.5 -9.5t7 -7.5t9 -5t11 -1.5h661q9 0 17 4.5t12.5 12.5t4.5 17v619zM644 626l131 -119h-131v119zM809 -77
h-595v755h364v-206q0 -14 9.5 -24t23.5 -10h198v-515zM313 300h397v69h-397v-69z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -5,6 +5,8 @@
*/
require('./order');
require('./order-detail');
require('./fav');
require('./index');
require('./coupons');
\ No newline at end of file
require('./coupons');
require('./online-service');
\ No newline at end of file
... ...
... ... @@ -4,12 +4,4 @@
* @date: 2015/11/12
*/
var Swiper = require('yoho.iswiper');
var recommendSwiper;
recommendSwiper = new Swiper('.swiper-recommend', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
slidesPerView: 'auto'
});
\ No newline at end of file
require('../product/recommend-for-you.js');
\ No newline at end of file
... ...
/**
* 在线客服
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/16
*/
var $ = require('jquery');
var $questionTab = $('.question-tab .tab-item');
$questionTab.on('touchend', function() {
var clickTab = $(this).data('tab');
clickTab = '[data-tab-name="' + clickTab + '"]';
$questionTab.removeClass('current');
$(this).addClass('current');
$('.question-list').removeClass('current');
$(clickTab).addClass('current');
});
... ...
/**
* 订单详情页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/16
*/
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload'),
Hammer = require('yoho.hammer');
var orderId = $('#order-detail').data('id');
var optHammer;
lazyLoad();
//订单删除
optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
optHammer.on('tap', function(e) {
var $cur = $(e.target);
if ($cur.hasClass('btn-del')) {
//删除订单
if (confirm('确定删除订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/delOrder',
data: {
id: orderId
}
});
}
} else if ($cur.hasClass('btn-cancel')) {
//取消订单
if (confirm('确定取消订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/cancelOrder',
data: {
id: orderId
}
});
}
}
});
\ No newline at end of file
... ...
/**
* 为您优选
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/16
*/
var Swiper = require('yoho.iswiper');
var recommendSwiper;
recommendSwiper = new Swiper('.swiper-recommend', {
// lazyLoading: true,
// lazyLoadingInPrevNext: true,
slidesPerView: 'auto'
});
\ No newline at end of file
... ...
@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you", "fav", "suggest", "address";
\ No newline at end of file
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service";
... ...
@function rem($n) {
@return $n / 40 * 1rem;
}
.online-service-page{
background: #f0f0f0;
.question {
background: #fff;
}
.question-title {
padding: rem(20) rem(30);
font-size: rem(28);
line-height: 1;
color: #b0b0b0;
}
.question-tab {
padding: rem(10) rem(30) rem(30);
font-size: rem(32);
line-height: rem(58);
text-align: center;
color: #b0b0b0;
.current {
color: #444;
}
.line {
margin: 0 rem(32);
border-left: 1px solid #b0b0b0;
}
}
.question-list {
display: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
&.current {
display: block;
}
li {
margin-left: rem(30);
width: rem(610);
font-size: rem(28);
line-height: rem(90);
border-bottom: 1px solid #ccc;
a {
display: block;
color: #444;
}
.iconfont {
float: right;
margin-right: rem(30);
color: #ccc;
}
&:last-child {
border-bottom: none;
}
}
}
.connect-info {
margin-top: 30px;
font-size: rem(28);
line-height: rem(50);
background: #fff;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
p {
margin-top: rem(25);
margin-left: rem(-72);
line-height: 1.5;
}
.icon-yoho-enter {
color: #ccc;
float: right;
}
.connect-item {
position: relative;
a {
display: block;
padding: rem(20) rem(30) rem(20) rem(94);
color: #444;
}
&:after {
content: '';
position: absolute;
right: 0;
bottom: 0;
width: rem(548);
height: 1px;
background: #ccc;
}
&:last-child {
&:after {
content: none;
}
}
}
.icon {
display: inline-block;
margin-right: rem(28);
margin-left: rem(-70);
vertical-align:middle;
}
}
}
.online-service-detail-page {
background: #f0f0f0;
.qa-list {
.question-item {
margin-bottom: rem(32);
border-top: 1px solid #c8c7cc;
border-bottom: 1px solid #c8c7cc;
color: #444;
background: #fff;
&:last-child {
margin-bottom: 0;
}
}
%qa {
margin-left: rem(30);
padding: 0 rem(40) 0 rem(10);
font-size: rem(30);
line-height: rem(76);
font-weight: bold;
}
.question {
@extend %qa;
position: relative;
&:after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
border-top: 1px solid #c8c7cc;
}
}
.answer {
@extend %qa;
}
}
}
\ No newline at end of file
... ...
.order-detail-page {
background: #f0f0f0;
.block {
position: relative;
background: #fff;
padding: 20rem / $pxConvertRem 30rem / $pxConvertRem;
.iconfont {
position: absolute;
left: 30rem / $pxConvertRem;
top: 50%;
font-size: 40rem / $pxConvertRem;
margin-top: -30rem / $pxConvertRem;
}
}
.sub {
position: relative;
.iconfont {
left: 0;
}
}
.logistics {
display: block;
.icon-right {
right: 25rem / $pxConvertRem;
left: auto;
color: #b0b0b0;
}
.sub-content {
border-top: 1px solid #e0e0e0;
margin-top: 20rem / $pxConvertRem;
padding-top: 20rem / $pxConvertRem;
}
}
.owner-info {
border-bottom: 1px solid #e0e0e0;
line-height: 1.5;
}
.beside-icon {
margin-left: 60rem / $pxConvertRem;
}
.name-phone {
font-size: 30rem / $pxConvertRem;
span {
float: right;
}
}
.address {
font-size: 24rem / $pxConvertRem;
margin-top: 10rem / $pxConvertRem;
}
.order-status {
margin: 20rem / $pxConvertRem 0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
padding-right: 0;
}
.sub-content span {
display: block;
color: #b0b0b0;
font-size: 24rem / $pxConvertRem;
}
.sub-content .sub-title {
display: block;
color: #000;
font-size: 26rem / $pxConvertRem;
}
.goods {
padding: 0;
margin-top: 20rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
}
.cost {
margin-bottom: 100rem / $pxConvertRem; /*排除被固定底部遮挡的影响*/
li {
font-size: 28rem / $pxConvertRem;
span {
float: right;
}
&:last-child span {
color: #f00;
}
}
}
.opt {
position: fixed;
bottom: 0;
left: 0;
right: 0;
text-align: right;
border-top: 1px solid #e0e0e0;
}
.btn {
display: inline-block;
box-sizing: border-box;
width: 140rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
@include border-radius(5px);
font-size: 26rem / $pxConvertRem;
text-align: center;
border: 1px solid #000;
}
.btn-pay {
color: #fff;
border: none;
background: #d0021b;
margin-left: 10rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
... ... @@ -18,7 +18,7 @@
border-bottom: 1px solid #e0e0e0;
}
.trading-status {
.order-status {
float: right;
}
... ... @@ -45,15 +45,13 @@
width: 140rem / $pxConvertRem;
font-size: 24rem / $pxConvertRem;
text-align: center;
}
.cancel {
border: 1px solid #000;
}
.pay {
background: #d0021b;
color: #fff;
border: none;
margin-left: 20rem / $pxConvertRem;
}
}
... ...
@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank";
\ No newline at end of file
@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank", "_recommend-for-you.scss";
\ No newline at end of file
... ...
... ... @@ -87,6 +87,6 @@
</div>
</div>
{{> me/recommend-for-you}}
{{> product/recommend-for-you}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="online-service-page yoho-page">
<form class="question-search">
</form>
<ul class="question-list">
<li class="question-item">
问题问
<span class="iconfont">&#xe604;</span>
</li>
<li class="question-item">
问题问
<span class="iconfont">&#xe604;</span>
</li>
<li class="question-item">
问题问
<span class="iconfont">&#xe604;</span>
</li>
</ul>
{{# service}}
<div class="question">
<div class="question-title">问题查询</div>
<div class="question-tab">
{{#tab}}
<span class="tab-item {{#current}}current{{/current}}" data-tab="{{tabid}}">{{tabname}}</span>
{{#iscut}}<span class="line"></span>{{/iscut}}
{{/tab}}
</div>
{{#question}}
<ul class="question-list {{#current}}current{{/current}}" data-tab-name="{{name}}">
{{#list}}
<li class="question-item">
<a href="{{link}}" title="{{title}}">
{{title}}
<span class="iconfont icon-yoho-enter">&#xe604;</span>
</a>
</li>
{{/list}}
</ul>
{{/question}}
</div>
{{/ service}}
<div class="connect-info">
<div class="connect-item connect-online">
<a href="http://chat80.live800.com/live800/chatClient/chatbox.jsp?companyID=493979&amp;configID=123576&amp;jid=9277320930" target="_blank" title="在线客服">
<span class="icon iconfont icon-chat">&#xe620;</span>
在线客服
<span class="iconfont icon-yoho-enter">&#xe604;</span>
</a>
</div>
<div class="connect-item connect-tel">
<a href="tel:400-889-9649" title="电话客服">
<span class="icon iconfont icon-tel">&#xe620;</span>
电话客服
<p>
400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
</p>
</a>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="online-service-detail-page yoho-page">
<div class="qa-list">
{{# list}}
<div class="question-item">
<div class="question">Q:{{q}}</div>
<div class="answer">{{a}}</div>
</div>
{{/ list}}
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="order-detail-page yoho-page">
{{# orderDetail}}
<div id="order-detail" data-id="{{orderNum}}">
<section class="owner-info block">
<span class="iconfont">&#xe631;</span>
<div class="beside-icon">
<p class="name-phone">
{{name}}
<span>{{phoneNum}}</span>
</p>
<p class="address">
{{address}}
</p>
</div>
</section>
<section class="order-status block">
<div class="status sub">
<span class="iconfont">&#xe632;</span>
<p class="beside-icon sub-content">
<span class="sub-title">{{orderStatus}}</span>
<span>订单编号:{{orderNum}}</span>
<span>下单时间:{{orderTime}}</span>
</p>
</div>
{{#if unreceived}}
<a class="logistics sub" href="{{logisticsUrl}}">
<span class="iconfont">&#xe630;</span>
<p class="beside-icon sub-content">
<span class="sub-title">物流信息</span>
<span>物流公司:{{logisticsCompany}}</span>
<span>快递单号:{{logisticsNum}}</span>
</p>
<span class="iconfont icon-right">&#xe614;</span>
</a>
{{/if}}
</section>
<section class="goods block">
{{# goods}}
{{> me/order/good}}
{{/ goods}}
</section>
<ul class="cost block">
<li>
商品总金额
<span>¥{{sumPrice}}</span>
</li>
<li>
活动金额
<span>-¥{{salePrice}}</span>
</li>
<li>
运费
<span>+¥{{freight}}</span>
</li>
<li>
YOHO币
<span>-¥{{yohoCoin}}</span>
</li>
<li>
实付金额
<span>¥{{price}}</span>
</li>
</ul>
<div class="opt block">
{{#unless unreceived}}
{{#unless unpaid}}
<span class="btn btn-del">删除订单</span>
{{/unless}}
{{/unless}}
{{#if unpaid}}
<span class="btn btn-cancel">取消订单</span>
<a href="{{payUrl}}">
<span class="btn btn-pay">立即付款</span>
</a>
{{/if}}
{{#if unreceived}}
<a href="{{logisticsUrl}}">
<span class="btn btn-check-logistics">查看物流</span>
</a>
{{/if}}
</div>
</div>
{{/ orderDetail}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -201,7 +201,6 @@
</script>
{{/if}}
{{!-- 个人中心 --}}
{{!-- 个人中心首页 --}}
{{#if myIndexPage}}
<script>
seajs.use('js/me/index');
... ... @@ -212,16 +211,23 @@
seajs.use('js/me/order');
</script>
{{/if}}
{{!-- 个人中心: 商品收藏&品牌收藏 --}}
{{#if orderDetailPage}}
<script>
seajs.use('js/me/order-detail');
</script>
{{/if}}
{{#if favPage}}
<script>
seajs.use('js/me/fav');
</script>
{{/if}}
{{#if couponsPage}}
<script>
seajs.use('js/me/coupons');
</script>
{{/if}}
{{#if onlineServicePage}}
<script>
seajs.use('js/me/online-service');
</script>
{{/if}}
\ No newline at end of file
... ...
<div class="order" data-id="{{orderNum}}">
<header class="header">
订单编号:{{orderNum}}
<span class="trading-status">{{tradingStatus}}</span>
<span class="order-status">{{orderStatus}}</span>
</header>
<section class="order-goods">
{{# goods}}
... ... @@ -12,6 +12,17 @@
共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
</footer>
{{!-- 对应订单状态的操作逻辑 --}}
{{!-- 完成和取消订单显示删除按钮 --}}
{{#unless unpaid}}
{{#unless unreceived}}
<div class="order-opt">
<span class="btn del">删除订单</span>
</div>
{{/unless}}
{{/unless}}
{{#if unpaid}}
<div class="order-opt">
<span class="btn cancel">取消订单</span>
... ... @@ -19,9 +30,9 @@
</div>
{{/if}}
{{#with unreceived}}
{{#if unreceived}}
<div class="order-opt">
<a class="check-logistics" href="{{.}}">查看物流</a>
<a class="check-logistics" href="{{logisticsUrl}}">查看物流</a>
</div>
{{/with}}
{{/if}}
</div>
\ No newline at end of file
... ...
... ... @@ -2,17 +2,17 @@
<div class="recommend-for-you">
<div class="title">为您优选新品</div>
<div class="swiper-recommend">
<div class="swiper-wrapper">
<ul class="swiper-wrapper">
{{#recommendList}}
<div class="swiper-slider">
<li class="swiper-slider">
<img class="img-box" src="{{thumb}}">
<div class="price">
<span class="sale-price"{{salePrice}}</span>
<span class="old-price"{{price}}</span>
</div>
</div>
</li>
{{/recommendList}}
</div>
</ul>
</div>
</div>
{{/ recommendForYou}}
\ No newline at end of file
... ...
... ... @@ -167,13 +167,14 @@ class HomeController extends AbstractAction
$this->setNavHeader('优惠券', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 8826435;
$status = $this->get('status', 0);
$coupons = array(
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
'couponsUrl' => array(
\Index\UserModel::getCouponData($uid, 0),
\Index\UserModel::getCouponData($uid, 1),
),
'couponsPage' => true
);
print_r($coupons);
$this->_view->display('coupons', $coupons);
}
... ... @@ -207,56 +208,102 @@ class HomeController extends AbstractAction
$uid = 967016;
$address = \Index\UserModel::getAddressData($uid);
$addressList = \Index\UserModel::getAddressListData($uid);
// print_r($address);
$this->_view->display('address', array(
'addressPage' => true,
'pageFooter' => true,
'address' => $address
'address' => $address,
'addressList' => $addressList
));
}
/**
* 修改地址
*/
public function editAddressAction()
{
// 设置网站标题
$this->setTitle('修改地址');
$this->setNavHeader('修改地址', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$address = \Index\UserModel::getAddressData($uid);
/**
* 修改地址或者添加新地址
*/
public function saveAddressAction()
{
$result = array();
if ($this->isAjax()) {
// $uid = $this->getUid();
$uid = 967016;
$address = $this->post('address', '');
$area_code = $this->post('area_code', '');
$consignee = $this->post('consignee', '');
$email = $this->post('email', '');
$id = $this->post('id', null);
$mobile = $this->post('mobile', '');
$zip_code = $this->post('zip_code', '');
$result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
}
// print_r($address);
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
$this->_view->display('edit_address', array(
'editAddressPage' => true,
'pageFooter' => true,
'address' => $address
));
}
}
/**
* 在线客服
* 设置默认地址
*/
public function onlineServiceAction()
public function defaultAddressAction()
{
$service = \Index\UserModel::getOnlineServiceData();
$result = array();
if ($this->isAjax()) {
// $uid = $this->getUid();
$uid = 967016;
$id = $this->post('id', '');
$result = \Index\UserModel::setDefaultAddress($uid, $id);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
print_r($service);
//在线客服
public function onlineServiceAction()
{
// 设置网站标题
$this->setTitle('在线客服');
$this->setNavHeader('在线客服', true, SITE_MAIN);
$service = home\OnlineModel::getOnlineServiceInfo();
$this->_view->display('online_service', array(
'onlineServicePage' => true,
'pageFooter' => true,
// 'pageFooter' => true,
'service' => $service
));
}
}
/**
//在线客服-具体详情
public function onlineServiceDetailAction()
{
$service = array();
$cateId = $this->get('cateId', 0);
$cateName = $this->get('cateName', '');
if ($cateId > 0)
{
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
}
$this->setTitle('在线客服');
$this->setNavHeader($cateName, true, '');
$this->_view->display('online_service_detail', $service);
}
/**
* 我的逛
*/
public function myGuangAction()
... ... @@ -385,4 +432,53 @@ class HomeController extends AbstractAction
while(false);
//$this -> _view -> display('order',$data);
}
/**
* 订单详情页
*/
public function orderDetailAction()
{
$data = array(
'name' => '毛毛莉Lydia',
'phoneNum' => '18600001133',
'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼',
'orderStatus' => '待收货',
'orderNum' => '418358063',
'orderTime' => '2014-03-10 17:25:10',
'unreceived' => true,
'logisticsUrl' => '',
'logisticsCompany' => '顺丰',
'logisticsNum' => '51537443456',
'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,
'yohoCoin' => 5,
'price' => 719
);
$this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
}
}
... ...
... ... @@ -218,7 +218,7 @@ class UserModel
// 处理优惠券数据
if (isset($coupons['data']) && !empty($coupons['data'])) {
$result = $coupons['data'];
$result = $coupons['data']['info'];
}
return $result;
... ... @@ -246,6 +246,96 @@ class UserModel
}
/**
* 处理地址列表数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的地址列表数据
*/
public static function getAddressListData($uid)
{
$result = array();
// 调用接口获取地址列表数据
$address = UserData::addressListData($uid);
// 处理地址数据
if (isset($address['data']) && !empty($address['data'])) {
$result = $address['data'];
}
return $result;
}
/**
* 保存地址数据
*
* @param int $uid 用户ID
* @param string $address 地址信息
* @param int $area_code 城市码
* @param string $consignee 收货人
* @param string $email 邮箱地址
* @param int $id 地址唯一标识符id
* @param string $mobile 手机号码
* @param string $zip_code 邮编
* @return array|mixed 处理之后的地址列表数据
*/
public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
{
$result = array();
// 参数验证
if (empty($uid)) {
$result['code'] = 400;
$result['message'] = '用户不可用';
} else if (empty($address)) {
$result['code'] = 401;
$result['message'] = '请输入可用的地址信息';
} else if (empty($area_code)) {
$result['code'] = 402;
$result['message'] = '地区码不可用';
} else if (empty($consignee)) {
$result['code'] = 403;
$result['message'] = '请输入收件人姓名';
} else if (!empty($email) && Helpers::verifyEmail($email)) {
$result['code'] = 404;
$result['message'] = '输入的邮箱地址格式不正确';
} else if (!empty($mobile) && Helpers::verifyMobile($mobile)) {
$result['code'] = 404;
$result['message'] = '输入的手机号码格式不正确';
} else {
// 调用接口保存地址数据
$address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
// 处理返回结果
if (isset($address['code']) && $address['code'] == 200) {
$result = $address['data'];
}
}
return $result;
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public static function setDefaultAddress($uid, $id)
{
$result = array('code' => 400, 'message' => '错误');
// 调用接口设置默认地址
$address = UserData::setDefaultAddress($uid, $id);
// 处理返回结果
if ($address && isset($address['code'])) {
$result = $address;
}
return $result;
}
/**
* 处理意见反馈数据
*
* @param string $udid 客户端唯一标识
... ...
... ... @@ -227,19 +227,30 @@ class NewsaleModel
return $result;
}
/**
* 筛选出来的热销排行榜商品数据处理
*
* @param array $data 筛选出来的原数据
* @return array 处理之后的数据
*/
public static function selectTopData($data)
/**
* 筛选出来的热销排行榜商品数据处理
*
* @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 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @return array 处理之后的数据
*/
public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
{
$result = array();
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
$result = NewSaleProcess::newSaleData($data['data']);
unset($result['filter']);
if ($notab) {
unset($result['tabs']);
}
}
return $result;
... ...
<?php
namespace home;
use LibModels\Wap\Home\OnlineData;
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 在线客服相关数据处理
*/
class OnlineModel
{
//获取在线帮助分类
public static function getOnlineServiceInfo($clientType = 'iphone')
{
//调用接口获取数据
$res = OnlineData::getOnlineServiceInfo($clientType);
$cateInfo = $res['data'];
$question = array();
$tab = array();
if ($cateInfo)
{
foreach ($cateInfo as $key => $value)
{
//强制截成3个tab
if ($key > 2)
{
break;
}
$tab[$key]['tabid'] = 'tab' . $value['id'];
$tab[$key]['tabname'] = $value['category_name'];
$tab[$key]['iscut'] = true;
$tab[$key]['current'] = (!$key) ? TRUE : FALSE;
$question[$key]['name'] = 'tab' . $value['id'];
$question[$key]['current'] = (!$key) ? TRUE : FALSE;
$sub = $value['sub'];
$qTmp = array();
if ($sub)
{
foreach ($sub as $sk => $sv)
{
$qTmp[$sk]['title'] = $sv['category_name'];
$qTmp[$sk]['link'] = '/home/onlineservicedetail?cateId=' . $sv['id'].'&cateName='.$sv['category_name'];
}
}
$question[$key]['list'] = $qTmp;
}
$question[0]['current'] = true;
$tab[count($tab) - 1]['iscut'] = false;
}
//处理返回信息
$result = array(
'header' => array('title' => '在线客服'),
'tab' => $tab,
'question' => $question
);
return $result;
}
//加载分类下的问题和解决方法
public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone')
{
$result = array();
if (!$cateId)
{
return $result;
}
$res = OnlineData::getOnlineServiceDetail($cateId, $clinetType);
$questionInfo = $res['data'];
if ($questionInfo)
{
$list = array();
if ($questionInfo)
{
foreach ($questionInfo as $qk => $qv)
{
$list[$qk]['q'] = $qv['title'];
$list[$qk]['a'] = $qv['content'];
}
}
//处理返回信息
$result = array(
'header' => array('title' => '在线客服'),
'list' => $list
);
}
return $result;
}
}
... ...
... ... @@ -106,12 +106,11 @@ class NewsaleController extends AbstractAction
$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();
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
$result = \Product\NewsaleModel::selectTopData($data);
$result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page);
}
if (empty($result)) {
... ...