Commit 536a9bfa by 冷斌

fix bug

parent 123f1cf5
<?php <?php
namespace App\basic\Lib\Action; namespace App\basic\Lib\Action;
use App\classroom\Lib\Action\CommonAction; use App\classroom\Lib\Action\CommonAction;
...@@ -6,13 +7,15 @@ use App\classroom\Lib\Action\CommonAction; ...@@ -6,13 +7,15 @@ use App\classroom\Lib\Action\CommonAction;
/** /**
* 单页 * 单页
*/ */
class SingleAction extends CommonAction { class SingleAction extends CommonAction
{
/** /**
* 初始化,配置内容标题 * 初始化,配置内容标题
* @return void * @return void
*/ */
public function _initialize() { public function _initialize()
{
parent::_initialize(); parent::_initialize();
} }
...@@ -20,38 +23,40 @@ class SingleAction extends CommonAction { ...@@ -20,38 +23,40 @@ class SingleAction extends CommonAction {
* 首页 * 首页
* @return void * @return void
*/ */
public function info() { public function info()
$id = t($_GET['id']); {
var_dump($id); $id = t($_GET['id']);
die; if ($id === 'buy') {
$map['is_del'] = 0; $res = [
if( is_numeric( $id )) { 'title' => '购买协议',
$map['id'] = $id; 'text' => model('Xdata')->get("admin_Config:about"),
];
} else { } else {
$map['key'] = $id; $map['is_del'] = 0;
} if (is_numeric($id)) {
$res = M('single')->where($map)->find(); $map['id'] = $id;
} else {
if( !$res ) { $map['key'] = $id;
unset( $map['id'] ); }
$map['key'] = $id;
$res = M('single')->where($map)->find(); $res = M('single')->where($map)->find();
}
$this->assign('data' , $res); if (!$res) {
unset($map['id']);
$map['key'] = $id;
$res = M('single')->where($map)->find();
}
}
$this->assign('data', $res);
$this->display(); $this->display();
} }
/** /**
* 独立的单页 * 独立的单页
*/ */
public function indie(){ public function indie()
$this->display();
}
public function buy()
{ {
echo 1; die; $this->display();
} }
} }
<include file="__THEME__/public_header_w3g" /> <include file="__THEME__/_header_w3g" />
<style> <style>
body { .content ,.cf2{ background-color: #f0f0f2!important;padding:10px 0; }
padding: 0 !important; .wrap{min-height: 400px;background: #fff; padding: 20px; margin-bottom: 20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; border: 1px solid #e4ecf3;}
} .jgpage_right_tit{padding-bottom:20px;margin: 0 0 20px 0; border-bottom: 1px solid #f5f5f5;}
.jgpage_right_tit{color:#333;font-size:18px;}
.jgpage_right_con{overflow:hidden;line-height: 36px;}
</style> </style>
<div class="content cf2">
<div id="app"> <div class="wrap">
<div class="layout_v"> <div class="jgpage_right_tit mb30">{$data.title}</div>
<van-cell @click="onChangePwd" title="修改密码" is-link ></van-cell> <div class="jgpage_right_con">
<!-- <van-cell @click="onFeedback" title="意见反馈" is-link ></van-cell>--> {$data.text}
<!-- <van-cell @click="onAboutUs" title="关于我们" is-link ></van-cell>--> </div>
<van-cell @click="onQuit" title="退出账号" is-link ></van-cell>
</div> </div>
</div> </div>
<script type="text/javascript">
new Vue({
el: "#app",
data: function() {
return {
}
},
mounted:function(){
document.title = "设置"
},
methods: {
onChangePwd: function() {
window.location.href = "{:U('home/User/changepsw')}"
},
onFeedback: function() {
},
onAboutUs: function() {
},
onQuit: function() {
logout()
}
}
})
</script>
<include file="__THEME__/public_footer_w3g"/> <include file="__THEME__/public_footer_w3g"/>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment