123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?php
- namespace app\admin\controller\ask;
- use app\common\controller\Backend;
- use think\Session;
- /**
- * 移动端主题
- *
- * @icon fa fa-gears
- */
- class Theme extends Backend
- {
- /**
- * 查看
- */
- public function index()
- {
- if ($this->request->isPost()) {
- $preview = $this->request->post('preview');
- $navbar = $this->request->post('navbar/a', []);
- $theme = $this->request->post('theme/a', []);
- $tabbar = $this->request->post('tabbar/a', []);
- $tabbar['midButton'] = (bool)$tabbar['midButton'];
- $tabbar['borderTop'] = (bool)$tabbar['borderTop'];
- if (isset($tabbar['list'])) {
- foreach ($tabbar['list'] as $index => &$item) {
- $item['midButton'] = isset($item['midButton']) && $item['midButton'] ? true : false;
- $item = array_merge($item, [
- 'count' => 0,
- 'isDot' => false,
- 'badgeColor' => $theme['color'], //字体颜色
- 'badgeBgColor' => $theme['bgColor'], //背景颜色
- ]);
- }
- $tabbar['list'] = array_values($tabbar['list']);
- }
- $theme = array_merge($theme, [
- 'ladder' => 10,//前景色和背景色的阶梯数
- 'number' => 9,//取第几个的阶梯颜色
- 'border' => 5,//边框取第几个阶梯数
- ]);
- $navbar['isshow'] = true;
- $tabbar['isshow'] = true;
- $config = [
- 'navbar' => $navbar,
- 'theme' => $theme,
- 'tabbar' => $tabbar,
- ];
- //如果是预览模式则写入session
- if ($preview) {
- Session::set("previewtheme-ask", $config);
- } else {
- \addons\ask\library\Theme::set($config);
- }
- $this->success();
- }
- $config = \addons\ask\library\Theme::get();
- $this->view->assign("themeConfig", $config);
- $this->assignconfig("themeConfig", $config);
- return $this->view->fetch();
- }
- public function get_page_list()
- {
- $pageList = [
- ['path' => 'https://www.baidu.com', 'name' => '外部链接'],
- ['path' => '/pages/question/index', 'name' => '问答'],
- ['path' => '/pages/question/detail?id=1', 'name' => '问答详情(问答ID)'],
- ['path' => '/pages/question/post', 'name' => '发布问题'],
- ['path' => '/pages/question/answer', 'name' => '完善回答'],
- ['path' => '/pages/article/index', 'name' => '文章'],
- ['path' => '/pages/article/detail?id=1', 'name' => '文章详情(文章ID)'],
- ['path' => '/pages/article/post', 'name' => '发布文章'],
- ['path' => '/pages/experts/index', 'name' => '专家'],
- ['path' => '/pages/experts/detail?id=1', 'name' => '专家详情(专家ID)'],
- ['path' => '/pages/experts/post', 'name' => '申请专家认证'],
- ['path' => '/pages/zone/index', 'name' => '专区'],
- ['path' => '/pages/my/index', 'name' => '个人中心'],
- ['path' => '/pages/my/question', 'name' => '我(他?user_id=1)的问题'],
- ['path' => '/pages/my/answer', 'name' => '我(他?user_id=1)的回答'],
- ['path' => '/pages/my/article', 'name' => '我(他?user_id=1)的文章'],
- ['path' => '/pages/my/follower', 'name' => '我(他?user_id=1)的粉丝'],
- ['path' => '/pages/my/attention', 'name' => '我(他?user_id=1)的关注'],
- ['path' => '/pages/my/collection', 'name' => '我的收藏'],
- ['path' => '/pages/my/notification', 'name' => '我的通知'],
- ['path' => '/pages/my/message', 'name' => '我的私信'],
- ['path' => '/pages/my/invite', 'name' => '邀请我回答'],
- ['path' => '/pages/my/recharge', 'name' => '余额充值'],
- ['path' => '/pages/user/index?user_id=1', 'name' => '个人主页(指定用户ID)'],
- ['path' => '/pages/zone/index', 'name' => '专区'],
- ['path' => '/pages/zone/detail?id=1', 'name' => '专区详情'],
- ['path' => '/pages/setting/setting', 'name' => '设置'],
- ['path' => '/pages/setting/myinfo', 'name' => '会员中心'],
- ['path' => '/pages/setting/editinfo', 'name' => '修改资料'],
- ['path' => '/pages/setting/editpwd', 'name' => '修改密码'],
- ['path' => '/pages/search/search', 'name' => '搜索'],
- ['path' => '/pages/tag/detail?id=1&type=question', 'name' => '话题(指定话题ID和类型)'],
- ['path' => '/pages/logs/money', 'name' => '余额日志'],
- ['path' => '/pages/logs/score', 'name' => '积分日志'],
- ['path' => '/pages/other/about', 'name' => '关于我们'],
- ['path' => '/pages/my/agreement', 'name' => '用户协议'],
- ['path' => '/pages/signin/signin', 'name' => '签到'],
- ['path' => '/pages/signin/ranking', 'name' => '签到排行榜'],
- ['path' => '/pages/signin/logs', 'name' => '签到日志'],
- ['path' => '/pages/login/login', 'name' => '登录(账号密码)'],
- ['path' => '/pages/login/mobilelogin', 'name' => '登录(手机号)'],
- ['path' => '/pages/login/register', 'name' => '注册'],
- ['path' => '/pages/login/forgetpwd', 'name' => '忘记密码'],
- ];
- $this->view->assign('pageList', $pageList);
- return $this->view->fetch('ask/theme/pages');
- }
- }
|