<?php

/* ========================================================================
 * $Id: view.php 1397 2020-07-08 22:52:45Z onez $
 * 
 * Email: www@onez.cn
 * QQ: 6200103
 * HomePage: http://www.onez.cn
 * ========================================================================
 * Copyright 2016-2017 佳蓝科技.
 * 
 * ======================================================================== */

!defined('IN_ONEZ') && exit('Access Denied');
# edit
#请求数据
if($MODE=='$post'){
  $id=onez()->gp('id');
  $action=onez()->gp('action');
  if($action=='data'){
    $key=onez()->gp('key');
    unset($_POST['action']);
    
    $G['site']=$G['this']->site;
    $_POST['_siteid']=(int)$G['site']['id'];
    $r=onez('bs.app.shipments')->onezapi('view',array('key'=>$key,'post'=>$_POST));
    if($r['isRead']){
      $onezInfoFile=ONEZ_CACHE_PATH.'/plugins/bs/infos/users/'.$G['site']['userid'].'.php';
      @unlink($onezInfoFile);
    }
    if($r['uninstall']){
      $_r=onez('bs.app.shipments')->uninstall($r['uninstall'],$G['site']['id']);
      $_r && $r=array_merge($r,$_r);
    }
    if($r['install']){
      $_r=onez('bs.app.shipments')->install($r['install'],$G['site']['id']);
      $_r && $r=array_merge($r,$_r);
    }
    if($r['upgrade']){
      foreach($r['upgrade'] as $v){
        onez('fetch')->get($v,1);
      }
    }
    if(onez()->gp('ac')){
      return $r;
    }
    $A['html']=$r;
  }
  return;
}
$this->add(array(
  'type'=>'breadcrumb',
  'name'=>'面包屑导航',
  'data'=>'html',
));
?>
<section :class="html.classname">
  <template v-if="html.type=='record'">
    <component v-for="item in html.record" :is="item.type||'onez-html'" :data="item"></component>
  </template>
  <component v-else :is="html.type||'onez-html'" :data="html"></component>
</section>
