Authored by 周少峰

change passport template

... ... @@ -217,21 +217,21 @@
</script>
<script type="text/html" id="tmpl-my-login-new">
<div class="myyoho-info-header clearfix">
<div class="myyoho-photo" ><img src="\{\{headerimg head_ico\}\}" alt="" data-url =""></div>
<h3 class="user-email"><a href="//www.yohobuy.com/home?t=\{\{random\}\}">\{\{profile_name\}\}</a></h3>
<div class="myyoho-photo" ><img src="\{\{headerimg headIco\}\}" alt="" data-url =""></div>
<h3 class="user-email"><a href="//www.yohobuy.com/home?t=\{\{random\}\}">\{\{profileName\}\}</a></h3>
<h3 class="user-level">
VIP:
<span class="leveldetail">\{\{vip.curVipInfo.title\}\}</span>
<span class="leveldetail">\{\{curTitle\}\}</span>
</h3>
\{\{#unless vip3 \}\}
<div class="levelinfo">
<div class="levelwrapper float-left">
<div class="levelspan">
\{\{vip.curYearCost\}\}/\{\{vip.nextVipInfo.needCost\}\}
\{\{curYearCost\}\}/\{\{nextVipNeedCost\}\}
</div>
<p class="\{\{#if vip.curYearCostPer\}\}integrate\{\{/if\}\}" style="width: \{\{vip.curYearCostPer\}\}%;"></p>
<p class="\{\{#if curYearCostPer\}\}integrate\{\{/if\}\}" style="width: \{\{curYearCostPer\}\}%;"></p>
</div>
<span class="cardcate float-left">\{\{vip.nextVipInfo.title\}\}</span>
<span class="cardcate float-left">\{\{nextVipTitle\}\}</span>
</div>
\{\{/unless\}\}
</div>
... ... @@ -240,7 +240,7 @@
<span class="itemdetail float-left">
<a href="//www.yohobuy.com/home/orders?t=\{\{timestamp\}\}">待处理的订单</a>
</span>
<span class="itemnum float-right">\{\{orderCount\}\}</span>
<span class="itemnum float-right">\{\{order\}\}</span>
</li>
<li class="item">
<span class="itemdetail float-left">
... ... @@ -252,19 +252,19 @@
<span class="itemdetail float-left">
<a href="//www.yohobuy.com/home/coupons?t=\{\{timestamp\}\}">我的优惠券</a>
</span>
<span class="itemnum float-right">\{\{couponCount\}\}</span>
<span class="itemnum float-right">\{\{coupon\}\}</span>
</li>
<li class="item">
<span class="itemdetail float-left">
<a href="//www.yohobuy.com/home/currency?t=\{\{timestamp\}\}">我的YOHO币</a>
</span>
<span class="itemnum float-right">\{\{YohocoinCount\}\}</span>
<span class="itemnum float-right">\{\{coin\}\}</span>
</li>
<li class="item">
<span class="itemdetail float-left">
<a href="//www.yohobuy.com/home/returns?t=\{\{timestamp\}\}">我的退货换货</a>
</span>
<span class="itemnum float-right">\{\{refundCount\}\}</span>
<span class="itemnum float-right">\{\{return\}\}</span>
</li>
</ul>
<div class="myyoho-info-footer">
... ...
... ... @@ -1399,7 +1399,7 @@ function actionLoginState(_data) {
'{{/unless}}';
var $boxObj = $('#loginBox');
var info = window.cookie('_UID');
var name = _data.data.profile_name;
var name = _data.profileName;
var _length = 0;
var t = 0;
var char = '';
... ... @@ -1474,14 +1474,14 @@ function actionLoginState(_data) {
* @return {[type]} [description]
*/
function actionVipInfo(_data) {
var vipInfo = _data.data;
var vipInfo = _data;
var headUrl = '';
if (_data.result === 1) {
if (typeof vipInfo === undefined || vipInfo.length < 1) {
return false;
}
if (vipInfo.vip.curVipInfo.curLevel === '3') {
if (vipInfo.curLevel === '3') {
vipInfo.vip3 = true;
}
... ...
... ... @@ -11,6 +11,7 @@ use LibModels\Web\Home\CartData;
use WebPlugin\Cache;
use WebPlugin\Images;
use WebPlugin\Helpers;
use Api\Yohobuy;
class CommonController extends WebAction
{
... ... @@ -239,27 +240,57 @@ class CommonController extends WebAction
*/
public function passportAction()
{
// 是否调用个人信息数字接口
$getNumberFlag = true;
$userInfo = array();
$callback = $this->get('callback');
$uid = $this->getUid();
do {
if (empty($uid)) {
break;
}
//调用用户信息
// $userInfo = UserData::passportGet($uid);
//获取个人信息VIP资料
$api['profile'] = UserData::getUserProfile($uid, true);
$api['number'] = UserData::getUserInfoNum($uid, true);
$apiInfo = \Api\Yohobuy::getMulti($api);
if ($getNumberFlag) {
$api['number'] = UserData::getUserInfoNum($uid, true);
}
$apiInfo = Yohobuy::getMulti($api);
//个人信息调用失败返回
if (!isset($apiInfo['profile']) || empty($apiInfo['profile'])) {
break;
}
$userInfo['result'] = 1;
//个人资料
$userInfo['profileName'] = $apiInfo['profile']['profile_name'];
$userInfo['headIco'] = isset($apiInfo['profile']['head_ico']) && !empty($apiInfo['profile']['head_ico']) ? $apiInfo['profile']['head_ico'] : '';
//VIP信息
$userInfo['curLevel'] = $apiInfo['profile']['vip_info']['cur_level'];
$userInfo['curTitle'] = $apiInfo['profile']['vip_info']['title'];
$userInfo['curYearCost'] = isset($apiInfo['profile']['vip_info']['curYearCost']) ? $apiInfo['profile']['vip_info']['curYearCost'] : 0;
$userInfo['nextLevel'] = isset($apiInfo['profile']['vip_info']['next_level']) ? $apiInfo['profile']['vip_info']['next_level'] : 0;
$userInfo['nextVipTitle'] = isset($apiInfo['profile']['vip_info']['nextVipTitle']) ? $apiInfo['profile']['vip_info']['nextVipTitle'] : '';
$userInfo['nextVipNeedCost'] = isset($apiInfo['profile']['vip_info']['nextVipNeedCost']) ? $apiInfo['profile']['vip_info']['nextVipNeedCost'] : 0;
//升级百分比
if ($userInfo['nextVipNeedCost']) {
$userInfo['curYearCostPer'] = round($userInfo['curYearCost'] / $userInfo['nextVipNeedCost'] * 100);
}
$userInfo['data'] = array_merge($apiInfo['profile'], $apiInfo['number']);
$userInfo['data']['vip'] = $userInfo['data']['vip_info'];
unset($userInfo['data']['vip_info']);
$userInfo['data']['result'] = 1;
//待处理订单
$userInfo['order'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['wait_pay_num'] + $apiInfo['number']['wait_cargo_num'] + $apiInfo['number']['send_cargo_num'] : 0;
//我的收藏
$userInfo['favorite'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['brand_favorite_total'] : 0;
//我的优惠券
$userInfo['coupon'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['coupon_num'] : 0;
//我的YOHO币
$userInfo['coin'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['yoho_coin_num'] : 0;
//我的退换货
$userInfo['return'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['refund_exchange_num'] : 0;
//更新购物车cookie信息
$total = 0;
... ...