<?php

/* ========================================================================
 * $Id: search.php 1651 2020-07-08 15:02:46Z onez $
 * 
 * Email: www@onez.cn
 * QQ: 6200103
 * HomePage: http://www.onez.cn
 * ========================================================================
 * Copyright 2016-2017 佳蓝科技.
 * 
 * ======================================================================== */

!defined('IN_ONEZ') && exit('Access Denied');
# search
#请求数据
if($MODE=='$post'){
  $action=onez()->gp('action');
  if($action=='data'){
    $action=onez()->gp('ac');


    if($action=='del'){
      $id=(int)onez()->gp('id');
    }
    $data=array();
    $data['title']='帮助中心';
    $datatable=$this->load('datatable');
    $datatable->set('colFunc',function(&$rs){
      $rs['items']=$items;
      $rs['title']=$rs['token'];
      $rs['summary']=date('Y-m-d H:i:s',$rs['addtime']);
      $rs['content']=$rs['sendBody'];
    });
    $datatable->set('del','1');
    $datatable->set('fields','id,title,value,summary,content');

    $orderno=onez()->gp('orderno');
    $data['orderno']=$orderno;
    $xxx='';
    if($orderno){
      $xxx.=" and token='$orderno'";
    }
    $datatable->output($data,array(
      'table'=>'orders',

      'where'=>"1$xxx order by id desc",
      'pagesize'=>999,
    ));
    $A['pagedata']=$data;
  }
  return;
}
?>
<template v-if="$pagedata && pagedata.title">

<div class="searchBox">
  <van-search v-model="kw" show-action placeholder="请输入您要查询的订单号" @search="onSearch">
    <template #action>
      <van-button plain type="info" @click="onSearch">查看</van-button>
    </template>
  </van-search>
</div>
<template v-if="pagedata.orderno">
<dl v-for="(item,index) in pagedata.record">
  <dt>{{item.title}}</dt>
  <dd v-html="item.content"></dd>
</dl>
<van-empty v-if="pagedata.total==0" image="error" description="很抱歉，没有找到符合条件的条" />
</template>
<template v-else>
<van-empty description="请填写您要查询的订单号" />
</template>
</template>