Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xiaowei
9 years ago
Commit
e193115af4f98642c0ec690f9d00f4dd1ceb4b11
1 parent
f46f7962
master
...
develop
feature/brandCoupon
feature/changeQr
feature/encryptionUid
feature/filter-age
feature/mobile
feature/newInvoice
feature/order-show
feature/payMethod
feature/rcmnd4U
feature/rebuy
feature/shopBaseTlp
feature/ticket
feature/userInfoTip
hotfix/cancelOrder
hotfix/catlog
hotfix/deleteOrderStyle
hotfix/detail
hotfix/editOrder
hotfix/guang-goodsgroup
hotfix/itemApiurl
hotfix/loophole
hotfix/making-order
hotfix/new-girls
hotfix/orders
hotfix/productDetail
hotfix/receipt
hotfix/register
hotfix/returnImage
hotfix/rtrngdsstyl
hotfix/validate
patch-1
release/4.7
release/4.8
release/outlets
4.8.2
4.7.2
4.6.2.1
4.6.2
4.6
pchttps
pc4.5
fix-ip-login-limit
fix-ip-limit
4.4 JIT拆单
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
2075 additions
and
1798 deletions
template/www.yohobuy.com/actions/cart/index/order-ensure.phtml
template/www.yohobuy.com/actions/home/orders/order-detail.phtml
web-static/sass/home/_order-detail.css
yohobuy/www.yohobuy.com/application/models/Home/Order.php
yohobuy/www.yohobuy.com/application/models/Shopping/Cart.php
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/www.yohobuy.com/application/modules/Home/controllers/Orders.php
template/www.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
e193115
{
{>
layout/header
}
}
<div
class=
"order-ensure-page yoho-page clearfix"
>
{
{#
orderEnsure
}
}
<div
class=
"order-edit"
>
<div
class=
"order-title"
>
<ul>
<li
class=
"first"
>查看购物车</li>
<li
class=
"active"
>填写订单</li>
<li
class=
"end"
>付款,完成购买</li>
</ul>
</div>
<div
class=
"order-edit-main"
id=
"order-edit-main"
{
{#isNewUser
}
}data-new=
"new"
{
{/isNewUser
}
}
cartType=
"{{cartType}}"
>
<h
2
class=
"title"
>请填写并核对以下信息
<a
href=
"{{cartUrl}}"
class=
"btn_backcart"
></a>
</h
2
>
<div
class=
"order-content"
>
<div
class=
"order-selection address-list"
>
<h
2
>收货地址:<span>
[
修改
]
</span></h
2
>
<div
class=
"address-list-inner"
>
<ul
class=
"exist-address-list"
>
{
{#each
hasAddress
}
}
<li
class=
"has-exist-address"
>
<input
class=
"radio"
type=
"radio"
name=
"exist-address"
id=
"{{id}}"
{
{#if
checked
}
}checked
{
{/if
}
}/>
<label
for=
"{{id}}"
>
<strong>
{
{user
}
}</strong>
<span>
{
{address
}
}</span>
<b
class=
"default-address"
>设为默认地址</b>
<div
class=
"order-modify-btn"
>
<span
class=
"address-modify"
>
[
修改
]
</span>
<span
class=
"address-del"
>
[
删除
]
</span>
</div>
</label>
</li>
{
{/each
}
}
<li
class=
"use-new-address hide"
>
<input
class=
"radio add-address"
type=
"radio"
name=
"address"
id=
""
/>
<label
for=
""
>使用新地址</label>
</li>
</ul>
<div
class=
"address-manage hide"
cart-type=
"{{cartType}}"
>
<ul>
<li>
<span
class=
"address-legend"
><i>*</i>收货人姓名:</span>
<input
type=
"text"
name=
"name"
class=
"name text-input"
/>
<span>请填写您的真实姓名,最多
5
个汉字</span>
</li>
<li>
<span
class=
"address-legend"
><i>*</i>省市:</span>
<select
name=
"province"
id=
""
class=
"text-input"
>
</select>
<select
name=
"city"
id=
""
class=
"text-input"
>
</select>
<select
name=
"county"
id=
""
class=
"text-input"
>
</select>
<input
type=
"text"
name=
"address"
class=
"text-input"
/>
<span>标'*'的为支持加急送的地区,请输入收货的详细地址</span>
</li>
<li>
<span
class=
"address-legend"
><i>*</i>手机号码:</span>
<input
type=
"text"
name=
"phone"
class=
"text-input"
/>
<span>填写正确手机号便于接收发货和收货通知</span>
</li>
<li>
<span
class=
"address-legend"
>固定电话:</span>
<div
class=
"address-tel-input"
>
<input
type=
"text"
name=
"tel-code"
class=
"tel-lengend text-input"
/>
<input
type=
"text"
name=
"tel"
class=
"text-input"
/>
—
</div>
<span>如:
010-12345678
,固话和手机号至少填一项</span>
</li>
<li>
<span
class=
"address-legend"
>电子邮件:</span>
<input
type=
"text"
name=
"mail"
class=
"text-input"
/>
<span>用来接收订单提醒邮件,便于您及时了解订单状态</span>
</li>
<li>
<span
class=
"address-legend"
>邮编:</span>
<input
type=
"text"
name=
"code"
class=
"text-input"
/>
<span>请填写准确的邮编,以确保商品尽快送达</span>
</li>
</ul>
</div>
<span
class=
"save-btn hide"
>保存并送到这个地址</span>
</div>
</div>
<div
class=
"order-selection pay-time"
>
<h
2
>支付及送货时间:<span
class=
"switch-pay-modify"
>
[
修改
]
</span></h
2
>
<ul
class=
"modity-pay-info"
>
<li>付款方式:<span>
{
{defaultPayWay
}
}</span></li>
{
{#if
isPreSell
}
}
<li
class=
"prev-sell-item"
>发货时间:商品到货后立即发货</li>
{
{/if
}
}
<li>送货时间:<span>
{
{defaultDelivery
}
}</span></li>
<li>送货前联系我:<span>否</span></li>
</ul>
<div
class=
"pay-time-modify hide"
>
<h
3
class=
"pay-time-title"
>支付方式</h
3
>
<ul>
<li
class=
"pay-dashed-hr pay-recommend"
>
<div
class=
"pay-type-legend"
>
<input
value=
"1"
{
{#if
onlinePay.checked
}
}
checked
{
{/if
}
}
class=
"radio {{#if onlinePay.checked}}checked{{/if}}"
name=
"pay-type"
type=
"radio"
id=
""
data-pay=
"{{onlinePay.paymentId}}"
/>
<label
for=
""
>在线支付(推荐)</label>
</div>
<span
class=
"pay-type-legend"
>查看支持在线支付的银行和平台</span>
<div
class=
"support-type hide"
>
<h
4
>支持以下支付平台在线支付:</h
4
>
<ul>
{
{#each
supportLine
}
}
<li><img
src=
"{{src}}"
alt=
""
/></li>
{
{/each
}
}
</ul>
<h
4
>支持以下银行在线支付:</h
4
>
<ul>
{
{#each
supportBank
}
}
<li><img
src=
"{{src}}"
alt=
""
/></li>
{
{/each
}
}
</ul>
</div>
</li>
<li>
{
{#if
supportDeliveryPay
}
}
<input
value=
"2"
{
{#if
deliveryPay.checked
}
}checked
{
{/if
}
}
class=
"radio {{#if deliveryPay.checked}}checked{{/if}}"
name=
"pay-type"
type=
"radio"
id=
""
data-pay=
"{{deliveryPay.paymentId}}"
/>
{
{/if
}
}
<label
for=
""
>货到付款</label>
<span
class=
"pay-type-tips"
>注:订单中有限量商品、预售商品、化妆品或者订单金额超过
5000
元不可以选择货到付款。</span>
</li>
</ul>
<h
3
>送货时间</h
3
>
<ul>
{
{#each
delivery
}
}
<li>
<input
{
{#if
checked
}
}checked
{
{/if
}
}
value=
{
{id
}
}
class=
"radio"
name=
"pay-time-radio"
type=
"radio"
id=
"{{id}}"
/>
<label
for=
""
>
{
{desc
}
}</label>
</li>
{
{/each
}
}
<li
class=
"pay-dashed-hr pay-type-tips"
>声明:我们会努力按照您指定的时间配送,但因为天气、交通等各类因素影响,您的订单有可能会有延误现象,敬请谅解!</li>
<li>
<span>送货前是否联系:</span>
<input
value=
"Y"
class=
"radio"
name=
"call-me"
type=
"radio"
id=
""
/>
<label
for=
""
>是</label>
<input
value=
"N"
checked
class=
"radio"
name=
"call-me"
type=
"radio"
id=
""
/>
<label
for=
""
>否</label>
</li>
</ul>
<span
class=
"pay-btn"
>确定</span>
</div>
</div>
<div
class=
"order-selection select-express"
>
<h
2
>选择快递:</h
2
>
{
{#each
carriageList
}
}
<div
class=
"express-list"
>
<input
{
{#
checked
}
}checked
{
{/
checked
}
}
class=
"radio"
type=
"radio"
name=
"carriagegroup"
id=
"common-{{id}}"
value=
"{{id}}"
/>
<label
for=
"common-express"
>
{
{name
}
}: 运费
¥
{
{value
}
}
{
{desc
}
}</label>
</div>
{
{/each
}
}
<div
class=
"express-list express-tips"
>注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。
</div>
<div
class=
"express-list hide is-sup"
><span
class=
"sf"
>您所选择的区域暂不在顺风派送范围内,</span><a
style=
"text-decoration: none;"
target=
"_blank"
href=
"{{sfUrl}}"
>点击查看详情</a></div>
<div
class=
"express-list sf hide"
>如您购买的商品为航空禁运品顺丰会用陆运的方式给你派送,预计
3-5
天送达,请您见谅</div>
</div>
</div>
</div>
</div>
<div
class=
"order-pay"
>
<div
class=
"pay-wapper"
>
<table>
<thead>
<tr>
<th
style=
"width:40%;"
>
商品信息
</th>
<th
style=
"width:10%;"
>单价(元)</th>
<th
style=
"width:10%;"
>返YOHO币</th>
<th
style=
"width:10%;"
>数量</th>
<th
style=
"width:10%;"
>小计(元)</th>
<th
style=
"width:20%;"
>商品金额(元)</th>
</tr>
</thead>
<tbody>
{
{#each
orderProducts
}
}
<tr>
<td>
<div
class=
"pay-pro"
>
<a
class=
"pay-pro-icon"
href=
"{{link}}"
>
<img
src=
"{{imgCover}}"
/>
{
{#isPriceGift
}
}
<span
class=
"incentive"
>加价购</span>
{
{/isPriceGift
}
}
{
{#isGift
}
}
<span
class=
"gift"
>赠品</span>
{
{/isGift
}
}
</a>
<p
class=
"pay-pro-info"
>
<a
href=
"{{link}}"
target=
"_blank"
>
{
{productTitle
}
}</a>
<span>颜色:
{
{productColor
}
}
尺码:
{
{productSize
}
}</span>
</p>
</div>
</td>
<td>
{
{productPrice
}
}
{
{#isVipPrice
}
}
<span
class=
"vipPrice"
>(VIP)</span>
{
{/isVipPrice
}
}
</td>
<td>
{
{yohoIcon
}
}</td>
<td>
{
{productNum
}
}</td>
<td
class=
"cart-sub-total {{#xForOne}}xforone{{/xForOne}}"
>
{
{#if
xForOne
}
}
<del>
{
{productSubtotal
}
}</del>
<span
class=
"free"
></span>
{
{^
}
}
{
{productSubtotal
}
}
{
{/if
}
}
</td>
<td
class=
"cart-sub-total-all"
>
{
{productSubtotal
}
}</td>
</tr>
{
{/each
}
}
</tbody>
</table>
<!--YOHO-->
<div
class=
"play-content clearfix"
>
<div
class=
"play-left"
>
<dl
class=
"play-piao-pan pan"
>
<dt>索要发票</dt>
<dd>
<div
class=
"play-pan"
>
<ul>
<li><label>发票抬头
:</label><input
type=
"text"
class=
"textbox"
id=
"piaodesc"
/></li>
<li><label>发票类型
:</label>
<select
class=
"dropdown"
id=
"piaotype"
>
<option
value=
"0"
>请选择</option>
{
{#each
piaoTypes
}
}
<option
value=
"{{id}}"
>
{
{name
}
}</option>
{
{/each
}
}
</select>
</li>
</ul>
</div>
</dd>
</dl>
<dl
class=
"play-remark-pan pan"
>
<dt>添加备注信息</dt>
<dd>
<div
class=
"play-pan"
>
<textarea
class=
"textbox"
id=
"notedesc"
></textarea>
<p
class=
"note"
>声明:备注中有关收货人信息、支付方式、配送方式、发票信息等购买要求一律以上面的选择为准,备注无效。</p>
<p>是否打印价格:
<input
name=
"isPP"
id=
"isPPY"
type=
"radio"
value=
"Y"
checked=
""
>
<label
for=
"isPPY"
>是</label>
<input
name=
"isPP"
id=
"isPPN"
type=
"radio"
value=
"N"
>
<label
for=
"isPPN"
>否</label>
(如:送朋友的商品可不打印价格哦!)
</p>
</div>
</dd>
</dl>
</div>
<div
class=
"play-right"
>
<ul
class=
"play-total"
>
{
{#each
promotionFormulaList
}
}
<li
class=
"{{#if isExpress}}total-express-w{{/if}}"
>
<label>
{
{promotion
}
}</label><em>
{
{promotionAmount
}
}</em>
</li>
{
{/each
}
}
</ul>
{
{#if
showCouponPay
}
}
<dl
class=
"play-juan-pan pan"
>
<dt>使用优惠券支付</dt>
<dd>
<div
class=
"play-pan"
>
<p
class=
"strong"
>请选择您要使用的优惠券:
</p>
<p
class=
"strong orange"
>(OUTLET商品除免邮券外不可使用优惠券)</p>
<p
class=
"strong orange"
>(订单中使用优惠券将不赠送商品返还的YOHO币)</p>
<div
class=
"play-juan"
>
<ul>
<li>
<input
checked
name=
"juangroup"
type=
"radio"
value=
""
>
<label>直接输入优惠码:
</label>
<input
type=
"text"
class=
"textbox"
id=
"juancode"
/>
</li>
</ul>
</div>
<p
class=
"errtip red"
></p>
<div
class=
"btn-group clearfix"
>
<input
type=
"button"
class=
"ok"
value=
"确定"
id=
"juansubmit"
/>
<input
type=
"button"
class=
"cancel cancel-code"
value=
"取消"
/>
</div>
</div>
</dd>
</dl>
{
{/if
}
}
<dl
class=
"play-bi-pan pan"
>
<dt>使用YOHO币支付</dt>
<dd>
<div
class=
"play-pan"
>
<div
class=
"strong"
>
使用YOHO币:
<input
type=
"text"
class=
"textbox"
id=
"biprice"
data-bi=
"{{ownYohoCoin}}"
value=
"0"
/>
个
</div>
<p
>
您目前有YOHO币
<em
class=
"strong"
>
{
{ownYohoCoin
}
}</em>
个
</p>
<p
class=
"errbitip red"
></p>
<div
class=
"btn-group clearfix"
>
<input
type=
"button"
class=
"ok"
value=
"确定"
id=
"bisubmit"
/>
<input
type=
"button"
class=
"cancel cancel-bi"
value=
"取消"
/>
</div>
</div>
</dd>
</dl>
{
{#if
redEnvelopes
}
}
<div
class=
"red-envelopes active"
>
<div
class=
"use-envelopes"
>
<input
checked
value=
"0"
data-all=
"{{redEnvelopes}}"
data-use=
"{{useRedEnvelopes}}"
type=
"checkbox"
/>使用现金红包支付:<span>-¥
{
{useRedEnvelopes
}
}</span>
</div>
<div
class=
"has-envelopes"
>您的现金红包余额:<span></span></div>
</div>
{
{/if
}
}
</div>
</div>
</div>
<div
class=
"to-play"
>
<p>您需要实际支付金额:<em>
{
{lastOrderAmount
}
}</em>元</p>
<div
class=
"btn-group clearfix"
>
<input
type=
"button"
class=
"submit"
value=
"去付款"
/>
</div>
</div>
</div>
{
{/
orderEnsure
}
}
<div
class=
"loading"
><span></span>请稍后...</div>
</div>
{
{>
layout/header
}
}
<div
class=
"order-ensure-page yoho-page clearfix"
>
{
{#
orderEnsure
}
}
<div
class=
"order-edit"
>
<div
class=
"order-title"
>
<ul>
<li
class=
"first"
>查看购物车</li>
<li
class=
"active"
>填写订单</li>
<li
class=
"end"
>付款,完成购买</li>
</ul>
</div>
<div
class=
"order-edit-main"
id=
"order-edit-main"
{
{#isNewUser
}
}data-new=
"new"
{
{/isNewUser
}
}
cartType=
"{{cartType}}"
>
<h
2
class=
"title"
>请填写并核对以下信息
<a
href=
"{{cartUrl}}"
class=
"btn_backcart"
></a>
</h
2
>
<div
class=
"order-content"
>
<div
class=
"order-selection address-list"
>
<h
2
>收货地址:<span>
[
修改
]
</span></h
2
>
<div
class=
"address-list-inner"
>
<ul
class=
"exist-address-list"
>
{
{#each
hasAddress
}
}
<li
class=
"has-exist-address"
>
<input
class=
"radio"
type=
"radio"
name=
"exist-address"
id=
"{{id}}"
{
{#if
checked
}
}checked
{
{/if
}
}/>
<label
for=
"{{id}}"
>
<strong>
{
{user
}
}</strong>
<span>
{
{address
}
}</span>
<b
class=
"default-address"
>设为默认地址</b>
<div
class=
"order-modify-btn"
>
<span
class=
"address-modify"
>
[
修改
]
</span>
<span
class=
"address-del"
>
[
删除
]
</span>
</div>
</label>
</li>
{
{/each
}
}
<li
class=
"use-new-address hide"
>
<input
class=
"radio add-address"
type=
"radio"
name=
"address"
id=
""
/>
<label
for=
""
>使用新地址</label>
</li>
</ul>
<div
class=
"address-manage hide"
cart-type=
"{{cartType}}"
>
<ul>
<li>
<span
class=
"address-legend"
><i>*</i>收货人姓名:</span>
<input
type=
"text"
name=
"name"
class=
"name text-input"
/>
<span>请填写您的真实姓名,最多
5
个汉字</span>
</li>
<li>
<span
class=
"address-legend"
><i>*</i>省市:</span>
<select
name=
"province"
id=
""
class=
"text-input"
>
</select>
<select
name=
"city"
id=
""
class=
"text-input"
>
</select>
<select
name=
"county"
id=
""
class=
"text-input"
>
</select>
<input
type=
"text"
name=
"address"
class=
"text-input"
/>
<span>标'*'的为支持加急送的地区,请输入收货的详细地址</span>
</li>
<li>
<span
class=
"address-legend"
><i>*</i>手机号码:</span>
<input
type=
"text"
name=
"phone"
class=
"text-input"
/>
<span>填写正确手机号便于接收发货和收货通知</span>
</li>
<li>
<span
class=
"address-legend"
>固定电话:</span>
<div
class=
"address-tel-input"
>
<input
type=
"text"
name=
"tel-code"
class=
"tel-lengend text-input"
/>
<input
type=
"text"
name=
"tel"
class=
"text-input"
/>
—
</div>
<span>如:
010-12345678
,固话和手机号至少填一项</span>
</li>
<li>
<span
class=
"address-legend"
>电子邮件:</span>
<input
type=
"text"
name=
"mail"
class=
"text-input"
/>
<span>用来接收订单提醒邮件,便于您及时了解订单状态</span>
</li>
<li>
<span
class=
"address-legend"
>邮编:</span>
<input
type=
"text"
name=
"code"
class=
"text-input"
/>
<span>请填写准确的邮编,以确保商品尽快送达</span>
</li>
</ul>
</div>
<span
class=
"save-btn hide"
>保存并送到这个地址</span>
</div>
</div>
<div
class=
"order-selection pay-time"
>
<h
2
>支付及送货时间:<span
class=
"switch-pay-modify"
>
[
修改
]
</span></h
2
>
<ul
class=
"modity-pay-info"
>
<li>付款方式:<span>
{
{defaultPayWay
}
}</span></li>
{
{#if
isPreSell
}
}
<li
class=
"prev-sell-item"
>发货时间:商品到货后立即发货</li>
{
{/if
}
}
<li>送货时间:<span>
{
{defaultDelivery
}
}</span></li>
<li>送货前联系我:<span>否</span></li>
</ul>
<div
class=
"pay-time-modify hide"
>
<h
3
class=
"pay-time-title"
>支付方式</h
3
>
<ul>
<li
class=
"pay-dashed-hr pay-recommend"
>
<div
class=
"pay-type-legend"
>
<input
value=
"1"
{
{#if
onlinePay.checked
}
}
checked
{
{/if
}
}
class=
"radio {{#if onlinePay.checked}}checked{{/if}}"
name=
"pay-type"
type=
"radio"
id=
""
data-pay=
"{{onlinePay.paymentId}}"
/>
<label
for=
""
>在线支付(推荐)</label>
</div>
<span
class=
"pay-type-legend"
>查看支持在线支付的银行和平台</span>
<div
class=
"support-type hide"
>
<h
4
>支持以下支付平台在线支付:</h
4
>
<ul>
{
{#each
supportLine
}
}
<li><img
src=
"{{src}}"
alt=
""
/></li>
{
{/each
}
}
</ul>
<h
4
>支持以下银行在线支付:</h
4
>
<ul>
{
{#each
supportBank
}
}
<li><img
src=
"{{src}}"
alt=
""
/></li>
{
{/each
}
}
</ul>
</div>
</li>
<li>
{
{#if
supportDeliveryPay
}
}
<input
value=
"2"
{
{#if
deliveryPay.checked
}
}checked
{
{/if
}
}
class=
"radio {{#if deliveryPay.checked}}checked{{/if}}"
name=
"pay-type"
type=
"radio"
id=
""
data-pay=
"{{deliveryPay.paymentId}}"
/>
{
{/if
}
}
<label
for=
""
>货到付款</label>
<span
class=
"pay-type-tips"
>
{
{#if
packages
}
}
注:您订单中的商品暂不支持货到付款,请您选择在线支付。
{
{^
}
}
注:
{
{paymentInCashInfo
}
}
{
{/if
}
}
</span>
</li>
</ul>
<h
3
>送货时间</h
3
>
<ul>
{
{#each
delivery
}
}
<li>
<input
{
{#if
checked
}
}checked
{
{/if
}
}
value=
{
{id
}
}
class=
"radio"
name=
"pay-time-radio"
type=
"radio"
id=
"{{id}}"
/>
<label
for=
""
>
{
{desc
}
}</label>
</li>
{
{/each
}
}
<li
class=
"pay-dashed-hr pay-type-tips"
>声明:我们会努力按照您指定的时间配送,但因为天气、交通等各类因素影响,您的订单有可能会有延误现象,敬请谅解!</li>
<li>
<span>送货前是否联系:</span>
<input
value=
"Y"
class=
"radio"
name=
"call-me"
type=
"radio"
id=
""
/>
<label
for=
""
>是</label>
<input
value=
"N"
checked
class=
"radio"
name=
"call-me"
type=
"radio"
id=
""
/>
<label
for=
""
>否</label>
</li>
</ul>
<span
class=
"pay-btn"
>确定</span>
</div>
</div>
<div
class=
"order-selection select-express"
>
<h
2
>选择快递:</h
2
>
{
{#each
carriageList
}
}
<div
class=
"express-list"
>
<input
{
{#
checked
}
}checked
{
{/
checked
}
}
class=
"radio"
type=
"radio"
name=
"carriagegroup"
id=
"common-{{id}}"
value=
"{{id}}"
/>
<label
for=
"common-express"
>
{
{name
}
}: 运费
¥
{
{value
}
}
{
{desc
}
}</label>
</div>
{
{/each
}
}
<div
class=
"express-list express-tips"
>注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。
</div>
<div
class=
"express-list hide is-sup"
><span
class=
"sf"
>您所选择的区域暂不在顺风派送范围内,</span><a
style=
"text-decoration: none;"
target=
"_blank"
href=
"{{sfUrl}}"
>点击查看详情</a></div>
<div
class=
"express-list sf hide"
>如您购买的商品为航空禁运品顺丰会用陆运的方式给你派送,预计
3-5
天送达,请您见谅</div>
</div>
</div>
</div>
</div>
<!--
订单提示-->
{
{#if
packages
}
}
<div
id=
"differentOrder"
class=
"differentOrder"
>
<p
class=
"warn"
>
温馨提示:你购买的商品<span
class=
"red"
>分属不同的仓库</span>,需要调拨,将被拆分为多个包裹送达
<span
class=
"why"
>
</span>
</p>
<div
id=
"differentBag"
class=
"differentBag"
>
{
{#each
packages
}
}
<div
class=
"bag"
>
<h
3
>
{
{title
}
}
</h
3
>
<p
class=
"pre"
>
</p>
<div
class=
"bagDetil"
>
<ul>
{
{#each
goodlist
}
}
<li
>
<a
href=
{
{link
}
}>
<img
src=
{
{src
}
}/>
</a>
{
{#if
goodsType
}
}
<p
class=
"{{classname}}"
>
{
{goodsType
}
}</p>
{
{/if
}
}
</li>
{
{/each
}
}
</ul>
</div>
<p
class=
"next"
>
</p>
{
{#if
fee
}
}
<p>运费:¥
{
{fee
}
}元(原价
{
{orign
}
}元,优惠
{
{count
}
}元)</p>
{
{else
}
}
<p>运费:¥
0.00
元</p>
{
{/if
}
}
</div>
{
{/each
}
}
</div>
</div>
{
{/if
}
}
<div
class=
"order-pay"
>
<div
class=
"pay-wapper"
>
<table>
<thead>
<tr>
<th
style=
"width:40%;"
>
商品信息
</th>
<th
style=
"width:10%;"
>单价(元)</th>
<th
style=
"width:10%;"
>返YOHO币</th>
<th
style=
"width:10%;"
>数量</th>
<th
style=
"width:10%;"
>小计(元)</th>
<th
style=
"width:20%;"
>商品金额(元)</th>
</tr>
</thead>
<tbody>
{
{#each
orderProducts
}
}
<tr>
<td>
<div
class=
"pay-pro"
>
<a
class=
"pay-pro-icon"
href=
"{{link}}"
>
<img
src=
"{{imgCover}}"
/>
{
{#isPriceGift
}
}
<span
class=
"incentive"
>加价购</span>
{
{/isPriceGift
}
}
{
{#isGift
}
}
<span
class=
"gift"
>赠品</span>
{
{/isGift
}
}
</a>
<p
class=
"pay-pro-info"
>
<a
href=
"{{link}}"
target=
"_blank"
>
{
{productTitle
}
}</a>
<span>颜色:
{
{productColor
}
}
尺码:
{
{productSize
}
}</span>
</p>
</div>
</td>
<td>
{
{productPrice
}
}
{
{#isVipPrice
}
}
<span
class=
"vipPrice"
>(VIP)</span>
{
{/isVipPrice
}
}
</td>
<td>
{
{yohoIcon
}
}</td>
<td>
{
{productNum
}
}</td>
<td
class=
"cart-sub-total {{#xForOne}}xforone{{/xForOne}}"
>
{
{#if
xForOne
}
}
<del>
{
{productSubtotal
}
}</del>
<span
class=
"free"
></span>
{
{^
}
}
{
{productSubtotal
}
}
{
{/if
}
}
</td>
<td
class=
"cart-sub-total-all"
>
{
{productSubtotal
}
}</td>
</tr>
{
{/each
}
}
</tbody>
</table>
<!--YOHO-->
<div
class=
"play-content clearfix"
>
<div
class=
"play-left"
>
<dl
class=
"play-piao-pan pan"
>
<dt>索要发票</dt>
<dd>
<div
class=
"play-pan"
>
<ul>
<li><label>发票抬头
:</label><input
type=
"text"
class=
"textbox"
id=
"piaodesc"
/></li>
<li><label>发票类型
:</label>
<select
class=
"dropdown"
id=
"piaotype"
>
<option
value=
"0"
>请选择</option>
{
{#each
piaoTypes
}
}
<option
value=
"{{id}}"
>
{
{name
}
}</option>
{
{/each
}
}
</select>
</li>
</ul>
</div>
</dd>
</dl>
<dl
class=
"play-remark-pan pan"
>
<dt>添加备注信息</dt>
<dd>
<div
class=
"play-pan"
>
<textarea
class=
"textbox"
id=
"notedesc"
></textarea>
<p
class=
"note"
>声明:备注中有关收货人信息、支付方式、配送方式、发票信息等购买要求一律以上面的选择为准,备注无效。</p>
<p>是否打印价格:
<input
name=
"isPP"
id=
"isPPY"
type=
"radio"
value=
"Y"
checked=
""
>
<label
for=
"isPPY"
>是</label>
<input
name=
"isPP"
id=
"isPPN"
type=
"radio"
value=
"N"
>
<label
for=
"isPPN"
>否</label>
(如:送朋友的商品可不打印价格哦!)
</p>
</div>
</dd>
</dl>
</div>
<div
class=
"play-right"
>
{
{#if
totalYoho
}
}
<div
class=
"back-coin"
>
<a
href=
"/help/?category_id=87"
class=
"yoho-coin"
target=
"_blank"
></a>共返YOHO币:
{
{totalYoho
}
}个
</div>
{
{/if
}
}
<ul
class=
"play-total"
>
{
{#each
promotionFormulaList
}
}
<li
class=
"{{#if isExpress}}total-express-w{{/if}}"
>
<label>
{
{promotion
}
}</label><em>
{
{promotionAmount
}
}</em>
</li>
{
{/each
}
}
</ul>
{
{#if
showCouponPay
}
}
<dl
class=
"play-juan-pan pan"
>
<dt>使用优惠券支付</dt>
<dd>
<div
class=
"play-pan"
>
<p
class=
"strong"
>请选择您要使用的优惠券:
</p>
<p
class=
"strong orange"
>(OUTLET商品除免邮券外不可使用优惠券)</p>
<p
class=
"strong orange"
>(订单中使用优惠券将不赠送商品返还的YOHO币)</p>
<div
class=
"play-juan"
>
<ul>
<li>
<input
checked
name=
"juangroup"
type=
"radio"
value=
""
>
<label>直接输入优惠码:
</label>
<input
type=
"text"
class=
"textbox"
id=
"juancode"
/>
</li>
</ul>
</div>
<p
class=
"errtip red"
></p>
<div
class=
"btn-group clearfix"
>
<input
type=
"button"
class=
"ok"
value=
"确定"
id=
"juansubmit"
/>
<input
type=
"button"
class=
"cancel cancel-code"
value=
"取消"
/>
</div>
</div>
</dd>
</dl>
{
{/if
}
}
<dl
class=
"play-bi-pan pan"
>
<dt>使用YOHO币支付</dt>
<dd>
<div
class=
"play-pan"
>
<div
class=
"strong"
>
使用YOHO币:
<input
type=
"text"
class=
"textbox"
id=
"biprice"
data-bi=
"{{ownYohoCoin}}"
value=
"0"
/>
个
</div>
<p
>
您目前有YOHO币
<em
class=
"strong"
>
{
{ownYohoCoin
}
}</em>
个
</p>
<p
class=
"errbitip red"
></p>
<div
class=
"btn-group clearfix"
>
<input
type=
"button"
class=
"ok"
value=
"确定"
id=
"bisubmit"
/>
<input
type=
"button"
class=
"cancel cancel-bi"
value=
"取消"
/>
</div>
</div>
</dd>
</dl>
{
{#if
redEnvelopes
}
}
<div
class=
"red-envelopes active"
>
<div
class=
"use-envelopes"
>
<input
checked
value=
"0"
data-all=
"{{redEnvelopes}}"
data-use=
"{{useRedEnvelopes}}"
type=
"checkbox"
/>使用现金红包支付:<span>-¥
{
{useRedEnvelopes
}
}</span>
</div>
<div
class=
"has-envelopes"
>您的现金红包余额:<span></span></div>
</div>
{
{/if
}
}
</div>
</div>
</div>
<div
class=
"to-play"
>
<p>您需要实际支付金额:<em>
{
{lastOrderAmount
}
}</em>元</p>
<div
class=
"btn-group clearfix"
>
<input
type=
"button"
class=
"submit"
value=
"去付款"
/>
</div>
</div>
</div>
{
{/
orderEnsure
}
}
<div
class=
"loading"
><span></span>请稍后...</div>
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/www.yohobuy.com/actions/home/orders/order-detail.phtml
View file @
e193115
{
{>
layout/header
}
}
<div
class=
"order-detail-page me-page yoho-page clearfix"
>
{
{#
meOrderDetail
}
}
{
{>
home/path
}
}
{
{>
home/navigation
}
}
<div
class=
"me-main"
>
<div
class=
"order-detail block"
data-id=
"{{orderNum}}"
>
<h
2
class=
"title"
></h
2
>
<div
class=
"status"
>
<p>
订单编号:
<em>
{
{orderNum
}
}</em>
</p>
<p
class=
"cur-status"
>
当前状态:
{
{curStatus
}
}
</p>
{
{#if
complete
}
}
<p
class=
"complete-tip"
>订单已经完成,感谢你在YOHO商城购物,欢迎您对本次交易及所购商品进行评价。</p>
{
{/if
}
}
{
{#if
operation.goPay
}
}
<a
class=
"go-pay oo-btn"
href=
"{{operation.goPay}}"
>立即付款</a>
{
{/if
}
}
</div>
<div
class=
"detail-info{{#if virtualGoods}} virtual-detail{{/unless}}"
>
{
{#
progress
}
}
<div
class=
"order-progress"
>
<div
class=
"progress-box"
>
<div
class=
"outter-progress"
>
<div
class=
"inner-progress"
style=
"width: {{percent}};"
></div>
</div>
<ul
class=
"clearfix"
>
{
{#each
middleStatus
}
}
<li
class=
"pg-{{@index}}{{#if cur}} cur{{/if}}"
>
{
{name
}
}
{
{#if
date
}
}
<span
class=
"date"
>
{
{date
}
}</span>
{
{/if
}
}
</li>
{
{/each
}
}
</ul>
</div>
</div>
{
{/
progress
}
}
{
{#
traceOrder
}
}
<div
class=
"trace-order"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
订单追踪
</p>
<div
class=
"content"
>
<p>下单时间:
{
{orderDate
}
}</p>
{
{#if
logisticsCompany
}
}
<p>物流公司:
{
{logisticsCompany
}
}</p>
{
{/if
}
}
{
{#if
courierNumbe
}
}
<p>快递单号:
{
{courierNumbe
}
}</p>
{
{/if
}
}
<table>
<thead>
<th
class=
"handle-time"
>处理时间</th>
<th
class=
"recive-place"
>接收地点</th>
<th
class=
"logistics-info"
>物流信息</th>
</thead>
<tbody>
{
{#
logistics
}
}
<tr>
{
{#each
.
}
}
<td>
{
{.
}
}
</td>
{
{/each
}
}
</tr>
{
{/
logistics
}
}
</tbody>
</table>
</div>
</div>
{
{/
traceOrder
}
}
{
{#
orderInfo
}
}
<div
class=
"order-info"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
订单信息
</p>
<div
class=
"content"
>
<p>收货人:
{
{receiver
}
}</p>
<p>收货地址:
{
{address
}
}</p>
<p>联系电话:
{
{phone
}
}</p>
</div>
</div>
{
{/
orderInfo
}
}
<div
class=
"order-remark"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
备注
</p>
<p
class=
"content"
>
{
{remark
}
}
</p>
</div>
{
{#
noramlPayMode
}
}
<div
class=
"pay-mode"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
支付及配送方式
</p>
<div
class=
"content"
>
<p>支付类型:
{
{payMode
}
}</p>
{
{#if
payWay
}
}
<p>支付方式:
{
{payWay
}
}</p>
{
{/if
}
}
<p>送货上门时间:
{
{deliverTime
}
}</p>
</div>
</div>
{
{/
noramlPayMode
}
}
{
{#
virtualPayMode
}
}
<div
class=
"pay-mode virtual-pay-mode"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
付款方式
</p>
<div
class=
"content"
>
<span>付款方式:
{
{payMode
}
}</span>
<span>电话号码:
{
{phone
}
}</span>
</div>
</div>
{
{/
virtualPayMode
}
}
<div
class=
"good-list"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
商品清单
</p>
<div
class=
"content"
>
<table>
<thead>
<th
class=
"product-info"
>商品信息</th>
<th
class=
"good-price"
>单价(元)</th>
<th
class=
"yoho-coin"
>
返YOHO币
<a
target=
"_blank"
href=
"{{yohoCoinUrl}}"
></a>
</th>
<th
class=
"num"
>数量</th>
<th
class=
"sum"
>小计(元)</th>
</thead>
<tbody>
{
{#
goods
}
}
<tr>
<td>
<a
class=
"thumb-link"
href=
"{{url}}"
target=
"_blank"
>
<img
class=
"thumb"
src=
"{{img}}"
>
{
{>
home/order-goods-tags
}
}
</a>
<p
class=
"name-color-size"
>
<a
class=
"name"
href=
"{{url}}"
target=
"_blank"
>
{
{name
}
}</a>
{
{#if
color
}
}
颜色:
{
{color
}
}
{
{/if
}
}
{
{#if
size
}
}
尺码:
{
{size
}
}
{
{/if
}
}
{
{#if
date
}
}
日期:
{
{date
}
}
{
{/if
}
}
</p>
</td>
<td>
{
{price
}
}</td>
<td>
{
{coin
}
}</td>
<td>
{
{num
}
}</td>
<td>
{
{sum
}
}</td>
</tr>
{
{/
goods
}
}
</tbody>
</table>
<div
class=
"order-balance"
>
{
{#each
orderBalance
}
}
<p>
{
{promotion
}
}:
{
{#if
@first
}
}
<em>
{
{account
}
}</em>
{
{^
}
}
{
{#if
@last
}
}
<em
class=
"payment"
>
{
{account
}
}</em>
{
{^
}
}
{
{account
}
}
{
{/if
}
}
{
{/if
}
}
元
</p>
{
{/each
}
}
</div>
</div>
</div>
{
{#
operation
}
}
<div
class=
"order-operation clearfix"
>
{
{#if
paid
}
}
<p>
<span
class=
"success-icon oo-icon"
></span>
订单已支付
</p>
{
{/if
}
}
{
{#if
goPay
}
}
<a
class=
"go-pay oo-btn"
href=
"{{goPay}}"
target=
"_blank"
>立即付款</a>
{
{/if
}
}
{
{#if
cancelOrder
}
}
<span
class=
"cancel-order oo-btn"
>取消订单</span>
{
{/if
}
}
{
{#if
shipped
}
}
<span
id=
"receive-confirm"
class=
"confirm-received oo-btn"
>确认收货</span>
{
{/if
}
}
{
{#if
cancel
}
}
<p>
<span
class=
"cancel-icon oo-icon"
></span>
订单已取消
</p>
{
{/if
}
}
{
{#if
checkQrCode
}
}
<a
class=
"check-qrcode oo-btn"
href=
"{{checkQrCode}}"
target=
"_blank"
>查看二维码</a>
{
{/if
}
}
</div>
{
{/
operation
}
}
</div>
</div>
</div>
{
{/
meOrderDetail
}
}
{
{>
home/order-cancel-tpl
}
}
</div>
{
{>
layout/header
}
}
<div
class=
"order-detail-page me-page yoho-page clearfix"
>
{
{#
meOrderDetail
}
}
{
{>
home/path
}
}
{
{>
home/navigation
}
}
<div
class=
"me-main"
>
<div
class=
"order-detail block"
data-id=
"{{orderNum}}"
>
<h
2
class=
"title"
></h
2
>
<div
class=
"status"
>
<p>
订单编号:
<em>
{
{orderNum
}
}</em>
</p>
<p
class=
"cur-status"
>
当前状态:
{
{curStatus
}
}
</p>
{
{#if
complete
}
}
<p
class=
"complete-tip"
>订单已经完成,感谢你在YOHO商城购物,欢迎您对本次交易及所购商品进行评价。</p>
{
{/if
}
}
{
{#if
operation.goPay
}
}
<a
class=
"go-pay oo-btn"
href=
"{{operation.goPay}}"
>立即付款</a>
{
{/if
}
}
</div>
<div
class=
"detail-info{{#if virtualGoods}} virtual-detail{{/unless}}"
>
{
{#
progress
}
}
<div
class=
"order-progress"
>
<div
class=
"progress-box"
>
<div
class=
"outter-progress"
>
<div
class=
"inner-progress"
style=
"width: {{percent}};"
></div>
</div>
<ul
class=
"clearfix"
>
{
{#each
middleStatus
}
}
<li
class=
"pg-{{@index}}{{#if cur}} cur{{/if}}"
>
{
{name
}
}
{
{#if
date
}
}
<span
class=
"date"
>
{
{date
}
}</span>
{
{/if
}
}
</li>
{
{/each
}
}
</ul>
</div>
</div>
{
{/
progress
}
}
{
{#
traceOrder
}
}
<div
class=
"trace-order"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
订单追踪
</p>
<div
class=
"content"
>
<p>下单时间:
{
{orderDate
}
}</p>
{
{#if
logisticsCompany
}
}
<p>物流公司:
{
{logisticsCompany
}
}</p>
{
{/if
}
}
{
{#if
courierNumbe
}
}
<p>快递单号:
{
{courierNumbe
}
}</p>
{
{/if
}
}
<table>
<thead>
<th
class=
"handle-time"
>处理时间</th>
<th
class=
"recive-place"
>接收地点</th>
<th
class=
"logistics-info"
>物流信息</th>
</thead>
<tbody>
{
{#
logistics
}
}
<tr>
{
{#each
.
}
}
<td>
{
{.
}
}
</td>
{
{/each
}
}
</tr>
{
{/
logistics
}
}
</tbody>
</table>
</div>
</div>
{
{/
traceOrder
}
}
{
{#
orderInfo
}
}
<div
class=
"order-info"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
订单信息
</p>
<div
class=
"content"
>
<p>收货人:
{
{receiver
}
}</p>
<p>收货地址:
{
{address
}
}</p>
<p>联系电话:
{
{phone
}
}</p>
</div>
</div>
{
{/
orderInfo
}
}
<div
class=
"order-remark"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
备注
</p>
<p
class=
"content"
>
{
{remark
}
}
</p>
</div>
{
{#
noramlPayMode
}
}
<div
class=
"pay-mode"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
支付及配送方式
</p>
<div
class=
"content"
>
<p>支付类型:
{
{payMode
}
}</p>
{
{#if
payWay
}
}
<p>支付方式:
{
{payWay
}
}</p>
{
{/if
}
}
<p>送货上门时间:
{
{deliverTime
}
}</p>
</div>
</div>
{
{/
noramlPayMode
}
}
{
{#
virtualPayMode
}
}
<div
class=
"pay-mode virtual-pay-mode"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
付款方式
</p>
<div
class=
"content"
>
<span>付款方式:
{
{payMode
}
}</span>
<span>电话号码:
{
{phone
}
}</span>
</div>
</div>
{
{/
virtualPayMode
}
}
<!--订单不同包裹提示-->
{
{#if
packages
}
}
<div
id=
"differentOrder"
class=
"differentOrder"
>
<p
class=
"warn"
>
温馨提示:你购买的商品<span
class=
"red"
>分属不同的仓库</span>,需要调拨,将被拆分为多个包裹送达
<span
class=
"why"
>
</span>
</p>
<div
id=
"differentBag"
class=
"differentBag"
>
{
{#each
packages
}
}
<div
class=
"bag"
>
<h
3
>
{
{title
}
}
</h
3
>
<p
class=
"pre"
>
</p>
<div
class=
"bagDetil"
>
<ul>
{
{#each
goodlist
}
}
<li>
<a
href=
{
{link
}
}>
<img
src=
{
{src
}
}/>
</a>
{
{#if
goodsType
}
}
<p
class=
"{{classname}}"
>
{
{goodsType
}
}</p>
{
{/if
}
}
</li>
{
{/each
}
}
</ul>
</div>
<p
class=
"next"
>
</p>
{
{#if
fee
}
}
<p>运费:¥
{
{fee
}
}元(原价
{
{orign
}
}元,优惠
{
{count
}
}元)</p>
{
{else
}
}
<p>运费:¥
0.00
元</p>
{
{/if
}
}
</div>
{
{/each
}
}
</div>
</div>
{
{/if
}
}
<div
class=
"good-list"
>
<p
class=
"sub-title"
>
<span
class=
"icon"
></span>
商品清单
</p>
<div
class=
"content"
>
<table>
<thead>
<th
class=
"product-info"
>商品信息</th>
<th
class=
"good-price"
>单价(元)</th>
<th
class=
"yoho-coin"
>
返YOHO币
<a
target=
"_blank"
href=
"{{yohoCoinUrl}}"
></a>
</th>
<th
class=
"num"
>数量</th>
<th
class=
"sum"
>小计(元)</th>
</thead>
<tbody>
{
{#
goods
}
}
<tr>
<td>
<a
class=
"thumb-link"
href=
"{{url}}"
target=
"_blank"
>
<img
class=
"thumb"
src=
"{{img}}"
>
{
{>
home/order-goods-tags
}
}
</a>
<p
class=
"name-color-size"
>
<a
class=
"name"
href=
"{{url}}"
target=
"_blank"
>
{
{name
}
}</a>
{
{#if
color
}
}
颜色:
{
{color
}
}
{
{/if
}
}
{
{#if
size
}
}
尺码:
{
{size
}
}
{
{/if
}
}
{
{#if
date
}
}
日期:
{
{date
}
}
{
{/if
}
}
</p>
</td>
<td>
{
{price
}
}</td>
<td>
{
{coin
}
}</td>
<td>
{
{num
}
}</td>
<td>
{
{sum
}
}</td>
</tr>
{
{/
goods
}
}
</tbody>
</table>
<div
class=
"order-balance"
>
{
{#if
totalYoho
}
}
<p
class=
"back-coin"
>
<a
href=
"/help/?category_id=87"
class=
"yoho-coin"
target=
"_blank"
></a>共返YOHO币:
{
{totalYoho
}
}个
</p>
{
{/if
}
}
{
{#each
orderBalance
}
}
<p>
{
{promotion
}
}:
{
{#if
@first
}
}
<em>
{
{account
}
}</em>
{
{^
}
}
{
{#if
@last
}
}
<em
class=
"payment"
>
{
{account
}
}</em>
{
{^
}
}
{
{account
}
}
{
{/if
}
}
{
{/if
}
}
元
</p>
{
{/each
}
}
</div>
</div>
</div>
{
{#
operation
}
}
<div
class=
"order-operation clearfix"
>
{
{#if
paid
}
}
<p>
<span
class=
"success-icon oo-icon"
></span>
订单已支付
</p>
{
{/if
}
}
{
{#if
goPay
}
}
<a
class=
"go-pay oo-btn"
href=
"{{goPay}}"
target=
"_blank"
>立即付款</a>
{
{/if
}
}
{
{#if
cancelOrder
}
}
<span
class=
"cancel-order oo-btn"
>取消订单</span>
{
{/if
}
}
{
{#if
shipped
}
}
<span
id=
"receive-confirm"
class=
"confirm-received oo-btn"
>确认收货</span>
{
{/if
}
}
{
{#if
cancel
}
}
<p>
<span
class=
"cancel-icon oo-icon"
></span>
订单已取消
</p>
{
{/if
}
}
{
{#if
checkQrCode
}
}
<a
class=
"check-qrcode oo-btn"
href=
"{{checkQrCode}}"
target=
"_blank"
>查看二维码</a>
{
{/if
}
}
</div>
{
{/
operation
}
}
</div>
</div>
</div>
{
{/
meOrderDetail
}
}
{
{>
home/order-cancel-tpl
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
web-static/sass/home/_order-detail.css
View file @
e193115
.order-detail-page
{
font-size
:
12px
;
.order-detail
>
.title
{
background-image
:
resolve
(/
home
/
order-detail
.
png
);
}
.status
{
padding
:
10px
;
background
:
#efefef
;
border-bottom
:
1px
solid
#e6e6e6
;
p
{
margin
:
5px
0
;
line-height
:
18px
;
}
.cur-status
{
color
:
#e8044f
;
}
.complete-tip
{
color
:
#999
;
}
}
.detail-info
{
padding
:
10px
;
}
.sub-title
{
height
:
21px
;
line-height
:
21px
;
border
:
1px
solid
#e6e6e6
;
color
:
#333
;
background
:
#efefef
;
.icon
{
display
:
inline-block
;
height
:
11px
;
width
:
11px
;
background-image
:
resolve
(/
home
/
complaint-icon
.
png
);
margin
:
5px
5px
0
;
}
}
.content
{
padding
:
10px
20px
20px
;
p
{
line-height
:
18px
;
}
}
.order-progress
{
padding-top
:
20px
;
li
{
position
:
absolute
;
width
:
150px
;
line-height
:
15px
;
top
:
20px
;
}
.cur
{
color
:
#e9034e
;
font-weight
:
bold
;
}
.date
{
display
:
block
;
color
:
#999
;
padding-left
:
12px
;
}
}
.progress-box
{
position
:
relative
;
width
:
552px
;
height
:
70px
;
margin
:
0
auto
;
.pg-0
{
left
:
-20px
;
}
.pg-1
{
left
:
145px
;
}
.pg-2
{
left
:
330px
;
}
.pg-3
{
left
:
515px
;
}
}
/*虚拟商品订单*/
.virtual-detail
{
.pg-1
{
left
:
245px
;
}
.pg-2
{
left
:
515px
;
}
.outter-progress
{
background
:
resolve
(/
home
/
virtual-order-progress
.
png
)
no-repeat
0
0
;
}
.inner-progress
{
background
:
resolve
(/
home
/
virtual-order-progress
.
png
)
no-repeat
0
-12px
;
}
}
.outter-progress
{
width
:
552px
;
height
:
12px
;
background
:
resolve
(/
home
/
order-progress
.
png
)
no-repeat
0
0
;
}
.inner-progress
{
height
:
12px
;
background
:
resolve
(/
home
/
order-progress
.
png
)
no-repeat
0
-12px
;
}
.handle-time
{
width
:
300px
;
}
.recive-place
{
width
:
200px
;
}
.logistics-info
{
width
:
800px
;
}
.trace-order
td
,
.trace-order
th
{
line-height
:
18px
;
}
.good-list
{
table
{
border-collapse
:
collapse
;
}
thead
{
height
:
25px
;
line-height
:
25px
;
background
:
#000
;
padding
:
2px
5px
;
color
:
#fff
;
}
th
,
td
{
padding
:
5px
;
text-align
:
center
;
border-right
:
1px
solid
#e6e6e6
;
border-bottom
:
1px
solid
#e6e6e6
;
}
th
{
border-color
:
#000
;
}
tr
td
:last-child
,
tr
th
:last-child
{
border-right
:
none
;
}
.product-info
{
width
:
314px
;
}
.good-price
,
.num
,
.sum
{
width
:
91px
;
}
.yoho-coin
{
width
:
100px
;
a
{
$
img
:
/
home
/
coin-help
.
png
;
display
:
inline-block
;
width
:
width
(
$
img
);
height
:
height
(
$
img
);
background
:
url($img)
;
vertical-align
:
text-top
;
}
}
.thumb-link
{
float
:
left
;
position
:
relative
;
margin-left
:
5px
;
margin-right
:
10px
;
}
.thumb
{
display
:
block
;
width
:
60px
;
height
:
60px
;
}
.name-color-size
{
float
:
left
;
color
:
#999
;
padding-top
:
12px
;
text-align
:
left
;
}
.name
{
display
:
block
;
color
:
#468fa2
;
line-height
:
18px
;
text-align
:
left
;
max-width
:
230px
;
@mixin
ellipsis;
}
}
.order-balance
{
text-align
:
right
;
border-bottom
:
1px
solid
#e6e6e6
;
padding
:
10px
0
;
.back-coin
{
height
:
30px
;
}
.yoho-coin
{
width
:
14px
;
height
:
14px
;
display
:
inline-block
;
background
:
url(/cart/yoho-coin.png)
;
vertical-align
:
middle
;
margin-top
:
-2px
;
margin-right
:
4px
;
}
em
{
font-weight
:
bold
;
}
.payment
{
color
:
#e8044f
;
}
}
.oo-btn
{
display
:
inline-block
;
height
:
30px
;
width
:
92px
;
line-height
:
30px
;
text-align
:
center
;
border-radius
:
3px
;
color
:
#fff
;
cursor
:
pointer
;
}
.go-pay
{
background
:
#d9044a
;
border
:
1px
solid
#c54b73
;
}
.order-operation
{
text-align
:
right
;
padding
:
20px
10px
20px
;
.oo-icon
{
display
:
inline-block
;
height
:
22px
;
width
:
22px
;
vertical-align
:
text-bottom
;
}
.success-icon
{
background
:
url(/home/success-icon.png)
;
}
.cancel-icon
{
background
:
url(/home/cancel-icon.png)
;
}
.confirm-received
{
display
:
block
;
float
:
right
;
margin-top
:
5px
;
background
:
#d9044a
;
border
:
1px
solid
#c54b73
;
}
.cancel-order
{
background
:
#ebebeb
;
border
:
1px
solid
#c1c1c1
;
color
:
#000
;
}
}
}
\ No newline at end of file
.order-detail-page
{
font-size
:
12px
;
.order-detail
>
.title
{
background-image
:
resolve
(/
home
/
order-detail
.
png
);
}
.status
{
padding
:
10px
;
background
:
#efefef
;
border-bottom
:
1px
solid
#e6e6e6
;
p
{
margin
:
5px
0
;
line-height
:
18px
;
}
.cur-status
{
color
:
#e8044f
;
}
.complete-tip
{
color
:
#999
;
}
}
.detail-info
{
padding
:
10px
;
}
.sub-title
{
height
:
21px
;
line-height
:
21px
;
border
:
1px
solid
#e6e6e6
;
color
:
#333
;
background
:
#efefef
;
.icon
{
display
:
inline-block
;
height
:
11px
;
width
:
11px
;
background-image
:
resolve
(/
home
/
complaint-icon
.
png
);
margin
:
5px
5px
0
;
}
}
.content
{
padding
:
10px
20px
20px
;
p
{
line-height
:
18px
;
}
}
.order-progress
{
padding-top
:
20px
;
li
{
position
:
absolute
;
width
:
150px
;
line-height
:
15px
;
top
:
20px
;
}
.cur
{
color
:
#e9034e
;
font-weight
:
bold
;
}
.date
{
display
:
block
;
color
:
#999
;
padding-left
:
12px
;
}
}
.progress-box
{
position
:
relative
;
width
:
552px
;
height
:
70px
;
margin
:
0
auto
;
.pg-0
{
left
:
-20px
;
}
.pg-1
{
left
:
145px
;
}
.pg-2
{
left
:
330px
;
}
.pg-3
{
left
:
515px
;
}
}
/*虚拟商品订单*/
.virtual-detail
{
.pg-1
{
left
:
245px
;
}
.pg-2
{
left
:
515px
;
}
.outter-progress
{
background
:
resolve
(/
home
/
virtual-order-progress
.
png
)
no-repeat
0
0
;
}
.inner-progress
{
background
:
resolve
(/
home
/
virtual-order-progress
.
png
)
no-repeat
0
-12px
;
}
}
.outter-progress
{
width
:
552px
;
height
:
12px
;
background
:
resolve
(/
home
/
order-progress
.
png
)
no-repeat
0
0
;
}
.inner-progress
{
height
:
12px
;
background
:
resolve
(/
home
/
order-progress
.
png
)
no-repeat
0
-12px
;
}
.handle-time
{
width
:
300px
;
}
.recive-place
{
width
:
200px
;
}
.logistics-info
{
width
:
800px
;
}
.trace-order
td
,
.trace-order
th
{
line-height
:
18px
;
}
.differentOrder
{
position
:
relative
;
width
:
100%
;
.warn{
text-align
:
center
;
background
:
#FEFBD5
;
font
:
initial
;
height
:
40px
;
line-height
:
40px
;
font-size
:
16px
;
.red{
color
:
red
;
}
.why
{
background
:
url(/order/why.png)
no-repeat
;
width
:
26px
;
height
:
20px
;
display
:
inline-block
;
vertical-align
:
middle
;
}
.why
:hover
{
cursor
:
pointer
;
}
}
.differentBag
:before
{
content
:
""
;
position
:
absolute
;
width
:
0
;
height
:
0
;
border-bottom
:
10px
solid
#000000
;
border-left
:
10px
solid
transparent
;
border-right
:
10px
solid
transparent
;
top
:
-10px
;
right
:
115px
;
}
.differentBag
{
display
:
none
;
position
:
absolute
;
right
:
-10px
;
top
:
40px
;
width
:
510px
;
padding
:
0px
50px
;
background
:
#FFFFFF
;
z-index
:
1
;
border
:
solid
1px
#000000
;
font-size
:
14px
;
}
.bag
{
position
:
relative
;
border-bottom
:
solid
1px
#E0E0E0
;
margin-top
:
10px
;
padding
:
20px
0px
;
h3{
height
:
30px
;
line-height
:
30px
;
font-weight
:
bold
;
margin-left
:
15px
;
}
.pre
{
position
:
absolute
;
background
:
url(/order/pre.png)
no-repeat
;
width
:
30px
;
height
:
50px
;
left
:
-30px
;
top
:
70px
;
display
:
none
;
cursor
:
pointer
;
}
.next
{
position
:
absolute
;
background
:
url(/order/next.png)
no-repeat
;
width
:
30px
;
height
:
50px
;
right
:
-30px
;
top
:
70px
;
display
:
none
;
cursor
:
pointer
;
}
p
{
color
:
#767676
;
margin-left
:
15px
;
}
}
.bagDetil
{
position
:
relative
;
height
:
90px
;
width
:
510px
;
overflow
:
hidden
;
margin-bottom
:
20px
;
ul{
list-style
:
none
;
position
:
absolute
;
left
:
0
;
clear
:
both
;
height
:
90px
;
li{
float
:
left
;
width
:
102px
;
height
:
90px
;
line-height
:
90px
;
text-align
:
center
;
position
:
relative
;
img{
width
:
90px
;
height
:
90px
;
}
p
{
position
:
absolute
;
bottom
:
0
;
background
:
#9c3
;
width
:
90px
;
height
:
1rem
;
line-height
:
1rem
;
color
:
#FFFFFF
;
margin-left
:
7px
;
}
a
{
cursor
:
default
;
}
a
:hover
{
cursor
:
default
;
}
}
}
}
}
.good-list
{
table
{
border-collapse
:
collapse
;
}
thead
{
height
:
25px
;
line-height
:
25px
;
background
:
#000
;
padding
:
2px
5px
;
color
:
#fff
;
}
th
,
td
{
padding
:
5px
;
text-align
:
center
;
border-right
:
1px
solid
#e6e6e6
;
border-bottom
:
1px
solid
#e6e6e6
;
}
th
{
border-color
:
#000
;
}
tr
td
:last-child
,
tr
th
:last-child
{
border-right
:
none
;
}
.product-info
{
width
:
314px
;
}
.good-price
,
.num
,
.sum
{
width
:
91px
;
}
.yoho-coin
{
width
:
100px
;
a
{
$
img
:
/
home
/
coin-help
.
png
;
display
:
inline-block
;
width
:
width
(
$
img
);
height
:
height
(
$
img
);
background
:
url($img)
;
vertical-align
:
text-top
;
}
}
.thumb-link
{
float
:
left
;
position
:
relative
;
margin-left
:
5px
;
margin-right
:
10px
;
}
.thumb
{
display
:
block
;
width
:
60px
;
height
:
60px
;
}
.name-color-size
{
float
:
left
;
color
:
#999
;
padding-top
:
12px
;
text-align
:
left
;
}
.name
{
display
:
block
;
color
:
#468fa2
;
line-height
:
18px
;
text-align
:
left
;
max-width
:
230px
;
@mixin
ellipsis;
}
}
.order-balance
{
text-align
:
right
;
border-bottom
:
1px
solid
#e6e6e6
;
padding
:
10px
0
;
.back-coin
{
height
:
30px
;
}
.yoho-coin
{
width
:
14px
;
height
:
14px
;
display
:
inline-block
;
background
:
url(/cart/yoho-coin.png)
;
vertical-align
:
middle
;
margin-top
:
-2px
;
margin-right
:
4px
;
}
em
{
font-weight
:
bold
;
}
.payment
{
color
:
#e8044f
;
}
}
.oo-btn
{
display
:
inline-block
;
height
:
30px
;
width
:
92px
;
line-height
:
30px
;
text-align
:
center
;
border-radius
:
3px
;
color
:
#fff
;
cursor
:
pointer
;
}
.go-pay
{
background
:
#d9044a
;
border
:
1px
solid
#c54b73
;
}
.order-operation
{
text-align
:
right
;
padding
:
20px
10px
20px
;
.oo-icon
{
display
:
inline-block
;
height
:
22px
;
width
:
22px
;
vertical-align
:
text-bottom
;
}
.success-icon
{
background
:
url(/home/success-icon.png)
;
}
.cancel-icon
{
background
:
url(/home/cancel-icon.png)
;
}
.confirm-received
{
display
:
block
;
float
:
right
;
margin-top
:
5px
;
background
:
#d9044a
;
border
:
1px
solid
#c54b73
;
}
.cancel-order
{
background
:
#ebebeb
;
border
:
1px
solid
#c1c1c1
;
color
:
#000
;
}
}
.freebie-tag
{
background
:
#9c3
;
}
.advance-buy-tag
{
background
:
#fc1264
;
}
.virtual-good-tag
{
background
:
red
;
}
.presall-tag
{
background
:
blue
;
}
}
...
...
yohobuy/www.yohobuy.com/application/models/Home/Order.php
View file @
e193115
<?php
namespace
Home
;
use
LibModels\Web\Home\OrderData
;
use
Configs\ChannelConfig
;
use
WebPlugin\Helpers
;
use
WebPlugin\Images
;
/**
* 个人中心-我的订单逻辑处理
*/
class
OrderModel
{
/**
* 获取我的订单列表数据-分页
* @param type $uid
* @param type $page
* @param type $limit
* @param type $type 获取订单类型 type=1全部,type=2待付款,type=3待发货,type=4待收货,type=5待评论(已成功) 7取消
*/
public
static
function
getOrders
(
$uid
,
$page
,
$limit
,
$type
,
$isPage
=
FALSE
)
{
$orders
=
array
();
$orderInfo
=
OrderData
::
getUserOrders
(
$uid
,
$page
,
$limit
,
$type
);
if
(
isset
(
$orderInfo
[
'data'
][
'order_list'
])
&&
$orderInfo
[
'data'
][
'order_list'
])
{
foreach
(
$orderInfo
[
'data'
][
'order_list'
]
as
$orderK
=>
$orderV
)
{
$orders
[
$orderK
][
'orderNum'
]
=
$orderV
[
'order_code'
];
//订单标识
$orders
[
$orderK
][
'orderTime'
]
=
date
(
"Y-m-d H:i:s"
,
$orderV
[
'create_time'
]);
//下单时间
$statusInfo
=
self
::
getOrderStatus
(
$orderV
[
'is_cancel'
],
$orderV
[
'status'
],
$orderV
[
'payment_type'
],
$orderV
[
'payment_status'
]);
//订单状态
if
(
$statusInfo
[
'cancel'
])
{
$orders
[
$orderK
][
'cancel'
]
=
$statusInfo
[
'cancel'
];
}
else
{
if
(
!
empty
(
$statusInfo
[
'keyName'
]))
{
$orders
[
$orderK
][
$statusInfo
[
'keyName'
]]
=
TRUE
;
//已发货,物流信息
if
(
$statusInfo
[
'keyName'
]
==
'shipped'
)
{
$expressInfo
=
self
::
getExpressInfo
(
$orderV
[
'order_code'
],
$uid
,
$orderV
[
'payment_type'
],
$orderV
[
'create_time'
]);
$orders
[
$orderK
][
'logistics'
]
=
$expressInfo
[
'logistics'
];
}
}
}
//订单商品相关信息
$opRefundStatus
=
true
;
//订单不可操作退换货
if
(
isset
(
$orderV
[
'order_goods'
])
&&
$orderV
[
'order_goods'
])
{
$goods
=
array
();
$refundFlag
=
array
();
foreach
(
$orderV
[
'order_goods'
]
as
$gokey
=>
$goval
)
{
$goods
[
$gokey
][
'href'
]
=
Helpers
::
getUrlBySkc
(
$goval
[
'product_id'
],
$goval
[
'goods_id'
],
$goval
[
'cn_alphabet'
]);
$goods
[
$gokey
][
'thumb'
]
=
(
isset
(
$goval
[
'goods_image'
])
&&
$goval
[
'goods_image'
])
?
Images
::
getImageUrl
(
$goval
[
'goods_image'
],
100
,
100
)
:
''
;
$goods
[
$gokey
][
'name'
]
=
$goval
[
'product_name'
];
$goods
[
$gokey
][
'color'
]
=
$goval
[
'color_name'
];
$goods
[
$gokey
][
'size'
]
=
$goval
[
'size_name'
];
$goods
[
$gokey
][
'price'
]
=
$goval
[
'goods_price'
];
$buyNum
=
intval
(
$goval
[
'buy_number'
]);
$refundNum
=
intval
(
$goval
[
'refund_num'
]);
$goods
[
$gokey
][
'count'
]
=
$buyNum
;
$refundStatus
=
(
$refundNum
>
0
)
?
true
:
false
;
//只要发生一件退换,退换过的标记
$goods
[
$gokey
][
'refundStatus'
]
=
$refundStatus
;
$refundFlag
[]
=
((
$buyNum
==
$refundNum
)
&&
$refundNum
>
0
)
?
'finished'
:
'unfinished'
;
//某一件商品全部退换结束
$goods
[
$gokey
][
'arrivalDate'
]
=
$goval
[
'expect_arrival_time'
];
$goodsTagName
=
self
::
getGoodsTag
(
$orderV
[
'attribute'
],
$goval
[
'goods_type'
]);
if
(
$goodsTagName
)
{
$goods
[
$gokey
][
$goodsTagName
]
=
TRUE
;
}
$orders
[
$orderK
][
'goods'
]
=
$goods
;
}
if
(
in_array
(
'unfinished'
,
$refundFlag
))
{
$opRefundStatus
=
false
;
}
$orders
[
$orderK
][
'pay'
]
=
$orderV
[
'amount'
];
//付款数
$orders
[
$orderK
][
'fregit'
]
=
$orderV
[
'shipping_cost'
];
//邮费
}
//操作
$orders
[
$orderK
][
'operation'
]
=
self
::
getOperateInfo
(
$orderV
[
'attribute'
],
$orderV
[
'is_cancel'
],
$orderV
[
'status'
],
$orderV
[
'payment_status'
],
$orderV
[
'update_time'
],
$orderV
[
'order_type'
],
$orderV
[
'refund_status'
],
$orderV
[
'payment_type'
],
$orderV
[
'order_code'
],
$opRefundStatus
);
}
if
(
$isPage
)
{
$orders
[
'pager'
][
'total'
]
=
$orderInfo
[
'data'
][
'total'
];
$orders
[
'pager'
][
'pageTotal'
]
=
$orderInfo
[
'data'
][
'page_total'
];
$orders
[
'pager'
][
'page'
]
=
$orderInfo
[
'data'
][
'page'
];
}
}
else
{
$descStr
=
self
::
getOrderDescStr
(
$type
);
$orders
=
array
(
'empty'
=>
$descStr
);
}
return
$orders
;
}
/**
* 我的订单-tabs
* @param type $type
* @return boolean
*/
public
static
function
getOrderTabs
(
$type
)
{
$tabs
=
array
(
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
1
)),
'name'
=>
'现有订单'
),
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
5
)),
'name'
=>
'成功订单'
),
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
7
)),
'name'
=>
'已取消订单'
),
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
8
)),
'name'
=>
'历史订单'
)
);
switch
(
$type
)
{
case
1
:
$tabs
[
0
][
'active'
]
=
true
;
break
;
case
5
:
$tabs
[
1
][
'active'
]
=
true
;
break
;
case
7
:
$tabs
[
2
][
'active'
]
=
true
;
break
;
case
8
:
$tabs
[
3
][
'active'
]
=
true
;
break
;
default
:
$tabs
[
0
][
'active'
]
=
true
;
break
;
}
return
$tabs
;
}
/**
* 详情页
* @param type $orderCode
*/
public
static
function
getOrderDetail
(
$uid
,
$orderCode
)
{
$detail
=
array
();
$orderInfo
=
OrderData
::
getOrderDetail
(
$uid
,
$orderCode
);
//不属于这个人订单,跳转个人中心首页
if
(
isset
(
$orderInfo
[
'code'
])
&&
$orderInfo
[
'code'
]
==
400
)
{
return
$orderInfo
;
}
if
(
isset
(
$orderInfo
[
'data'
])
&&
$orderInfo
[
'data'
])
{
$orderDetail
=
$orderInfo
[
'data'
];
$detail
[
'orderNum'
]
=
$orderDetail
[
'order_code'
];
//订单状态
$statusInfo
=
self
::
getOrderStatus
(
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'status'
],
$orderDetail
[
'payment_type'
],
$orderDetail
[
'payment_status'
]);
$detail
[
'statusStr'
]
=
$statusInfo
[
'statusStr'
];
//订单是否已完成
$detail
[
'complete'
]
=
false
;
if
(
$orderDetail
[
'status'
]
==
6
)
{
$detail
[
'complete'
]
=
true
;
}
//进度条
if
(
$statusInfo
[
'cancel'
])
{
$detail
[
'progress'
]
=
false
;
}
else
{
//未取消订单,进度
if
(
$orderDetail
[
'attribute'
]
==
3
)
{
$detail
[
'progress'
]
=
self
::
getVirtualPro
(
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'status'
],
$orderDetail
[
'create_time'
]);
}
else
{
$detail
[
'progress'
]
=
self
::
getNormalPro
(
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'status'
],
$orderDetail
[
'create_time'
]);
}
}
//物流信息
$detail
[
'traceOrder'
][
'orderDate'
]
=
date
(
'Y.m.d H:i:s'
,
$orderDetail
[
'create_time'
]);
$expressInfo
=
self
::
getExpressInfo
(
$orderCode
,
$uid
,
$orderDetail
[
'payment_type'
],
$orderDetail
[
'create_time'
],
true
);
$detail
[
'traceOrder'
][
'logistics'
]
=
$expressInfo
[
'logistics'
];
//物流信息
$detail
[
'traceOrder'
][
'logisticsCompany'
]
=
$expressInfo
[
'logisticsCompany'
];
$detail
[
'traceOrder'
][
'courierNumbe'
]
=
$expressInfo
[
'courierNumbe'
];
//虚拟商品
if
(
$orderDetail
[
'attribute'
]
==
3
)
{
$detail
[
'virtualGoods'
]
=
TRUE
;
$detail
[
'virtualPayMode'
][
'payMode'
]
=
ChannelConfig
::
$payType
[
$orderDetail
[
'payment_type'
]];
$detail
[
'virtualPayMode'
][
'phone'
]
=
substr_replace
(
$orderDetail
[
'mobile'
],
'****'
,
3
,
4
);
}
else
{
$detail
[
'virtualGoods'
]
=
FALSE
;
$detail
[
'noramlPayMode'
][
'payMode'
]
=
ChannelConfig
::
$payType
[
$orderDetail
[
'payment_type'
]];
$detail
[
'noramlPayMode'
][
'payWay'
]
=
$orderDetail
[
'payment_name'
];
$detail
[
'noramlPayMode'
][
'deliverTime'
]
=
(
isset
(
$orderDetail
[
'delivery_time'
]))
?
$orderDetail
[
'delivery_time'
]
:
''
;
//配送信息
$detail
[
'orderInfo'
][
'receiver'
]
=
$orderDetail
[
'user_name'
];
$detail
[
'orderInfo'
][
'address'
]
=
$orderDetail
[
'area'
]
.
$orderDetail
[
'address'
];
$detail
[
'orderInfo'
][
'phone'
]
=
substr_replace
(
$orderDetail
[
'mobile'
],
'****'
,
3
,
4
)
.
(
!
empty
(
$orderDetail
[
'phone'
])
?
','
.
substr_replace
(
$orderDetail
[
'phone'
],
'****'
,
3
,
5
)
:
''
);
}
//商品信息
if
(
$orderDetail
[
'order_goods'
])
{
foreach
(
$orderDetail
[
'order_goods'
]
as
$gok
=>
$gov
)
{
$detail
[
'goods'
][
$gok
][
'url'
]
=
Helpers
::
getUrlBySkc
(
$gov
[
'product_id'
],
$gov
[
'goods_id'
],
$gov
[
'cn_alphabet'
]);
$detail
[
'goods'
][
$gok
][
'img'
]
=
Images
::
getImageUrl
(
$gov
[
'goods_image'
],
60
,
60
);
$detail
[
'goods'
][
$gok
][
'name'
]
=
$gov
[
'product_name'
];
$detail
[
'goods'
][
$gok
][
'color'
]
=
$gov
[
'color_name'
];
$detail
[
'goods'
][
$gok
][
'size'
]
=
$gov
[
'size_name'
];
$detail
[
'goods'
][
$gok
][
'price'
]
=
$gov
[
'goods_price'
];
$detail
[
'goods'
][
$gok
][
'coin'
]
=
$gov
[
'yoho_give_coin'
];
$detail
[
'goods'
][
$gok
][
'num'
]
=
$gov
[
'buy_number'
];
$detail
[
'goods'
][
$gok
][
'sum'
]
=
$gov
[
'goods_amount'
];
$detail
[
'goods'
][
$gok
][
'sku'
]
=
$gov
[
'product_sku'
];
$goodsTagName
=
self
::
getGoodsTag
(
$orderDetail
[
'attribute'
],
$gov
[
'goods_type'
]);
if
(
$goodsTagName
)
{
$detail
[
'goods'
][
$gok
][
$goodsTagName
]
=
TRUE
;
}
}
}
//详情页-订单付费详情
if
(
isset
(
$orderDetail
[
'promotion_formulas'
])
&&
$orderDetail
[
'promotion_formulas'
])
{
foreach
(
$orderDetail
[
'promotion_formulas'
]
as
$pricek
=>
$pricev
)
{
$detail
[
'orderBalance'
][
$pricek
]
=
array
(
'promotion'
=>
$pricev
[
'promotion'
],
'account'
=>
$pricev
[
'promotion_amount'
]);
}
$detail
[
'orderBalance'
][]
=
array
(
'promotion'
=>
'实际应支付'
,
'account'
=>
$orderDetail
[
'amount'
]);
}
$detail
[
'yohoCoinUrl'
]
=
Helpers
::
url
(
'/help'
,
array
(
'category_id'
=>
87
));
//什么是yoho币介绍
$detail
[
'remark'
]
=
$orderDetail
[
'remark'
];
$detail
[
'operation'
]
=
self
::
getOrderDetailOp
(
$orderDetail
[
'order_code'
],
$orderDetail
[
'payment'
],
$orderDetail
[
'status'
],
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'payment_status'
],
$orderDetail
[
'payment_type'
],
$orderDetail
[
'order_type'
],
$orderDetail
[
'attribute'
],
$orderDetail
[
'refund_status'
]);
//,$orderDetail['order_type_value']
}
return
$detail
;
}
/**
* 获取历史订单
* @param type $uid
* @param type $page
* @param type $limit
* @return type
*/
public
static
function
getHistoryOrders
(
$uid
,
$page
,
$limit
)
{
$historyOrders
=
array
();
$orderInfo
=
OrderData
::
getHistoryOrders
(
$uid
,
$page
,
$limit
);
if
(
isset
(
$orderInfo
[
'data'
][
'list'
])
&&
$orderInfo
[
'data'
][
'list'
])
{
foreach
(
$orderInfo
[
'data'
][
'list'
]
as
$hok
=>
$hov
)
{
$historyOrders
[
$hok
][
'orderNum'
]
=
$hov
[
'order_code'
];
$historyOrders
[
$hok
][
'orderTime'
]
=
date
(
'Y/m/d H:i:s'
,
$hov
[
'order_time'
]);
$historyOrders
[
$hok
][
'goods'
]
=
json_decode
(
$hov
[
'goods_data'
],
true
);
$historyOrders
[
$hok
][
'orderSum'
]
=
$hov
[
'amount'
];
$historyOrders
[
$hok
][
'payMode'
]
=
$hov
[
'payment'
];
}
$historyOrders
[
'pager'
][
'total'
]
=
$orderInfo
[
'data'
][
'total'
];
$historyOrders
[
'pager'
][
'pageTotal'
]
=
$orderInfo
[
'data'
][
'total_page'
];
$historyOrders
[
'pager'
][
'page'
]
=
$orderInfo
[
'data'
][
'page'
];
}
else
{
$historyOrders
=
array
(
'empty'
=>
'您没有历史订单'
);
}
return
$historyOrders
;
}
public
static
function
getTicketsInfo
(
$orderCode
)
{
$ret
=
array
();
$ticketInfo
=
OrderData
::
getTicketCode
(
$orderCode
);
$tickets
=
$ticketInfo
[
'data'
][
'ticks'
];
if
(
isset
(
$tickets
)
&&
$tickets
)
{
foreach
(
$tickets
as
$tk
=>
$tv
)
{
$ret
[
$tk
][
'img'
]
=
self
::
getTicketImgs
(
'ticket'
,
$tv
[
'ticket_code'
],
1
,
9
,
1
);
$ret
[
$tk
][
'desc'
]
=
$tv
[
'ticket_code'
];
}
}
return
$ret
;
}
/**
* 获取虚拟商品二维码图片
* @param type $type
* @param type $dataStr
* @param type $version
* @param type $boxSize
* @param type $border
* @param type $color
* @return type
*/
protected
static
function
getTicketImgs
(
$type
,
$dataStr
,
$version
=
1
,
$boxSize
=
4
,
$border
=
1
,
$color
=
1
)
{
$data
=
$type
.
'-'
.
$dataStr
;
$nodeNum
=
sprintf
(
'%u'
,
crc32
(
$data
))
%
count
(
ChannelConfig
::
$newImageServerUrl
);
$filePath
=
abs
(
crc32
(
$data
))
%
20000
;
$pathData
=
array
(
$data
,
$version
,
$boxSize
,
$border
,
$color
);
return
ChannelConfig
::
$newImageServerUrl
[
$nodeNum
]
.
'/yohood/'
.
$filePath
.
'/'
.
implode
(
'-'
,
$pathData
)
.
'.jpg'
;
}
/**
* 订单详情页物流
*
*/
protected
static
function
getExpressInfo
(
$orderCode
,
$uid
,
$paymetType
,
$createTime
,
$isDetail
=
false
)
{
$result
[
'logisticsUrl'
]
=
''
;
$result
[
'logisticsImg'
]
=
''
;
$result
[
'logisticsCompany'
]
=
''
;
$result
[
'courierNumbe'
]
=
''
;
if
(
$paymetType
==
1
)
{
if
(
$isDetail
)
{
$result
[
'logistics'
][]
=
array
(
date
(
'Y-m-d H:i:s'
,
$createTime
),
' '
,
'您的订单已提交,等待付款'
);
}
else
{
$result
[
'logistics'
][]
=
date
(
'Y-m-d H:i:s'
,
$createTime
)
.
' '
.
'您的订单已提交,等待付款'
;
}
}
if
(
$paymetType
==
2
)
{
if
(
$isDetail
)
{
$result
[
'logistics'
][]
=
array
(
date
(
'Y-m-d H:i:s'
,
$createTime
),
' '
,
'您的订单已提交,等待审核'
);
}
else
{
$result
[
'logistics'
][]
=
date
(
'Y-m-d H:i:s'
,
$createTime
)
.
' '
.
'您的订单已提交,等待审核'
;
}
}
//有物流
if
(
isset
(
$orderCode
)
&&
is_numeric
(
$uid
))
{
$logistics
=
OrderData
::
getLogisticsData
(
$orderCode
,
$uid
);
if
(
isset
(
$logistics
[
'data'
])
&&
$logistics
[
'data'
])
{
$result
[
'logisticsUrl'
]
=
isset
(
$logistics
[
'data'
][
'url'
])
?
$logistics
[
'data'
][
'url'
]
:
''
;
$result
[
'logisticsImg'
]
=
isset
(
$logistics
[
'data'
][
'logo'
])
?
$logistics
[
'data'
][
'logo'
]
:
''
;
$result
[
'logisticsCompany'
]
=
isset
(
$logistics
[
'data'
][
'caption'
])
?
$logistics
[
'data'
][
'caption'
]
:
''
;
$result
[
'courierNumbe'
]
=
isset
(
$logistics
[
'data'
][
'express_number'
])
?
$logistics
[
'data'
][
'express_number'
]
:
''
;
$expressDetail
=
isset
(
$logistics
[
'data'
][
'express_detail'
])
?
$logistics
[
'data'
][
'express_detail'
]
:
array
();
if
(
isset
(
$expressDetail
)
&&
$expressDetail
)
{
foreach
(
$expressDetail
as
$value
)
{
$pos
=
stripos
(
$value
[
'accept_address'
],
' '
)
/
3
;
$city
=
mb_substr
(
$value
[
'accept_address'
],
0
,
$pos
,
'utf-8'
);
$exInfo
=
mb_substr
(
$value
[
'accept_address'
],
$pos
,
null
,
'utf-8'
);
if
(
$isDetail
)
{
$result
[
'logistics'
][]
=
array
(
$value
[
'acceptTime'
],
$city
,
$exInfo
);
}
else
{
$result
[
'logistics'
][]
=
$value
[
'acceptTime'
]
.
$city
.
$exInfo
;
}
}
}
}
}
return
$result
;
}
/**
* 订单详情页操作步骤
*/
protected
static
function
getOrderDetailOp
(
$orderCode
,
$payment
,
$status
,
$isCancel
,
$paymentStatus
,
$paymentType
,
$orderType
,
$attribute
,
$refundStatus
)
{
$operation
=
array
();
//立刻付款
if
(
$paymentType
==
1
&&
$paymentStatus
==
'N'
&&
$isCancel
==
'N'
&&
isset
(
$payment
)
&&
$payment
!=
19
)
{
$operation
+=
array
(
'goPay'
=>
Helpers
::
url
(
'/shopping/pay'
,
array
(
'ordercode'
=>
$orderCode
)));
}
//取消订单
if
(
$status
<
3
&&
$isCancel
==
'N'
&&
$paymentStatus
==
'N'
&&
$orderType
!=
5
)
{
$operation
+=
array
(
'cancelOrder'
=>
TRUE
);
}
//订单已支付
if
(
$paymentType
==
1
&&
$paymentStatus
==
'Y'
&&
$status
<
6
)
{
$operation
+=
array
(
'paid'
=>
TRUE
);
}
//确认收货
if
(
$status
>=
4
&&
$status
<
6
&&
$refundStatus
==
0
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
+=
array
(
'shipped'
=>
TRUE
);
}
//订单已取消
if
(
$isCancel
==
'Y'
)
{
$operation
+=
array
(
'cancel'
=>
TRUE
);
}
//虚拟查看二维码
if
(
$attribute
==
3
)
{
$operation
+=
array
(
'checkQrCode'
=>
Helpers
::
url
(
'/home/orders/ticket'
,
array
(
'orderCode'
=>
$orderCode
)));
}
return
$operation
;
}
/**
* 详情页进度条-普通商品
* @param type $isCancel
* @param type $status
* @param type $createTime
* @return boolean
*/
protected
static
function
getNormalPro
(
$isCancel
,
$status
,
$createTime
)
{
$process
[
'middleStatus'
]
=
array
(
array
(
'name'
=>
'1. 提交订单'
,
'date'
=>
date
(
'Y.m.d H:i:s'
,
$createTime
),
),
array
(
'name'
=>
'2. 商品出库'
),
array
(
'name'
=>
'3. 等待收货'
),
array
(
'name'
=>
'4. 交易完成'
)
);
//订单已取消
if
(
$isCancel
==
'N'
)
{
if
(
$status
==
0
)
{
$process
[
'percent'
]
=
'25%'
;
$process
[
'middleStatus'
][
0
][
'cur'
]
=
TRUE
;
}
else
if
(
$status
>
0
&&
$status
<
4
)
{
$process
[
'percent'
]
=
'50%'
;
$process
[
'middleStatus'
][
1
][
'cur'
]
=
TRUE
;
}
else
if
(
$status
>=
4
&&
$status
<
6
)
{
$process
[
'percent'
]
=
'75%'
;
$process
[
'middleStatus'
][
2
][
'cur'
]
=
TRUE
;
}
elseif
(
$status
==
6
)
{
$process
[
'percent'
]
=
'100%'
;
$process
[
'middleStatus'
][
3
][
'cur'
]
=
TRUE
;
}
}
return
$process
;
}
/**
* 详情页进度条-虚拟商品
* @param type $isCancel
* @param type $status
* @param type $createTime
* @return boolean
*/
protected
static
function
getVirtualPro
(
$isCancel
,
$status
,
$createTime
)
{
$process
[
'middleStatus'
]
=
array
(
array
(
'name'
=>
'1. 提交订单'
,
'date'
=>
date
(
'Y.m.d H:i:s'
,
$createTime
),
),
array
(
'name'
=>
'2. 已发货'
),
array
(
'name'
=>
'3. 交易完成'
)
);
//订单已取消
if
(
$isCancel
==
'N'
)
{
if
(
$status
==
0
)
{
$process
[
'percent'
]
=
'30%'
;
$process
[
'middleStatus'
][
0
][
'cur'
]
=
TRUE
;
}
else
if
(
$status
>
0
&&
$status
<
6
)
{
$process
[
'percent'
]
=
'80%'
;
$process
[
'middleStatus'
][
1
][
'cur'
]
=
TRUE
;
}
elseif
(
$status
==
6
)
{
$process
[
'percent'
]
=
'100%'
;
$process
[
'middleStatus'
][
3
][
'cur'
]
=
TRUE
;
}
}
return
$process
;
}
/**
* 订单状态
* @param type $isCancel
* @param type $status
* @param type $payType
* @param type $payStatus
* @return string
*/
protected
static
function
getOrderStatus
(
$isCancel
,
$status
,
$payType
,
$payStatus
)
{
//初始化:未取消,待付款
$ret
=
array
(
'cancel'
=>
FALSE
,
'keyName'
=>
'noPay'
,
'statusStr'
=>
'订单已成功,等待付款'
);
//订单已取消
if
(
$isCancel
==
'Y'
)
{
$ret
=
array
(
'cancel'
=>
TRUE
,
'statusStr'
=>
'订单已取消'
);
}
else
{
switch
(
$status
)
{
case
0
:
//'订单已成功,等待付款'
if
(
$payType
!=
2
&&
$payStatus
==
'N'
)
{
$ret
[
'keyName'
]
=
'noPay'
;
$ret
[
'statusStr'
]
=
'订单已成功,等待付款'
;
}
//'订单已付款,等待备货中'
elseif
(
$payType
!=
2
&&
$payStatus
==
'Y'
)
{
$ret
[
'keyName'
]
=
'paid'
;
$ret
[
'statusStr'
]
=
'订单已付款,等待备货中'
;
}
//'订单已成功,等待备货中'-货到付款
elseif
(
$payType
==
2
&&
$payStatus
==
'N'
)
{
$ret
[
'keyName'
]
=
'complete'
;
$ret
[
'statusStr'
]
=
'订单已成功,等待备货中'
;
}
break
;
case
1
:
case
2
:
case
3
:
//'订单已付款,等待备货中'
$ret
[
'keyName'
]
=
'paid'
;
$ret
[
'statusStr'
]
=
'订单已付款,等待备货中'
;
break
;
case
4
:
case
5
:
//'订单已发货'
$ret
[
'keyName'
]
=
'shipped'
;
$ret
[
'statusStr'
]
=
'订单已发货'
;
break
;
case
6
:
//'交易完成';
$ret
[
'keyName'
]
=
'reback'
;
$ret
[
'statusStr'
]
=
'交易完成'
;
break
;
}
}
return
$ret
;
}
/**
* 操作栏
* @param type $attribute 订单属性
* @param type $isCancel 是否取消
* @param type $status 订单状态
* @param type $payStatus 付款状态
* @param type $updateTime 更新时间
* @param type $orderType 订单类型
* @param type $refundStatus 是否退换
* @param type $paymentType 付款类型
* @param type $orderCode 订单号
* @param type $opRefundStatus 退换操作是否灰化 true 灰化 false 可用
* @return string
*/
protected
static
function
getOperateInfo
(
$attribute
,
$isCancel
,
$status
,
$payStatus
,
$updateTime
,
$orderType
,
$refundStatus
,
$paymentType
,
$orderCode
,
$opRefundStatus
)
{
//查看订单
$orderDetailUrl
=
Helpers
::
url
(
'/home/orders/detail'
,
array
(
'orderCode'
=>
$orderCode
));
//查看二维码
$ticketUrl
=
Helpers
::
url
(
'/home/orders/tickets'
,
array
(
'orderCode'
=>
$orderCode
));
//立即付款
$payUrl
=
Helpers
::
url
(
'/shopping/pay'
,
array
(
'ordercode'
=>
$orderCode
));
//取消订单
$cancelOrderUrl
=
'javascript:void(0)'
;
//确认订单
$confirmOrderUrl
=
'javascript:void(0)'
;
//申请换货
$exchangeUrl
=
Helpers
::
url
(
'/home/returns/exchangeRequest'
,
array
(
'orderCode'
=>
$orderCode
));
//申请退货
$refundUrl
=
Helpers
::
url
(
'/home/returns/refundrequest'
,
array
(
'orderCode'
=>
$orderCode
));
//立即付款
if
(
$payStatus
==
'N'
&&
$paymentType
!=
2
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'payNow'
=>
true
,
'href'
=>
$payUrl
);
}
$operation
[]
=
array
(
'href'
=>
$orderDetailUrl
,
'name'
=>
'查看订单'
);
//查看订单,虚拟订单查看二维码
if
(
$attribute
==
3
)
{
if
(
$payStatus
==
'Y'
)
{
$operation
[]
=
array
(
'href'
=>
$ticketUrl
,
'name'
=>
'查看二维码'
);
}
}
//取消订单
if
(
$status
<
3
&&
$isCancel
==
'N'
&&
$orderType
!=
5
&&
$payStatus
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$cancelOrderUrl
,
'name'
=>
'取消订单'
,
'cancelOrder'
=>
true
);
}
//确认收货
if
(
$status
>=
4
&&
$status
<
6
&&
$refundStatus
==
0
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$confirmOrderUrl
,
'name'
=>
'确认收货'
,
'confirmReceived'
=>
true
);
}
//换货
$time
=
(
time
()
-
$updateTime
);
$orderExchangeLimitTime
=
ChannelConfig
::
$exchangeDay
;
if
(
$status
>=
6
&&
$time
<
86400
*
$orderExchangeLimitTime
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$exchangeUrl
,
'name'
=>
'申请换货'
,
'optDis'
=>
$opRefundStatus
);
}
//退货
$orderRefundLimitTime
=
ChannelConfig
::
$refundDay
;
if
(
$status
>=
6
&&
$time
<
86400
*
$orderRefundLimitTime
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$refundUrl
,
'name'
=>
'申请退货'
,
'optDis'
=>
$opRefundStatus
);
}
return
$operation
;
}
/**
* 商品属性标签
* @param type $attribute
* @param type $goodsType
* @return string
*/
protected
static
function
getGoodsTag
(
$attribute
,
$goodsType
)
{
$goodsTagName
=
''
;
switch
(
$goodsType
)
{
//赠品
case
'gift'
:
$goodsTagName
=
'freebie'
;
break
;
//加价购
case
'price_gift'
:
$goodsTagName
=
'advanceBuy'
;
break
;
//预售
case
'advance'
:
$goodsTagName
=
'preSaleGood'
;
break
;
//outlet
case
'outlet'
:
$goodsTagName
=
''
;
break
;
//免单
case
'free'
:
$goodsTagName
=
''
;
break
;
//电子
case
'ticket'
:
$goodsTagName
=
''
;
break
;
default
:
break
;
}
//虚拟
if
(
$attribute
==
3
)
{
$goodsTagName
=
'virtualGood'
;
}
return
$goodsTagName
;
}
/**
* 空订单数据提示
* @param type $type
* @return string
*/
protected
static
function
getOrderDescStr
(
$type
)
{
switch
(
$type
)
{
case
1
:
$str
=
'您还没有任何订单'
;
break
;
case
5
:
$str
=
'您目前还没有成功的订单'
;
break
;
case
7
:
$str
=
'您还没有任何取消的订单'
;
break
;
default
:
$str
=
''
;
break
;
}
return
$str
;
}
}
<?php
namespace
Home
;
use
LibModels\Web\Home\OrderData
;
use
Shopping\CartModel
;
use
Configs\ChannelConfig
;
use
LibModels\Web\Product\ItemData
;
use
WebPlugin\Helpers
;
use
WebPlugin\Images
;
/**
* 个人中心-我的订单逻辑处理
*/
class
OrderModel
{
/**
* 获取我的订单列表数据-分页
* @param type $uid
* @param type $page
* @param type $limit
* @param type $type 获取订单类型 type=1全部,type=2待付款,type=3待发货,type=4待收货,type=5待评论(已成功) 7取消
*/
public
static
function
getOrders
(
$uid
,
$page
,
$limit
,
$type
,
$isPage
=
FALSE
)
{
$descStr
=
self
::
getOrderDescStr
(
$type
);
$orders
=
array
(
'empty'
=>
$descStr
);
$orderInfo
=
OrderData
::
getUserOrders
(
$uid
,
$page
,
$limit
,
$type
);
if
(
isset
(
$orderInfo
[
'data'
][
'order_list'
])
&&
$orderInfo
[
'data'
][
'order_list'
])
{
$orders
=
array
();
foreach
(
$orderInfo
[
'data'
][
'order_list'
]
as
$orderK
=>
$orderV
)
{
$orders
[
$orderK
][
'orderNum'
]
=
$orderV
[
'order_code'
];
//订单标识
$orders
[
$orderK
][
'orderTime'
]
=
date
(
"Y-m-d H:i:s"
,
$orderV
[
'create_time'
]);
//下单时间
$statusInfo
=
self
::
getOrderStatus
(
$orderV
[
'is_cancel'
],
$orderV
[
'status'
],
$orderV
[
'payment_type'
],
$orderV
[
'payment_status'
]);
//订单状态
if
(
$statusInfo
[
'cancel'
])
{
$orders
[
$orderK
][
'cancel'
]
=
$statusInfo
[
'cancel'
];
}
else
{
if
(
!
empty
(
$statusInfo
[
'keyName'
]))
{
$orders
[
$orderK
][
$statusInfo
[
'keyName'
]]
=
TRUE
;
//已发货,物流信息
if
(
$statusInfo
[
'keyName'
]
==
'shipped'
)
{
$expressInfo
=
self
::
getExpressInfo
(
$orderV
[
'order_code'
],
$uid
,
$orderV
[
'payment_type'
],
$orderV
[
'create_time'
]);
$orders
[
$orderK
][
'logistics'
]
=
$expressInfo
[
'logistics'
];
}
}
}
//订单商品相关信息
$opRefundStatus
=
true
;
//订单不可操作退换货
if
(
isset
(
$orderV
[
'order_goods'
])
&&
$orderV
[
'order_goods'
])
{
$goods
=
array
();
$refundFlag
=
array
();
foreach
(
$orderV
[
'order_goods'
]
as
$gokey
=>
$goval
)
{
$goods
[
$gokey
][
'href'
]
=
Helpers
::
getUrlBySkc
(
$goval
[
'product_id'
],
$goval
[
'goods_id'
],
$goval
[
'cn_alphabet'
]);
$goods
[
$gokey
][
'thumb'
]
=
(
isset
(
$goval
[
'goods_image'
])
&&
$goval
[
'goods_image'
])
?
Images
::
getImageUrl
(
$goval
[
'goods_image'
],
100
,
100
)
:
''
;
$goods
[
$gokey
][
'name'
]
=
$goval
[
'product_name'
];
$goods
[
$gokey
][
'color'
]
=
$goval
[
'color_name'
];
$goods
[
$gokey
][
'size'
]
=
$goval
[
'size_name'
];
$goods
[
$gokey
][
'price'
]
=
$goval
[
'goods_price'
];
$buyNum
=
intval
(
$goval
[
'buy_number'
]);
$refundNum
=
intval
(
$goval
[
'refund_num'
]);
$goods
[
$gokey
][
'count'
]
=
$buyNum
;
$refundStatus
=
(
$refundNum
>
0
)
?
true
:
false
;
//只要发生一件退换,退换过的标记
$goods
[
$gokey
][
'refundStatus'
]
=
$refundStatus
;
$refundFlag
[]
=
((
$buyNum
==
$refundNum
)
&&
$refundNum
>
0
)
?
'finished'
:
'unfinished'
;
//某一件商品全部退换结束
$goods
[
$gokey
][
'arrivalDate'
]
=
$goval
[
'expect_arrival_time'
];
$goodsTagName
=
self
::
getGoodsTag
(
$orderV
[
'attribute'
],
$goval
[
'goods_type'
]);
if
(
$goodsTagName
)
{
$goods
[
$gokey
][
$goodsTagName
]
=
TRUE
;
}
$orders
[
$orderK
][
'goods'
]
=
$goods
;
}
if
(
in_array
(
'unfinished'
,
$refundFlag
))
{
$opRefundStatus
=
false
;
}
$orders
[
$orderK
][
'pay'
]
=
$orderV
[
'amount'
];
//付款数
$orders
[
$orderK
][
'fregit'
]
=
$orderV
[
'shipping_cost'
];
//邮费
}
//操作
$orders
[
$orderK
][
'operation'
]
=
self
::
getOperateInfo
(
$orderV
[
'attribute'
],
$orderV
[
'is_cancel'
],
$orderV
[
'status'
],
$orderV
[
'payment_status'
],
$orderV
[
'update_time'
],
$orderV
[
'order_type'
],
$orderV
[
'refund_status'
],
$orderV
[
'payment_type'
],
$orderV
[
'order_code'
],
$opRefundStatus
);
}
if
(
$isPage
)
{
$orders
[
'pager'
][
'total'
]
=
$orderInfo
[
'data'
][
'total'
];
$orders
[
'pager'
][
'pageTotal'
]
=
$orderInfo
[
'data'
][
'page_total'
];
$orders
[
'pager'
][
'page'
]
=
$orderInfo
[
'data'
][
'page'
];
}
}
return
$orders
;
}
/**
* 我的订单-tabs
* @param type $type
* @return boolean
*/
public
static
function
getOrderTabs
(
$type
)
{
$tabs
=
array
(
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
ChannelConfig
::
$allType
)),
'name'
=>
'现有订单'
),
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
ChannelConfig
::
$completeType
)),
'name'
=>
'成功订单'
),
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
ChannelConfig
::
$cancelType
)),
'name'
=>
'已取消订单'
),
array
(
'url'
=>
Helpers
::
url
(
'/home/orders'
,
array
(
'page'
=>
1
,
'type'
=>
ChannelConfig
::
$historyType
)),
'name'
=>
'历史订单'
)
);
switch
(
$type
)
{
case
ChannelConfig
::
$allType
:
$tabs
[
0
][
'active'
]
=
true
;
break
;
case
ChannelConfig
::
$completeType
:
$tabs
[
1
][
'active'
]
=
true
;
break
;
case
ChannelConfig
::
$cancelType
:
$tabs
[
2
][
'active'
]
=
true
;
break
;
case
ChannelConfig
::
$historyType
:
$tabs
[
3
][
'active'
]
=
true
;
break
;
default
:
$tabs
[
0
][
'active'
]
=
true
;
break
;
}
return
$tabs
;
}
/**
* 详情页
* @param type $orderCode
*/
public
static
function
getOrderDetail
(
$uid
,
$orderCode
)
{
$detail
=
array
();
$orderInfo
=
OrderData
::
getOrderDetail
(
$uid
,
$orderCode
);
//不属于这个人订单,跳转个人中心首页
if
(
isset
(
$orderInfo
[
'code'
])
&&
$orderInfo
[
'code'
]
==
400
)
{
return
$orderInfo
;
}
if
(
isset
(
$orderInfo
[
'data'
])
&&
$orderInfo
[
'data'
])
{
$orderDetail
=
$orderInfo
[
'data'
];
$detail
[
'orderNum'
]
=
$orderDetail
[
'order_code'
];
//订单状态
$statusInfo
=
self
::
getOrderStatus
(
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'status'
],
$orderDetail
[
'payment_type'
],
$orderDetail
[
'payment_status'
]);
$detail
[
'statusStr'
]
=
$statusInfo
[
'statusStr'
];
//订单是否已完成
$detail
[
'complete'
]
=
false
;
if
(
$orderDetail
[
'status'
]
==
6
)
{
$detail
[
'complete'
]
=
true
;
}
//进度条
if
(
$statusInfo
[
'cancel'
])
{
$detail
[
'progress'
]
=
false
;
}
else
{
//未取消订单,进度
if
(
$orderDetail
[
'attribute'
]
==
3
)
{
$detail
[
'progress'
]
=
self
::
getVirtualPro
(
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'status'
],
$orderDetail
[
'create_time'
]);
}
else
{
$detail
[
'progress'
]
=
self
::
getNormalPro
(
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'status'
],
$orderDetail
[
'create_time'
]);
}
}
//物流信息
$detail
[
'traceOrder'
][
'orderDate'
]
=
date
(
'Y.m.d H:i:s'
,
$orderDetail
[
'create_time'
]);
$expressInfo
=
self
::
getExpressInfo
(
$orderCode
,
$uid
,
$orderDetail
[
'payment_type'
],
$orderDetail
[
'create_time'
],
true
);
$detail
[
'traceOrder'
][
'logistics'
]
=
$expressInfo
[
'logistics'
];
//物流信息
$detail
[
'traceOrder'
][
'logisticsCompany'
]
=
$expressInfo
[
'logisticsCompany'
];
$detail
[
'traceOrder'
][
'courierNumbe'
]
=
$expressInfo
[
'courierNumbe'
];
//虚拟商品
if
(
$orderDetail
[
'attribute'
]
==
3
)
{
$detail
[
'virtualGoods'
]
=
TRUE
;
$detail
[
'virtualPayMode'
][
'payMode'
]
=
ChannelConfig
::
$payType
[
$orderDetail
[
'payment_type'
]];
$detail
[
'virtualPayMode'
][
'phone'
]
=
substr_replace
(
$orderDetail
[
'mobile'
],
'****'
,
3
,
4
);
}
else
{
$detail
[
'virtualGoods'
]
=
FALSE
;
$detail
[
'noramlPayMode'
][
'payMode'
]
=
ChannelConfig
::
$payType
[
$orderDetail
[
'payment_type'
]];
$detail
[
'noramlPayMode'
][
'payWay'
]
=
$orderDetail
[
'payment_name'
];
$detail
[
'noramlPayMode'
][
'deliverTime'
]
=
(
isset
(
$orderDetail
[
'delivery_time'
]))
?
$orderDetail
[
'delivery_time'
]
:
''
;
//配送信息
$detail
[
'orderInfo'
][
'receiver'
]
=
$orderDetail
[
'user_name'
];
$detail
[
'orderInfo'
][
'address'
]
=
$orderDetail
[
'area'
]
.
$orderDetail
[
'address'
];
$detail
[
'orderInfo'
][
'phone'
]
=
substr_replace
(
$orderDetail
[
'mobile'
],
'****'
,
3
,
4
)
.
(
!
empty
(
$orderDetail
[
'phone'
])
?
','
.
substr_replace
(
$orderDetail
[
'phone'
],
'****'
,
3
,
5
)
:
''
);
}
//商品信息
if
(
$orderDetail
[
'order_goods'
])
{
foreach
(
$orderDetail
[
'order_goods'
]
as
$gok
=>
$gov
)
{
$detail
[
'goods'
][
$gok
][
'url'
]
=
Helpers
::
getUrlBySkc
(
$gov
[
'product_id'
],
$gov
[
'goods_id'
],
$gov
[
'cn_alphabet'
]);
$detail
[
'goods'
][
$gok
][
'img'
]
=
Images
::
getImageUrl
(
$gov
[
'goods_image'
],
60
,
60
);
$detail
[
'goods'
][
$gok
][
'name'
]
=
$gov
[
'product_name'
];
$detail
[
'goods'
][
$gok
][
'color'
]
=
$gov
[
'color_name'
];
$detail
[
'goods'
][
$gok
][
'size'
]
=
$gov
[
'size_name'
];
$detail
[
'goods'
][
$gok
][
'price'
]
=
$gov
[
'goods_price'
];
$detail
[
'goods'
][
$gok
][
'coin'
]
=
$gov
[
'yoho_give_coin'
];
$detail
[
'goods'
][
$gok
][
'num'
]
=
$gov
[
'buy_number'
];
$detail
[
'goods'
][
$gok
][
'sum'
]
=
$gov
[
'goods_amount'
];
$detail
[
'goods'
][
$gok
][
'sku'
]
=
$gov
[
'product_sku'
];
$goodsTagName
=
self
::
getGoodsTag
(
$orderDetail
[
'attribute'
],
$gov
[
'goods_type'
]);
if
(
$goodsTagName
)
{
$detail
[
'goods'
][
$gok
][
$goodsTagName
]
=
TRUE
;
}
}
}
//详情页-订单付费详情
if
(
isset
(
$orderDetail
[
'promotion_formulas'
])
&&
$orderDetail
[
'promotion_formulas'
])
{
foreach
(
$orderDetail
[
'promotion_formulas'
]
as
$pricek
=>
$pricev
)
{
$detail
[
'orderBalance'
][
$pricek
]
=
array
(
'promotion'
=>
$pricev
[
'promotion'
],
'account'
=>
$pricev
[
'promotion_amount'
]);
}
$detail
[
'orderBalance'
][]
=
array
(
'promotion'
=>
'实际应支付'
,
'account'
=>
$orderDetail
[
'amount'
]);
}
$detail
[
'yoho_give_coin'
]
=
$orderDetail
[
'yoho_give_coin'
];
$detail
[
'yohoCoinUrl'
]
=
Helpers
::
url
(
'/help'
,
array
(
'category_id'
=>
87
));
//什么是yoho币介绍
$detail
[
'remark'
]
=
$orderDetail
[
'remark'
];
$detail
[
'operation'
]
=
self
::
getOrderDetailOp
(
$orderDetail
[
'order_code'
],
$orderDetail
[
'payment'
],
$orderDetail
[
'status'
],
$orderDetail
[
'is_cancel'
],
$orderDetail
[
'payment_status'
],
$orderDetail
[
'payment_type'
],
$orderDetail
[
'order_type'
],
$orderDetail
[
'attribute'
],
$orderDetail
[
'refund_status'
]);
//,$orderDetail['order_type_value']
$detail
[
'packages'
]
=
CartModel
::
getPackageInfo
(
$orderDetail
);
}
return
$detail
;
}
/**
* 获取历史订单
* @param type $uid
* @param type $page
* @param type $limit
* @return type
*/
public
static
function
getHistoryOrders
(
$uid
,
$page
,
$limit
)
{
$historyOrders
=
array
(
'empty'
=>
'您没有历史订单'
);
$orderInfo
=
OrderData
::
getHistoryOrders
(
$uid
,
$page
,
$limit
);
if
(
isset
(
$orderInfo
[
'data'
][
'list'
])
&&
$orderInfo
[
'data'
][
'list'
])
{
$historyOrders
=
array
();
foreach
(
$orderInfo
[
'data'
][
'list'
]
as
$hok
=>
$hov
)
{
$historyOrders
[
$hok
][
'orderNum'
]
=
$hov
[
'order_code'
];
$historyOrders
[
$hok
][
'orderTime'
]
=
date
(
'Y/m/d H:i:s'
,
$hov
[
'order_time'
]);
$historyOrders
[
$hok
][
'goods'
]
=
json_decode
(
$hov
[
'goods_data'
],
true
);
$historyOrders
[
$hok
][
'orderSum'
]
=
$hov
[
'amount'
];
$historyOrders
[
$hok
][
'payMode'
]
=
$hov
[
'payment'
];
}
$historyOrders
[
'pager'
][
'total'
]
=
$orderInfo
[
'data'
][
'total'
];
$historyOrders
[
'pager'
][
'pageTotal'
]
=
$orderInfo
[
'data'
][
'total_page'
];
$historyOrders
[
'pager'
][
'page'
]
=
$orderInfo
[
'data'
][
'page'
];
}
return
$historyOrders
;
}
public
static
function
getTicketsInfo
(
$orderCode
)
{
$ret
=
array
();
$ticketInfo
=
OrderData
::
getTicketCode
(
$orderCode
);
$tickets
=
$ticketInfo
[
'data'
][
'ticks'
];
if
(
isset
(
$tickets
)
&&
$tickets
)
{
foreach
(
$tickets
as
$tk
=>
$tv
)
{
$ret
[
$tk
][
'img'
]
=
self
::
getTicketImgs
(
'ticket'
,
$tv
[
'ticket_code'
],
1
,
9
,
1
);
$ret
[
$tk
][
'desc'
]
=
$tv
[
'ticket_code'
];
}
}
return
$ret
;
}
/**
* 获取虚拟商品二维码图片
* @param type $type
* @param type $dataStr
* @param type $version
* @param type $boxSize
* @param type $border
* @param type $color
* @return type
*/
protected
static
function
getTicketImgs
(
$type
,
$dataStr
,
$version
=
1
,
$boxSize
=
4
,
$border
=
1
,
$color
=
1
)
{
$data
=
$type
.
'-'
.
$dataStr
;
$nodeNum
=
sprintf
(
'%u'
,
crc32
(
$data
))
%
count
(
ChannelConfig
::
$newImageServerUrl
);
$filePath
=
abs
(
crc32
(
$data
))
%
20000
;
$pathData
=
array
(
$data
,
$version
,
$boxSize
,
$border
,
$color
);
return
ChannelConfig
::
$newImageServerUrl
[
$nodeNum
]
.
'/yohood/'
.
$filePath
.
'/'
.
implode
(
'-'
,
$pathData
)
.
'.jpg'
;
}
/**
* 订单详情页物流
*
*/
protected
static
function
getExpressInfo
(
$orderCode
,
$uid
,
$paymetType
,
$createTime
,
$isDetail
=
false
)
{
$result
[
'logisticsUrl'
]
=
''
;
$result
[
'logisticsImg'
]
=
''
;
$result
[
'logisticsCompany'
]
=
''
;
$result
[
'courierNumbe'
]
=
''
;
if
(
$paymetType
==
1
)
{
if
(
$isDetail
)
{
$result
[
'logistics'
][]
=
array
(
date
(
'Y-m-d H:i:s'
,
$createTime
),
' '
,
'您的订单已提交,等待付款'
);
}
else
{
$result
[
'logistics'
][]
=
date
(
'Y-m-d H:i:s'
,
$createTime
)
.
' '
.
'您的订单已提交,等待付款'
;
}
}
if
(
$paymetType
==
2
)
{
if
(
$isDetail
)
{
$result
[
'logistics'
][]
=
array
(
date
(
'Y-m-d H:i:s'
,
$createTime
),
' '
,
'您的订单已提交,等待审核'
);
}
else
{
$result
[
'logistics'
][]
=
date
(
'Y-m-d H:i:s'
,
$createTime
)
.
' '
.
'您的订单已提交,等待审核'
;
}
}
//有物流
if
(
isset
(
$orderCode
)
&&
is_numeric
(
$uid
))
{
$logistics
=
OrderData
::
getLogisticsData
(
$orderCode
,
$uid
);
if
(
isset
(
$logistics
[
'data'
])
&&
$logistics
[
'data'
])
{
$result
[
'logisticsUrl'
]
=
isset
(
$logistics
[
'data'
][
'url'
])
?
$logistics
[
'data'
][
'url'
]
:
''
;
$result
[
'logisticsImg'
]
=
isset
(
$logistics
[
'data'
][
'logo'
])
?
$logistics
[
'data'
][
'logo'
]
:
''
;
$result
[
'logisticsCompany'
]
=
isset
(
$logistics
[
'data'
][
'caption'
])
?
$logistics
[
'data'
][
'caption'
]
:
''
;
$result
[
'courierNumbe'
]
=
isset
(
$logistics
[
'data'
][
'express_number'
])
?
$logistics
[
'data'
][
'express_number'
]
:
''
;
$expressDetail
=
isset
(
$logistics
[
'data'
][
'express_detail'
])
?
$logistics
[
'data'
][
'express_detail'
]
:
array
();
if
(
isset
(
$expressDetail
)
&&
$expressDetail
)
{
foreach
(
$expressDetail
as
$value
)
{
$pos
=
stripos
(
$value
[
'accept_address'
],
' '
)
/
3
;
$city
=
mb_substr
(
$value
[
'accept_address'
],
0
,
$pos
,
'utf-8'
);
$exInfo
=
mb_substr
(
$value
[
'accept_address'
],
$pos
,
null
,
'utf-8'
);
if
(
$isDetail
)
{
$result
[
'logistics'
][]
=
array
(
$value
[
'acceptTime'
],
$city
,
$exInfo
);
}
else
{
$result
[
'logistics'
][]
=
$value
[
'acceptTime'
]
.
$city
.
$exInfo
;
}
}
}
}
}
return
$result
;
}
/**
* 订单详情页操作步骤
*/
protected
static
function
getOrderDetailOp
(
$orderCode
,
$payment
,
$status
,
$isCancel
,
$paymentStatus
,
$paymentType
,
$orderType
,
$attribute
,
$refundStatus
)
{
$operation
=
array
();
//立刻付款
if
(
$paymentType
==
1
&&
$paymentStatus
==
'N'
&&
$isCancel
==
'N'
&&
isset
(
$payment
)
&&
$payment
!=
19
)
{
$operation
+=
array
(
'goPay'
=>
Helpers
::
url
(
'/shopping/pay'
,
array
(
'ordercode'
=>
$orderCode
)));
}
//取消订单
if
(
$status
<
3
&&
$isCancel
==
'N'
&&
$paymentStatus
==
'N'
&&
$orderType
!=
5
)
{
$operation
+=
array
(
'cancelOrder'
=>
TRUE
);
}
//订单已支付
if
(
$paymentType
==
1
&&
$paymentStatus
==
'Y'
&&
$status
<
6
)
{
$operation
+=
array
(
'paid'
=>
TRUE
);
}
//确认收货
if
(
$status
>=
4
&&
$status
<
6
&&
$refundStatus
==
0
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
+=
array
(
'shipped'
=>
TRUE
);
}
//订单已取消
if
(
$isCancel
==
'Y'
)
{
$operation
+=
array
(
'cancel'
=>
TRUE
);
}
//虚拟查看二维码
if
(
$attribute
==
3
)
{
$operation
+=
array
(
'checkQrCode'
=>
Helpers
::
url
(
'/home/orders/ticket'
,
array
(
'orderCode'
=>
$orderCode
)));
}
return
$operation
;
}
/**
* 详情页进度条-普通商品
* @param type $isCancel
* @param type $status
* @param type $createTime
* @return boolean
*/
protected
static
function
getNormalPro
(
$isCancel
,
$status
,
$createTime
)
{
$process
[
'middleStatus'
]
=
array
(
array
(
'name'
=>
'1. 提交订单'
,
'date'
=>
date
(
'Y.m.d H:i:s'
,
$createTime
),
),
array
(
'name'
=>
'2. 商品出库'
),
array
(
'name'
=>
'3. 等待收货'
),
array
(
'name'
=>
'4. 交易完成'
)
);
//订单已取消
if
(
$isCancel
==
'N'
)
{
if
(
$status
==
0
)
{
$process
[
'percent'
]
=
'25%'
;
$process
[
'middleStatus'
][
0
][
'cur'
]
=
TRUE
;
}
else
if
(
$status
>
0
&&
$status
<
4
)
{
$process
[
'percent'
]
=
'50%'
;
$process
[
'middleStatus'
][
1
][
'cur'
]
=
TRUE
;
}
else
if
(
$status
>=
4
&&
$status
<
6
)
{
$process
[
'percent'
]
=
'75%'
;
$process
[
'middleStatus'
][
2
][
'cur'
]
=
TRUE
;
}
elseif
(
$status
==
6
)
{
$process
[
'percent'
]
=
'100%'
;
$process
[
'middleStatus'
][
3
][
'cur'
]
=
TRUE
;
}
}
return
$process
;
}
/**
* 详情页进度条-虚拟商品
* @param type $isCancel
* @param type $status
* @param type $createTime
* @return boolean
*/
protected
static
function
getVirtualPro
(
$isCancel
,
$status
,
$createTime
)
{
$process
[
'middleStatus'
]
=
array
(
array
(
'name'
=>
'1. 提交订单'
,
'date'
=>
date
(
'Y.m.d H:i:s'
,
$createTime
),
),
array
(
'name'
=>
'2. 已发货'
),
array
(
'name'
=>
'3. 交易完成'
)
);
//订单已取消
if
(
$isCancel
==
'N'
)
{
if
(
$status
==
0
)
{
$process
[
'percent'
]
=
'30%'
;
$process
[
'middleStatus'
][
0
][
'cur'
]
=
TRUE
;
}
else
if
(
$status
>
0
&&
$status
<
6
)
{
$process
[
'percent'
]
=
'80%'
;
$process
[
'middleStatus'
][
1
][
'cur'
]
=
TRUE
;
}
elseif
(
$status
==
6
)
{
$process
[
'percent'
]
=
'100%'
;
$process
[
'middleStatus'
][
3
][
'cur'
]
=
TRUE
;
}
}
return
$process
;
}
/**
* 订单状态
* @param type $isCancel
* @param type $status
* @param type $payType
* @param type $payStatus
* @return string
*/
protected
static
function
getOrderStatus
(
$isCancel
,
$status
,
$payType
,
$payStatus
)
{
//初始化:未取消,待付款
$ret
=
array
(
'cancel'
=>
FALSE
,
'keyName'
=>
'noPay'
,
'statusStr'
=>
'订单已成功,等待付款'
);
//订单已取消
if
(
$isCancel
==
'Y'
)
{
$ret
=
array
(
'cancel'
=>
TRUE
,
'statusStr'
=>
'订单已取消'
);
}
else
{
switch
(
$status
)
{
case
0
:
//'订单已成功,等待付款'
if
(
$payType
!=
2
&&
$payStatus
==
'N'
)
{
$ret
[
'keyName'
]
=
'noPay'
;
$ret
[
'statusStr'
]
=
'订单已成功,等待付款'
;
}
//'订单已付款,等待备货中'
elseif
(
$payType
!=
2
&&
$payStatus
==
'Y'
)
{
$ret
[
'keyName'
]
=
'paid'
;
$ret
[
'statusStr'
]
=
'订单已付款,等待备货中'
;
}
//'订单已成功,等待备货中'-货到付款
elseif
(
$payType
==
2
&&
$payStatus
==
'N'
)
{
$ret
[
'keyName'
]
=
'complete'
;
$ret
[
'statusStr'
]
=
'订单已成功,等待备货中'
;
}
break
;
case
1
:
case
2
:
case
3
:
//'订单已付款,等待备货中'
$ret
[
'keyName'
]
=
'paid'
;
$ret
[
'statusStr'
]
=
'订单已付款,等待备货中'
;
break
;
case
4
:
case
5
:
//'订单已发货'
$ret
[
'keyName'
]
=
'shipped'
;
$ret
[
'statusStr'
]
=
'订单已发货'
;
break
;
case
6
:
//'交易完成';
$ret
[
'keyName'
]
=
'reback'
;
$ret
[
'statusStr'
]
=
'交易完成'
;
break
;
}
}
return
$ret
;
}
/**
* 操作栏
* @param type $attribute 订单属性
* @param type $isCancel 是否取消
* @param type $status 订单状态
* @param type $payStatus 付款状态
* @param type $updateTime 更新时间
* @param type $orderType 订单类型
* @param type $refundStatus 是否退换
* @param type $paymentType 付款类型
* @param type $orderCode 订单号
* @param type $opRefundStatus 退换操作是否灰化 true 灰化 false 可用
* @return string
*/
protected
static
function
getOperateInfo
(
$attribute
,
$isCancel
,
$status
,
$payStatus
,
$updateTime
,
$orderType
,
$refundStatus
,
$paymentType
,
$orderCode
,
$opRefundStatus
)
{
//查看订单
$orderDetailUrl
=
Helpers
::
url
(
'/home/orders/detail'
,
array
(
'orderCode'
=>
$orderCode
));
//查看二维码
$ticketUrl
=
Helpers
::
url
(
'/home/orders/tickets'
,
array
(
'orderCode'
=>
$orderCode
));
//立即付款
$payUrl
=
Helpers
::
url
(
'/shopping/pay'
,
array
(
'ordercode'
=>
$orderCode
));
//取消订单
$cancelOrderUrl
=
'javascript:void(0)'
;
//确认订单
$confirmOrderUrl
=
'javascript:void(0)'
;
//申请换货
$exchangeUrl
=
Helpers
::
url
(
'/home/returns/exchangeRequest'
,
array
(
'orderCode'
=>
$orderCode
));
//申请退货
$refundUrl
=
Helpers
::
url
(
'/home/returns/refundrequest'
,
array
(
'orderCode'
=>
$orderCode
));
//立即付款
if
(
$payStatus
==
'N'
&&
$paymentType
!=
2
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'payNow'
=>
true
,
'href'
=>
$payUrl
);
}
$operation
[]
=
array
(
'href'
=>
$orderDetailUrl
,
'name'
=>
'查看订单'
);
//查看订单,虚拟订单查看二维码
if
(
$attribute
==
3
)
{
if
(
$payStatus
==
'Y'
)
{
$operation
[]
=
array
(
'href'
=>
$ticketUrl
,
'name'
=>
'查看二维码'
);
}
}
//取消订单
if
(
$status
<
3
&&
$isCancel
==
'N'
&&
$orderType
!=
5
&&
$payStatus
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$cancelOrderUrl
,
'name'
=>
'取消订单'
,
'cancelOrder'
=>
true
);
}
//确认收货
if
(
$status
>=
4
&&
$status
<
6
&&
$refundStatus
==
0
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$confirmOrderUrl
,
'name'
=>
'确认收货'
,
'confirmReceived'
=>
true
);
}
//换货
$time
=
(
time
()
-
$updateTime
);
$orderExchangeLimitTime
=
ChannelConfig
::
$exchangeDay
;
if
(
$status
>=
6
&&
$time
<
86400
*
$orderExchangeLimitTime
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$exchangeUrl
,
'name'
=>
'申请换货'
,
'optDis'
=>
$opRefundStatus
);
}
//退货
$orderRefundLimitTime
=
ChannelConfig
::
$refundDay
;
if
(
$status
>=
6
&&
$time
<
86400
*
$orderRefundLimitTime
&&
$attribute
!=
3
&&
$isCancel
==
'N'
)
{
$operation
[]
=
array
(
'href'
=>
$refundUrl
,
'name'
=>
'申请退货'
,
'optDis'
=>
$opRefundStatus
);
}
return
$operation
;
}
/**
* 商品属性标签
* @param type $attribute
* @param type $goodsType
* @return string
*/
protected
static
function
getGoodsTag
(
$attribute
,
$goodsType
)
{
$goodsTagName
=
''
;
switch
(
$goodsType
)
{
//赠品
case
'gift'
:
$goodsTagName
=
'freebie'
;
break
;
//加价购
case
'price_gift'
:
$goodsTagName
=
'advanceBuy'
;
break
;
//预售
case
'advance'
:
$goodsTagName
=
'preSaleGood'
;
break
;
//outlet
case
'outlet'
:
$goodsTagName
=
''
;
break
;
//免单
case
'free'
:
$goodsTagName
=
''
;
break
;
//电子
case
'ticket'
:
$goodsTagName
=
''
;
break
;
default
:
break
;
}
//虚拟
if
(
$attribute
==
3
)
{
$goodsTagName
=
'virtualGood'
;
}
return
$goodsTagName
;
}
/**
* 空订单数据提示
* @param type $type
* @return string
*/
protected
static
function
getOrderDescStr
(
$type
)
{
switch
(
$type
)
{
case
ChannelConfig
::
$allType
:
$str
=
'您还没有任何订单'
;
break
;
case
ChannelConfig
::
$completeType
:
$str
=
'您目前还没有成功的订单'
;
break
;
case
ChannelConfig
::
$cancelType
:
$str
=
'您还没有任何取消的订单'
;
break
;
default
:
$str
=
''
;
break
;
}
return
$str
;
}
}
...
...
yohobuy/www.yohobuy.com/application/models/Shopping/Cart.php
View file @
e193115
...
...
@@ -5,11 +5,13 @@ namespace Shopping;
use
LibModels\Web\Home\CartData
;
use
LibModels\Web\Home\UserData
;
use
LibModels\Web\Product\FavoriteData
;
use
LibModels\Web\Product\ItemData
;
use
WebPlugin\Helpers
;
use
WebPlugin\Cache
;
use
WebPlugin\Images
;
use
Configs\WebCacheConfig
;
use
Hood\Core\Security\AuthCode
;
use
Configs\ChannelConfig
;
/**
* 购物车相关的模板数据模型
...
...
@@ -587,7 +589,14 @@ class CartModel
}
}
}
// tar add 1605061351 货到付款提示信息处理
if
(
isset
(
$pay
[
'data'
][
'payment_way'
])){
foreach
(
$pay
[
'data'
][
'payment_way'
]
as
$item
)
{
if
(
$item
[
'payment_type'
]
===
2
){
$result
[
'paymentInCashInfo'
]
=
$item
[
'is_support_message'
];
}
}
}
// 未设置时,设置默认
if
(
!
isset
(
$result
[
'defaultPayWay'
]))
{
$result
[
'onlinePay'
][
'checked'
]
=
true
;
...
...
@@ -719,7 +728,8 @@ class CartModel
if
(
!
empty
(
$pay
[
'data'
][
'shopping_cart_data'
]))
{
$result
[
'lastOrderAmount'
]
=
Helpers
::
transPrice
(
$pay
[
'data'
][
'shopping_cart_data'
][
'last_order_amount'
]);
}
// 返还的 YOHO 币
$result
[
'totalYoho'
]
=
$pay
[
'data'
][
'shopping_cart_data'
][
'gain_yoho_coin'
];
// 拥有的YOHO币
$result
[
'ownYohoCoin'
]
=
$pay
[
'data'
][
'yoho_coin'
]
*
100
;
// 默认是否使用YOHO币
...
...
@@ -746,12 +756,46 @@ class CartModel
$isNewUser
=
false
;
}
$result
[
'isNewUser'
]
=
$isNewUser
?
true
:
false
;
}
while
(
false
);
//JIT拆单需求 package
$result
[
'packages'
]
=
self
::
getPackageInfo
(
$pay
[
'data'
][
'shopping_cart_data'
]);
}
while
(
false
);
return
$result
;
}
/**
* JIT拆单-结算页
* @param array $cartInfo
* @param bool $isOrder 处理订单接口和购物车接口返回差异性
* @return type
*/
public
static
function
getPackageInfo
(
$cartInfo
)
{
$packages
=
false
;
$isMulti
=
(
$cartInfo
[
'is_multi_package'
]
===
'Y'
);
//是否拆单
if
(
$isMulti
)
{
$packageList
=
$cartInfo
[
'package_list'
];
foreach
(
$packageList
as
$pk
=>
$pv
)
{
$packages
[
$pk
][
'title'
]
=
(
$pv
[
'supplier_id'
]
==
0
)
?
'包裹1:总仓库'
:
'包裹2:异地调拨'
;
//仓库
$goodList
=
$pv
[
'goods_list'
];
foreach
(
$goodList
as
$glk
=>
$glv
)
{
$packages
[
$pk
][
'goodlist'
][
$glk
][
'src'
]
=
Images
::
getImageUrl
(
$glv
[
'goods_images'
],
90
,
90
);
$tagInfo
=
isset
(
ChannelConfig
::
$orderTagArr
[
$glv
[
'goods_type'
]])
?
ChannelConfig
::
$orderTagArr
[
$glv
[
'goods_type'
]]
:
''
;
$packages
[
$pk
][
'goodlist'
][
$glk
][
'goodsType'
]
=!
empty
(
$tagInfo
[
'name'
])
?
$tagInfo
[
'name'
]
:
false
;
$packages
[
$pk
][
'goodlist'
][
$glk
][
'classname'
]
=!
empty
(
$tagInfo
[
'classname'
])
?
$tagInfo
[
'classname'
]
:
false
;
$packages
[
$pk
][
'goodlist'
][
$glk
][
'link'
]
=
'javascript:void(0)'
;
}
$packages
[
$pk
][
'fee'
]
=
(
$pv
[
'shopping_cost'
]
==
'0.00'
)
?
false
:
$pv
[
'shopping_cost'
];
$packages
[
$pk
][
'orign'
]
=
$pv
[
'shopping_orig_cost'
];
$packages
[
$pk
][
'count'
]
=
$pv
[
'shopping_cut_cost'
];
}
}
return
$packages
;
}
/**
* 购物车结算--支付方式和配送方式选择以及是否使用YOHO币接口返回的数据处理
*
* @param int $uid 用户ID
...
...
@@ -1071,22 +1115,6 @@ class CartModel
return
$result
;
}
/**
* 购物车结算--获取用户可用和不可用的优惠券列表
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public
static
function
getListCoupon
(
$uid
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.Shopping.listCoupon'
;
$param
[
'uid'
]
=
$uid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 获取用户的优惠券列表
*
...
...
@@ -1249,8 +1277,7 @@ class CartModel
return
$result
;
}
/**
* 页面顶部购物车数据
* @param int $uid
...
...
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
e193115
...
...
@@ -231,10 +231,10 @@ class IndexController extends WebAction
if
(
empty
(
$orderEnsure
))
{
$this
->
go
(
Helpers
::
url
(
'/shopping/cart'
));
}
$this
->
_view
->
display
(
'order-ensure'
,
array
(
'orderEnsurePage'
=>
true
,
'orderEnsure'
=>
$orderEnsure
,
'packages'
=>
$orderEnsure
[
'packages'
]
));
}
...
...
yohobuy/www.yohobuy.com/application/modules/Home/controllers/Orders.php
View file @
e193115
<?php
use
Action\WebAction
;
use
WebPlugin\Helpers
;
use
Home\UserModel
;
use
Home\OrderModel
;
use
LibModels\Web\Home\OrderData
;
use
WebPlugin\Paging
;
/**
* 订单
*/
class
OrdersController
extends
WebAction
{
/**
* 我的订单
*/
public
function
indexAction
()
{
//判断是否登录
$uid
=
$this
->
auditJumpLogin
(
true
,
Helpers
::
url
(
'/home/orders'
));
//头部导航
$channel
=
Helpers
::
getChannelNameByCookie
();
$this
->
setWebNavHeader
(
$channel
);
//面包屑-左侧导航
$path
=
UserModel
::
getCenterCrumb
(
'订单中心'
);
$leftNav
=
UserModel
::
getCenterLeftNav
(
'我的订单'
,
$uid
);
//分页
$page
=
$this
->
get
(
'page'
,
1
);
$type
=
$this
->
get
(
'type'
,
1
);
$limit
=
10
;
$paging
=
new
Paging
(
'yoho'
);
//订单 type-8-历史
if
(
$type
==
8
)
{
$orders
=
OrderModel
::
getHistoryOrders
(
$uid
,
$page
,
$limit
);
}
else
{
$orders
=
OrderModel
::
getOrders
(
$uid
,
$page
,
$limit
,
$type
,
TRUE
);
}
$total
=
isset
(
$orders
[
'pager'
][
'total'
])
?
$orders
[
'pager'
][
'total'
]
:
0
;
$pageTotal
=
isset
(
$orders
[
'pager'
][
'pageTotal'
])
?
$orders
[
'pager'
][
'pageTotal'
]
:
0
;
$page
=
isset
(
$orders
[
'pager'
][
'page'
])
?
$orders
[
'pager'
][
'page'
]
:
0
;
unset
(
$orders
[
'pager'
]);
$paging
->
setTotal
(
$total
)
->
setSize
(
$limit
)
->
setQuery
(
array
(
'page'
=>
$page
,
'type'
=>
$type
));
//数据整合
$data
=
array
(
'path'
=>
$path
,
'userThumb'
=>
UserModel
::
getUserHeadImg
(
$uid
),
'homeNav'
=>
$leftNav
,
'tabs'
=>
OrderModel
::
getOrderTabs
(
$type
),
'pager'
=>
array
(
'count'
=>
$total
,
'curPage'
=>
$page
,
'totalPages'
=>
$pageTotal
,
'pagerHtml'
=>
$paging
->
view
(
false
)
)
);
//历史订单/普通订单
$orderKey
=
(
$type
==
8
)
?
'historyOrders'
:
'orders'
;
$data
[
$orderKey
]
=
$orders
;
$this
->
_view
->
display
(
'orders'
,
array
(
'meOrdersPage'
=>
true
,
'meOrders'
=>
$data
));
}
/**
* 订单详情
*/
public
function
detailAction
()
{
//判断是否登录
$uid
=
$this
->
auditJumpLogin
();
//头部导航
$channel
=
Helpers
::
getChannelNameByCookie
();
$this
->
setWebNavHeader
(
$channel
);
//面包屑-左侧导航
$path
=
UserModel
::
getCenterCrumb
(
'订单详细'
,
array
(
'href'
=>
Helpers
::
url
(
'/home/orders'
),
'name'
=>
'订单中心'
));
$leftNav
=
UserModel
::
getCenterLeftNav
(
'我的订单'
,
$uid
);
$orderCode
=
$this
->
get
(
'orderCode'
,
''
);
//兼容老网站传参方式
if
(
!
$orderCode
)
{
$orderCode
=
$this
->
get
(
'order_code'
,
''
);
}
$detail
=
OrderModel
::
getOrderDetail
(
$uid
,
$orderCode
);
//非当前用户的订单,跳转个首
if
(
isset
(
$detail
[
'code'
])
&&
$detail
[
'code'
]
==
400
){
$this
->
go
(
Helpers
::
url
(
'/home'
));
}
$data
=
array
(
'path'
=>
$path
,
'userThumb'
=>
UserModel
::
getUserHeadImg
(
$uid
),
'homeNav'
=>
$leftNav
);
if
(
$detail
)
{
$data
+=
array
(
'orderNum'
=>
$detail
[
'orderNum'
],
'curStatus'
=>
$detail
[
'statusStr'
],
'complete'
=>
$detail
[
'complete'
],
'virtualGoods'
=>
$detail
[
'virtualGoods'
],
'progress'
=>
$detail
[
'progress'
],
'remark'
=>
$detail
[
'remark'
],
'goods'
=>
$detail
[
'goods'
],
'yohoCoinUrl'
=>
$detail
[
'yohoCoinUrl'
],
'orderBalance'
=>
isset
(
$detail
[
'orderBalance'
])
?
$detail
[
'orderBalance'
]
:
array
(),
'operation'
=>
$detail
[
'operation'
]
);
if
(
isset
(
$detail
[
'noramlPayMode'
]))
{
$data
[
'orderInfo'
]
=
$detail
[
'orderInfo'
];
$data
[
'traceOrder'
]
=
$detail
[
'traceOrder'
];
$data
[
'noramlPayMode'
]
=
$detail
[
'noramlPayMode'
];
}
else
if
(
isset
(
$detail
[
'virtualPayMode'
]))
{
$data
[
'virtualPayMode'
]
=
$detail
[
'virtualPayMode'
];
}
}
$this
->
_view
->
display
(
'order-detail'
,
array
(
'meOrdersPage'
=>
true
,
'meOrderDetail'
=>
$data
));
}
/**
* 二维码票
*/
public
function
ticketsAction
()
{
//判断是否登录
$uid
=
$this
->
auditJumpLogin
();
//头部导航
$channel
=
Helpers
::
getChannelNameByCookie
();
$this
->
setWebNavHeader
(
$channel
);
//面包屑-左侧导航
$path
=
UserModel
::
getCenterCrumb
(
'查看二维码'
,
array
(
'href'
=>
Helpers
::
url
(
'/home/orders'
),
'name'
=>
'订单中心'
));
$leftNav
=
UserModel
::
getCenterLeftNav
(
'我的订单'
,
$uid
);
$orderCode
=
$this
->
get
(
'orderCode'
,
''
);
//兼容老网站传参方式
if
(
!
$orderCode
)
{
$orderCode
=
$this
->
get
(
'order_code'
,
''
);
}
$detail
=
OrderModel
::
getOrderDetail
(
$uid
,
$orderCode
);
//非当前用户的订单,跳转个首
if
(
isset
(
$detail
[
'code'
])
&&
$detail
[
'code'
]
==
400
){
$this
->
go
(
Helpers
::
url
(
'/home'
));
}
if
(
isset
(
$detail
)
&&
$detail
)
{
$tickets
=
OrderModel
::
getTicketsInfo
(
$orderCode
);
$data
=
array
(
'path'
=>
$path
,
'userThumb'
=>
UserModel
::
getUserHeadImg
(
$uid
),
'homeNav'
=>
$leftNav
,
'name'
=>
$detail
[
'goods'
][
0
][
'name'
],
'num'
=>
$detail
[
'goods'
][
0
][
'num'
],
'orderNum'
=>
$detail
[
'orderNum'
],
'myOrdersUrl'
=>
Helpers
::
url
(
'/home/orders'
),
'tickets'
=>
$tickets
);
}
$this
->
_view
->
display
(
'ticket'
,
array
(
'meOrderTicket'
=>
$data
));
}
/**
* 取消订单-ajax
*/
public
function
cancelOrderAction
()
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
''
,
'data'
=>
''
);
do
{
/* 判断是不是AJAX请求 */
if
(
!
$this
->
isAjax
())
{
break
;
}
$uid
=
$this
->
auditJumpLogin
();
$orderCode
=
trim
(
$this
->
post
(
'orderCode'
,
''
));
$data
=
OrderData
::
cancelUserOrder
(
$uid
,
$orderCode
);
if
(
!
isset
(
$data
[
'code'
]))
{
break
;
}
}
while
(
false
);
$this
->
echoJson
(
$data
);
}
/**
* 确认订单-ajax
*/
public
function
confirmOrderAction
()
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
''
,
'data'
=>
''
);
do
{
/* 判断是不是AJAX请求 */
if
(
!
$this
->
isAjax
())
{
break
;
}
$uid
=
$this
->
auditJumpLogin
();
$orderCode
=
trim
(
$this
->
post
(
'orderCode'
,
''
));
$data
=
OrderData
::
confirmUserOrder
(
$uid
,
$orderCode
);
if
(
!
isset
(
$data
[
'code'
]))
{
break
;
}
}
while
(
false
);
$this
->
echoJson
(
$data
);
}
}
<?php
use
Action\WebAction
;
use
WebPlugin\Helpers
;
use
Home\UserModel
;
use
Home\OrderModel
;
use
LibModels\Web\Home\OrderData
;
use
Configs\ChannelConfig
;
use
WebPlugin\Paging
;
/**
* 订单
*/
class
OrdersController
extends
WebAction
{
/**
* 我的订单
*/
public
function
indexAction
()
{
//判断是否登录
$uid
=
$this
->
auditJumpLogin
(
false
,
Helpers
::
url
(
'/home/orders'
));
//头部导航
$channel
=
Helpers
::
getChannelNameByCookie
();
$this
->
setWebNavHeader
(
$channel
);
//面包屑-左侧导航
$path
=
UserModel
::
getCenterCrumb
(
'订单中心'
);
$leftNav
=
UserModel
::
getCenterLeftNav
(
'我的订单'
,
$uid
);
//分页
$page
=
$this
->
get
(
'page'
,
1
);
$type
=
$this
->
get
(
'type'
,
1
);
$limit
=
10
;
$paging
=
new
Paging
(
'yoho'
);
//订单 type-8-历史
if
(
$type
==
ChannelConfig
::
$historyType
)
{
$orders
=
OrderModel
::
getHistoryOrders
(
$uid
,
$page
,
$limit
);
}
else
{
$orders
=
OrderModel
::
getOrders
(
$uid
,
$page
,
$limit
,
$type
,
TRUE
);
}
$total
=
isset
(
$orders
[
'pager'
][
'total'
])
?
$orders
[
'pager'
][
'total'
]
:
0
;
$pageTotal
=
isset
(
$orders
[
'pager'
][
'pageTotal'
])
?
$orders
[
'pager'
][
'pageTotal'
]
:
0
;
$page
=
isset
(
$orders
[
'pager'
][
'page'
])
?
$orders
[
'pager'
][
'page'
]
:
0
;
unset
(
$orders
[
'pager'
]);
$paging
->
setTotal
(
$total
)
->
setSize
(
$limit
)
->
setQuery
(
array
(
'page'
=>
$page
,
'type'
=>
$type
));
//数据整合
$data
=
array
(
'path'
=>
$path
,
'userThumb'
=>
UserModel
::
getUserHeadImg
(
$uid
),
'homeNav'
=>
$leftNav
,
'tabs'
=>
OrderModel
::
getOrderTabs
(
$type
),
'pager'
=>
array
(
'count'
=>
$total
,
'curPage'
=>
$page
,
'totalPages'
=>
$pageTotal
,
'pagerHtml'
=>
$paging
->
view
(
false
)
)
);
//历史订单/普通订单
$orderKey
=
(
$type
==
ChannelConfig
::
$historyType
)
?
'historyOrders'
:
'orders'
;
$data
[
$orderKey
]
=
$orders
;
$this
->
_view
->
display
(
'orders'
,
array
(
'meOrdersPage'
=>
true
,
'meOrders'
=>
$data
));
}
/**
* 订单详情
*/
public
function
detailAction
()
{
//判断是否登录
$uid
=
$this
->
auditJumpLogin
();
//头部导航
$channel
=
Helpers
::
getChannelNameByCookie
();
$this
->
setWebNavHeader
(
$channel
);
//面包屑-左侧导航
$path
=
UserModel
::
getCenterCrumb
(
'订单详细'
,
array
(
'href'
=>
Helpers
::
url
(
'/home/orders'
),
'name'
=>
'订单中心'
));
$leftNav
=
UserModel
::
getCenterLeftNav
(
'我的订单'
,
$uid
);
$orderCode
=
$this
->
get
(
'orderCode'
,
''
);
//兼容老网站传参方式
if
(
!
$orderCode
)
{
$orderCode
=
$this
->
get
(
'order_code'
,
''
);
}
$detail
=
OrderModel
::
getOrderDetail
(
$uid
,
$orderCode
);
//非当前用户的订单,跳转个首
if
(
isset
(
$detail
[
'code'
])
&&
$detail
[
'code'
]
==
400
)
{
$this
->
go
(
Helpers
::
url
(
'/home'
));
}
$data
=
array
(
'path'
=>
$path
,
'userThumb'
=>
UserModel
::
getUserHeadImg
(
$uid
),
'homeNav'
=>
$leftNav
);
$packages
=
false
;
if
(
$detail
)
{
$data
+=
array
(
'orderNum'
=>
$detail
[
'orderNum'
],
'curStatus'
=>
$detail
[
'statusStr'
],
'complete'
=>
$detail
[
'complete'
],
'virtualGoods'
=>
$detail
[
'virtualGoods'
],
'progress'
=>
$detail
[
'progress'
],
'remark'
=>
$detail
[
'remark'
],
'goods'
=>
$detail
[
'goods'
],
'yohoCoinUrl'
=>
$detail
[
'yohoCoinUrl'
],
'orderBalance'
=>
isset
(
$detail
[
'orderBalance'
])
?
$detail
[
'orderBalance'
]
:
array
(),
'operation'
=>
$detail
[
'operation'
],
'totalYoho'
=>
$detail
[
'yoho_give_coin'
],
);
if
(
isset
(
$detail
[
'noramlPayMode'
]))
{
$data
[
'orderInfo'
]
=
$detail
[
'orderInfo'
];
$data
[
'traceOrder'
]
=
$detail
[
'traceOrder'
];
$data
[
'noramlPayMode'
]
=
$detail
[
'noramlPayMode'
];
}
else
if
(
isset
(
$detail
[
'virtualPayMode'
]))
{
$data
[
'virtualPayMode'
]
=
$detail
[
'virtualPayMode'
];
}
//JIT拆单
$packages
=
$detail
[
'packages'
];
}
$this
->
_view
->
display
(
'order-detail'
,
array
(
'meOrdersPage'
=>
true
,
'meOrderDetail'
=>
$data
,
'packages'
=>
$packages
));
}
/**
* 二维码票
*/
public
function
ticketsAction
()
{
//判断是否登录
$uid
=
$this
->
auditJumpLogin
();
//头部导航
$channel
=
Helpers
::
getChannelNameByCookie
();
$this
->
setWebNavHeader
(
$channel
);
//面包屑-左侧导航
$path
=
UserModel
::
getCenterCrumb
(
'查看二维码'
,
array
(
'href'
=>
Helpers
::
url
(
'/home/orders'
),
'name'
=>
'订单中心'
));
$leftNav
=
UserModel
::
getCenterLeftNav
(
'我的订单'
,
$uid
);
$orderCode
=
$this
->
get
(
'orderCode'
,
''
);
//兼容老网站传参方式
if
(
!
$orderCode
)
{
$orderCode
=
$this
->
get
(
'order_code'
,
''
);
}
$detail
=
OrderModel
::
getOrderDetail
(
$uid
,
$orderCode
);
//非当前用户的订单,跳转个首
if
(
isset
(
$detail
[
'code'
])
&&
$detail
[
'code'
]
==
400
)
{
$this
->
go
(
Helpers
::
url
(
'/home'
));
}
if
(
isset
(
$detail
)
&&
$detail
)
{
$tickets
=
OrderModel
::
getTicketsInfo
(
$orderCode
);
$data
=
array
(
'path'
=>
$path
,
'userThumb'
=>
UserModel
::
getUserHeadImg
(
$uid
),
'homeNav'
=>
$leftNav
,
'name'
=>
$detail
[
'goods'
][
0
][
'name'
],
'num'
=>
$detail
[
'goods'
][
0
][
'num'
],
'orderNum'
=>
$detail
[
'orderNum'
],
'myOrdersUrl'
=>
Helpers
::
url
(
'/home/orders'
),
'tickets'
=>
$tickets
);
}
$this
->
_view
->
display
(
'ticket'
,
array
(
'meOrderTicket'
=>
$data
));
}
/**
* 取消订单-ajax
*/
public
function
cancelOrderAction
()
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
''
,
'data'
=>
''
);
do
{
/* 判断是不是AJAX请求 */
if
(
!
$this
->
isAjax
())
{
break
;
}
$uid
=
$this
->
auditJumpLogin
();
$orderCode
=
trim
(
$this
->
post
(
'orderCode'
,
''
));
$data
=
OrderData
::
cancelUserOrder
(
$uid
,
$orderCode
);
if
(
!
isset
(
$data
[
'code'
]))
{
break
;
}
}
while
(
false
);
$this
->
echoJson
(
$data
);
}
/**
* 确认订单-ajax
*/
public
function
confirmOrderAction
()
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
''
,
'data'
=>
''
);
do
{
/* 判断是不是AJAX请求 */
if
(
!
$this
->
isAjax
())
{
break
;
}
$uid
=
$this
->
auditJumpLogin
();
$orderCode
=
trim
(
$this
->
post
(
'orderCode'
,
''
));
$data
=
OrderData
::
confirmUserOrder
(
$uid
,
$orderCode
);
if
(
!
isset
(
$data
[
'code'
]))
{
break
;
}
}
while
(
false
);
$this
->
echoJson
(
$data
);
}
}
...
...
Please
register
or
login
to post a comment