Authored by hf

do home page view my order logistic

... ... @@ -24,8 +24,8 @@ class Yohobuy
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://devapi.yoho.cn:58078/';
const SERVICE_URL = 'http://devservice.yoho.cn:58077/';
const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const YOHOBUY_ORDER = 'http://192.168.102.205:8084/order/'; //我的订单
const API_URL_MYCENTER = 'http://192.168.102.205:8081/users/'; // 我的个人中心接口URL
... ...
... ... @@ -18,7 +18,7 @@ class OrderData
* and open the template in the editor.
*/
static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid)
public static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -40,7 +40,7 @@ class OrderData
* and open the template in the editor.
*/
static function cancelOrderData($order_code, $uid, $gender, $yh_channel)
public static function cancelOrderData($order_code, $uid, $gender, $yh_channel)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -60,7 +60,7 @@ class OrderData
* and open the template in the editor.
*/
static function deleteOrderData($order_code, $uid, $gender, $yh_channel)
public static function deleteOrderData($order_code, $uid, $gender, $yh_channel)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -76,17 +76,18 @@ class OrderData
/*
* 我的订单-查看物流
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*
* @param int $orderCode 订单号
* @param int $uid 用户ID
* @return array
*/
static function LogisticsData()
public static function LogisticsData($orderCode, $uid)
{
//构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.express.li';
//$param['gender'] = $gender;
//$param['yh_channel'] = $yh_channel;
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -96,7 +97,7 @@ class OrderData
* 支付url
* To change this template file, choose Tools | Templates
*/
static function paymentData($gender, $yh_channel, $code)
public static function paymentData($gender, $yh_channel, $code)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -109,10 +110,11 @@ class OrderData
}
/*
* 随便逛逛url
* To change this template file, choose Tools | Templates
* 随便逛逛url
*
* 备注:暂不使用
*/
static function strollData($gender, $yh_channel, $code)
public static function strollData($gender, $yh_channel, $code)
{
//构建必传参数
$param = Yohobuy::param();
... ...
... ... @@ -431,4 +431,35 @@ class UserData
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v1/help/getCategory', $param);
}
/**
* 帮助中心列表接口
*
* @return array 接口返回的数据
*/
public static function helpListData()
{
$param = Yohobuy::param();
$param['method'] = 'app.help.li';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 帮助详情接口
*
* @param string $code 具体一条帮助的code
* @return array 接口返回的数据
*/
public static function helpDetailData($code)
{
$param = Yohobuy::param();
$param['method'] = 'app.help.detail';
$param['return_type'] = 'html';
$param['code'] = $code;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, true, true);
}
}
... ...
... ... @@ -313,7 +313,7 @@ class ListProcess
{
$fieldArr = array();
foreach ($array as $k => $v) {
$fieldArr[$k] = $v[$field];
$fieldArr[$k] = isset($v[$field]) ? $v[$field] : '';
}
$sort = $desc == false ? SORT_ASC : SORT_DESC;
array_multisort($fieldArr, $sort, $array);
... ...
... ... @@ -16,6 +16,7 @@ var $addressForm = $('.edit-address'),
$footer = $('#yoho-footer'),
$backBtn = $('.nav-back'),
$navTitle = $('.nav-title'),
$input = $('input, textarea'),
navTitle = $navTitle.html(),
$area = $('.area'),
isSubmiting,
... ... @@ -101,6 +102,7 @@ $addressForm.on('submit', function() {
});
$submit.on('touchend', function() {
$input.blur();
$addressForm.submit();
return false;
}).on('touchstart', function() {
... ... @@ -109,26 +111,26 @@ $submit.on('touchend', function() {
$(this).removeClass('highlight');
});
$('input, textarea').on('focus', function() {
$input.on('focus', function() {
$footer.hide();
}).on('blur', function() {
$footer.show();
});
// 省市区
$area.on('touchend', function() {
$editAddressPage.hide();
$addressListPage.show(1, function() {
$footer.hide();
});
currentPage = 'list';
$navTitle.html('地区选择');
});
// 省市区列表异步加载
$.get('/home/locationList').then(function(html) {
$addressListPage.html(html);
// 省市区
$area.on('touchend', function() {
$editAddressPage.hide();
$addressListPage.show(1, function() {
$footer.hide();
});
currentPage = 'list';
$navTitle.html('地区选择');
});
// touchend 在下滑的时候会触发
// 省市区联动
$addressListPage.find('.address').each(function(i, elem) {
... ... @@ -137,6 +139,9 @@ $.get('/home/locationList').then(function(html) {
addressHammer.on('tap', function(e) {
var $this = $(e.target);
if (e.target.tagName !== 'li') {
$this = $this.parent('li');
}
newArea.push($this.children('.caption').text());
$this.siblings().hide();
$this.children('ul').show().children('li').show();
... ...
... ... @@ -23,8 +23,9 @@
width: 16rem / $pxConvertRem;
height: 16rem / $pxConvertRem;
margin: 0 (8rem / $pxConvertRem);
background: #efefef;
background: #f0f0f0;
border-radius: 50%;
opacity: 1;
}
span.swiper-pagination-bullet-active {
... ... @@ -85,4 +86,4 @@
}
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -32,7 +32,9 @@
height: 180rem / $pxConvertRem;
overflow: hidden;
margin: 20rem / $pxConvertRem auto;
background: image-url('me/employ/employ.jpg') top center no-repeat;
background-image: image-url('me/employ/employ.jpg');
background-position: top center;
background-repeat:no-repeat;
background-size: 100% 100%;
color: #fff;
position: relative;
... ...
... ... @@ -35,6 +35,9 @@
font-size: 48em / $pxConvertRem;
margin-right: 8%;
float: left;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
.head-portrait{
width:90rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
... ...
... ... @@ -31,7 +31,7 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
//意见反馈主体
.suggest-content {
border-top: pxToRem(30px) solid #fff;
border-top: 1px solid #e0e0e0;
.suggest-item {
width: 100%;
... ... @@ -76,6 +76,7 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
&.suggest-active {
> div {
width: 50%;
height: 100%;
float: left;
text-align: left;
padding-left: pxToRem(128px);
... ... @@ -135,8 +136,29 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
line-height: pxToRem(88px);
text-align: center;
font-size: pxToRem(30px);
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
//border-top: 1px solid #e0e0e0;
//border-bottom: 1px solid #e0e0e0;
border-top: pxToRem(30px) solid #f0f0f0;
border-bottom: pxToRem(30px) solid #f0f0f0;
position: relative;
&:after {
content: '';
width: 100%;
height: 1px;
border-top: 1px solid #e0e0e0;
position: absolute;
left: 0;
top: 0;
}
&:before {
content: '';
width: 100%;
height: 1px;
border-bottom: 1px solid #e0e0e0;
position: absolute;
left: 0;
bottom: 0;
}
a {
color: #444;
... ...
... ... @@ -38,7 +38,7 @@ $basicBtnC:#eb0313;
.column {
box-sizing: border-box;
display: table-cell;
padding: pxToRem(16px) pxToRem(12px);
padding: pxToRem(20px) pxToRem(12px);
width: 50%;
border-bottom: 1px solid #fff;
border-right: 1px solid #fff;
... ... @@ -100,8 +100,10 @@ $basicBtnC:#eb0313;
margin-left: .5px;
font-size: pxToRem(18px);
text-align: center;
line-height: pxToRem(30px);
padding: 0 8px;
line-height: pxToRem(24px);
position: relative;
vertical-align: middle;
padding:0 5px;
}
.new-tag {
background-color: #78dc7e;
... ... @@ -253,6 +255,7 @@ $basicBtnC:#eb0313;
vertical-align: middle;
display: inline-block;
line-height: pxToRem(88px);
padding-left: pxToRem(8px);
}
.vip-img {
width: pxToRem(53px);
... ... @@ -394,9 +397,10 @@ $basicBtnC:#eb0313;
// .recommend-for-you {
// margin-bottom: pxToRem(30px);
// }
.yoho-tip{
top:40%;
}
}
.bottom-blank{
height: pxToRem(120px);
}
@import "comments-consults";
@import "product-description";
... ...
... ... @@ -44,27 +44,24 @@
min-height: pxToRem(136px);
margin: pxToRem(10px) 0;
text-align: center;
display: flex;
align-items: center;
// width: 100%;
// border-bottom:1px solid $borderC;
img {
position:absolute;
top:0;
bottom:0;
left:0;
margin:auto;
//position:absolute;
//top:0;
//bottom:0;
//left:0;
//margin:auto;
//width: pxToRem(90px);
height: auto;
padding-right: pxToRem(20px);
//height: auto;
//padding-right: pxToRem(20px);
}
.material-image {
display: inline-block;
width: 23%;
min-height: pxToRem(136px);
float: left;
//background-size: 100%;
background-position-x: center;
background-repeat: no-repeat;
}
.material-desc {
//padding-left:pxToRem(120px);
... ... @@ -84,17 +81,17 @@
}
}
.wash-tips{
padding-top:pxToRem(18px);
padding-top:pxToRem(20px);
&.page-block{
// border-top: 0px;
padding-left: pxToRem(15px);
padding-right: pxToRem(15px);
}
// padding-bottom:pxToRem(18px);
.tip{
display: inline-block;
width: 16.6%;
float:left;
//min-height: pxToRem(120px);
// margin-right: pxToRem(24px);
img{
width: pxToRem(48px);
... ... @@ -106,7 +103,9 @@
padding: 0 pxToRem(13px);
font-size: pxToRem(18px);
line-height: pxToRem(22px);
margin-bottom: pxToRem(18px);
//margin-bottom: pxToRem(18px);
min-height: pxToRem(44px);
text-align:center;
}
}
... ... @@ -146,11 +145,12 @@
width: pxToRem(70px);
margin-top: pxToRem(66px);
.avatar {
line-height: pxToRem(40px);
// line-height: pxToRem(40px);
display: inline-block;
width: pxToRem(40px);
border-radius: 50%;
height: pxToRem(40px);
margin: pxToRem(18px) 0;
margin: pxToRem(12px) 0;
}
}
}
... ...
... ... @@ -2,7 +2,7 @@
<div class="my-address-page yoho-page">
<div class="my-edit-address-page page-wrap">
<form class="edit-address">
<input type="hidden" name="id" value="{{address.address_id}}">
<input type="hidden" name="id" value="{{address.id}}">
<label class="username">
收件人姓名
<input type="text" name="consignee" maxlength="20" value="{{address.consignee}}">
... ... @@ -18,7 +18,7 @@
<span class="iconfont">&#xe604;</span>
</label>
<label class="address">
详细地址
详细地址
<textarea name="address" maxlength="255">{{address.address}}</textarea>
</label>
... ... @@ -28,7 +28,6 @@
确认
</div>
</div>
<div class="my-address-list-page page-wrap hide">
</div>
{{> me/address/address-list}}
</div>
{{> layout/footer}}
{{> layout/footer}}
\ No newline at end of file
... ...
{{#coupons}}
<div class="employ-main" style="background:url('{{coupon_pic}}')">
<div class="employ-main" style="background-image:url('{{coupon_pic}}')">
<span>{{ money}}</span>
<p class="coupon-name">{{ coupon_name}}</p>
<p>{{ couponValidity}}</p>
<p>有效期:{{ couponValidity}}</p>
{{# used}}<i></i>{{/ used}}
</div>
{{/coupons}}
... ...
{{> layout/header}}
<div class="yoho-page">
<div class="employ">
<span class="active">未使用</span>
<span>已使用</span>
<div class="employ">
<span class="active">未使用</span>
<span>已使用</span>
</div>
{{# couponsUrl}}
<div class="employ-list">
{{# used}}
<div class="employ-main">
<span>{{ money}}</span>
<p>{{ coupon_name}}</p>
<p>{{ couponValidity}}</p>
</div>
{{/ used}}
{{^ used}}
<div class="null">
<i></i>
<p>您还没有优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
</div>
{{/ used}}
</div>
<div id="employ"></div>
<div class="employ-list not none">
{{# unused}}
<div class="employ-main">
<span>{{ money}}</span>
<p>{{ coupon_name}}</p>
<p>{{ couponValidity}}</p>
<i></i>
</div>
{{/ unused}}
{{^ unused}}
<div class="null">
<i></i>
<p>您还没有使用的优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
</div>
{{/ unused}}
</div>
{{/ couponsUrl}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -17,7 +17,7 @@
<div class="fav-load-more fav-load-background hide"></div>
</div>
<div class="fav-type">
<div class="fav-brand-swiper-wrapper"></div>
<div class="fav-brand-swiper"></div>
<div class="fav-content-loading"></div>
<div class="fav-null-box hide">
... ...
... ... @@ -28,7 +28,7 @@
{{#isLogin}}{{brand_favorite_total}}{{/isLogin}}
<p>收藏的品牌</p>
</a>
<a class="link-item" href="/home/record">
<a class="link-item" href="/home/">
{{#isLogin}}{{product_browse}}{{/isLogin}}
<p>浏览记录</p>
</a>
... ... @@ -44,23 +44,14 @@
<a class="type-item" href="/home/order?type=2">
<span class="iconfont">&#xe634;</span>
<br>待付款
{{#if pendingPaymentCount}}
<span class="num">{{pendingPaymentCount}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=3">
<span class="iconfont">&#xe63b;</span>
<br>待发货
{{#if dueOutGoodsCount}}
<span class="num">{{dueOutGoodsCount}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=4">
<span class="iconfont">&#xe633;</span>
<br>待收货
{{#if dueInGoodsCount}}
<span class="num">{{dueInGoodsCount}}</span>
{{/if}}
</a>
</div>
</div>
... ... @@ -103,7 +94,7 @@
</a>
</div>
<div class="group-list">
<a class="list-item" href="/help.html">
<a class="list-item" href="/home/IHelp">
<span class="iconfont icon">&#xe639;</span>
帮助
<span class="iconfont num">&#xe604;</span>
... ... @@ -115,4 +106,4 @@
</div>
{{> layout/download_app}}
{{> layout/footer}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@
<div class="right">
<div>
<span class='info'>物流公司:</span>
<span >{{logisticCompany}}</span>
<span>{{logisticCompany}}</span>
</div>
<div>
<span class='info'>快递单号:</span>
... ... @@ -28,7 +28,7 @@
<span class="timeline-node"></span>
<div class="timeline-info">
<div class="timeline-info-row">
{{ city}}&nbsp;&nbsp;&nbsp;{{ status}}
{{ status}}
</div>
<div class="timeline-info-row">
{{date}}
... ...
{{> layout/header}}
<div class="online-service-detail-page yoho-page">
<div class="qa-list">
{{# service}}
{{# list}}
<div class="question-item">
<div class="question">Q:{{q}}</div>
<div class="answer">{{a}}</div>
</div>
{{/ list}}
{{/ service}}
{{/ list}}
</div>
</div>
{{> layout/footer}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -10,20 +10,18 @@
{{# suggestContent}}
<div class="suggest-item" data-id="{{suggest_id}}">
{{#if imgUrl}}
<div class="suggest-item-img">
<img class="lazy" data-original="{{imgUrl}}" alt=""/>
</div>
{{/if}}
<h2>{{title}}</h2>
<p>{{content}}</p>
<div class="suggest-type suggest-good {{#good}}show{{/good}}">
<div class="suggest-type suggest-good">
<div class="active">
<span class="iconfont">&#xe601;</span>
<span>靠谱,谢谢您的反馈</span>
</div>
</div>
<div class="suggest-type suggest-bad {{# bad}}show{{/ bad}}">
<div class="suggest-type suggest-bad">
<div class="active">
<span class="iconfont">&#xe601;</span>
<span>不靠谱,谢谢您的反馈</span>
... ...
... ... @@ -2,10 +2,10 @@
<div class="good-detail-page yoho-page">
<div class="banner-container">
<div class="tag-container">
<!-- <p class="good-tag new-tag">NEW</p> -->
<p class="good-tag new-tag">NEW</p>
{{# tags}}
{{# is_new}}
<p class="good-tag new-tag">NEW</p>
<!-- <p class="good-tag new-tag">NEW</p> -->
{{/ is_new}}
{{# is_advance}}
<p class="good-tag renew-tag">再到着</p>
... ... @@ -56,7 +56,7 @@
<ul class="vip-level clearfix">
{{# list}}
<li class="icons-item">
<span class="vip-img" style="background-size:cover;">
<span class="vip-img" style="background-size:contain;">
</span>
<span class="vip-price">{{text}}</span>
</li>
... ...
... ... @@ -15,7 +15,7 @@
{{# savePrice}}
<div class="save-price save-price-number">
比收藏时降价了<span>{{.}}</span>
<span class="del-fav"></span>
<span class="del-fav iconfont">&#xe621;</span>
</div>
{{/ savePrice}}
... ...
... ... @@ -277,14 +277,11 @@
</script>
{{/if}}
{{#if browseRecordPage}}
<<<<<<< HEAD
<script>
seajs.use('js/me/browse-record');
</script>
{{/if}}
{{#if logisticInfoPage}}
=======
>>>>>>> feature/hf
<script>
seajs.use('js/me/logistic');
</script>
... ...
... ... @@ -105,7 +105,9 @@
<p class="material-desc">
{{desc}}
</p>-->
<div class="material-image" style="background-image:url({{img}})"></div>
<div class="material-image">
<img src="{{img}}" alt="材质图">
</div>
<div class="material-desc">
{{desc}}
</div>
... ...
... ... @@ -628,6 +628,7 @@ class HomeController extends AbstractAction
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
*
*/
public function orderAction()
{
// 审判跳转登录页
... ... @@ -660,7 +661,7 @@ class HomeController extends AbstractAction
if (!$this->isAjax()) {
echo ' ';
}
//获取基本参数:type 1:全部 2:待付款 3:待发货 4:待收货 5:待评论 7:失败 取消 订单
$type = $this->get('type', 1);
$page = $this->get('page', 1);
... ... @@ -669,7 +670,7 @@ class HomeController extends AbstractAction
$uid = $this->getUid(true);
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$data = OrderModel::getOrder($type, $page, 10, $gender, $channel, $uid);
$data = OrderModel::getOrder($type, $page, 10, $gender, $channel, 5772257);
/* 如果取不到订单数据时,分两种情况:
1、page>1时,echo一个空格字符串到浏览器。
2、page=1时,就给一个随便逛逛的链接。
... ... @@ -739,38 +740,22 @@ class HomeController extends AbstractAction
}
}
/*
* 我的订单-查看物流详情
*/
public function getLogisticsAction()
{
$order_code = $this->get('order_code');
$order_code = '1509143619';
$data = OrderModel::Logistics($order_code);
}
/**
* 物流信息页面
* 我的订单-查看物流信息
*/
public function logisticAction()
{
$data = array(
'logisticInfoPage' => true,
'pageFooter' => true,
'logisticImg' => 'http://localhost:8000/img/me/logistic/sf-icon.jpg',
'logisticCompany' => '顺丰0909',
'logisticNumber' => '999999999',
'logisticDetail' => array(
array('city' => '南京市', 'status' => '派送中派送中派送', 'date' => '2015-12-01 22:03:30'),
array('city' => '南京市', 'status' => '派送中', 'date' => '2015-12-01 22:03:30'),
array('city' => '南京市', 'status' => '派送中', 'date' => '2015-12-01 22:03:30')
)
);
// 审判跳转登录页
$this->auditJumpLogin();
$this->setTitle('物流详情');
$this->setNavHeader('物流详情');
$orderCode = $this->get('order_code');
$data = OrderModel::Logistics($orderCode, $this->_uid);
$data['logisticInfoPage'] = true;
$data['pageFooter'] = true;
$this->_view->display('logistic', $data);
}
... ... @@ -783,9 +768,9 @@ class HomeController extends AbstractAction
// OrderModel::payment($gender, $yh_channel);
// }
/*
* 我的订单-确认收货
*/
// /*
// * 我的订单-确认收货
// */
// private function confirmAction(){
// //
// $gender = Helpers::getGenderByCookie();
... ...
... ... @@ -107,8 +107,8 @@ class BrandModel
$build['list'] = array();
foreach ($value as $row) {
$list['name'] = $row['brand_name'];
$list['isHot'] = ($row['is_hot'] === 'Y') ? true : false;
$list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false;
$list['isHot'] = (isset($row['is_hot']) && $row['is_hot'] === 'Y') ? true : false;
$list['isNew'] = (isset($row['is_show_new']) && $row['is_show_new'] === 'Y') ? true : false;
$list['url'] = Helpers::url('', null, $row['brand_domain']);
$build['list'][] = $list;
}
... ...
... ... @@ -4,13 +4,6 @@ namespace Home;
use LibModels\Wap\Home\OrderData;
use Plugin\Helpers;
use Configs\CacheConfig;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Order
... ... @@ -18,7 +11,6 @@ use Configs\CacheConfig;
*/
class OrderModel
{
/* 频道选择页取背景图片的位置码 */
const CODE_PAYMENT = '04cf5abaa7c20178325a07c4a833782c'; //支付订单资源码
const CODE_STROLL = 'a7989369aa86681c678bc40f171b8f1d'; //随便逛逛url地址资源码
... ... @@ -26,12 +18,18 @@ class OrderModel
/**
* 订单相关数据处理
*/
public static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid) {
public static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid)
{
$result = array();
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
// 判断是否还有数据, 没有数据则返回空
if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
return $result;
}
//检查数据返回是否正常,正常则处理数据
if ($data['code'] == 200 && isset($data['data'])) {
if (!empty($data['data']['order_list'])) {
foreach ($data['data']['order_list'] as $key => $vo) {
//订单号,支付状态,订单商品数量,订单总价格
$result[$key]['orderNum'] = $vo['order_code'];
... ... @@ -48,8 +46,8 @@ class OrderModel
break;
}
/* 先判断订单付款方式,根据不同的付款方式计算订单状态。(注:货到付款没有待付款状态)
* 付款方式:1 => 在线支付,2 => 货到付款,3 => 现金支付,4 => 抵消支付;
*/
* 付款方式:1 => 在线支付,2 => 货到付款,3 => 现金支付,4 => 抵消支付;
*/
//支付方式为非货到付款时,计算订单状态。
if ($vo['payment_type'] != 2) {
switch ($vo['status']) {
... ... @@ -61,35 +59,13 @@ class OrderModel
case 2:
case 3:
//已付款状态不给查看物流URL
$result[$key]['unreceived'] = true;
$result[$key]['unreceived'] = true;
break;
case 4:
case 5:
//已发货状态,给查看物流URL
$result[$key]['unreceived'] = true;
$result[$key]['logisticsUrl'] = "暂无logisticsUrl数据";
break;
case 6:
$result[$key]['completed'] = true;
break;
default:
break;
}
} elseif ($vo['payment_type'] == 2) {
//订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态)
switch ($vo['status']) {
case 0:
case 1:
case 2:
case 3:
//备货中、已付款状态不给查看物流链接
$result[$key]['unreceived'] = true;
break;
case 4:
case 5:
//待收货状态,给查看物流url
$result[$key]['unreceived'] = true;
$resault[$key]['logisticsUrl'] = "备注:暂无logisticsUrl数据";
$result[$key]['logisticsUrl'] = Helpers::url('/home/logistic', array('order_code' => $vo['order_code']));
break;
case 6:
$result[$key]['completed'] = true;
... ... @@ -97,6 +73,29 @@ class OrderModel
default:
break;
}
break;
}
//订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态)
switch ($vo['status']) {
case 0:
case 1:
case 2:
case 3:
//备货中、已付款状态不给查看物流链接
$result[$key]['unreceived'] = true;
break;
case 4:
case 5:
//待收货状态,给查看物流url
$result[$key]['unreceived'] = true;
$result[$key]['logisticsUrl'] = Helpers::url('/home/logistic', array('order_code' => $vo['order_code']));
break;
case 6:
$result[$key]['completed'] = true;
break;
default:
break;
}
} while (false);
}
... ... @@ -105,39 +104,67 @@ class OrderModel
return $result;
}
/**
* 获得支付链接
*/
public static function payment($gender, $yh_channel)
{
$code = self::CODE_PAYMENT;
$data = OrderData::paymentData($gender, $yh_channel, $code);
}
//根据type值设置nav属性
static function getNavs($type) {
$navType = array(1=>'全部',2=>'待付款',3=>'待发货',4=>'待收货');
/**
* 查看物流
*
* @param int $orderCode 订单编号
* @param int $uid 用户ID
* @return array
*/
public static function Logistics($orderCode, $uid)
{
$result = array();
if (isset($orderCode) && is_numeric($uid)) {
$logistics = OrderData::LogisticsData($orderCode, $uid);
if (!empty($logistics['data'])) {
$result['logisticUrl'] = $logistics['data']['url'];
$result['logisticImg'] = $logistics['data']['logo'];
$result['logisticCompany'] = $logistics['data']['caption'];
$result['logisticNumber'] = $logistics['data']['express_number'];
$build = array();
foreach ($logistics['data']['express_detail'] as $value) {
$build['status'] = $value['accept_address'];
$build['date'] = $value['acceptTime'];
$result['logisticDetail'][] = $build;
}
}
}
return $result;
}
/**
* 根据type值设置nav属性
*/
public static function getNavs($type)
{
$navType = array(1 => '全部', 2 => '待付款', 3 => '待发货', 4 => '待收货');
$nav = array();
foreach ($navType as $key => $value) {
$act = false;
if($type == $key){
if ($type == $key) {
$act = true;
}
$tmp = array(
'name'=>$value,
'typeId'=>$key,
'active'=>$act,
'url'=> Helpers::url('/home/order',array('type'=>$key))
$nav[] = array(
'name' => $value,
'typeId' => $key,
'active' => $act,
'url' => Helpers::url('/home/order', array('type' => $key))
);
$nav[] = $tmp;
}
return $nav;
}
//获得支付链接
static function payment($gender, $yh_channel) {
$code = self::CODE_PAYMENT;
$data = OrderData::paymentData($gender, $yh_channel, $code);
return $nav;
}
//查看物流
// static function Logistics(){
// OrderData::LogisticsData();
// }
}
... ...
... ... @@ -142,10 +142,10 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart($resource);
if (isset($banner['code']) && $banner['code'] == 200) {
if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) {
$result = array();
// 处理数据
foreach ($banner['data'] as $val) {
foreach ($banner['data']['list'] as $val) {
foreach ($val['data'] as $single) {
$result['url'] = ($channel === 2) ? Helpers::url('/boys') : Helpers::url('/girls');
$result['img'] = Helpers::getImageUrl($single['src'], 640, 200);
... ...
... ... @@ -725,4 +725,42 @@ class UserModel
return $result;
}
/**
* 处理帮助中心列表数据
*
* @return array|mixed 处理之后的返回
*/
public static function getHelpListData()
{
$result = array();
$helpListData = UserData::helpListData();
if (isset($helpListData['data']) && !empty($helpListData['data'])) {
$help = $helpListData['data'];
$one = array();
foreach ($help as $val) {
$one = array();
$one['name'] = $val['caption'];
$one['url'] = Helpers::url('/home/helpdetail/', array('code' => $val['code']));
$result['iHelp'][] = $one;
}
}
return $result;
}
/**
* 处理帮助详情数据
*
* @param string $code 具体一条帮助的code
* @return array|mixed 处理之后的返回
*/
public static function getHelpDetailData($code)
{
return UserData::helpDetailData($code);
}
}
... ...