{extend name="$base" /} {block name="resources"} {/block} {block name="main"} {php} // 会员等级 $member_level_list = api('System.Member.memberLevelQuery'); $member_level_list = $member_level_list['data']['data']; // 会员账户信息 $member_account = api("System.Member.memberAccount"); $member_account = $member_account['data']; // 会员等级配置 $level_config = api('System.Config.memberLevelConfig'); $level_config = $level_config['data']; // 1按积分 2按消费额 3按购买次数 // 会员信息 $member_info = api('System.Member.memberInfo'); $member_info = $member_info['data']; if(!empty($member_level_list)){ foreach($member_level_list as $key => $item){ if($item['level_id'] == $member_info['member_level']){ $member_info['level_info'] = $item; if(!empty($member_level_list[$key + 1])) $member_info['next_level_info'] = $member_level_list[$key + 1]; } } } if(!empty($member_info['next_level_info'])){ if ($level_config['type'] == 1) { $member_info['next_level_info']['need'] = $member_info['next_level_info']['min_integral'] - $member_account['member_sum_point']; $member_info['next_level_info']['need'] = $member_info['next_level_info']['need'] < 0 ? 0 : $member_info['next_level_info']['need']; $member_info['next_level_info']['desc'] = '已有'.round($member_account['member_sum_point']).'积分，升级还需'.round($member_info['next_level_info']['need']).'积分'; $member_info['next_level_info']['ratio'] = round($member_account['member_sum_point'] / $member_info['next_level_info']['min_integral'], 2) * 100; $member_info['next_level_info']['ratio'] = $member_info['next_level_info']['ratio'] > 100 ? 100 : $member_info['next_level_info']['ratio']; } elseif($level_config['type'] == 2) { $member_info['next_level_info']['need'] = $member_info['next_level_info']['quota'] - $member_account['member_cunsum']; $member_info['next_level_info']['need'] = $member_info['next_level_info']['need'] < 0 ? 0 : $member_info['next_level_info']['need']; $member_info['next_level_info']['desc'] = '已消费'.$member_account['member_cunsum'].'元，升级还需'.$member_info['next_level_info']['need'].'元'; $member_info['next_level_info']['ratio'] = round($member_account['member_cunsum'] / $member_info['next_level_info']['quota'], 2) * 100; $member_info['next_level_info']['ratio'] = $member_info['next_level_info']['ratio'] > 100 ? 100 : $member_info['next_level_info']['ratio']; } elseif($level_config['type'] == 3) { $member_info['next_level_info']['need'] = $member_info['next_level_info']['order_num'] - $member_account['order_num']; $member_info['next_level_info']['need'] = $member_info['next_level_info']['need'] < 0 ? 0 : $member_info['next_level_info']['need']; $member_info['next_level_info']['desc'] = '已购买'.$member_account['order_num'].'次，升级还需购买'.$member_info['next_level_info']['need'].'次'; $member_info['next_level_info']['ratio'] = round($member_account['order_num'] / $member_info['next_level_info']['order_num'], 2) * 100; $member_info['next_level_info']['ratio'] = $member_info['next_level_info']['ratio'] > 100 ? 100 : $member_info['next_level_info']['ratio']; } } {/php}
{if condition="$member_info['user_info']['user_headimg'] eq ''"} {else/} {/if}

{$member_info['user_info']['nick_name']}

{notempty name="$member_info['level_info']"}
{$member_info['level_info']['level_name']}
{/notempty} {notempty name="$member_info['next_level_info']"}
{$member_info['next_level_info']['desc']}
{else/}
您已经是最高级别的会员了！
{/notempty}

升级会员，享专属权益

- 专属标签

  标签达人

- 专享折扣

  {if !empty($member_info['level_info']) && $member_info['level_info']['goods_discount'] < 1}

  专享{$member_info['level_info']['goods_discount'] * 10}折

  {/if}

- 优质服务

  360度全方位

{notempty name="$member_level_list"}

### 会员等级

{foreach name="$member_level_list" item="vo"}

- {$vo.level_name}
  条件 | {if $level_config['type'] eq 1} 累计积分满{$vo.min_integral}分 {elseif $level_config['type'] eq 2} 消费额满{$vo.quota}元 {elseif $level_config['type'] eq 3} 购买量满{$vo.order_num}笔 {/if}
  权益 | {if $vo.goods_discount < 1}购物享{$vo.goods_discount * 10}折优惠{/if}
  升级礼包 | {if $vo.give_coupon > 0}升级送优惠券 {/if} {if $vo.give_point > 0}升级送积分 {/if} {if $vo.give_money > 0}升级送余额 {/if}
  {notempty name="$vo.desc"}
  等级说明 | {$vo.desc}
  {/notempty}

{/foreach}

{/notempty}
{/block} {block name="footer"}{/block}