@ -0,0 +1,18 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
return [ |
||||
|
'template' => [ |
||||
|
'taglib_pre_load' => 'app\\culture\\taglib\\Yf', |
||||
|
], |
||||
|
'hostpath'=>'https://xcx.szcaee.cn', |
||||
|
'aes'=>[ |
||||
|
'key'=>'92dbf2e19f802e68755a0917eb42071b', |
||||
|
'iv'=>'91828dd543e6db32', |
||||
|
], |
||||
|
]; |
||||
@ -0,0 +1,158 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
namespace app\culture\controller; |
||||
|
|
||||
|
use think\Controller; |
||||
|
use think\Validate; |
||||
|
|
||||
|
class Agency extends Base{ |
||||
|
protected $current=[['title'=>'文化金融服务机构']]; |
||||
|
protected $apitoken=''; |
||||
|
public function _initialize(){ |
||||
|
parent::_initialize(); |
||||
|
$this->assign('current',$this->current); |
||||
|
$this->apitoken=session('api_token'); |
||||
|
} |
||||
|
/** |
||||
|
* 机构列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function investors(){ |
||||
|
$page=input('page',1,'intval'); |
||||
|
$industry_id=input('industry_id','','intval'); |
||||
|
$investment_id=input('investment_id','','intval'); |
||||
|
$region_id=input('region_id','','intval'); |
||||
|
$keyword=input('keyword'); |
||||
|
$sort=input('sort'); |
||||
|
|
||||
|
$token=request()->token('__agen__'); |
||||
|
if($keyword){ |
||||
|
$rule = [ |
||||
|
'__agen__' =>'require|token:__agen__' |
||||
|
]; |
||||
|
$message =[ |
||||
|
'__agen__.require'=>'令牌缺失' |
||||
|
]; |
||||
|
|
||||
|
$validate=new Validate($rule,$message); |
||||
|
$result=$validate->check(input()); |
||||
|
if(!$result){ |
||||
|
return json_encode(['investors'=>[],'token'=>$token]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$parmas=['page'=>$page,'industry_id'=>$industry_id,'region_id'=>$region_id,'investment_id'=>$investment_id,'keyword'=>$keyword,'sort'=>$sort]; |
||||
|
$params=http_build_query($parmas); |
||||
|
$url=$this->hostpath."/api/investors/index?".$params; |
||||
|
$investors="[]"; |
||||
|
try { |
||||
|
$investors=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return json_encode(['investors'=>$investors,'token'=>$token]); |
||||
|
} |
||||
|
/** |
||||
|
* 获取机构联系⽅式 |
||||
|
* @return array|mixed |
||||
|
*/ |
||||
|
public function contact(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$url=$this->hostpath."/api/investors/".$id."/contact"; |
||||
|
$pro=[]; |
||||
|
try { |
||||
|
$pro=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$pro=json_decode($pro,true); |
||||
|
if(!isset($pro['name']))$pro=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $pro; |
||||
|
} |
||||
|
/** |
||||
|
* 机构详情 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function detail(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$this->assign('id',$id); |
||||
|
$this->assign('type','机构'); |
||||
|
|
||||
|
$apitoken=session('api_token'); |
||||
|
if(empty($apitoken)){ |
||||
|
$this->error('请先登录'); |
||||
|
} |
||||
|
|
||||
|
$pro=[]; |
||||
|
$title=""; |
||||
|
if($id){ |
||||
|
$url=$this->hostpath."/api/investors/".$id; |
||||
|
try { |
||||
|
$header=['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]; |
||||
|
$pro=go_curl($url,'GET',false,$header); |
||||
|
$pro=json_decode($pro,true); |
||||
|
$title=$pro['name']; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
if(isset($pro['id'])&&isset($pro['message'])){ |
||||
|
$this->error($pro['message']); |
||||
|
} |
||||
|
if(!isset($pro['name']))$pro=['avatar'=>'','name'=>'','industries'=>[],'investable_type'=>'','individual_info'=>[],'description'=>'','reputation'=>0]; |
||||
|
if(isset($pro['reputation'])){ |
||||
|
$score=$pro['reputation']; |
||||
|
$userinfo=$this->getUserProfile(); |
||||
|
if(!isset($userinfo['reputation'])||$score>$userinfo['reputation']){ |
||||
|
$this->error('你的信誉积分不足,请补全认证资料增加信誉积分才可以查看'); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>$title]); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('detail',$pro); |
||||
|
|
||||
|
return $this->view->fetch(':agency_detail'); |
||||
|
} |
||||
|
/** |
||||
|
* 机构列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function index(){ |
||||
|
$userscore=''; |
||||
|
$profile=false; |
||||
|
$apitoken=session('api_token'); |
||||
|
if($apitoken){ |
||||
|
$userinfo=$this->getUserProfile(); |
||||
|
if(isset($userinfo['reputation'])){ |
||||
|
$userscore=$userinfo['reputation']; |
||||
|
} |
||||
|
|
||||
|
if(isset($userinfo['profile_completed'])){ |
||||
|
$profile=$userinfo['profile_completed']; |
||||
|
} |
||||
|
} |
||||
|
$this->assign('profile',intval($profile)); |
||||
|
$this->assign('userscore',$userscore); |
||||
|
$url=$this->hostpath."/api/investor/filters"; |
||||
|
$profilters="[]"; |
||||
|
try { |
||||
|
$profilters=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$profilters=json_decode($profilters,true); |
||||
|
if(isset($profilters['id']))$profilters=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('profilters',$profilters); |
||||
|
return $this->view->fetch(':agency'); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,197 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
namespace app\culture\controller; |
||||
|
|
||||
|
use app\common\controller\Common; |
||||
|
use app\admin\model\Options; |
||||
|
use think\Db; |
||||
|
use think\Session; |
||||
|
use think\Request; |
||||
|
|
||||
|
class Base extends Common{ |
||||
|
protected $hostpath; |
||||
|
protected $menu_arr; |
||||
|
protected function _initialize(){ |
||||
|
parent::_initialize(); |
||||
|
$this->hostpath=config('hostpath'); |
||||
|
$this->curren_menu_id=7; |
||||
|
//菜单 |
||||
|
$this->menu_id=input('id',0,'intval'); |
||||
|
if($this->menu_id){ |
||||
|
$this->menu_arr=get_menu_parents($this->menu_id); |
||||
|
if($this->menu_arr){ |
||||
|
$this->curren_menu_id=$this->menu_arr[0]; |
||||
|
} |
||||
|
} |
||||
|
$this->assign('curren_menu_id',$this->curren_menu_id); |
||||
|
|
||||
|
$this->assign('menu_arr',$this->menu_arr); |
||||
|
//主题 |
||||
|
$site_options=Options::get_options('site_options',$this->lang); |
||||
|
|
||||
|
$this->site_options=$site_options; |
||||
|
$site_options['site_tongji']=htmlspecialchars_decode($site_options['site_tongji']); |
||||
|
$site_options['site_copyright']=htmlspecialchars_decode($site_options['site_copyright']); |
||||
|
//主题 |
||||
|
$theme=$site_options['site_tpl']; |
||||
|
$this->assign($site_options); |
||||
|
|
||||
|
$this->view=$this->view->config('view_path',APP_PATH.request()->module().'/view/'.$theme.'/'); |
||||
|
$yf_theme_path=__ROOT__.'/app/culture/view/'.$theme.'/'; |
||||
|
$this->assign('yf_theme_path',$yf_theme_path); |
||||
|
|
||||
|
$yf_theme_path=__ROOT__.'/app/home/view/'.$theme.'/'; |
||||
|
$this->assign('yf_home_path',$yf_theme_path); |
||||
|
|
||||
|
$home_slides=Db::name('link')->where(['lk_cid'=>3,'lk_status'=>1])->order('lk_order')->select(); |
||||
|
$this->assign("home_slides",$home_slides); |
||||
|
|
||||
|
$is_mobile=0; |
||||
|
if(request()->isMobile()){ |
||||
|
$is_mobile=1; |
||||
|
} |
||||
|
$is_admin=false; |
||||
|
$address=''; |
||||
|
$this->user=array(); |
||||
|
$uid=session('hid'); |
||||
|
|
||||
|
if(session('hid')){ |
||||
|
$this->user=Db::name('member_list')->find(session('hid')); |
||||
|
if(!empty($this->user['member_list_province'])){ |
||||
|
$rst=Db::name('region')->field('name')->find($this->user['member_list_province']); |
||||
|
$address.=$rst?$rst['name'].lang('province'):''; |
||||
|
} |
||||
|
if(!empty($this->user['member_list_city'])){ |
||||
|
$rst=Db::name('region')->field('name')->find($this->user['member_list_city']); |
||||
|
$address.=$rst?$rst['name'].lang('city'):''; |
||||
|
} |
||||
|
if(!empty($this->user['member_list_town'])){ |
||||
|
$rst=Db::name('region')->field('name')->find($this->user['member_list_town']); |
||||
|
$address.=$rst?$rst['name']:''; |
||||
|
} |
||||
|
//未读通知数 |
||||
|
$notice_unread=Db::name('cult4notice')->alias('a') |
||||
|
->where(['a.user_id'=>session('hid'),'is_read'=>0]) |
||||
|
->count(); |
||||
|
$this->assign('notice_unread',$notice_unread); |
||||
|
} |
||||
|
//友情链接 |
||||
|
$links=get_links(2); |
||||
|
|
||||
|
$this->assign("links",$links);$this->user['address']=$address; |
||||
|
$this->assign("user",$this->user); |
||||
|
$this->assign("is_admin",$is_admin); |
||||
|
$this->assign("is_mobile",$is_mobile); |
||||
|
|
||||
|
//同意协议 |
||||
|
$agreesys=Options::get_options('agree_options',$this->lang); |
||||
|
$this->assign("agreesys",$agreesys); |
||||
|
|
||||
|
//托管同意协议 |
||||
|
$tg_agreesys1=Options::get_options('agree_options1',$this->lang); |
||||
|
$this->assign("agreesys1",$tg_agreesys1); |
||||
|
|
||||
|
$tg_agreesys2=Options::get_options('agree_options2',$this->lang); |
||||
|
$this->assign("agreesys2",$tg_agreesys2); |
||||
|
|
||||
|
$tg_agreesys3=Options::get_options('agree_options3',$this->lang); |
||||
|
$this->assign("agreesys3",$tg_agreesys3); |
||||
|
|
||||
|
$tg_agreesys4=Options::get_options('agree_options4',$this->lang); |
||||
|
$this->assign("agreesys4",$tg_agreesys4); |
||||
|
|
||||
|
$tg_agreesys5=Options::get_options('agree_options5',$this->lang); |
||||
|
$this->assign("agreesys5",$tg_agreesys5); |
||||
|
|
||||
|
//托管同意协议 |
||||
|
$tg_agreesys1=Options::get_options('tgagree_options1',$this->lang); |
||||
|
$this->assign("tg_agreesys1",$tg_agreesys1); |
||||
|
|
||||
|
$tg_agreesys2=Options::get_options('tgagree_options2',$this->lang); |
||||
|
$this->assign("tg_agreesys2",$tg_agreesys2); |
||||
|
|
||||
|
$tg_agreesys3=Options::get_options('tgagree_options3',$this->lang); |
||||
|
$this->assign("tg_agreesys3",$tg_agreesys3); |
||||
|
|
||||
|
$tg_agreesys4=Options::get_options('tgagree_options4',$this->lang); |
||||
|
$this->assign("tg_agreesys4",$tg_agreesys4); |
||||
|
|
||||
|
$tg_agreesys5=Options::get_options('tgagree_options5',$this->lang); |
||||
|
$this->assign("tg_agreesys5",$tg_agreesys5); |
||||
|
|
||||
|
|
||||
|
|
||||
|
//托管同意协议 |
||||
|
$org_agreesys= Db::name('org_temp')->where(['code'=>'orgagree_options'])->find(); |
||||
|
$this->assign("org_agreesys",$org_agreesys); |
||||
|
//登录掌柜文化金服token |
||||
|
$this->assign("user_token",session('user_token')); |
||||
|
|
||||
|
|
||||
|
//浏览器检测 |
||||
|
$broswer=getBroswer(true); |
||||
|
$this->assign('broswer', $broswer); |
||||
|
|
||||
|
} |
||||
|
// 获取sign |
||||
|
protected function getSign2($data){ |
||||
|
$aes=config('aes'); |
||||
|
$crypt = new \Aes(\Aes::AES_128_CBC); |
||||
|
$crypt->setKey($aes['key']); |
||||
|
$crypt->setIV($aes['iv']); |
||||
|
|
||||
|
if (isset($data['token'])) |
||||
|
unset($data['token']); |
||||
|
// 对数组的值按key排序 |
||||
|
ksort($data); |
||||
|
// 生成url的形式 |
||||
|
$params = http_build_query($data); |
||||
|
// 生成sign |
||||
|
$sign = md5($params.$aes['key']); |
||||
|
return $crypt->enUrl($sign); |
||||
|
} |
||||
|
/** |
||||
|
* 上传方法 |
||||
|
*/ |
||||
|
public function upload(Request $request){ |
||||
|
// 获取表单上传文件 |
||||
|
$key=$request->param('key'); |
||||
|
if(!$key)return $this->error('參數錯誤'); |
||||
|
$file = request()->file($key); |
||||
|
// 移动到框架应用根目录/uploads/ 目录下 |
||||
|
$uploadpath=config('upload_path'); |
||||
|
$path=ROOT_PATH . config('upload_path'); |
||||
|
$validate = config('upload_validate'); |
||||
|
$info = $file->validate($validate)->move($path); |
||||
|
if($info){ |
||||
|
$data=array(); |
||||
|
$data['ext']=$info->getExtension(); |
||||
|
$data['path']=$uploadpath.DS.$info->getSaveName(); |
||||
|
$data['filename']=$info->getFilename(); |
||||
|
return $this->success('上傳成功','',$data); |
||||
|
}else{ |
||||
|
return $this->error($file->getError()); |
||||
|
} |
||||
|
} |
||||
|
protected function getUserProfile(){ |
||||
|
$url=$this->hostpath."/api/user/profiles"; |
||||
|
$userinfo=[]; |
||||
|
try { |
||||
|
$apitoken=session("api_token"); |
||||
|
$res=go_curl($url,'GET',false,["Accept:application/json","Authorization:Bearer ".$apitoken]); |
||||
|
$userinfo=json_decode($res,true); |
||||
|
if(empty($res)){ |
||||
|
$userinfo=[]; |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $userinfo; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,140 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
namespace app\culture\controller; |
||||
|
|
||||
|
use think\captcha\Captcha; |
||||
|
use think\Session; |
||||
|
use think\Log; |
||||
|
|
||||
|
class Common extends Base{ |
||||
|
public function _initialize(){ |
||||
|
parent::_initialize(); |
||||
|
$this->assign('current',[['title'=>'文化金融服务项目']]); |
||||
|
} |
||||
|
public function verify(){ |
||||
|
$key=request()->param('key'); |
||||
|
if(empty($key))$this->error('缺少参数'); |
||||
|
return $this->verify_build($key); |
||||
|
} |
||||
|
protected function verify_build($id=''){ |
||||
|
ob_end_clean(); |
||||
|
$verify = new Captcha (config('verify')); |
||||
|
return $verify->entry($id); |
||||
|
} |
||||
|
/** |
||||
|
* 登录页面 |
||||
|
* @return mixed|string |
||||
|
*/ |
||||
|
public function login(){ |
||||
|
$apitoken=session('api_token'); |
||||
|
if(!empty($apitoken)){ |
||||
|
$this->redirect(url('culture/user/index')); |
||||
|
} |
||||
|
$this->assign('current',[['title'=>'用户登录']]); |
||||
|
return $this->fetch(':login'); |
||||
|
} |
||||
|
/** |
||||
|
* 退出 |
||||
|
*/ |
||||
|
public function logout(){ |
||||
|
Session::delete('api_token'); |
||||
|
$this->success("登出成功",url('culture/common/login')); |
||||
|
} |
||||
|
/** |
||||
|
* 注册小程序用户 |
||||
|
*/ |
||||
|
public function register(){ |
||||
|
$token=md5('szcaee_culture'); |
||||
|
$options = array( |
||||
|
'token'=>$token, //填写你设定的key |
||||
|
'appid'=>'wx5cf3b72f956ecbe1', //填写高级调用功能的app id, 请在微信开发模式后台查询 |
||||
|
'appsecret'=>'281ad0e4de4c56fe39893d05c1222357', //填写高级调用功能的密钥 |
||||
|
); |
||||
|
|
||||
|
$we_obj = new \Wechat($options); |
||||
|
$code =input('code'); |
||||
|
if ($code) { |
||||
|
Log::write($code); |
||||
|
try { |
||||
|
$json = $we_obj->getOauthAccessToken(); |
||||
|
}catch (\Exception $e){ |
||||
|
$this->redirect(url('culture/common/login')); |
||||
|
} |
||||
|
Log::write($json); |
||||
|
if (!$json) { |
||||
|
$this->redirect(url('culture/common/login')); |
||||
|
} |
||||
|
$openid=$json["openid"]; |
||||
|
$unionid=$json["unionid"]; |
||||
|
$access_token = $json['access_token']; |
||||
|
|
||||
|
$wxuser=['open_id'=>$openid]; |
||||
|
//缓存获取用户资料 |
||||
|
$cache=cache($openid); |
||||
|
$nickname=$avatar=''; |
||||
|
if($cache){ |
||||
|
try { |
||||
|
$userinfo=json_decode($cache,true); |
||||
|
$nickname=$userinfo['nickname']; |
||||
|
$avatar=$userinfo['avatar']; |
||||
|
}catch (\Exception $e){} |
||||
|
}else{ |
||||
|
$userinfo=$we_obj->getOauthUserinfo($access_token,$openid); |
||||
|
if ($userinfo && !empty($userinfo['nickname'])) { |
||||
|
$nickname=$userinfo['nickname']; |
||||
|
$avatar=$userinfo['headimgurl']; |
||||
|
} |
||||
|
$params=['nickname'=>$nickname,'avatar'=>$avatar]; |
||||
|
cache($openid,json_encode($params)); |
||||
|
} |
||||
|
if($nickname)$wxuser['nickname']=$nickname; |
||||
|
if($avatar)$wxuser['avatar']=$avatar; |
||||
|
$wxuser['unionid']=$unionid; |
||||
|
$wxuser['timestamp']=time(); |
||||
|
|
||||
|
$url=$this->hostpath."/api/auth/register"; |
||||
|
$secret="098f6bcd4621d373cade4e832627b4f6"; |
||||
|
$token=$this->getSign($secret, $wxuser); |
||||
|
$wxuser['token']=$token; |
||||
|
$result=['status'=>0]; |
||||
|
Log::write($wxuser); |
||||
|
try { |
||||
|
$res=go_curl($url,'POST',$wxuser,['Accept'=>'application/json']); |
||||
|
Log::write($res); |
||||
|
$res=json_decode($res,true); |
||||
|
if(isset($res['status'])&&$res['status']){ |
||||
|
$result['status']=$res['status']; |
||||
|
Session::delete('api_token'); |
||||
|
session('api_token',$res['access_token']); |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
if($result['status']){ |
||||
|
$this->redirect(url('culture/user/index')); |
||||
|
}else{ |
||||
|
$this->redirect(url('culture/common/login')); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
// 获取sign |
||||
|
protected function getSign($secret, $data) |
||||
|
{ |
||||
|
if (isset($data['token'])) |
||||
|
unset($data['token']); |
||||
|
// 对数组的值按key排序 |
||||
|
ksort($data); |
||||
|
// 生成url的形式 |
||||
|
$params = http_build_query($data); |
||||
|
// 生成sign |
||||
|
$sign = md5($params . $secret); |
||||
|
return $sign; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,218 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
namespace app\culture\controller; |
||||
|
|
||||
|
use think\Db; |
||||
|
class Index extends Base{ |
||||
|
protected $current=[['title'=>'文化金融服务项目']]; |
||||
|
protected $apitoken=''; |
||||
|
public function _initialize(){ |
||||
|
parent::_initialize(); |
||||
|
$this->assign('current',$this->current); |
||||
|
$this->apitoken=session('api_token'); |
||||
|
} |
||||
|
protected function test(){ |
||||
|
$apply_list=Db::name('cult4apply')->alias("a")->join(config('database.prefix').'cult4baseinfo b','a.apply_id =b.apply_id')->where(['b.new_flag'=>1,'a.status'=>array('in',[30,31])])->select(); |
||||
|
|
||||
|
foreach ($apply_list as $row){ |
||||
|
$data=[]; |
||||
|
$data['user_id']='57'; |
||||
|
$data['logo']=$row['logo']; |
||||
|
$region_id='2162'; |
||||
|
switch ($row['apply_type']){ |
||||
|
case 1: |
||||
|
$addr=$row['c_reg_addr']; |
||||
|
$addrs=explode('市', $addr); |
||||
|
$city=$addrs[0]; |
||||
|
if(strpos($city,'省')!=false){ |
||||
|
$addrs=explode('省', $city); |
||||
|
$city=$addrs[1]; |
||||
|
} |
||||
|
if($city){ |
||||
|
$res=Db::connect('db1')->query("select * from regions where name like '%".$city."%'"); |
||||
|
if($res){ |
||||
|
$region_id=$res[0]['id']; |
||||
|
} |
||||
|
} |
||||
|
$data['name']=$row['c_name']; |
||||
|
$data['minimum_amount']=$row['c_reg_capital']; |
||||
|
$data['maximum_amount']=$row['c_reg_capital']; |
||||
|
$data['business_introduction']=$row['c_business_model_descr']; |
||||
|
$data['project_introduction']=$row['c_business_model_descr']; |
||||
|
$data['created_at']=$row['c_appl_date']?date("Y-m-d H:i:s",$row['c_appl_date']):''; |
||||
|
$data['updated_at']=$row['c_appl_date']?date("Y-m-d H:i:s",$row['c_appl_date']):''; |
||||
|
break; |
||||
|
case 2: |
||||
|
$data['name']=$row['p_name']; |
||||
|
$data['minimum_amount']=$row['p_amount']; |
||||
|
$data['maximum_amount']=$row['p_amount']; |
||||
|
$data['business_introduction']=$row['p_business_model_descr']; |
||||
|
$data['project_introduction']=$row['p_descr']; |
||||
|
$data['created_at']=$row['create_time']?date("Y-m-d H:i:s",$row['create_time']):''; |
||||
|
$data['updated_at']=$row['create_time']?date("Y-m-d H:i:s",$row['create_time']):''; |
||||
|
break; |
||||
|
case 3: |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$data['industry_id']=1; |
||||
|
$data['region_id']=$region_id; |
||||
|
$data['investment_id']=1; |
||||
|
$data['major_product_introduction']=''; |
||||
|
$data['core_team_introduction']=''; |
||||
|
$data['financing_introduction']=''; |
||||
|
$data['proposal_images']=''; |
||||
|
$data['proposal_file']=''; |
||||
|
$data['approved_at']=$row['code_oper_time']?date("Y-m-d H:i:s",$row['code_oper_time']):''; |
||||
|
$data['tag']=1; |
||||
|
$query=Db::connect('db1')->table('projects')->insert($data); |
||||
|
$lastid=Db::connect('db1')->table('projects')->getLastInsID(); |
||||
|
|
||||
|
$data=[]; |
||||
|
$data['user_id']='57'; |
||||
|
$data['auditable_type']='App\Project'; |
||||
|
$data['auditable_id']=$lastid; |
||||
|
$data['audited_at']=date("Y-m-d H:i:s",time()); |
||||
|
$data['created_at']=date("Y-m-d H:i:s",time()); |
||||
|
$data['updated_at']=date("Y-m-d H:i:s",time()); |
||||
|
$data['tag']=1; |
||||
|
$query=Db::connect('db1')->table('audits')->insert($data); |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* 中心简介 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function index(){ |
||||
|
$current=[]; |
||||
|
$current[0]['jump']=url('introduction'); |
||||
|
$current[0]['title']='中心简介'; |
||||
|
$this->assign('current',$current); |
||||
|
|
||||
|
$url=$this->hostpath."/api/about"; |
||||
|
|
||||
|
$page="[]"; |
||||
|
try { |
||||
|
$page=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$page=json_decode($page,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('page',$page); |
||||
|
return $this->view->fetch(':introduction'); |
||||
|
} |
||||
|
/** |
||||
|
* 文化金融政策 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function policy(){ |
||||
|
$current=[]; |
||||
|
$current[0]['jump']=url('policy'); |
||||
|
$current[0]['title']='文化金融政策'; |
||||
|
$this->assign('current',$current); |
||||
|
return $this->view->fetch(':policy'); |
||||
|
} |
||||
|
/** |
||||
|
* 政策列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function ajaxpolicys(){ |
||||
|
$page=input('page',1,'intval'); |
||||
|
|
||||
|
$parmas=['page'=>$page]; |
||||
|
$params=http_build_query($parmas); |
||||
|
$url=$this->hostpath."/api/policys/index?".$params; |
||||
|
|
||||
|
$policys="[]"; |
||||
|
try { |
||||
|
$policys=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $policys; |
||||
|
} |
||||
|
/** |
||||
|
* 政策详情 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function policydetail(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$this->assign('id',$id); |
||||
|
$pro=[]; |
||||
|
$url=$this->hostpath."/api/policys/".$id; |
||||
|
|
||||
|
try { |
||||
|
$pro=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$pro=json_decode($pro,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
if(isset($pro['id'])&&isset($pro['message'])){ |
||||
|
$this->error($pro['message']); |
||||
|
} |
||||
|
|
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>$pro['name']]); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('detail',$pro); |
||||
|
return $this->view->fetch(':policy_detail'); |
||||
|
} |
||||
|
/** |
||||
|
* 轮播图展示 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function carousels(){ |
||||
|
$url=$this->hostpath."/api/carousels"; |
||||
|
$carousels="[]"; |
||||
|
try { |
||||
|
$carousels=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
}catch (\Exception $e){ |
||||
|
} |
||||
|
return $carousels; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取项⽬联系⽅式 |
||||
|
* @return array|mixed |
||||
|
*/ |
||||
|
public function contact(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$url=$this->hostpath."/api/projects/".$id."/contact"; |
||||
|
$pro=[]; |
||||
|
try { |
||||
|
$pro=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$pro=json_decode($pro,true); |
||||
|
if(!isset($pro['name']))$pro=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
} |
||||
|
return $pro; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 检查积分 |
||||
|
*/ |
||||
|
protected function checkscore(){ |
||||
|
$apitoken=session('api_token'); |
||||
|
if(empty($apitoken)){ |
||||
|
$this->error('请先登录'); |
||||
|
} |
||||
|
$id=input('id'); |
||||
|
$score=input('score'); |
||||
|
$userinfo=$this->getUserProfile(); |
||||
|
if(!isset($userinfo['reputation'])||$score>$userinfo['reputation']){ |
||||
|
$this->error('你的信誉积分不足,请补全认证资料增加信誉积分才可以查看'); |
||||
|
} |
||||
|
$jump=url('detail',['id'=>$id]); |
||||
|
$this->success('可访问',$jump); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
namespace app\culture\controller; |
||||
|
|
||||
|
use think\Db; |
||||
|
class Policy extends Base{ |
||||
|
protected $current=[['title'=>'文化金融政策']]; |
||||
|
protected $apitoken=''; |
||||
|
public function _initialize(){ |
||||
|
parent::_initialize(); |
||||
|
$this->assign('current',$this->current); |
||||
|
$this->apitoken=session('api_token'); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 文化金融政策 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function index(){ |
||||
|
$current=[]; |
||||
|
$current[0]['jump']=url('policy'); |
||||
|
$current[0]['title']='文化金融政策'; |
||||
|
$this->assign('current',$current); |
||||
|
return $this->view->fetch(':policy'); |
||||
|
} |
||||
|
/** |
||||
|
* 政策列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function ajaxpolicys(){ |
||||
|
$page=input('page',1,'intval'); |
||||
|
|
||||
|
$parmas=['page'=>$page]; |
||||
|
$params=http_build_query($parmas); |
||||
|
$url=$this->hostpath."/api/policys/index?".$params; |
||||
|
|
||||
|
$policys="[]"; |
||||
|
try { |
||||
|
$policys=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $policys; |
||||
|
} |
||||
|
/** |
||||
|
* 政策详情 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function policydetail(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$this->assign('id',$id); |
||||
|
$pro=[]; |
||||
|
$url=$this->hostpath."/api/policys/".$id; |
||||
|
|
||||
|
try { |
||||
|
$pro=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$pro=json_decode($pro,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
if(isset($pro['id'])&&isset($pro['message'])){ |
||||
|
$this->error($pro['message']); |
||||
|
} |
||||
|
|
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>$pro['name']]); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('detail',$pro); |
||||
|
|
||||
|
return $this->view->fetch(':policy_detail'); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,155 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
namespace app\culture\controller; |
||||
|
|
||||
|
use think\Db; |
||||
|
use think\Validate; |
||||
|
class Project extends Base{ |
||||
|
protected $current=[['title'=>'文化金融服务项目']]; |
||||
|
protected $apitoken=''; |
||||
|
public function _initialize(){ |
||||
|
parent::_initialize(); |
||||
|
$this->assign('current',$this->current); |
||||
|
$this->apitoken=session('api_token'); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 项目列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function ajaxprojects(){ |
||||
|
$page=input('page',1,'intval'); |
||||
|
$industry_id=input('industry_id','','intval'); |
||||
|
$investment_id=input('investment_id','','intval'); |
||||
|
$region_id=input('region_id','','intval'); |
||||
|
$keyword=input('keyword'); |
||||
|
$sort=input('sort'); |
||||
|
|
||||
|
$token=request()->token('__cult__'); |
||||
|
if($keyword){ |
||||
|
$rule = [ |
||||
|
'__cult__' =>'require|token:__cult__' |
||||
|
]; |
||||
|
$message =[ |
||||
|
'__cult__.require'=>'令牌缺失' |
||||
|
]; |
||||
|
|
||||
|
$validate=new Validate($rule,$message); |
||||
|
$result=$validate->check(input()); |
||||
|
if(!$result){ |
||||
|
return json_encode(['projects'=>[],'token'=>$token]); |
||||
|
} |
||||
|
} |
||||
|
$parmas=['page'=>$page,'industry_id'=>$industry_id,'region_id'=>$region_id,'investment_id'=>$investment_id,'keyword'=>$keyword,'sort'=>$sort]; |
||||
|
$params=http_build_query($parmas); |
||||
|
$url=$this->hostpath."/api/projects/index?".$params; |
||||
|
|
||||
|
$projects="[]"; |
||||
|
try { |
||||
|
$projects=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return json_encode(['projects'=>$projects,'token'=>$token]); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 机构详情 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function detail(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$this->assign('id',$id); |
||||
|
$this->assign('type','项目'); |
||||
|
|
||||
|
$apitoken=session('api_token'); |
||||
|
if(empty($apitoken)){ |
||||
|
$this->error('请先登录'); |
||||
|
} |
||||
|
$pro=[]; |
||||
|
$url=$this->hostpath."/api/projects/".$id; |
||||
|
|
||||
|
try { |
||||
|
$pro=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$pro=json_decode($pro,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
if(isset($pro['id'])&&isset($pro['message'])){ |
||||
|
$this->error($pro['message']); |
||||
|
} |
||||
|
if(!isset($pro['name']))$pro=['name'=>'','reputation'=>0,'logo'=>'','project_introduction'=>'','major_product_introduction'=>'','core_team_introduction'=>'','financing_introduction'=>'']; |
||||
|
if(isset($pro['reputation'])){ |
||||
|
$score=$pro['reputation']; |
||||
|
$userinfo=$this->getUserProfile(); |
||||
|
if(!isset($userinfo['reputation'])||$score>$userinfo['reputation']){ |
||||
|
$this->error('你的信誉积分不足,请补全认证资料增加信誉积分才可以查看'); |
||||
|
} |
||||
|
} |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>$pro['name']]); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('detail',$pro); |
||||
|
|
||||
|
return $this->view->fetch(':project_detail'); |
||||
|
} |
||||
|
/** |
||||
|
* 检查积分 |
||||
|
*/ |
||||
|
protected function checkscore(){ |
||||
|
$apitoken=session('api_token'); |
||||
|
if(empty($apitoken)){ |
||||
|
$this->error('请先登录'); |
||||
|
} |
||||
|
$id=input('id'); |
||||
|
$score=input('score'); |
||||
|
$userinfo=$this->getUserProfile(); |
||||
|
if(!isset($userinfo['reputation'])||$score>$userinfo['reputation']){ |
||||
|
$this->error('你的信誉积分不足,请补全认证资料增加信誉积分才可以查看'); |
||||
|
} |
||||
|
$jump=url('detail',['id'=>$id]); |
||||
|
$this->success('可访问',$jump); |
||||
|
} |
||||
|
/** |
||||
|
* 项目列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function index(){ |
||||
|
$userscore=''; |
||||
|
$profile=false; |
||||
|
$apitoken=session('api_token'); |
||||
|
if($apitoken){ |
||||
|
$userinfo=$this->getUserProfile(); |
||||
|
|
||||
|
if(isset($userinfo['reputation'])){ |
||||
|
$userscore=$userinfo['reputation']; |
||||
|
} |
||||
|
if(isset($userinfo['profile_completed'])){ |
||||
|
$profile=$userinfo['profile_completed']; |
||||
|
} |
||||
|
} |
||||
|
$this->assign('profile',intval($profile)); |
||||
|
$this->assign('userscore',$userscore); |
||||
|
$url=$this->hostpath."/api/project/filters"; |
||||
|
$profilters="[]"; |
||||
|
try { |
||||
|
$profilters=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$profilters=json_decode($profilters,true); |
||||
|
if(isset($profilters['id']))$profilters=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('profilters',$profilters); |
||||
|
|
||||
|
return $this->view->fetch(':index'); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,894 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
namespace app\culture\controller; |
||||
|
|
||||
|
|
||||
|
use think\Validate; |
||||
|
|
||||
|
class User extends Base{ |
||||
|
protected $userinfo=[]; |
||||
|
protected $apitoken=''; |
||||
|
protected $current=[['title'=>'个人中心']]; |
||||
|
protected function _initialize(){ |
||||
|
parent::_initialize(); |
||||
|
$this->assign('current',$this->current); |
||||
|
$apitoken=session('api_token'); |
||||
|
if(empty($apitoken)){ |
||||
|
if(request()->isAjax()){ |
||||
|
$this->error('请先登录',url('culture/common/login')); |
||||
|
}else{ |
||||
|
$this->redirect(url('culture/common/login')); |
||||
|
} |
||||
|
} |
||||
|
$this->apitoken=$apitoken; |
||||
|
$this->userinfo=$this->getUserProfile(); |
||||
|
} |
||||
|
public function index(){ |
||||
|
|
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
return $this->fetch(':user'); |
||||
|
} |
||||
|
/** |
||||
|
* 获取已购买服务 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function mymarkets(){ |
||||
|
$url=$this->hostpath."/api/user/markets"; |
||||
|
$showlist=[]; |
||||
|
try { |
||||
|
$showlist=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$showlist=json_decode($showlist,true); |
||||
|
if(count($showlist)==0||isset($showlist['id']))$showlist=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('showlist',$showlist); |
||||
|
$this->assign('my',1); |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'我已购买的服务']); |
||||
|
$this->assign('current',$current); |
||||
|
|
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
return $this->view->fetch(':markets'); |
||||
|
} |
||||
|
/** |
||||
|
* 商城服务列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function markets(){ |
||||
|
$url=$this->hostpath."/api/markets"; |
||||
|
$showlist=[]; |
||||
|
try { |
||||
|
$showlist=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$showlist=json_decode($showlist,true); |
||||
|
if(count($showlist)==0)$showlist=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'积分商城']); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('showlist',$showlist); |
||||
|
|
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
return $this->view->fetch(':markets'); |
||||
|
} |
||||
|
/** |
||||
|
* 服务兑换 |
||||
|
* @return string[]|mixed |
||||
|
*/ |
||||
|
public function redeem(){ |
||||
|
$id=input('id','','intval'); |
||||
|
if(empty($id))$this->error('缺少id'); |
||||
|
$url=$this->hostpath."/api/markets/".$id."/redeem"; |
||||
|
$res=['message'=>'兑换失败']; |
||||
|
|
||||
|
try { |
||||
|
$res=go_curl($url,'POST',false,["Accept:application/json","Authorization:Bearer ".$this->apitoken]); |
||||
|
|
||||
|
$res=json_decode($res,true); |
||||
|
if(empty($res)){ |
||||
|
$res=['message'=>'兑换失败']; |
||||
|
} |
||||
|
if(isset($res['id'])){ |
||||
|
switch($res['message']){ |
||||
|
case 'Unauthenticated.': |
||||
|
$res['message']='接口未授权'; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
return $res; |
||||
|
} |
||||
|
/** |
||||
|
* 服务详情 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function market_detail(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$this->assign('id',$id); |
||||
|
$this->assign('type','服务'); |
||||
|
$title=''; |
||||
|
$pro=[]; |
||||
|
$url=$this->hostpath."/api/markets/".$id; |
||||
|
try { |
||||
|
$pro=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$pro=json_decode($pro,true); |
||||
|
if(!isset($pro['name']))$pro=[]; |
||||
|
else $title=$pro['name']; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'已购买的服务','jump'=>url('mymarkets')]); |
||||
|
if($title){ |
||||
|
array_push($current, ['title'=>$title]); |
||||
|
} |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('detail',$pro); |
||||
|
|
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
return $this->view->fetch(':market_detail'); |
||||
|
} |
||||
|
/** |
||||
|
* 获取个⼈资料 |
||||
|
*/ |
||||
|
public function individual_presentations(){ |
||||
|
$url=$this->hostpath."/api/individual-investor/presentations"; |
||||
|
if(request()->isPost()){ |
||||
|
$rule=[ |
||||
|
'avatar'=>'require', |
||||
|
'description'=>'require', |
||||
|
'images'=>'require' |
||||
|
]; |
||||
|
$msg=[ |
||||
|
'avatar.require'=>'请输入投资者照片', |
||||
|
'description.require'=>'请输入介绍文字', |
||||
|
'images.require'=>'请输入照片' |
||||
|
]; |
||||
|
|
||||
|
$data=request()->param(); |
||||
|
$validate = new Validate($rule,$msg); |
||||
|
$result = $validate->check($data); |
||||
|
if(!$result){ |
||||
|
$this->error($validate->getError()); |
||||
|
} |
||||
|
|
||||
|
$res=['message'=>'编辑失败']; |
||||
|
try { |
||||
|
$res=go_curl($url,'POST',$data,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
$this->success('编辑成功'); |
||||
|
} |
||||
|
$res=[]; |
||||
|
try { |
||||
|
$res=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('detail',$res); |
||||
|
return $this->fetch(':indpresentations'); |
||||
|
} |
||||
|
/** |
||||
|
* 获取机构资料 |
||||
|
*/ |
||||
|
public function institutional_presentations(){ |
||||
|
$url=$this->hostpath."/api/institutional-investor/presentations"; |
||||
|
if(request()->isPost()){ |
||||
|
$rule=[ |
||||
|
'avatar'=>'require', |
||||
|
'description'=>'require', |
||||
|
'images'=>'require' |
||||
|
]; |
||||
|
$msg=[ |
||||
|
'avatar.require'=>'请输入机构logo照片', |
||||
|
'description.require'=>'请输入介绍文字', |
||||
|
'images.require'=>'请输入照片' |
||||
|
]; |
||||
|
|
||||
|
$data=request()->param(); |
||||
|
$validate = new Validate($rule,$msg); |
||||
|
$result = $validate->check($data); |
||||
|
if(!$result){ |
||||
|
$this->error($validate->getError()); |
||||
|
} |
||||
|
|
||||
|
$res=['message'=>'编辑失败']; |
||||
|
try { |
||||
|
$res=go_curl($url,'POST',$data,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
$this->success('编辑成功'); |
||||
|
} |
||||
|
$res=[]; |
||||
|
try { |
||||
|
$res=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('detail',$res); |
||||
|
return $this->fetch(':inspresentations'); |
||||
|
} |
||||
|
/** |
||||
|
* ⽤户信息 |
||||
|
* @return mixed|string |
||||
|
*/ |
||||
|
public function profile(){ |
||||
|
$this->assign('profiles',$this->userinfo); |
||||
|
if(request()->isPost()){ |
||||
|
$rule=[ |
||||
|
'name'=>'require', |
||||
|
'phone'=>'require|length:11', |
||||
|
'position'=>'require', |
||||
|
'email'=>'require|email', |
||||
|
'company'=>'require', |
||||
|
'avatar'=>'require' |
||||
|
]; |
||||
|
$msg=[ |
||||
|
'name.require'=>'请输入用户名称', |
||||
|
'phone.require'=>'请输入用户手机号码', |
||||
|
'phone.length'=>'请输入11位手机号码', |
||||
|
'position.require'=>'请输入用户职位', |
||||
|
'email.require'=>'请输入用户邮箱', |
||||
|
'email.email'=>'邮箱格式错误', |
||||
|
'company.require'=>'请输入公司名称', |
||||
|
'avatar.require'=>'请输入用户头像 ' |
||||
|
]; |
||||
|
|
||||
|
$data=request()->param(); |
||||
|
$validate = new Validate($rule,$msg); |
||||
|
$result = $validate->check($data); |
||||
|
if(!$result){ |
||||
|
$this->error($validate->getError()); |
||||
|
} |
||||
|
if(strpos($data['avatar'],'http')===false)$data['avatar']=SITE_PATH.$data['avatar']; |
||||
|
$url=$this->hostpath."/api/user/profiles"; |
||||
|
$res=['message'=>'编辑失败']; |
||||
|
try { |
||||
|
$res=go_curl($url,'POST',$data,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
|
||||
|
$res=json_decode($res,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
$this->success('编辑成功',url('profile')); |
||||
|
} |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'修改个人信息']); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
return $this->fetch(':profile'); |
||||
|
} |
||||
|
/** |
||||
|
* 投资认证 |
||||
|
* @return mixed|string |
||||
|
*/ |
||||
|
public function certification(){ |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'投资认证']); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
|
||||
|
$url=$this->hostpath."/api/individual-investor/verifications"; |
||||
|
$regions=$this->regions(); |
||||
|
$res=[]; |
||||
|
try { |
||||
|
$res=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
|
||||
|
$res=json_decode($res,true); |
||||
|
|
||||
|
if(isset($res['id'])&&$res['id']=='model.not_found'){ |
||||
|
$res=[ |
||||
|
'contact_name'=>'', |
||||
|
'contact_phone'=>'', |
||||
|
'region_id'=>'', |
||||
|
'address'=>'', |
||||
|
'industry_id'=>'', |
||||
|
'company'=>'', |
||||
|
'position'=>'', |
||||
|
'email'=>'', |
||||
|
'investment_stage_id'=>'', |
||||
|
'interested_industry_ids'=>'', |
||||
|
'investment_concerns'=>'', |
||||
|
'invested_projects'=>'', |
||||
|
'investment_point'=>'', |
||||
|
'province'=>'', |
||||
|
'city'=>'', |
||||
|
]; |
||||
|
} |
||||
|
if(isset($res['region_id'])){ |
||||
|
$row=deep_in_array($res['region_id'],$regions); |
||||
|
if(isset($row['id'])){ |
||||
|
$res['province']=$row['id']; |
||||
|
$res['city']=$res['region_id']; |
||||
|
} |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('detail1',$res); |
||||
|
|
||||
|
|
||||
|
$url=$this->hostpath."/api/institutional-investor/verifications"; |
||||
|
$res=[]; |
||||
|
try { |
||||
|
$res=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
|
||||
|
$res=json_decode($res,true); |
||||
|
|
||||
|
if(isset($res['id'])&&$res['id']=='model.not_found'){ |
||||
|
$res=[ |
||||
|
'contact_name'=>'', |
||||
|
'contact_phone'=>'', |
||||
|
'company'=>'', |
||||
|
'name'=>'', |
||||
|
'region_id'=>'', |
||||
|
'address'=>'', |
||||
|
'establish_date'=>'', |
||||
|
'registration_capital'=>'', |
||||
|
'company_size'=>'', |
||||
|
'company_website'=>'', |
||||
|
'legal_representative'=>'', |
||||
|
'investment_stage_id'=>'', |
||||
|
'interested_industry_ids'=>'', |
||||
|
'investment_concerns'=>'', |
||||
|
'invested_projects'=>'', |
||||
|
'investment_point'=>'', |
||||
|
'province'=>'', |
||||
|
'city'=>'', |
||||
|
]; |
||||
|
} |
||||
|
if(isset($res['region_id'])){ |
||||
|
$row=deep_in_array($res['region_id'],$regions); |
||||
|
if(isset($row['id'])){ |
||||
|
$res['province']=$row['id']; |
||||
|
$res['city']=$res['region_id']; |
||||
|
} |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
$this->assign('detail2',$res); |
||||
|
|
||||
|
$stages=$this->stages(); |
||||
|
$this->assign('stages',$stages); |
||||
|
|
||||
|
$industries=$this->industries(); |
||||
|
$this->assign('industries',$industries); |
||||
|
|
||||
|
$this->assign('regions',$regions); |
||||
|
return $this->fetch(':certification'); |
||||
|
} |
||||
|
/** |
||||
|
* 个⼈投资者认证信息 |
||||
|
* @return mixed|string |
||||
|
*/ |
||||
|
public function individual(){ |
||||
|
$url=$this->hostpath."/api/individual-investor/verifications"; |
||||
|
$regions=$this->regions(); |
||||
|
if(request()->isPost()){ |
||||
|
$res=['message'=>'编辑失败']; |
||||
|
|
||||
|
$rule=[ |
||||
|
'contact_name'=>'require', |
||||
|
'contact_phone'=>'require', |
||||
|
'region_id'=>'require', |
||||
|
'address'=>'require', |
||||
|
'industry_id'=>'require', |
||||
|
'company'=>'require', |
||||
|
'position'=>'require', |
||||
|
'email'=>'require|email', |
||||
|
'investment_stage_id'=>'require', |
||||
|
'interested_industry_ids'=>'require', |
||||
|
]; |
||||
|
$msg=[ |
||||
|
'contact_name.require'=>'请输入联系人', |
||||
|
'contact_phone.require'=>'请输入联系手机号', |
||||
|
'region_id.require'=>'请输入地区', |
||||
|
'address.require'=>'请输入地址', |
||||
|
'industry_id.require'=>'请选择行业', |
||||
|
'company.require'=>'请输入任职机构', |
||||
|
'position.require'=>'请输入职位', |
||||
|
'email.require'=>'请输入公司邮箱', |
||||
|
'email.email'=>'错误邮箱地址', |
||||
|
'investment_stage_id.require'=>'请选择投资阶段', |
||||
|
'interested_industry_ids.require'=>'请选择关注行业', |
||||
|
]; |
||||
|
$data=request()->param(); |
||||
|
$validate = new Validate($rule,$msg); |
||||
|
$result = $validate->check($data); |
||||
|
if(!$result){ |
||||
|
$this->error($validate->getError()); |
||||
|
} |
||||
|
if(count($data['investment_stage_id'])){ |
||||
|
$data['investment_stage_id']=$data['investment_stage_id']; |
||||
|
} |
||||
|
if(count($data['interested_industry_ids'])){ |
||||
|
$data['interested_industry_ids']=$data['interested_industry_ids']; |
||||
|
} |
||||
|
|
||||
|
try { |
||||
|
$res=go_curl($url,'POST',$data,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
|
||||
|
$res=json_decode($res,true); |
||||
|
|
||||
|
}catch (\Exception $e){ |
||||
|
$this->error('编辑失败'); |
||||
|
} |
||||
|
|
||||
|
if(isset($res['id'])){ |
||||
|
$this->error($res['message']); |
||||
|
} |
||||
|
$this->success('编辑成功',url('index')); |
||||
|
} |
||||
|
$res=[]; |
||||
|
try { |
||||
|
$res=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
|
||||
|
if(isset($res['id'])&&$res['id']=='model.not_found'){ |
||||
|
$res=[ |
||||
|
'contact_name'=>'', |
||||
|
'contact_phone'=>'', |
||||
|
'region_id'=>'', |
||||
|
'address'=>'', |
||||
|
'industry_id'=>'', |
||||
|
'company'=>'', |
||||
|
'position'=>'', |
||||
|
'email'=>'', |
||||
|
'investment_stage_id'=>'', |
||||
|
'interested_industry_ids'=>'', |
||||
|
'investment_concerns'=>'', |
||||
|
'invested_projects'=>'', |
||||
|
'investment_point'=>'', |
||||
|
'province'=>'', |
||||
|
'city'=>'', |
||||
|
]; |
||||
|
} |
||||
|
if(isset($res['region_id'])){ |
||||
|
$row=deep_in_array($res['region_id'],$regions); |
||||
|
if(isset($row['id'])){ |
||||
|
$res['province']=$row['id']; |
||||
|
$res['city']=$res['region_id']; |
||||
|
} |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'投资认证']); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
$this->assign('detail',$res); |
||||
|
|
||||
|
|
||||
|
$stages=$this->stages(); |
||||
|
$this->assign('stages',$stages); |
||||
|
|
||||
|
$industries=$this->industries(); |
||||
|
$this->assign('industries',$industries); |
||||
|
|
||||
|
$this->assign('regions',$regions); |
||||
|
return $this->fetch(':individual'); |
||||
|
} |
||||
|
/** |
||||
|
* 投资机构认证 |
||||
|
* @return mixed|string |
||||
|
*/ |
||||
|
public function institutional(){ |
||||
|
$url=$this->hostpath."/api/institutional-investor/verifications"; |
||||
|
|
||||
|
$regions=$this->regions(); |
||||
|
if(request()->isPost()){ |
||||
|
$res=['message'=>'编辑失败']; |
||||
|
|
||||
|
$rule=[ |
||||
|
'contact_name'=>'require', |
||||
|
'contact_phone'=>'require', |
||||
|
'company'=>'require', |
||||
|
'name'=>'require', |
||||
|
'region_id'=>'require', |
||||
|
'address'=>'require', |
||||
|
'establish_date'=>'require', |
||||
|
'registration_capital'=>'require', |
||||
|
'company_size'=>'require', |
||||
|
'legal_representative'=>'require', |
||||
|
'investment_stage_id'=>'require', |
||||
|
'interested_industry_ids'=>'require', |
||||
|
]; |
||||
|
$msg=[ |
||||
|
'contact_name.require'=>'请输入联系人', |
||||
|
'contact_phone.require'=>'请输入联系手机号', |
||||
|
'company.require'=>'请输入任职机构', |
||||
|
'name.require'=>'请输入用户姓名', |
||||
|
'region_id.require'=>'请输入地区', |
||||
|
'address.require'=>'请输入地址', |
||||
|
'establish_date.require'=>'请输入注册日期', |
||||
|
'registration_capital.require'=>'请输入注册资本', |
||||
|
'company_size.require'=>'请输入公司人数', |
||||
|
'company_website.require'=>'请输入公司网站', |
||||
|
'legal_representative.require'=>'请输入法人代表', |
||||
|
'investment_stage_id.require'=>'请选择投资阶段', |
||||
|
'interested_industry_ids.require'=>'请选择关注行业' |
||||
|
]; |
||||
|
$data=request()->param(); |
||||
|
$validate = new Validate($rule,$msg); |
||||
|
$result = $validate->check($data); |
||||
|
if(!$result){ |
||||
|
$this->error($validate->getError()); |
||||
|
} |
||||
|
if(count($data['investment_stage_id'])){ |
||||
|
$data['investment_stage_id']=$data['investment_stage_id']; |
||||
|
} |
||||
|
if(count($data['interested_industry_ids'])){ |
||||
|
$data['interested_industry_ids']=$data['interested_industry_ids']; |
||||
|
} |
||||
|
|
||||
|
try { |
||||
|
$res=go_curl($url,'POST',$data,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
|
||||
|
}catch (\Exception $e){ |
||||
|
$this->success('编辑失败'); |
||||
|
} |
||||
|
if(isset($res['id'])){ |
||||
|
$this->error($res['message']); |
||||
|
} |
||||
|
$this->success('编辑成功',url('index')); |
||||
|
} |
||||
|
$res=[]; |
||||
|
try { |
||||
|
$res=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
if(isset($res['id'])&&$res['id']=='model.not_found'){ |
||||
|
$res=[ |
||||
|
'contact_name'=>'', |
||||
|
'contact_phone'=>'', |
||||
|
'company'=>'', |
||||
|
'name'=>'', |
||||
|
'region_id'=>'', |
||||
|
'address'=>'', |
||||
|
'establish_date'=>'', |
||||
|
'registration_capital'=>'', |
||||
|
'company_size'=>'', |
||||
|
'company_website'=>'', |
||||
|
'legal_representative'=>'', |
||||
|
'investment_stage_id'=>'', |
||||
|
'interested_industry_ids'=>'', |
||||
|
'investment_concerns'=>'', |
||||
|
'invested_projects'=>'', |
||||
|
'investment_point'=>'', |
||||
|
'province'=>'', |
||||
|
'city'=>'', |
||||
|
]; |
||||
|
} |
||||
|
if(isset($res['region_id'])){ |
||||
|
$row=deep_in_array($res['region_id'],$regions); |
||||
|
if(isset($row['id'])){ |
||||
|
$res['province']=$row['id']; |
||||
|
$res['city']=$res['region_id']; |
||||
|
} |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'投资机构认证']); |
||||
|
$this->assign('current',$current); |
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
$this->assign('detail',$res); |
||||
|
|
||||
|
|
||||
|
$stages=$this->stages(); |
||||
|
$this->assign('stages',$stages); |
||||
|
|
||||
|
$industries=$this->industries(); |
||||
|
$this->assign('industries',$industries); |
||||
|
|
||||
|
$this->assign('regions',$regions); |
||||
|
return $this->fetch(':institutional'); |
||||
|
} |
||||
|
/** |
||||
|
* 申请企业认证 |
||||
|
*/ |
||||
|
public function corporate(){ |
||||
|
$url=$this->hostpath."/api/corporate/verifications"; |
||||
|
$regions=$this->regions(); |
||||
|
if(request()->isPost()){ |
||||
|
$res=['message'=>'编辑失败']; |
||||
|
|
||||
|
$rule=[ |
||||
|
'name'=>'require', |
||||
|
'legal_person'=>'require', |
||||
|
'region_id'=>'require', |
||||
|
'address'=>'require', |
||||
|
'nature'=>'require', |
||||
|
'registration_date'=>'require', |
||||
|
'registration_capital'=>'require', |
||||
|
'contact_name'=>'require', |
||||
|
'contact_email'=>'require', |
||||
|
'contact_name'=>'require', |
||||
|
'contact_phone'=>'require', |
||||
|
'financing_way'=>'require', |
||||
|
'stock_transfer_proportion'=>'require', |
||||
|
]; |
||||
|
$msg=[ |
||||
|
'name.require'=>'请输入企业名称', |
||||
|
'legal_person.require'=>'请输入法人姓名', |
||||
|
'region_id.require'=>'请输入地区', |
||||
|
'address.require'=>'请输入地址', |
||||
|
'nature.require'=>'请输入企业性质', |
||||
|
'registration_date.require'=>'请输入注册日期', |
||||
|
'registration_capital.require'=>'请输入注册资本', |
||||
|
'contact_name.require'=>'请输入联系人', |
||||
|
'contact_email.require'=>'请输入联系邮箱', |
||||
|
'contact_phone.require'=>'请输入联系手机号', |
||||
|
'financing_way.require'=>'请输入融资方式', |
||||
|
'stock_transfer_proportion.require'=>'请输入股权出让比例' |
||||
|
]; |
||||
|
$data=request()->param(); |
||||
|
$validate = new Validate($rule,$msg); |
||||
|
$result = $validate->check($data); |
||||
|
if(!$result){ |
||||
|
$this->error($validate->getError()); |
||||
|
} |
||||
|
try { |
||||
|
$res=go_curl($url,'POST',$data,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
}catch (\Exception $e){ |
||||
|
$this->error('保存失败'); |
||||
|
} |
||||
|
if(isset($res['id'])){ |
||||
|
$msg=isset($res['message'])&&$res['message']?$res['message']:'保存失败'; |
||||
|
$this->error($msg); |
||||
|
} |
||||
|
$this->success('保存成功'); |
||||
|
} |
||||
|
$res=[]; |
||||
|
try { |
||||
|
$res=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
|
||||
|
$res=json_decode($res,true); |
||||
|
if(isset($res['id'])){ |
||||
|
$res=[ |
||||
|
'name'=>'', |
||||
|
'legal_person'=>'', |
||||
|
'region_id'=>'', |
||||
|
'address'=>'', |
||||
|
'nature'=>'', |
||||
|
'registration_date'=>'', |
||||
|
'registration_capital'=>'', |
||||
|
'contact_name'=>'', |
||||
|
'contact_phone'=>'', |
||||
|
'contact_fax'=>'', |
||||
|
'contact_email'=>'', |
||||
|
'financing_way'=>'', |
||||
|
'stock_transfer_proportion'=>'', |
||||
|
'province'=>'', |
||||
|
'city'=>'', |
||||
|
]; |
||||
|
} |
||||
|
if(isset($res['region_id'])){ |
||||
|
$row=deep_in_array($res['region_id'],$regions); |
||||
|
if(isset($row['id'])){ |
||||
|
$res['province']=$row['id']; |
||||
|
$res['city']=$res['region_id']; |
||||
|
} |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
$this->assign('regions',$regions); |
||||
|
|
||||
|
$this->assign('detail',$res); |
||||
|
$this->assign('profile',$this->userinfo); |
||||
|
|
||||
|
$current=$this->current; |
||||
|
$current[0]['jump']=url('index'); |
||||
|
array_push($current, ['title'=>'企业认证']); |
||||
|
$this->assign('current',$current); |
||||
|
return $this->fetch(':corporate'); |
||||
|
} |
||||
|
/** |
||||
|
* 项目列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function ajaxprojects(){ |
||||
|
$page=input('page',1,'intval'); |
||||
|
$industry_id=input('industry_id','','intval'); |
||||
|
$investment_id=input('investment_id','','intval'); |
||||
|
$region_id=input('region_id','','intval'); |
||||
|
$keyword=input('keyword'); |
||||
|
$sort=input('sort'); |
||||
|
|
||||
|
$parmas=['page'=>$page,'industry_id'=>$industry_id,'region_id'=>$region_id,'investment_id'=>$investment_id,'keyword'=>$keyword,'sort'=>$sort]; |
||||
|
$params=http_build_query($parmas); |
||||
|
$url=$this->hostpath."/api/user/projects?".$params; |
||||
|
$projects="[]"; |
||||
|
try { |
||||
|
$projects=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $projects; |
||||
|
} |
||||
|
/** |
||||
|
* 机构详情 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function detail(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$this->assign('id',$id); |
||||
|
$this->assign('type','项目'); |
||||
|
|
||||
|
|
||||
|
$pro=[]; |
||||
|
$url=$this->hostpath."/api/user/projects/".$id; |
||||
|
try { |
||||
|
$pro=go_curl($url,'GET',false,['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$pro=json_decode($pro,true); |
||||
|
if(!isset($pro['name']))$pro=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
if(isset($pro['reputation'])){ |
||||
|
$score=$pro['reputation']; |
||||
|
if(!isset($this->userinfo['reputation'])||$score>$this->userinfo['reputation']){ |
||||
|
$this->error('你的信誉积分不足,请补全认证资料增加信誉积分才可以查看'); |
||||
|
} |
||||
|
} |
||||
|
$this->assign('detail',$pro); |
||||
|
|
||||
|
return $this->view->fetch(':project_detail'); |
||||
|
} |
||||
|
/** |
||||
|
* 删除自己项目 |
||||
|
* @return string[]|mixed |
||||
|
*/ |
||||
|
public function delprojects(){ |
||||
|
$id=input('id','','intval'); |
||||
|
$url=$this->hostpath."/api/user/delete-projects"; |
||||
|
if(empty($id)){ |
||||
|
return ['message'=>'缺少参数id']; |
||||
|
} |
||||
|
$res=['message'=>'删除失败']; |
||||
|
try { |
||||
|
$res=go_curl($url,'POST',["project_id"=>$id],['Accept'=>'application/json',"Authorization:Bearer ".$this->apitoken]); |
||||
|
$res=json_decode($res,true); |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $res; |
||||
|
} |
||||
|
/** |
||||
|
* 项目列表 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function projects(){ |
||||
|
$userscore=''; |
||||
|
$apitoken=session('api_token'); |
||||
|
if(isset($this->userinfo['reputation'])){ |
||||
|
$userscore=$this->userinfo['reputation']; |
||||
|
} |
||||
|
$this->assign('userscore',$userscore); |
||||
|
$url=$this->hostpath."/api/project/filters"; |
||||
|
$profilters="[]"; |
||||
|
try { |
||||
|
$profilters=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$profilters=json_decode($profilters,true); |
||||
|
if(isset($profilters['id']))$profilters=[]; |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
$this->assign('profilters',$profilters); |
||||
|
|
||||
|
return $this->view->fetch(':index'); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取所属⾏业 |
||||
|
* @return array|mixed |
||||
|
*/ |
||||
|
protected function industries(){ |
||||
|
$url=$this->hostpath."/api/association/industries"; |
||||
|
$list=[]; |
||||
|
try { |
||||
|
$investors=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$list=json_decode($investors); |
||||
|
$list=object_to_array($list); |
||||
|
if(!isset($list[0]['id'])){ |
||||
|
$list=[]; |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $list; |
||||
|
} |
||||
|
/** |
||||
|
* 获取投资⽅式 |
||||
|
* @return array|mixed |
||||
|
*/ |
||||
|
protected function investments(){ |
||||
|
$url=$this->hostpath."/api/association/investments"; |
||||
|
$list=[]; |
||||
|
try { |
||||
|
$investors=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$list=json_decode($investors); |
||||
|
$list=object_to_array($list); |
||||
|
if(!isset($list[0]['id'])){ |
||||
|
$list=[]; |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $list; |
||||
|
} |
||||
|
/** |
||||
|
* 获取地区数据 |
||||
|
* @return array|mixed |
||||
|
*/ |
||||
|
protected function regions(){ |
||||
|
$url=$this->hostpath."/api/association/regions"; |
||||
|
$list=[]; |
||||
|
try { |
||||
|
$investors=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$list=json_decode($investors); |
||||
|
$list=object_to_array($list); |
||||
|
if(!isset($list[0]['id'])){ |
||||
|
$list=[]; |
||||
|
} |
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $list; |
||||
|
} |
||||
|
/** |
||||
|
* 获取投资阶段 |
||||
|
* @return array|mixed |
||||
|
*/ |
||||
|
protected function stages(){ |
||||
|
$url=$this->hostpath."/api/association/investment-stages"; |
||||
|
$list=[]; |
||||
|
try { |
||||
|
$investors=go_curl($url,'GET',false,['Accept'=>'application/json']); |
||||
|
$list=json_decode($investors); |
||||
|
$list=object_to_array($list); |
||||
|
if(!isset($list[0]['id'])){ |
||||
|
$list=[]; |
||||
|
} |
||||
|
|
||||
|
}catch (\Exception $e){ |
||||
|
|
||||
|
} |
||||
|
return $list; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,459 @@ |
|||||
|
<?php |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ] |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved. |
||||
|
// +---------------------------------------------------------------------- |
||||
|
// | Author: rainfer <81818832@qq.com> |
||||
|
// +---------------------------------------------------------------------- |
||||
|
|
||||
|
//------------------------ |
||||
|
// 自定义标签库 |
||||
|
//------------------------- |
||||
|
|
||||
|
namespace app\culture\taglib; |
||||
|
|
||||
|
use think\template\TagLib; |
||||
|
use think\Db; |
||||
|
|
||||
|
class Yf extends Taglib |
||||
|
{ |
||||
|
|
||||
|
// 标签定义 |
||||
|
protected $tags = [ |
||||
|
// 标签定义: attr 属性列表 close 是否闭合(0 或者1 默认1) alias 标签别名 level 嵌套层次 |
||||
|
'menu'=>['attr' => 'top_ul_id,top_ul_class,child_ul_class,child_li_class,firstchild_dropdown_class,haschild_a_class,haschild_span_class,nochild_a_class,showlevel', 'close' => 0], |
||||
|
'webuploader'=>['attr'=>'name,url,word,multiple,nums','close'=>0] |
||||
|
]; |
||||
|
/** |
||||
|
* 返回前台menu |
||||
|
* @param $tag |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function tagMenu($tag) |
||||
|
{ |
||||
|
$top_ul_id=isset($tag['top_ul_id']) ? $tag['top_ul_id'] : ''; |
||||
|
$top_ul_class=isset($tag['top_ul_class']) ? $tag['top_ul_class'] : ''; |
||||
|
$child_ul_class=isset($tag['child_ul_class']) ? $tag['child_ul_class'] : ''; |
||||
|
$child_li_class=isset($tag['child_li_class']) ? $tag['child_li_class'] : ''; |
||||
|
$firstchild_dropdown_class=isset($tag['firstchild_dropdown_class']) ? $tag['firstchild_dropdown_class'] : ''; |
||||
|
$haschild_a_class=isset($tag['haschild_a_class']) ? $tag['haschild_a_class'] : ''; |
||||
|
$haschild_span_class=isset($tag['haschild_span_class']) ? $tag['haschild_span_class'] : ''; |
||||
|
$nochild_a_class=isset($tag['nochild_a_class']) ? $tag['nochild_a_class'] : ''; |
||||
|
$showlevel=!empty($tag['showlevel']) ? intval($tag['showlevel']) : 6; |
||||
|
|
||||
|
$childtpl='<a href=\'\$href\' target=\'\$menu_target\' class=\''.$nochild_a_class.'\'>\$menu_name</a>'; |
||||
|
$parenttpl='<a href=\'\$href\' target=\'\$menu_target\' class=\''.$haschild_a_class.'\'>\$menu_name<span class=\''.$haschild_span_class.'\'> <i class=\'fa fa-angle-down\'></i></span></a>'; |
||||
|
$parseStr = '<?php '; |
||||
|
$parseStr .='echo get_menu(0,"'.$top_ul_id.'","'.$childtpl.'","'.$parenttpl.'","'.$child_ul_class.'","'.$child_li_class.'","'.$top_ul_class.'","'.$showlevel.'","'.$firstchild_dropdown_class.'");'; |
||||
|
$parseStr .="?>"; |
||||
|
if (!empty($parseStr)) { |
||||
|
return $parseStr; |
||||
|
} |
||||
|
return ''; |
||||
|
} |
||||
|
/** |
||||
|
* 上传标签 |
||||
|
* @param string $tag |
||||
|
* url:上传的图片处理的控制器方法 |
||||
|
* name:表单name |
||||
|
* word:提示文字 |
||||
|
*/ |
||||
|
public function tagWebuploader($tag){ |
||||
|
$url=isset($tag['url'])?$tag['url']:url('home/Listn/upload');//上传后台地址 |
||||
|
$name=isset($tag['name'])?$tag['name']:'file_name'; |
||||
|
$nums=(isset($tag['nums']) && intval($tag['nums'])>0)?intval($tag['nums']):10; |
||||
|
$word=isset($tag['word'])?$tag['word']:'或将文件拖到这里'; |
||||
|
$multiple=isset($tag['multiple'])?$tag['multiple']:'false'; |
||||
|
$id_name='upload-'.uniqid();//避免重复 |
||||
|
$str=<<<php |
||||
|
<div id="$id_name" class="xb-uploader"> |
||||
|
<div class="queueList"> |
||||
|
<div class="placeholder"> |
||||
|
<div class="filePicker"></div> |
||||
|
<p>$word</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="statusBar" style="display:none;"> |
||||
|
<div class="progress"> |
||||
|
<span class="text">0%</span> |
||||
|
<span class="percentage"></span> |
||||
|
</div> |
||||
|
<div class="info"></div> |
||||
|
<div class="btns"> |
||||
|
<div class="webuploader-container filePicker2"> |
||||
|
<div class="webuploader-pick">继续添加</div> |
||||
|
<div style="position: absolute; top: 0px; left: 0px; width: 1px; height: 1px; overflow: hidden;" id="rt_rt_1armv2159g1o1i9c2a313hadij6"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="uploadBtn">开始上传</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<script> |
||||
|
jQuery(function() { |
||||
|
var \$wrap = \$("#$id_name"), |
||||
|
// 图片容器 |
||||
|
\$queue = \$('<ul class="filelist"></ul>') |
||||
|
.appendTo( \$wrap.find('.queueList') ), |
||||
|
// 状态栏,包括进度和控制按钮 |
||||
|
\$statusBar = \$wrap.find('.statusBar'), |
||||
|
// 文件总体选择信息。 |
||||
|
\$info = \$statusBar.find('.info'), |
||||
|
// 上传按钮 |
||||
|
\$upload = \$wrap.find('.uploadBtn'), |
||||
|
// 没选择文件之前的内容。 |
||||
|
\$placeHolder = \$wrap.find('.placeholder'), |
||||
|
// 总体进度条 |
||||
|
\$progress = \$statusBar.find('.progress').hide(), |
||||
|
// 添加的文件数量 |
||||
|
fileCount = 0, |
||||
|
// 添加的文件总大小 |
||||
|
fileSize = 0, |
||||
|
// 优化retina, 在retina下这个值是2 |
||||
|
ratio = window.devicePixelRatio || 1, |
||||
|
// 缩略图大小 |
||||
|
thumbnailWidth = 110 * ratio, |
||||
|
thumbnailHeight = 110 * ratio, |
||||
|
// 可能有pedding, ready, uploading, confirm, done. |
||||
|
state = 'pedding', |
||||
|
// 所有文件的进度信息,key为file id |
||||
|
percentages = {}, |
||||
|
supportTransition = (function(){ |
||||
|
var s = document.createElement('p').style, |
||||
|
r = 'transition' in s || |
||||
|
'WebkitTransition' in s || |
||||
|
'MozTransition' in s || |
||||
|
'msTransition' in s || |
||||
|
'OTransition' in s; |
||||
|
s = null; |
||||
|
return r; |
||||
|
})(), |
||||
|
thisSuccess, |
||||
|
// WebUploader实例 |
||||
|
uploader; |
||||
|
if ( !WebUploader.Uploader.support() ) { |
||||
|
alert( 'Web Uploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器'); |
||||
|
throw new Error( 'WebUploader does not support the browser you are using.' ); |
||||
|
} |
||||
|
// 实例化 |
||||
|
uploader = WebUploader.create({ |
||||
|
pick: { |
||||
|
id: "#$id_name .filePicker", |
||||
|
label: '点击选择文件', |
||||
|
multiple : $multiple |
||||
|
}, |
||||
|
dnd: "#$id_name .queueList", |
||||
|
paste: document.body, |
||||
|
// swf文件路径 |
||||
|
swf: '__PUBLIC__/webuploader/Uploader.swf', |
||||
|
disableGlobalDnd: true, |
||||
|
chunked: true, |
||||
|
server: "$url", |
||||
|
fileNumLimit: $nums, |
||||
|
fileSizeLimit: 200 * 1024 * 1024, // 200 M |
||||
|
fileSingleSizeLimit: 50 * 1024 * 1024 // 50 M |
||||
|
}); |
||||
|
// 添加“添加文件”的按钮, |
||||
|
uploader.addButton({ |
||||
|
id: "#$id_name .filePicker2", |
||||
|
label: '继续添加' |
||||
|
}); |
||||
|
// 当有文件添加进来时执行,负责view的创建 |
||||
|
function addFile( file ) { |
||||
|
var \$li = \$( '<li id="' + file.id + '">' + |
||||
|
'<p class="title">' + file.name + '</p>' + |
||||
|
'<p class="imgWrap"></p>'+ |
||||
|
'<p class="progress"><span></span></p>' + |
||||
|
'<input class="bjy-filename" type="hidden" name="{$name}[]">'+ |
||||
|
'</li>' ), |
||||
|
\$btns = \$('<div class="file-panel">' + |
||||
|
'<span class="cancel">删除</span>' + |
||||
|
'<span class="rotateRight">向右旋转</span>' + |
||||
|
'<span class="rotateLeft">向左旋转</span></div>').appendTo( \$li ), |
||||
|
\$prgress = \$li.find('p.progress span'), |
||||
|
\$wrap = \$li.find( 'p.imgWrap' ), |
||||
|
\$info = \\$('<p class="error"></p>'), |
||||
|
showError = function( code ) { |
||||
|
switch( code ) { |
||||
|
case 'exceed_size': |
||||
|
text = '文件大小超出'; |
||||
|
break; |
||||
|
case 'interrupt': |
||||
|
text = '上传暂停'; |
||||
|
break; |
||||
|
default: |
||||
|
text = '上传失败,请重试'; |
||||
|
break; |
||||
|
} |
||||
|
\$info.text( text ).appendTo( \$li ); |
||||
|
}; |
||||
|
if ( file.getStatus() === 'invalid' ) { |
||||
|
showError( file.statusText ); |
||||
|
} else { |
||||
|
// @todo lazyload |
||||
|
\$wrap.text( '预览中' ); |
||||
|
uploader.makeThumb( file, function( error, src ) { |
||||
|
if ( error ) { |
||||
|
\$wrap.text( '不能预览' ); |
||||
|
return; |
||||
|
} |
||||
|
var img = \\$('<img src="'+src+'">'); |
||||
|
\$wrap.empty().append( img ); |
||||
|
}, thumbnailWidth, thumbnailHeight ); |
||||
|
percentages[ file.id ] = [ file.size, 0 ]; |
||||
|
file.rotation = 0; |
||||
|
} |
||||
|
file.on('statuschange', function( cur, prev ) { |
||||
|
if ( prev === 'progress' ) { |
||||
|
\$prgress.hide().width(0); |
||||
|
} else if ( prev === 'queued' ) { |
||||
|
\$li.off( 'mouseenter mouseleave' ); |
||||
|
\$btns.remove(); |
||||
|
} |
||||
|
// 成功 |
||||
|
if ( cur === 'error' || cur === 'invalid' ) { |
||||
|
showError( file.statusText ); |
||||
|
percentages[ file.id ][ 1 ] = 1; |
||||
|
} else if ( cur === 'interrupt' ) { |
||||
|
showError( 'interrupt' ); |
||||
|
} else if ( cur === 'queued' ) { |
||||
|
percentages[ file.id ][ 1 ] = 0; |
||||
|
} else if ( cur === 'progress' ) { |
||||
|
\$info.remove(); |
||||
|
\$prgress.css('display', 'block'); |
||||
|
} else if ( cur === 'complete' ) { |
||||
|
\$li.append( '<span class="success"></span>' ); |
||||
|
} |
||||
|
\$li.removeClass( 'state-' + prev ).addClass( 'state-' + cur ); |
||||
|
}); |
||||
|
\$li.on( 'mouseenter', function() { |
||||
|
\$btns.stop().animate({height: 30}); |
||||
|
}); |
||||
|
\$li.on( 'mouseleave', function() { |
||||
|
\$btns.stop().animate({height: 0}); |
||||
|
}); |
||||
|
\$btns.on( 'click', 'span', function() { |
||||
|
var index = \\$(this).index(), |
||||
|
deg; |
||||
|
switch ( index ) { |
||||
|
case 0: |
||||
|
uploader.removeFile( file ); |
||||
|
return; |
||||
|
case 1: |
||||
|
file.rotation += 90; |
||||
|
break; |
||||
|
case 2: |
||||
|
file.rotation -= 90; |
||||
|
break; |
||||
|
} |
||||
|
if ( supportTransition ) { |
||||
|
deg = 'rotate(' + file.rotation + 'deg)'; |
||||
|
\$wrap.css({ |
||||
|
'-webkit-transform': deg, |
||||
|
'-mos-transform': deg, |
||||
|
'-o-transform': deg, |
||||
|
'transform': deg |
||||
|
}); |
||||
|
} else { |
||||
|
\$wrap.css( 'filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation='+ (~~((file.rotation/90)%4 + 4)%4) +')'); |
||||
|
// use jquery animate to rotation |
||||
|
// \\$({ |
||||
|
// rotation: rotation |
||||
|
// }).animate({ |
||||
|
// rotation: file.rotation |
||||
|
// }, { |
||||
|
// easing: 'linear', |
||||
|
// step: function( now ) { |
||||
|
// now = now * Math.PI / 180; |
||||
|
// var cos = Math.cos( now ), |
||||
|
// sin = Math.sin( now ); |
||||
|
// \$wrap.css( 'filter', "progid:DXImageTransform.Microsoft.Matrix(M11=" + cos + ",M12=" + (-sin) + ",M21=" + sin + ",M22=" + cos + ",SizingMethod='auto expand')"); |
||||
|
// } |
||||
|
// }); |
||||
|
} |
||||
|
}); |
||||
|
\$li.appendTo( \$queue ); |
||||
|
} |
||||
|
// 负责view的销毁 |
||||
|
function removeFile( file ) { |
||||
|
var \$li = \\$('#'+file.id); |
||||
|
delete percentages[ file.id ]; |
||||
|
updateTotalProgress(); |
||||
|
\$li.off().find('.file-panel').off().end().remove(); |
||||
|
} |
||||
|
function updateTotalProgress() { |
||||
|
var loaded = 0, |
||||
|
total = 0, |
||||
|
spans = \$progress.children(), |
||||
|
percent; |
||||
|
\$.each( percentages, function( k, v ) { |
||||
|
total += v[ 0 ]; |
||||
|
loaded += v[ 0 ] * v[ 1 ]; |
||||
|
} ); |
||||
|
percent = total ? loaded / total : 0; |
||||
|
spans.eq( 0 ).text( Math.round( percent * 100 ) + '%' ); |
||||
|
spans.eq( 1 ).css( 'width', Math.round( percent * 100 ) + '%' ); |
||||
|
updateStatus(); |
||||
|
} |
||||
|
function updateStatus() { |
||||
|
var text = '', stats; |
||||
|
if ( state === 'ready' ) { |
||||
|
text = '选中' + fileCount + '个文件,共' + |
||||
|
WebUploader.formatSize( fileSize ) + '。'; |
||||
|
} else if ( state === 'confirm' ) { |
||||
|
stats = uploader.getStats(); |
||||
|
if ( stats.uploadFailNum ) { |
||||
|
text = '已成功上传' + stats.successNum+ '个文件,'+ |
||||
|
stats.uploadFailNum + '个上传失败,<a class="retry" href="#">重新上传</a>失败文件或<a class="ignore" href="#">忽略</a>' |
||||
|
} |
||||
|
} else { |
||||
|
stats = uploader.getStats(); |
||||
|
text = '共' + fileCount + '个(' + |
||||
|
WebUploader.formatSize( fileSize ) + |
||||
|
'),已上传' + stats.successNum + '个'; |
||||
|
if ( stats.uploadFailNum ) { |
||||
|
text += ',失败' + stats.uploadFailNum + '个'; |
||||
|
} |
||||
|
if (fileCount==stats.successNum && stats.successNum!=0) { |
||||
|
$('#$id_name .webuploader-element-invisible').remove(); |
||||
|
} |
||||
|
} |
||||
|
\$info.html( text ); |
||||
|
} |
||||
|
uploader.onUploadAccept=function(object ,ret){ |
||||
|
if(ret.error_info){ |
||||
|
fileError=ret.error_info; |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
uploader.onUploadSuccess=function(file ,response){ |
||||
|
\$('#'+file.id +' .bjy-filename').val(response.name) |
||||
|
} |
||||
|
uploader.onUploadError=function(file){ |
||||
|
alert(fileError); |
||||
|
} |
||||
|
function setState( val ) { |
||||
|
var file, stats; |
||||
|
if ( val === state ) { |
||||
|
return; |
||||
|
} |
||||
|
\$upload.removeClass( 'state-' + state ); |
||||
|
\$upload.addClass( 'state-' + val ); |
||||
|
state = val; |
||||
|
switch ( state ) { |
||||
|
case 'pedding': |
||||
|
\$placeHolder.removeClass( 'element-invisible' ); |
||||
|
\$queue.parent().removeClass('filled'); |
||||
|
\$queue.hide(); |
||||
|
\$statusBar.addClass( 'element-invisible' ); |
||||
|
uploader.refresh(); |
||||
|
break; |
||||
|
case 'ready': |
||||
|
\$placeHolder.addClass( 'element-invisible' ); |
||||
|
\$( "#$id_name .filePicker2" ).removeClass( 'element-invisible'); |
||||
|
\$queue.parent().addClass('filled'); |
||||
|
\$queue.show(); |
||||
|
\$statusBar.removeClass('element-invisible'); |
||||
|
uploader.refresh(); |
||||
|
break; |
||||
|
case 'uploading': |
||||
|
\$( "#$id_name .filePicker2" ).addClass( 'element-invisible' ); |
||||
|
\$progress.show(); |
||||
|
\$upload.text( '暂停上传' ); |
||||
|
break; |
||||
|
case 'paused': |
||||
|
\$progress.show(); |
||||
|
\$upload.text( '继续上传' ); |
||||
|
break; |
||||
|
case 'confirm': |
||||
|
\$progress.hide(); |
||||
|
\$upload.text( '开始上传' ).addClass( 'disabled' ); |
||||
|
stats = uploader.getStats(); |
||||
|
if ( stats.successNum && !stats.uploadFailNum ) { |
||||
|
setState( 'finish' ); |
||||
|
return; |
||||
|
} |
||||
|
break; |
||||
|
case 'finish': |
||||
|
stats = uploader.getStats(); |
||||
|
if ( stats.successNum ) { |
||||
|
} else { |
||||
|
// 没有成功的图片,重设 |
||||
|
state = 'done'; |
||||
|
location.reload(); |
||||
|
} |
||||
|
break; |
||||
|
} |
||||
|
updateStatus(); |
||||
|
} |
||||
|
uploader.onUploadProgress = function( file, percentage ) { |
||||
|
var \$li = \$('#'+file.id), |
||||
|
\$percent = \$li.find('.progress span'); |
||||
|
\$percent.css( 'width', percentage * 100 + '%' ); |
||||
|
percentages[ file.id ][ 1 ] = percentage; |
||||
|
updateTotalProgress(); |
||||
|
}; |
||||
|
uploader.onFileQueued = function( file ) { |
||||
|
fileCount++; |
||||
|
fileSize += file.size; |
||||
|
if ( fileCount === 1 ) { |
||||
|
\$placeHolder.addClass( 'element-invisible' ); |
||||
|
\$statusBar.show(); |
||||
|
} |
||||
|
addFile( file ); |
||||
|
setState( 'ready' ); |
||||
|
updateTotalProgress(); |
||||
|
}; |
||||
|
uploader.onFileDequeued = function( file ) { |
||||
|
fileCount--; |
||||
|
fileSize -= file.size; |
||||
|
if ( !fileCount ) { |
||||
|
setState( 'pedding' ); |
||||
|
} |
||||
|
removeFile( file ); |
||||
|
updateTotalProgress(); |
||||
|
}; |
||||
|
uploader.on( 'all', function( type ) { |
||||
|
var stats; |
||||
|
switch( type ) { |
||||
|
case 'uploadFinished': |
||||
|
setState( 'confirm' ); |
||||
|
break; |
||||
|
case 'startUpload': |
||||
|
setState( 'uploading' ); |
||||
|
break; |
||||
|
case 'stopUpload': |
||||
|
setState( 'paused' ); |
||||
|
break; |
||||
|
} |
||||
|
}); |
||||
|
uploader.onError = function( code ) { |
||||
|
alert( 'Eroor: ' + code ); |
||||
|
}; |
||||
|
\$upload.on('click', function() { |
||||
|
if ( \\$(this).hasClass( 'disabled' ) ) { |
||||
|
return false; |
||||
|
} |
||||
|
if ( state === 'ready' ) { |
||||
|
uploader.upload(); |
||||
|
} else if ( state === 'paused' ) { |
||||
|
uploader.upload(); |
||||
|
} else if ( state === 'uploading' ) { |
||||
|
uploader.stop(); |
||||
|
} |
||||
|
}); |
||||
|
\$info.on( 'click', '.retry', function() { |
||||
|
uploader.retry(); |
||||
|
} ); |
||||
|
\$info.on( 'click', '.ignore', function() { |
||||
|
alert( 'todo' ); |
||||
|
} ); |
||||
|
\$upload.addClass( 'state-' + state ); |
||||
|
updateTotalProgress(); |
||||
|
}); |
||||
|
</script> |
||||
|
php; |
||||
|
return $str; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,52 @@ |
|||||
|
{layout name="layout" /} |
||||
|
|
||||
|
<div class="projectWraper" > |
||||
|
<div class="project-wrapper"> |
||||
|
<div class="content"> |
||||
|
<div class="project clearfix"> |
||||
|
{if condition="count($showlist)"} |
||||
|
{foreach name="showlist" item="vo"} |
||||
|
<div class="project-item clearfix"> |
||||
|
<div class="project-media"><a href="javascript:void(0);" class="href-abs"></a> |
||||
|
<div class="top-padding"></div> |
||||
|
<div class="img-box"> |
||||
|
<img src="{$yf_theme_path}assets/img/default.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="project-content"> |
||||
|
<h2 class="project-title"><a href="javascript:void(0);" class="href-abs"></a>{$vo.name}</h2> |
||||
|
<div class="project-info">{$vo.description}</div> |
||||
|
<div class="jifen">信誉积分:<span>{$vo.redeem_point}</span><a href="javascript:void(0);" style="float:right;{if condition="isset($my) and $my eq 1"}display:none;{/if}" data-id="{$vo.id}" class="change">兑换</a></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
{/foreach} |
||||
|
{/if} |
||||
|
</div> |
||||
|
<div class="col-xs-12 text-center list-page" align="center"> |
||||
|
<ul id="propage" class="pagination"> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<script> |
||||
|
$(function(){ |
||||
|
$(".change").each(function(){ |
||||
|
$(this).click(function(){ |
||||
|
var url="{:url('redeem')}"; |
||||
|
var id=$(this).data('id'); |
||||
|
if(typeof id=='undefined'||id==''){ |
||||
|
layer.msg("缺少id"); |
||||
|
return false; |
||||
|
} |
||||
|
layer.load(1, {shade: [0.1,'#fff']}); |
||||
|
$.get(url,{id:id},function(data){ |
||||
|
layer.closeAll(); |
||||
|
if(typeof data.message!='undefined'){ |
||||
|
layer.msg(data.message); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
@ -0,0 +1,304 @@ |
|||||
|
{layout name="layout" /} |
||||
|
<style> |
||||
|
#propage{padding: 15px 20px;text-align: left;color: #ccc;text-align:center;} |
||||
|
#propage a{display: inline-block;color:#666;display: inline-block;line-height:1.4em;padding:6px 12px;border: 1px solid #ddd; margin: 0 2px;border-radius: 4px;vertical-align: middle;} |
||||
|
#propage a:hover{text-decoration: none;border: 1px solid #d43f3a;} |
||||
|
#propage span.current{display: inline-block;line-height:1.4em;padding:6px 12px;margin: 0 2px;color: #fff;background-color:#d43f3a; border: 1px solid #d43f3a;border-radius: 4px;vertical-align: middle;} |
||||
|
#propage span.disabled{ display: inline-block;line-height:1.4em;padding:6px 12px;margin: 0 2px; color: #bfbfbf;background: #f2f2f2;border: 1px solid #bfbfbf;border-radius: 4px;vertical-align: middle;} |
||||
|
</style> |
||||
|
<div class="projectWraper"> |
||||
|
<div class="retrieve-wrapper"> |
||||
|
<div class="content"> |
||||
|
{if condition="count($profilters)"} |
||||
|
{foreach name="profilters" item="vo"} |
||||
|
<input type="hidden" id="{$vo.key}" value="" /> |
||||
|
<div id="{$vo.key}" class="ret-item ret-select"> |
||||
|
<div class="left">{$vo.title}:</div> |
||||
|
<div class="right"> |
||||
|
<a href="javascript:void(0);" data-id="" class="subitem active">不限</a> |
||||
|
{if condition="count($vo['filters'])"} |
||||
|
{foreach name="vo['filters']" item="jo"} |
||||
|
<a href="javascript:void(0);" data-id="{$jo.id}" class="subitem">{$jo.name}</a> |
||||
|
{/foreach} |
||||
|
{/if} |
||||
|
<div class="more" style="display: block;"><i class="icon-arrows-down"></i></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
{/foreach} |
||||
|
{/if} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="paixu-wrapper"> |
||||
|
<div class="content"> |
||||
|
<div class="paixu clearfix"> |
||||
|
<div class="paixu-item paixu-select px-update active up" data-val=""> |
||||
|
<div class="word">更新</div> |
||||
|
<div class="arrow"><i class="icon-arrows-down"></i></div> |
||||
|
</div> |
||||
|
<div class="paixu-item paixu-select px-jifen" data-val="reputation"> |
||||
|
<div class="word">按照信用积分排序</div> |
||||
|
<div class="arrow"><i class="icon-arrows-down"></i></div> |
||||
|
</div> |
||||
|
<input type="hidden" id="prosort" value="" /> |
||||
|
<div class="paixu-item px-search"> |
||||
|
<div class="search-wrapper"> |
||||
|
<form id="seaForm" class="search-form" onsubmit="return false;"> |
||||
|
<i class="icon-search"></i> |
||||
|
{:token('__agen__')} |
||||
|
<input class="search-input" type="text" placeholder="搜索"> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="project-wrapper"> |
||||
|
<div class="content"> |
||||
|
<div class="project clearfix"> |
||||
|
|
||||
|
</div> |
||||
|
<div class="col-xs-12 text-center list-page" align="center"> |
||||
|
<ul id="propage" class="pagination"> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<script type="text/javascript" src="{$yf_theme_path}public/js/jquery.page.js"></script> |
||||
|
<script> |
||||
|
//项目分类 |
||||
|
$(function(){ |
||||
|
|
||||
|
// 检索收缩箭头 |
||||
|
$(".ret-select .more").click(function(event) { |
||||
|
event.preventDefault(); |
||||
|
var has=$(this).hasClass('open'); |
||||
|
var parent=$(this).parents('.ret-item'); |
||||
|
console.log(has); |
||||
|
if(has===true){ |
||||
|
$(this).removeClass('open'); |
||||
|
parent.animate({'max-height':'26px'},500); |
||||
|
}else{ |
||||
|
$(this).addClass('open'); |
||||
|
parent.animate({'max-height':'200px'},500); |
||||
|
} |
||||
|
}) |
||||
|
$(".ret-item").each(function () { |
||||
|
let $this = $(this) |
||||
|
let $right = $this.find('.right') |
||||
|
let $more = $this.find('.more') |
||||
|
let height = $right.height() |
||||
|
console.log(height); |
||||
|
if (height > 26) { |
||||
|
$more.show(); |
||||
|
$more.trigger('click'); |
||||
|
} |
||||
|
}) |
||||
|
$("body").on('click','.subitem',function(){ |
||||
|
var parent=$(this).parents('.ret-select'); |
||||
|
var id=parent.attr('id'); |
||||
|
var val=$(this).data('id'); |
||||
|
var last=$("#"+id).val(); |
||||
|
$("#"+id).val(val); |
||||
|
if(last!=val){ |
||||
|
parent.find('.active').removeClass('active'); |
||||
|
$(this).addClass('active'); |
||||
|
fillProject(1,1); |
||||
|
} |
||||
|
}); |
||||
|
var prolist=[]; |
||||
|
var userscore="{$userscore}"; |
||||
|
var profile={$profile}; |
||||
|
//检查积分 |
||||
|
$("body").on('click','.project-item',function(){ |
||||
|
event.preventDefault(); |
||||
|
var index=$(this).index(); |
||||
|
if(userscore==''){ |
||||
|
layer.msg('请先登录'); |
||||
|
setTimeout(function(){ |
||||
|
window.location.href="{:url('culture/common/login')}"; |
||||
|
},2000); |
||||
|
return false; |
||||
|
} |
||||
|
if(profile==false){ |
||||
|
layer.msg('您的资料未完善,无法查看项目信息,请先完善资料'); |
||||
|
return false; |
||||
|
} |
||||
|
layer.load(1, {shade: [0.1,'#fff']}); |
||||
|
userscore=parseInt(userscore); |
||||
|
if(typeof prolist[index]!='undefined'){ |
||||
|
var current=prolist[index]; |
||||
|
console.log(current); |
||||
|
var id=current.id; |
||||
|
var score=current.reputation; |
||||
|
var url="{:url('checkScore')}"; |
||||
|
var jump="__URL__/detail/id/"+id+".html"; |
||||
|
if(score>userscore){ |
||||
|
layer.closeAll(); |
||||
|
layer.msg('你的信誉积分不足,请补全认证资料增加信誉积分才可以查看'); |
||||
|
return false; |
||||
|
}else{ |
||||
|
window.location.href=jump; |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
layer.load(1, {shade: [0.1,'#fff']}); |
||||
|
function projects(list){ |
||||
|
var html=''; |
||||
|
prolist=list; |
||||
|
console.log(list); |
||||
|
list.forEach(function(item){ |
||||
|
var jump="javascript:void(0);"; |
||||
|
html+='<div class="project-item clearfix">'; |
||||
|
html+='<div class="project-media">'; |
||||
|
html+='<div class="top-padding"></div>'; |
||||
|
html+='<div class="img-box">'; |
||||
|
html+='<img src="'+item['avatar']+'" onerror="this.src=\'{$yf_theme_path}assets/img/default.png\'">'; |
||||
|
html+='</div></div>'; |
||||
|
html+='<div class="project-content"><h2 class="project-title">'+item['name']+'</h2>'; |
||||
|
var desc=item['description']; |
||||
|
if(desc==null){ |
||||
|
desc="暂无内容"; |
||||
|
} |
||||
|
html+='<div class="cats">投资领域:'+item['industry_text']+'</div>'; |
||||
|
html+='<div class="project-info">'+desc+'</div>'; |
||||
|
html+='<div class="jifen"> 信誉积分:<span>'+item['reputation']+'</span></div>'; |
||||
|
html+='</div></div>'; |
||||
|
|
||||
|
}); |
||||
|
return html; |
||||
|
} |
||||
|
function propage(meta){ |
||||
|
var per_page=meta['per_page']; |
||||
|
var total=parseInt(meta['total']); |
||||
|
var current_page=parseInt(meta['current_page']); |
||||
|
var pages=Math.ceil(total/per_page); |
||||
|
console.log(pages); |
||||
|
|
||||
|
var total=parseInt(meta['total']); |
||||
|
var html='<div id="retpage" class="ret-item"><div class="left">已选条件:</div><div class="right">'; |
||||
|
html+='<div class="num-wrapper">共<span class="num">'+total+'</span>个机构满足条件</div></div></div>'; |
||||
|
$("#retpage").remove(); |
||||
|
$(".retrieve-wrapper .content").append(html); |
||||
|
var lastpage=parseInt(meta['last_page']); |
||||
|
$("#propage").remove(); |
||||
|
$(".list-page").append('<ul id="propage" class="pagination"></ul>'); |
||||
|
$("#propage").createPage({ |
||||
|
pageCount:lastpage, |
||||
|
current:current_page, |
||||
|
backFn:function(p){ |
||||
|
fillProject(p,0); |
||||
|
} |
||||
|
}); |
||||
|
return html; |
||||
|
} |
||||
|
function fillProject(curpage,showpage){ |
||||
|
layer.load(1, {shade: [0.1,'#fff']}); |
||||
|
var keyword=$(".search-input").val(); |
||||
|
var sort=$("#prosort").val(); |
||||
|
var region=$("#region").val(); |
||||
|
var investment=$("#investment").val(); |
||||
|
var industry=$("#industry").val(); |
||||
|
|
||||
|
var query="page="+curpage; |
||||
|
if(keyword){ |
||||
|
query+="&keyword="+keyword; |
||||
|
} |
||||
|
if(sort){ |
||||
|
query+="&sort="+sort; |
||||
|
} |
||||
|
if(industry){ |
||||
|
query+="&industry_id="+industry; |
||||
|
} |
||||
|
if(investment){ |
||||
|
query+="&investment_id="+investment; |
||||
|
} |
||||
|
if(region){ |
||||
|
query+="®ion_id="+region; |
||||
|
} |
||||
|
|
||||
|
var url="{:url('investors')}?"+query; |
||||
|
$(this).attr('disabled',true); |
||||
|
console.log(url); |
||||
|
$.get(url,function(res){ |
||||
|
$(this).attr('disabled',false); |
||||
|
res=JSON.parse(res); |
||||
|
layer.closeAll(); |
||||
|
$("input[name='__agen__']").val(res.token); |
||||
|
console.log("token",res.token); |
||||
|
if(typeof res =='object'){ |
||||
|
var data=res.investors; |
||||
|
data=JSON.parse(data); |
||||
|
if(typeof data =='object'&&typeof data['data']!='undefined'){ |
||||
|
var meta=data['meta']; |
||||
|
var list=data['data']; |
||||
|
if(showpage){ |
||||
|
$("#propage").html(""); |
||||
|
propage(meta); |
||||
|
} |
||||
|
var html=projects(list); |
||||
|
$(".project").html(html); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
var curpage=1; |
||||
|
function searchProject(){ |
||||
|
var keyword=$(".search-input").val(); |
||||
|
if(typeof keyword=='undefined'||keyword==null||keyword==''){ |
||||
|
layer.msg('请输入搜索关键字'); |
||||
|
return false; |
||||
|
} |
||||
|
console.log("searchProject"); |
||||
|
fillProject(1,1); |
||||
|
} |
||||
|
$(".icon-search").click(function(event){ |
||||
|
event.preventDefault(); |
||||
|
searchProject(); |
||||
|
}) |
||||
|
$("#seaForm .search-input").keyup(function(event){ |
||||
|
event.preventDefault(); |
||||
|
event.stopPropagation(); |
||||
|
if(event.keyCode ==13){ |
||||
|
searchProject(); |
||||
|
} |
||||
|
return false; |
||||
|
}) |
||||
|
|
||||
|
$(".paixu-select").each(function(){ |
||||
|
$(this).click(function(){ |
||||
|
var has=$(this).hasClass('active'); |
||||
|
if(!has){ |
||||
|
$(".paixu-item").removeClass('active').removeClass('up'); |
||||
|
$(this).addClass('active').addClass('up'); |
||||
|
var key=$(this).data('val'); |
||||
|
$("#prosort").val(key); |
||||
|
fillProject(1,0); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
//项目列表 |
||||
|
var url="{:url('investors')}"; |
||||
|
$.get(url,function(res){ |
||||
|
$(this).attr('disabled',false); |
||||
|
res=JSON.parse(res); |
||||
|
layer.closeAll(); |
||||
|
$("input[name='__agen__']").val(res.token); |
||||
|
console.log("token",res.token); |
||||
|
if(typeof res =='object'){ |
||||
|
var data=res.investors; |
||||
|
data=JSON.parse(data); |
||||
|
if(typeof data =='object'&&typeof data['data']!='undefined'){ |
||||
|
var meta=data['meta']; |
||||
|
var list=data['data']; |
||||
|
var html=projects(list); |
||||
|
$(".project").html(html); |
||||
|
|
||||
|
var html=propage(meta); |
||||
|
$(".projectWraper").show(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
@ -0,0 +1,90 @@ |
|||||
|
{layout name="layout" /} |
||||
|
<div class="sec-detail"> |
||||
|
<div class="content"> |
||||
|
<div class="detail"> |
||||
|
<div class="detail-head clearfix"> |
||||
|
<div class="media"> |
||||
|
<div class="img-wrapper"> |
||||
|
{if condition="$detail['avatar']"} |
||||
|
<img src="{$detail.avatar}" alt="{$detail.name}" onerror="this.src='{$yf_theme_path}assets/img/default.png'"> |
||||
|
{else} |
||||
|
<img src="{$yf_theme_path}assets/img/default.png" alt=""> |
||||
|
{/if} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="media-content"> |
||||
|
<div class="content-content"> |
||||
|
<h2 class="title">{$detail.name}</h2> |
||||
|
<div class="tags"> |
||||
|
{if condition="count($detail['industries'])"} |
||||
|
{foreach name="detail['industries']" item="jo"} |
||||
|
<a href="javascript:void(0);">{$jo.name}</a> |
||||
|
{/foreach} |
||||
|
{/if} |
||||
|
</div> |
||||
|
<div class="jifen">信誉积分:<span>{$detail.reputation}</span></div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="detail-content"> |
||||
|
<div class="cats-title"><span>基本信息</span></div> |
||||
|
<div class="detail-info clearfix"> |
||||
|
{if condition="$detail['investable_type'] eq 2"} |
||||
|
{if condition="count($detail['institutional_info'])"} |
||||
|
<div class="base-item"> |
||||
|
<span>成立时间:</span><span>{$detail.institutional_info.establish_date}</span> |
||||
|
</div> |
||||
|
<div class="base-item"> |
||||
|
<span>公司名称:</span><span>{$detail.institutional_info.company}</span> |
||||
|
</div> |
||||
|
<div class="base-item"> |
||||
|
<span>注册资本:</span><span>{$detail.institutional_info.registration_capital}万元</span> |
||||
|
</div> |
||||
|
<div class="base-item"> |
||||
|
<span>公司网站:</span><span>{$detail.institutional_info.company_website}</span> |
||||
|
</div> |
||||
|
<div class="base-item"> |
||||
|
<span>法人代表:</span><span>{$detail.institutional_info.legal_representative}</span> |
||||
|
</div> |
||||
|
<div class="base-item"> |
||||
|
<span>归属地域:</span><span>{$detail.institutional_info.region_name}</span> |
||||
|
</div> |
||||
|
<div class="base-item"> |
||||
|
<span>管理规模:</span><span>{$detail.institutional_info.company_size}万元</span> |
||||
|
</div> |
||||
|
{/if} |
||||
|
{else} |
||||
|
{if condition="count($detail['individual_info'])"} |
||||
|
<div class="base-item"> |
||||
|
<span>所属公司:</span><span>{$detail.individual_info.company}</span> |
||||
|
</div> |
||||
|
<div class="base-item"> |
||||
|
<span>职务:</span><span>{$detail.individual_info.position}</span> |
||||
|
</div> |
||||
|
{if condition="isset($detail['individual_info']['industry']['name'])"} |
||||
|
<div class="base-item"> |
||||
|
<span>所属行业:</span><span>{$detail.individual_info.industry.name|default="暂无"}</span> |
||||
|
</div> |
||||
|
{/if} |
||||
|
<div class="base-item"> |
||||
|
<span>E-mail:</span><span>{$detail.individual_info.email}</span> |
||||
|
</div> |
||||
|
{/if} |
||||
|
{/if} |
||||
|
</div> |
||||
|
|
||||
|
<div class="cats-title"><span>介绍</span></div> |
||||
|
<div class="detail-info">{$detail.description|default="暂无"}</div> |
||||
|
{if condition="$detail['investable_type'] eq 1"} |
||||
|
<div class="cats-title"><span>已投项目</span></div> |
||||
|
<div class="detail-info">{$detail.invested_projects|default="暂无"}</div> |
||||
|
<div class="cats-title"><span>投资关注点</span></div> |
||||
|
<div class="detail-info">{$detail.investment_point|default="暂无"}</div> |
||||
|
<div class="cats-title"><span>本年度投资规划</span></div> |
||||
|
<div class="detail-info">{$detail.investment_concerns|default="暂无"}</div> |
||||
|
{/if} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,40 @@ |
|||||
|
/** |
||||
|
* Created by jsbfec on 2017/8/14. |
||||
|
*/ |
||||
|
require.config({ |
||||
|
baseUrl: '/xcxpc/assets/', |
||||
|
urlArgs:'_='+new Date().getTime(), |
||||
|
shim: { |
||||
|
"bootstrap": {"deps": ['jquery']}, |
||||
|
"swiper": {"deps": ['jquery'],"exports": 'Swiper'}, |
||||
|
"mixins":{"deps":['jquery']}, |
||||
|
"quDong": {"deps": ['jquery','mixins']}, |
||||
|
"bootstrapValidator":{ |
||||
|
"deps":['jquery','bootstrap'] |
||||
|
}, |
||||
|
"formjs":{ |
||||
|
"deps":['jquery'] |
||||
|
} |
||||
|
}, |
||||
|
paths: { |
||||
|
|
||||
|
jquery: ['//cdn.bootcss.com/jquery/1.11.1/jquery.min','statics/jquery/1.11.1/jquery.min'], |
||||
|
bootstrap: ['//cdn.bootcss.com/bootstrap/3.3.2/js/bootstrap.min','statics/bootstrap/bootstrap.min'], |
||||
|
bootstrapValidator:'statics/bootstrapvalidator/js/bootstrapValidator.min', |
||||
|
swiper: 'statics/swiper/swiper.min', |
||||
|
formjs:'statics/formjs/jquery.form.min', |
||||
|
mixins:'js/app/mixins', |
||||
|
quDong:'js/app/qudong-plugin', |
||||
|
login:'js/app/login', |
||||
|
api:'js/app/api', |
||||
|
mainMenu:'js/app/mainMenu', |
||||
|
siderBar:'js/app/siderBar', |
||||
|
|
||||
|
}, |
||||
|
map:{ |
||||
|
//'*':{
|
||||
|
// 'jquery':['//cdn.bootcss.com/jquery/1.11.1/jquery.min','statics/jquery/1.11.1/jquery.min']
|
||||
|
//}
|
||||
|
} |
||||
|
}); |
||||
|
|
||||
@ -0,0 +1,8 @@ |
|||||
|
$(function () { |
||||
|
//轮播
|
||||
|
let swiper = new Swiper('.js-swiper-index', { |
||||
|
autoplay: 5000,//可选选项,自动滑动
|
||||
|
pagination: '.swiper-pagination', |
||||
|
paginationClickable: true |
||||
|
}) |
||||
|
}) |
||||
@ -0,0 +1,454 @@ |
|||||
|
{layout name="layout" /} |
||||
|
<link rel="stylesheet" type="text/css" href="{$yf_theme_path}public/css/bootstrap.css"> |
||||
|
<style> |
||||
|
.user-detail .error{padding-left:5px;color:red;line-height:2.4em;} |
||||
|
.user-detail input[type=file]{ |
||||
|
position: absolute; |
||||
|
top: 1px; |
||||
|
left: 1px; |
||||
|
margin: 0; |
||||
|
height:100%; |
||||
|
width: 90%; |
||||
|
opacity: 0; |
||||
|
filter: alpha(opacity=0); |
||||
|
z-index:1; |
||||
|
cursor: pointer |
||||
|
} |
||||
|
.checkbox-inline{line-height:1em;} |
||||
|
.user-detail input[type=checkbox]{vertical-align:middle;margin-top:0px;} |
||||
|
.user-detail textarea{height:4em;overflow:auto;width:220px;} |
||||
|
.user-detail span.special{vertical-align: middle} |
||||
|
</style> |
||||
|
<div class="sec-user clearfix"> |
||||
|
<div class="content"> |
||||
|
<div class="user-detail"> |
||||
|
<div class="detail-edit"> |
||||
|
<div class="choose-type"> |
||||
|
<div class="type-box"> |
||||
|
<a href="javascript:void (0)" class="type person active">个人投资认证</a> |
||||
|
<a href="javascript:void (0)" class="type company">机构投资认证</a> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
<div class="edit-form"> |
||||
|
<form method="post" id="postForm1" action="{:url('individual')}" class="f-form f-form-2 form-horizontal active"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">联系人</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" class="form-control" name="contact_name" id="contact_name1" value="{$detail1.contact_name}"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">手机号码</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" class="form-control" name="contact_phone" id="contact_phone1" value="{$detail1.contact_phone}"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">邮箱</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" class="form-control" name="email" id="email1" value="{$detail1.email}"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">任职机构</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" class="form-control" name="company" id="company1" value="{$detail1.company}"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label" >所属行业</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<select id="industry_id1" class="form-control" name="industry_id"> |
||||
|
<option value="">请选择</option> |
||||
|
{foreach name="industries" id="vo"} |
||||
|
<option value="{$vo.id}" {if condition="$vo['id'] eq $detail1['industry_id']"}selected='selected'{/if}>{$vo.name}</option> |
||||
|
{/foreach} |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">职位</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="position" class="form-control" name="position" value="{$detail1.position}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">所在省市</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="hidden" id="region_id1" name="region_id" value="{$detail1.region_id}" /> |
||||
|
<select id="province1" name="province" style="width:158px;" class="form-control" > |
||||
|
<option value="">请选择省份</option> |
||||
|
{foreach name="regions" id="vo"} |
||||
|
<option value="{$vo.id}" {if condition="$vo['id'] eq $detail1['province']"}selected='selected'{/if}>{$vo.name}</option> |
||||
|
{/foreach} |
||||
|
</select> |
||||
|
<select id="city1" name="city" style="margin-left:10px;width:158px;line-height:1.4em;" class="form-control" > |
||||
|
<option value="">请选择城市</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">详细地址</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="address1" class="form-control" name="address" value="{$detail1.address}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">投资阶段</label> |
||||
|
<div class="col-xs-7"> |
||||
|
{foreach name="stages" id="vo" key="key"} |
||||
|
<label class="checkbox-inline"> |
||||
|
<input type="checkbox" id="investment_stage_id1{$key}" {if condition="is_array($detail1['investment_stage_id']) and in_array($vo['id'],$detail1['investment_stage_id']) "}checked='checked'{/if} name="investment_stage_id[]" value="{$vo.id}">{$vo.name} |
||||
|
</label> |
||||
|
{/foreach} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">关注行业</label> |
||||
|
<div class="col-xs-7"> |
||||
|
{foreach name="industries" id="vo" key="key"} |
||||
|
<label class="checkbox-inline"> |
||||
|
<input type="checkbox" id="interested_industry_ids1{$key}" name="interested_industry_ids[]" {if condition="is_array($detail1['interested_industry_ids']) and in_array($vo['id'],$detail1['interested_industry_ids']) "}checked='checked'{/if} value="{$vo.id}" />{$vo.name} |
||||
|
</label> |
||||
|
{/foreach} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label"> 投资关注(可选)</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<textarea class="form-control" id="investment_concerns1" name="investment_concerns">{$detail1.investment_concerns}</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">已投资项目(可选)</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<textarea class="form-control" id="invested_projects1" name="invested_projects">{$detail1.invested_projects}</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">{:date("Y")}年重点投资项目(可选)</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<textarea id="investment_point1" class="form-control" name="investment_point">{$detail1.investment_point}</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label"> </label> |
||||
|
<div class="col-xs-7"> |
||||
|
{if condition="$profile['individual_investor_verification_status'] eq 1"} |
||||
|
<button type="button" class="btn-submit" onclick="window.location.href='{:url('index')}'">返回</button> |
||||
|
{else} |
||||
|
<button type="submit" class="btn-submit">保存</button> |
||||
|
{/if} |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<div class="edit-form" style="display:none"> |
||||
|
<form method="post" id="postForm2" action="{:url('institutional')}" class="f-form f-form-2 form-horizontal active"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">联系人</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="contact_name2" class="form-control" name="contact_name" value="{$detail2.contact_name}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">手机号码</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="contact_phone2" class="form-control" name="contact_phone" value="{$detail2.contact_phone}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">企业名称</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="company2" class="form-control" name="company" value="{$detail2.company}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">机构名称</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="name2" class="form-control" name="name" value="{$detail2.name}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">所在省市</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="hidden" id="region_id2" name="region_id" value="{$detail2.region_id}" /> |
||||
|
<select id="province2" name="province" style="width:158px;" class="form-control" > |
||||
|
<option value="">请选择省份</option> |
||||
|
{foreach name="regions" id="vo"} |
||||
|
<option value="{$vo.id}" {if condition="$vo['id'] eq $detail2['province']"}selected='selected'{/if}>{$vo.name}</option> |
||||
|
{/foreach} |
||||
|
</select> |
||||
|
<select id="city2" name="city" style="margin-left:10px;width:158px;line-height:1.4em;" class="form-control" > |
||||
|
<option value="">请选择城市</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">详细地址</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" class="form-control" name="address" id="address2" value="{$detail2.address}"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">成立时间</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="establish_date" data-widget='dateTime' class="form-control" data-format="yyyy-mm" name="establish_date" value="{$detail2.establish_date}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">注册资本</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="registration_capital" class="form-control" name="registration_capital" value="{$detail2.registration_capital}" placeholder="单位万元" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">管理规模</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="company_size" name="company_size" class="form-control" value="{$detail2.company_size}" placeholder="单位万元" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">官方网站</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="company_website" class="form-control" name="company_website" value="{$detail2.company_website}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">法人代表</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="legal_representative" class="form-control" name="legal_representative" value="{$detail2.legal_representative}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">投资阶段</label> |
||||
|
<div class="col-xs-7"> |
||||
|
{foreach name="stages" id="vo" key="key"} |
||||
|
<label class="checkbox-inline"> |
||||
|
<input type="checkbox" id="investment_stage_id2{$key}" {if condition="is_array($detail1['investment_stage_id']) and in_array($vo['id'],$detail1['investment_stage_id']) "}checked='checked'{/if} name="investment_stage_id[]" value="{$vo.id}">{$vo.name} |
||||
|
</label> |
||||
|
{/foreach} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">关注行业</label> |
||||
|
<div class="col-xs-7"> |
||||
|
{foreach name="industries" id="vo" key="key"} |
||||
|
<label class="checkbox-inline"> |
||||
|
<input type="checkbox" id="interested_industry_ids2{$key}" name="interested_industry_ids[]" {if condition="is_array($detail1['interested_industry_ids']) and in_array($vo['id'],$detail1['interested_industry_ids']) "}checked='checked'{/if} value="{$vo.id}" />{$vo.name} |
||||
|
</label> |
||||
|
{/foreach} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label"> 投资关注(可选)</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<textarea class="form-control" id="investment_concerns2" name="investment_concerns">{$detail2.investment_concerns}</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">已投资项目(可选)</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<textarea class="form-control" id="invested_projects2" name="invested_projects">{$detail2.invested_projects}</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label"> {:date("Y")}年重点投资项目 (可选)</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<textarea id="investment_point2" class="form-control" name="investment_point">{$detail2.investment_point}</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label"></label> |
||||
|
<div class="col-xs-7"> |
||||
|
{if condition="$profile['institutional_investor_verification_status'] eq 1"} |
||||
|
<button type="button" class="btn-submit" onclick="window.location.href='{:url('index')}'">返回</button> |
||||
|
{else} |
||||
|
<button type="submit" class="btn-submit">保存</button> |
||||
|
{/if} |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="user-caidan"> |
||||
|
{include file="public:userinfo" /} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<script src="{$yf_theme_path}/public/js/jquery.form.js"></script> |
||||
|
<script src="{$yf_theme_path}/public/js/jquery.validate.min.js"></script> |
||||
|
<script src="{$yf_theme_path}/public/js/common.js"></script> |
||||
|
<script src="{$yf_theme_path}/public/js/base.js"></script> |
||||
|
<script> |
||||
|
$(function(){ |
||||
|
// 手机号码验证 |
||||
|
jQuery.validator.addMethod("isMobile", function(value, element) { |
||||
|
var length = value.length; |
||||
|
return this.optional(element) || (length == 11 && /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(value)); |
||||
|
}, "请正确填写您的手机号码。"); |
||||
|
// 身份证号码验证 |
||||
|
jQuery.validator.addMethod("isIdCardNo", function(value, element) { |
||||
|
//var idCard = /^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\w)$/; |
||||
|
return this.optional(element) || isIdCardNo(value); |
||||
|
}, "请输入正确的身份证号码。"); |
||||
|
var regions={$regions|json_encode}; |
||||
|
var city1="{$detail1.city}"; |
||||
|
if(city1!="")city1=parseInt(city1); |
||||
|
$("#province1").change(function(){ |
||||
|
var val=$("#province1").val(); |
||||
|
$("#region_id1").val(""); |
||||
|
var html='<option value="">请选择城市</option>'; |
||||
|
$("#city1").html(html); |
||||
|
var index=$("#province1").get(0).selectedIndex; |
||||
|
if(index>0){ |
||||
|
index=index-1; |
||||
|
if(typeof regions[index]!='undefined'){ |
||||
|
var current=regions[index]; |
||||
|
console.log(current); |
||||
|
var subregions=current['subregions']; |
||||
|
console.log(subregions); |
||||
|
if(subregions.length){ |
||||
|
subregions.forEach(function(item){ |
||||
|
if(city1!=""&&item['id']==city1){ |
||||
|
html+='<option value="'+item['id']+'" selected="selected">'+item['name']+'</option>'; |
||||
|
}else{ |
||||
|
html+='<option value="'+item['id']+'">'+item['name']+'</option>'; |
||||
|
} |
||||
|
}); |
||||
|
$("#city1").html(html); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
var city2="{$detail2.city}"; |
||||
|
if(city2!="")city2=parseInt(city2); |
||||
|
$("#province2").change(function(){ |
||||
|
var val=$("#province2").val(); |
||||
|
$("#region_id2").val(""); |
||||
|
var html='<option value="">请选择城市</option>'; |
||||
|
$("#city2").html(html); |
||||
|
var index=$("#province2").get(0).selectedIndex; |
||||
|
if(index>0){ |
||||
|
index=index-1; |
||||
|
if(typeof regions[index]!='undefined'){ |
||||
|
var current=regions[index]; |
||||
|
console.log(current); |
||||
|
var subregions=current['subregions']; |
||||
|
console.log(subregions); |
||||
|
if(subregions.length){ |
||||
|
subregions.forEach(function(item){ |
||||
|
if(city2!=""&&item['id']==city2){ |
||||
|
html+='<option value="'+item['id']+'" selected="selected">'+item['name']+'</option>'; |
||||
|
}else{ |
||||
|
html+='<option value="'+item['id']+'">'+item['name']+'</option>'; |
||||
|
} |
||||
|
}); |
||||
|
$("#city2").html(html); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
$("#city1").change(function(){ |
||||
|
var val=$("#city1").val(); |
||||
|
$("#region_id1").val(val); |
||||
|
}); |
||||
|
{if condition="$detail1['province'] and $detail1['city']"} |
||||
|
$("#province1").trigger("change"); |
||||
|
$("#region_id1").val("{$detail1.city}"); |
||||
|
{/if} |
||||
|
|
||||
|
$("#city2").change(function(){ |
||||
|
var val=$("#city2").val(); |
||||
|
$("#region_id2").val(val); |
||||
|
}); |
||||
|
{if condition="$detail2['province'] and $detail2['city']"} |
||||
|
$("#province2").trigger("change"); |
||||
|
$("#region_id2").val("{$detail2.city}"); |
||||
|
{/if} |
||||
|
|
||||
|
$(".choose-type a").click(function(){ |
||||
|
var has=$(this).hasClass('active'); |
||||
|
var index=$(this).index(); |
||||
|
if(!has){ |
||||
|
$(".choose-type a").removeClass('active'); |
||||
|
$(this).addClass('active'); |
||||
|
$(".edit-form").hide(); |
||||
|
$(".edit-form").eq(index).show(); |
||||
|
} |
||||
|
}); |
||||
|
var rules={ |
||||
|
"contact_name":"required", |
||||
|
"contact_phone":{ |
||||
|
"required":true, |
||||
|
"isMobile":true |
||||
|
}, |
||||
|
"email":{ |
||||
|
"required":true, |
||||
|
"email":true |
||||
|
}, |
||||
|
"company":"required", |
||||
|
"industry_id":"required", |
||||
|
"position":"required", |
||||
|
"city":"required", |
||||
|
"address":"required" |
||||
|
}; |
||||
|
var messages={ |
||||
|
"contact_name":"联系人必填", |
||||
|
"contact_phone":{ |
||||
|
"required":"手机号码必填", |
||||
|
"isMobile":"正确填写手机" |
||||
|
}, |
||||
|
"province":"省份必选", |
||||
|
"city":"城市必选", |
||||
|
"address":"地址必填", |
||||
|
"industry_id":"行业必选", |
||||
|
"company":"任职机构必填", |
||||
|
"position":"职位必填", |
||||
|
"email":{ |
||||
|
"required":"邮箱必填", |
||||
|
"email":"正确邮箱地址" |
||||
|
} |
||||
|
}; |
||||
|
tool.commonForm("#postForm1",rules,messages); |
||||
|
|
||||
|
var rules={ |
||||
|
"contact_name":"required", |
||||
|
"contact_phone":{ |
||||
|
"required":true, |
||||
|
"isMobile":true |
||||
|
}, |
||||
|
"company":"required", |
||||
|
"name":"required", |
||||
|
"city":"required", |
||||
|
"address":"required", |
||||
|
"establish_date":"required", |
||||
|
"registration_capital":"required", |
||||
|
"company_size":"required", |
||||
|
"legal_representative":"required", |
||||
|
"registration_capital":"required" |
||||
|
}; |
||||
|
var messages={ |
||||
|
"contact_name":"联系人必填", |
||||
|
"contact_phone":{ |
||||
|
"required":"手机号码必填", |
||||
|
"isMobile":"请正确填写手机" |
||||
|
}, |
||||
|
"company":"任职机构必填", |
||||
|
"name":"机构名称必填", |
||||
|
"city":"城市必选", |
||||
|
"address":"详细地址必填", |
||||
|
"establish_date":"成立时间必填", |
||||
|
"registration_capital":"注册资本必填", |
||||
|
"company_size":"管理规模必填", |
||||
|
"legal_representative":"法人代表必填" |
||||
|
}; |
||||
|
tool.commonForm("#postForm2",rules,messages); |
||||
|
}); |
||||
|
</script> |
||||
@ -0,0 +1,220 @@ |
|||||
|
{layout name="layout" /} |
||||
|
<link rel="stylesheet" type="text/css" href="{$yf_theme_path}public/css/bootstrap.css"> |
||||
|
<style> |
||||
|
.user-detail .error{padding-left:5px;color:red;line-height:2.4em;} |
||||
|
|
||||
|
|
||||
|
.user-detail input[type=checkbox]{vertical-align:middle} |
||||
|
.user-detail textarea{height:4em;overflow:auto;width:220px;} |
||||
|
.user-detail span.special{vertical-align: middle} |
||||
|
.detail-edit{padding-top:30px !important;} |
||||
|
</style> |
||||
|
<div class="sec-user clearfix"> |
||||
|
<div class="content"> |
||||
|
<div class="user-detail"> |
||||
|
<div class="detail-edit"> |
||||
|
<form method="post" id="postForm" action="{:url('corporate')}" class="f-form-2 form-horizontal active"> |
||||
|
<div class="sub-tit">企业基本信息</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">企业名称</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" class="form-control" id="name" name="name" value="{$detail.name}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">法人代表</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" class="form-control" id="legal_person" name="legal_person" value="{$detail.legal_person}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">所在省市</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="hidden" id="region_id" name="region_id" value="{$detail.region_id}" /> |
||||
|
<select id="province" name="province" class="form-control" style="width:158px;"> |
||||
|
<option value="">请选择省份</option> |
||||
|
{foreach name="regions" id="vo"} |
||||
|
<option value="{$vo.id}" {if condition="$vo['id'] eq $detail['province']"}selected='selected'{/if}>{$vo.name}</option> |
||||
|
{/foreach} |
||||
|
</select> |
||||
|
<select id="city" name="city" class="form-control" style="margin-left:10px;line-height:1.4em;width:158px;"> |
||||
|
<option value="">请选择城市</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">详细地址</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="address" name="address" class="form-control" value="{$detail.address}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">企业性质</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="nature" name="nature" class="form-control" value="{$detail.nature}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">注册时间</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="registration_date" class="form-control" data-widget='dateTime' data-format="yyyy-mm" name="registration_date"" value="{$detail.registration_date}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">注册资本</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="registration_capital" class="form-control" name="registration_capital" value="{$detail.registration_capital}" placeholder="单位万元" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">联系人</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="contact_name" name="contact_name" class="form-control" value="{$detail.contact_name}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">手机号</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="contact_phone" name="contact_phone" class="form-control" value="{$detail.contact_phone}" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">传真</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="contact_fax" name="contact_fax" value="{$detail.contact_fax}" class="form-control" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">E-MAIL</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="contact_email" name="contact_email" value="{$detail.contact_email}" class="form-control" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="sub-tit">融资计划信息(选填)</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">融资方式</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="financing_way" name="financing_way" value="{$detail.financing_way}" class="form-control"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label">股权/资产出让比</label> |
||||
|
<div class="col-xs-7"> |
||||
|
<input type="text" id="stock_transfer_proportion" name="stock_transfer_proportion" value="{$detail.stock_transfer_proportion}" class="form-control" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-xs-2 control-label"></label> |
||||
|
<div class="col-xs-7"> |
||||
|
{if condition="$profile['corporate_verification_status'] eq 1"} |
||||
|
<button type="button" class="btn-submit" onclick="window.location.href='{:url('index')}'">返回</button> |
||||
|
{else} |
||||
|
<button type="submit" class="btn-submit">保存</button> |
||||
|
{/if} |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="user-caidan"> |
||||
|
{include file="public:userinfo" /} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<script src="{$yf_theme_path}/public/js/jquery.form.js"></script> |
||||
|
<script src="{$yf_theme_path}/public/js/jquery.validate.min.js"></script> |
||||
|
<script src="{$yf_theme_path}/public/js/common.js"></script> |
||||
|
<script src="{$yf_theme_path}/public/js/base.js"></script> |
||||
|
<script> |
||||
|
$(function(){ |
||||
|
// 手机号码验证 |
||||
|
jQuery.validator.addMethod("isMobile", function(value, element) { |
||||
|
var length = value.length; |
||||
|
return this.optional(element) || (length == 11 && /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(value)); |
||||
|
}, "请正确填写您的手机号码。"); |
||||
|
// 身份证号码验证 |
||||
|
jQuery.validator.addMethod("isIdCardNo", function(value, element) { |
||||
|
//var idCard = /^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\w)$/; |
||||
|
return this.optional(element) || isIdCardNo(value); |
||||
|
}, "请输入正确的身份证号码。"); |
||||
|
var regions={$regions|json_encode}; |
||||
|
var city="{$detail.city}"; |
||||
|
if(city!="")city=parseInt(city); |
||||
|
$("#province").change(function(){ |
||||
|
$("#region_id").val(""); |
||||
|
var html='<option value="">请选择城市</option>'; |
||||
|
$("#city").html(html); |
||||
|
var val=$("#province").val(); |
||||
|
var index=$("#province").get(0).selectedIndex; |
||||
|
if(index>0){ |
||||
|
index=index-1; |
||||
|
if(typeof regions[index]!='undefined'){ |
||||
|
var current=regions[index]; |
||||
|
console.log(current); |
||||
|
var subregions=current['subregions']; |
||||
|
console.log(subregions); |
||||
|
var html='<option value="">请选择城市</option>'; |
||||
|
if(subregions.length){ |
||||
|
subregions.forEach(function(item){ |
||||
|
if(city!=""&&item['id']==city){ |
||||
|
html+='<option value="'+item['id']+'" selected="selected">'+item['name']+'</option>'; |
||||
|
}else{ |
||||
|
html+='<option value="'+item['id']+'">'+item['name']+'</option>'; |
||||
|
} |
||||
|
}); |
||||
|
$("#city").html(html); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
$("#city").change(function(){ |
||||
|
var val=$("#city").val(); |
||||
|
$("#region_id").val(val); |
||||
|
}); |
||||
|
{if condition="$detail['province'] and $detail['city']"} |
||||
|
$("#province").trigger("change"); |
||||
|
$("#region_id").val("{$detail.city}"); |
||||
|
{/if} |
||||
|
var rules={ |
||||
|
"name":"required", |
||||
|
"legal_person":"required", |
||||
|
"city":"required", |
||||
|
"address":"required", |
||||
|
"nature":"required", |
||||
|
"registration_date":"required", |
||||
|
"registration_capital":"required", |
||||
|
"financing_way":"required", |
||||
|
"stock_transfer_proportion":"required", |
||||
|
"contact_name":"required", |
||||
|
"contact_phone":{ |
||||
|
"required":true, |
||||
|
"isMobile":true |
||||
|
}, |
||||
|
"contact_email":{ |
||||
|
"required":true, |
||||
|
"email":true |
||||
|
} |
||||
|
}; |
||||
|
var messages={ |
||||
|
"name":"企业名称必填", |
||||
|
"legal_person":"法人代表必填", |
||||
|
"city":"城市必选", |
||||
|
"address":"详细地址必填", |
||||
|
"nature":"企业性质必填", |
||||
|
"registration_date":"注册日期必填", |
||||
|
"registration_capital":"注册资本必填", |
||||
|
"financing_way":"融资方式必填", |
||||
|
"stock_transfer_proportion":"出让比必填", |
||||
|
"contact_name":"联系人必填", |
||||
|
"contact_phone":{ |
||||
|
"required":"手机号码必填", |
||||
|
"isMobile":"请正确填写手机" |
||||
|
}, |
||||
|
"contact_email":{ |
||||
|
"required":"邮箱必填", |
||||
|
"email":"正确邮箱地址" |
||||
|
} |
||||
|
}; |
||||
|
tool.commonForm("#postForm",rules,messages); |
||||
|
}); |
||||
|
</script> |
||||
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 15 KiB |