123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- $title = '我的任务';
- $view
- # 公共页面,这种方式不会更改前端代码,还有一种方式可以参考manage组件
- ->import('inc/head,inc/menu')
- # 设置全局变量
- ->set('title', $title)
- # 这个变量控制不同页面的样式和js文件
- ->set('name', 'mytask')
- ->set('nav', 'user_task')
- # 定义header>span的html为$title
- ->fetch('header span', $title)
- ->append('header', '<a href="<{Dever::url("user/account", "main")}>" class="back"></a>')
- ->fetch(array('.tabs a@class', 0), '<{Dever::input("type", 1) == 1 ? "cur" : ""}>')
- ->fetch(array('.tabs a@class', 1), '<{Dever::input("type", 1) == 2 ? "cur" : ""}>')
- ->fetch(array('.tabs a@href', 0), '<{Dever::url("user/task?type=1", "main")}>')
- ->fetch(array('.tabs a@href', 1), '<{Dever::url("user/task?type=2", "main")}>')
- # 循环
- ->loop
- (
- '.tasklist .task',
- 'task/info.user',
- array
- (
- 'dt' => '$v.name',
- '.tk-column' => array
- (
- 'style' => '<{$v.score.total ? "" : "display:none;"}>',
- '.ico-person' => array
- (
- 'html' => '$v.score.report',
- ),
- '.ico-team' => array
- (
- 'html' => '$v.score.group',
- ),
- ),
- '.ico-person' => array
- (
- 'style' => '<{$v.score.report ? "" : "display:none;"}>',
- ),
- '.ico-team' => array
- (
- 'style' => '<{$v.score.group ? "" : "display:none;"}>',
- ),
- '.tk-coin' => array
- (
- 'style' => '<{$v.score.total ? "" : "display:none;"}>',
- '.ico-count' => array
- (
- 'html' => '$v.score.total',
- ),
- ),
- '.org' => array
- (
- 'href' => '$v.link',
- ),
- '.button|1' => array
- (
- 'href' => '<{Dever::url("user/report?type=".Dever::input("type", 1)."&id=".$v.id, "main")}>',
- ),
- )
- )
- ->fetch('.no-result .button@href', '<{Dever::url("task/list", "main")}>')
- ->fetch('.no-result@style', '<{Dever::load("task/info.user") ? "display:none;" : ""}>')
- # 暂无记录
- ->append('.wrapper', '<div id="page" dever-page-link="<{Dever::pageInfo()["link"]}>" dever-page-list=".wrapper"></div>')
- ->import('inc/foot')
- ->display();
|