作者 郭鑫

日常上传

... ... @@ -93,6 +93,20 @@ class IndexController extends CommentController
}else{
$final['is_check'] = 1;
}
// 判断是否填写过
$where_resume['user_id'] = Session::get('uid');
$where_resume['status'] = array('neq',9);
$is_resume = Db::name('Resume')->where($where_resume)->find();
if($is_resume){
if($is_resume['status'] == 2){
$final['is_resume'] = 2;
}else{
$final['is_resume'] = 3;
}
}else{
$final['is_resume'] = 0;
}
// 轮播图
$where_banner['status'] = array('neq',9);
$where_banner['type'] = 2;
... ... @@ -136,18 +150,24 @@ class IndexController extends CommentController
}
}
public function getPic(){
$get = new MemberController();
$this->apiResponse('1','成功',$get->pic($_FILES)) ;
}
// 我要兼职表单提交
public function resume()
{
$data = $this->request->param();
// 图片上传
$validate = Loader::validate('Resume');
if(!$validate->check($data)){
$mes = $validate->getError();
$this->apiResponse('0',$mes);
}
$model = new ResumeModel();
$data['user_id'] = Session::get('uid');
$res = $model->save($data);
if($res){
$this->apiResponse('1','成功');
... ...
... ... @@ -25,6 +25,7 @@ class MemberController extends CommentController
{
$where_member['id'] = Session::get('uid');
$member = Db::name('Member')->where($where_member)->find();
$member['wx_pic'] = cmf_get_image_url($member['wx_pic']);
$this->assign('list',$member);
return $this->fetch();
}
... ... @@ -32,63 +33,55 @@ class MemberController extends CommentController
public function changeUser(){
$where_member['id'] = Session::get('uid');
$member = Db::name('Member')->where($where_member)->find();
$member['wx_pic'] = cmf_get_image_url($member['wx_pic']);
$this->assign('list',$member);
return $this->fetch('editmaterial');
}
// 修改资料
public function change(){
$data = $this->request->param();
echo "<pre/>";
print_r($_FILES);
die;
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
}
$final = array();
if(!empty($_FILES)){
// 图片
$res = $this->pic($_FILES);
$final[] = cmf_get_image_url($res);
$data['wx_pic'] = $res;
}
else
{
echo "Invalid file";
}
die;
// $validate = Loader::validate('Member');
// if(!$validate->sceneIsset()->check($data)){
// $mes = $validate->getError();
// $this->apiResponse('0',$mes);
// }
$where_member['id'] = Session::get('uid');
$data['update_time'] = time();
$res = Db::name('Member')->where($where_member)->update($data);
if($res){
$this->apiResponse('1',"成功");
$this->apiResponse('1',"成功",$final);
}else{
$this->apiResponse('0',"失败");
}
}
// 图片
public function pic($file){
if ((($file["file"]["type"] == "image/gif")
|| ($file["file"]["type"] == "image/jpeg")
|| ($file["file"]["type"] == "image/png"))
&& ($file["file"]["size"] < 100000))
{
if ($file["file"]["error"] > 0)
{
$this->apiResponse('0',$file["file"]["error"]);
}else{
$data = './upload/';
$flodername = 'pic/' . date("Ymd", time());
$png = uniqid() . '.png';
$filename = $data.$flodername . '/' . $png;
if (!file_exists($data.$flodername)){
mkdir($data.$flodername, 0777, true);
}
move_uploaded_file($_FILES["file"]["tmp_name"],
$filename);
return $flodername . '/' . $png;
}
}else{
$this->apiResponse('0','图片格式错误');
}
}
// 我的订单
... ... @@ -112,24 +105,188 @@ die;
->field('o.id,o.order_sn,o.status as orderStatus,o.create_time as cre,o.update_time as up , h.id as hire_id,h.* , s.name as select_name ,m.name as member_name ')
->order('o.create_time desc')
->select()->toArray();
if($coo_list){
foreach ($coo_list as $k=>$v){
$coo_list[$k]['start_time'] = date('Y.m.d',strtotime($v['start_time']));
$coo_list[$k]['end_time'] = date('Y.m.d',strtotime($v['end_time']));
}
}
$this->apiResponse('1','成功',$coo_list);
}
// 我的订单详情
public function detail(){
$data = $this->request->param();
if(!empty($data['type'])){
$where_order['o.status'] = $data['type'];
}else{
$where_order['o.status'] = array('neq',9);
}
$where_order['o.id'] = $data['id'];
$where_order['h.user_id'] = Session::get('uid');
$coo_list = Db::name('Order')->alias('o')
->where($where_order)
->join("Hire h",'h.id = o.hire_id')
->join("Select s",'s.id = h.select_id')
->join("Member m",'m.id = h.user_id')
->field('o.id,o.order_sn,o.status as orderStatus,o.create_time as cre,o.update_time as up , h.id as hire_id,h.* , s.name as select_name ,m.name as member_name ')
->order('o.create_time desc')
->find();
if($coo_list){
$coo_list['start_time'] = date('Y.m.d',strtotime($coo_list['start_time']));
$coo_list['end_time'] = date('Y.m.d',strtotime($coo_list['end_time']));
}
$this->assign('list',$coo_list);
return $this->fetch('ordertail');
}
// 我的简历
// 取消订单/确认完成
public function changeStatus(){
$data = $this->request->param();
$where_order['id'] = $data['id'];
if($data['type'] == 1){
// 取消
$where_order['status'] = 3;
}else if($data['type'] == 2){
// 确认完成
$where_order['status'] = 6;
}
$order = Db::name('Order')->where($where_order)->find();
if($order){
if($data['type'] == 1){
// 取消
$up['status'] = 5;
}else if($data['type'] == 2){
// 确认完成
$up['status'] = 7;
}
$up['update_time'] = time();
$res = Db::name('Order')->where($where_order)->update($up);
if($data['type'] == 1){
// 取消
$meg = '取消';
}else if($data['type'] == 2){
// 确认完成
$meg = '确认完成';
}
if($res){
$this->apiResponse('1',$meg."成功");
}else{
$this->apiResponse('0',$meg.'取消失败');
}
}else{
$this->apiResponse('0','状态错误');
}
}
// 评价
public function common(){
if($this->request->isPost()){
$data = $this->request->param();
}else{
return $this->fetch('evalute');
}
}
// 我的钱包
public function myBalance(){
$where_member['id'] = Session::get('uid');
$where_member['status'] = array('neq',9);
$member = Db::name('Member')->where($where_member)->find();
$this->assign('list',$member);
return $this->fetch('myremain');
}
// 我要提现
public function getMoney(){
$where_member['id'] = Session::get('uid');
$where_member['status'] = array('neq',9);
$member = Db::name('Member')->where($where_member)->find();
$this->assign('list',$member);
return $this->fetch('mybalance');
}
// 我的简历
public function myResume(){
$where_member['m.id'] = Session::get('uid');
$where_member['m.status'] = array('neq',9);
$member = Db::name('Member')->alias('m')
->join("Resume r",'r.user_id = m.id')
->join("Select s",'r.select_id = s.id')
->where($where_member)
->field('m.wx_name,m.wx_pic,m.name,m.tel,m.card_num,r.*')
->field('m.wx_name,m.wx_pic,m.name,m.tel,m.card_num,r.*,s.name as select_name,s.id as select_id')
->order('create_time desc')
->find();
$member['wx_pic'] = cmf_get_image_url($member['wx_pic']);
$member['just'] = cmf_get_image_url($member['just']);
$member['back'] = cmf_get_image_url($member['back']);
$member['skill'] = explode(',',$member['skill']);
$this->assign('list',$member);
$where_select['status'] = array('neq',9);
$where_select['type'] = 2;
$select = Db::name('Select')->where($where_select)->order('score desc,create_time desc')->select()->toArray();
$final['select'] = $select;
// 判断是否填写过
$where_resume['user_id'] = Session::get('uid');
$where_resume['status'] = array('neq',9);
$is_resume = Db::name('Resume')->where($where_resume)->find();
$this->assign('final',$final);
return $this->fetch('viae');
}
// 上传图片
public function getPic(){
$this->apiResponse('1','成功',$this->pic($_FILES)) ;
}
// 修改简历
public function changeResume(){
$data = $this->request->param();
$model = new ResumeModel();
// 用户
$where_member['id'] = Session::get('uid');
if($data['wx_pic']){
$add_member['wx_pic'] = $data['wx_pic'];
}
// $add_member['wx_pic'] = $data['wx_pic']?$data['wx_pic']:;
$add_member['name'] = $data['name'];
$add_member['card_num'] = $data['card_num'];
$add_member['update_time'] = time();
$res_member = Db::name('Member')->where($where_member)->update($add_member);
if(!$res_member){
$this->apiResponse('0','修改失败1');
}
// 简历
unset($data['wx_pic']);
unset($data['name']);
unset($data['card_num']);
$where_resume['user_id'] = Session::get('uid');
$where_resume['status'] = array('neq',9);;
$id = $model->where($where_resume)->order('create_time desc')->value('id');
if($id){
$where_resume['user_id'] = Session::get('uid');
$where_resume['status'] = array('neq',9);
if(!$data['just']){
unset($data['just']);
}
if(!$data['back']){
unset($data['back']);
}
$data['id'] = $id;
$data['status'] = 2;
$res = $model->isUpdate(true)->save($data);
if($res){
$this->apiResponse('1','成功');
}else{
$this->apiResponse('0','失败');
}
}else{
$this->apiResponse('0','简历错误');
}
// 关于我们
}
// 关于我们
public function aboutUs(){
$where_art['type'] = 3;
$where_art['status'] = array('neq',9);
... ...
... ... @@ -24,8 +24,8 @@ class ResumeValidate extends Validate
'select_id' => 'require',
'skill' => 'require',
'experience' => 'require|max:500',
// 'just' => 'require',
// 'back' => 'require',
'just' => 'require',
'back' => 'require',
];
protected $message = [
... ... @@ -41,8 +41,8 @@ class ResumeValidate extends Validate
'skill.require' => '职业技能不能为空!',
'experience.require' => '工作经验不能为空!',
'experience.max' => '工作经验过长!',
// 'just.require' => '身份证正面照不能为空!',
// 'back.require' => '身份证反面照不能为空!',
'just.require' => '身份证正面照不能为空!',
'back.require' => '身份证反面照不能为空!',
];
protected $scene = [
... ...
... ... @@ -112,17 +112,23 @@
</div>
</div>
<!--提交成功之后弹层-->
<div class="materialwrapper" style="display:none">
<div class="materialwrapper" <eq name="final.is_resume" value="0"> style="display: none" </eq>>
<div class="materialpop">
<p class="materialimg">
<img src="__TMPL__/public/assets/images/bicon06@2x.png" alt="">
</p>
<div class="material_name">
<p class="materialname">您已成功填写求职信息,请在个人中心</p>
<p class="materialname">
<a href="" class="myresume">我的简历</a>
进行查看
</p>
<eq name="final.is_resume" value="2">
<p class="materialname">您已成功填写求职信息,请等待审核</p>
</eq>
<eq name="final.is_resume" value="3">
<p class="materialname">您已成功填写求职信息,请在个人中心</p>
<p class="materialname">
<a href="{:url('member/myresume')}" class="myresume">我的简历</a>
进行查看
</p>
</eq>
</div>
</div>
</div>
... ... @@ -277,7 +283,7 @@
</div>
<!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
<input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg">
<input type="hidden" id="face"/>
<p class="uploadimgname uploadfront">点击上传正面照</p>
</div>
<div class="back">
... ... @@ -288,6 +294,7 @@
<img id="imghead1" border="0" src="__TMPL__/public/assets/images/bicon04@2x.png" style="width:100%;height:100%" onclick="$('#previewImg1').click();">
</div>
<!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
<input type="hidden" id="back"/>
<input type="file" onchange="previewImage1(this)" style="display: none;" id="previewImg1">
<p class="uploadimgname uploadback">点击上传反面照</p>
... ... @@ -398,15 +405,15 @@
},
onConfirm: function (result) {
console.log(list[result[0]].label);
$(".sex").html(list[result[0]].label)
$(".sex").attr('index',sexlist[result[0]].value);
$(".sex").html(list[result[0]].label);
$(".sex").attr('index',list[result[0]].value);
}
});
});
//用户协议
$(".protoal").click(function(){
$(".workerwapper").css("display","block")
$(".workerwapper").css("display","block");
$('.select').removeClass("icon-weixuanze");
$('.select').addClass("icon-yixuanze");
})
... ... @@ -449,16 +456,18 @@
'</div>'
$(".skill_item").append(text);
$(".enterskill").val("请添加您的职业技能")
// $(".enterskill").val("请添加您的职业技能")
$(".enterskill").val('');
$(".enterskill").attr('placeholder',"请添加您的职业技能");
}
})
$(".skill").on("click",".deleteimg",function(){
$(this).parents(".skill_itemname").remove();
$(this).parents(".skill_itemname").remove();
})
//提交时资料不完善
// 提交时资料不完善
$(".mesub").click(function(){
var wx = $('.wx').val();
var age = $('.age').val();
... ... @@ -470,6 +479,8 @@
var skill = $('.skill1').val();
var experience = $('.experience').val();
var isTrue = $(".select").hasClass("icon-yixuanze");
var face = $('#face').val();
var back = $('#back').val();
if(isTrue == true){
$.ajax({
type: 'POST',
... ... @@ -484,6 +495,8 @@
'select_id' : select_id,
'skill' : skill,
'experience' : experience,
'just' : face,
'back' : back,
},
success: function (res) {
if(res.code == 1){
... ... @@ -492,9 +505,11 @@
}else{
popup(res.message);
}
console.log('1111111');
console.log(res);
},
error: function (res) {
console.log('33333333');
console.log(res);
}
});
... ... @@ -503,7 +518,7 @@
popup('请先勾选劳动者协议');
}
});
//上传图片
// 上传图片
function clacImgZoomParam(maxWidth, maxHeight, width, height) {
var param = {
top: 0,
... ... @@ -561,6 +576,37 @@
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
var thisFile = document.getElementById("previewImg").files[0];
var formData = new FormData();
formData.append('file',thisFile);
$.ajax({
url: "{:url('Index/getPic')}",
type: "POST",
data: formData,
/**
*必须false才会自动加上正确的Content-Type
*/
contentType: false,
/**
* 必须false才会避开jQuery对 formdata 的默认处理
* XMLHttpRequest会对 formdata 进行正确的处理
*/
processData: false,
success: function (data) {
if(data.code == 1){
$('#face').val(data.data);
// popup('上传成功');
}else{
popup(data.message)
}
console.log(data);
},
error: function () {
popup("上传失败!");
}
});
}
// 反面照
... ... @@ -597,6 +643,35 @@
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
var thisFile1 = document.getElementById("previewImg1").files[0];
var formData1 = new FormData();
formData1.append('file',thisFile1);
$.ajax({
url: "{:url('Index/getPic')}",
type: "POST",
data: formData1,
/**
*必须false才会自动加上正确的Content-Type
*/
contentType: false,
/**
* 必须false才会避开jQuery对 formdata 的默认处理
* XMLHttpRequest会对 formdata 进行正确的处理
*/
processData: false,
success: function (data) {
if(data.code == 1){
$('#back').val(data.data);
// popup('上传成功');
}else{
popup(data.message)
}
console.log(data);
},
error: function () {
popup("上传失败!");
}
});
}
... ...
... ... @@ -26,22 +26,18 @@
</div>
<div class="materialcontainer">
<form id="form1" enctype="multipart/form-data">
<div class="materialistimg">
<!--<p class="headimg">-->
<!--<img src="__TMPL__/public/assets/images/person_head.png" alt="">-->
<!--</p>-->
<div id="preview" class="headimg">
<img id="imghead" border="0" src="__TMPL__/public/assets/images/person_head.png " style="width:100%;height:100%" onclick="$('#previewImg').click();">
<img id="imghead" border="0" src="{$list.wx_pic}" style="width:100%;height:100%" onclick="$('#previewImg').click();">
</div>
<!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
<input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg" >
<div class="editheadimg">
<input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg" />
<div class="editheadimg" onclick="$('#previewImg').click();">
<p class="editname">编辑头像</p>
<p class="iconfont icon-right"></p>
</div>
</div>
</form>
<div class="namelist" data_id="0">
<p class="editname">姓名</p>
<div class="nameinfo">
... ... @@ -169,84 +165,73 @@
param.top = Math.round((maxHeight - param.height) / 2);
return param;
}
function previewImage(file) {
$(".uploadfront").css("display","none")
var MAXWIDTH = 50;
var MAXHEIGHT = 50;
var div = document.getElementById('preview');
if(file.files && file.files[0]) {
div.innerHTML = '<img id=imghead onclick=$("#previewImg").click()>';
var img = document.getElementById('imghead');
img.onload = function() {
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
img.width = rect.width;
img.height = rect.height;
// img.style.marginLeft = rect.left+'px';
img.style.marginTop = rect.top + 'px';
}
var reader = new FileReader();
reader.onload = function(evt) {
img.src = evt.target.result;
}
reader.readAsDataURL(file.files[0]);
// console.log('21222222222');
// console.log($("#form1")[0]);
$.ajax({
url: "/UpImg/upload",
type: "post",
dataType: "json",
cache: false,
data: new FormData($("#form1")[0]),
processData: false,// 不处理数据
contentType: false, // 不设置内容类型
success: function (res) {
console.log(res);
},
error: function (res) {
console.log(res);
}
});
} else //兼容IE
{
var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
file.select();
var src = document.selection.createRange().text;
div.innerHTML = '<img id=imghead>';
var img = document.getElementById('imghead');
img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
var a = $('#imghead').attr('src');
console.log('55555555555555555');
console.log(src);
}
function previewImage(file) {
$(".uploadfront").css("display","none")
var MAXWIDTH = 50;
var MAXHEIGHT = 50;
var div = document.getElementById('preview');
if(file.files && file.files[0]) {
div.innerHTML = '<img id=imghead onclick=$("#previewImg").click()>';
var img = document.getElementById('imghead');
img.onload = function() {
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
img.width = rect.width;
img.height = rect.height;
// img.style.marginLeft = rect.left+'px';
img.style.marginTop = rect.top + 'px';
}
var reader = new FileReader();
reader.onload = function(evt) {
img.src = evt.target.result;
}
reader.readAsDataURL(file.files[0]);
} else //兼容IE
{
var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
file.select();
var src = document.selection.createRange().text;
div.innerHTML = '<img id=imghead>';
var img = document.getElementById('imghead');
img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
}
$('.save').click(function () {
$('#form1').submit();
// $.ajax({
// type: 'POST',
// url: "{:url('Member/change')}",
// data: {
// 'pic': $('#previewImg').val()
// },
// success: function (res) {
// console.log(res);
// },
// error: function (res) {
// console.log(res);
// }
// });
var file = document.getElementById("previewImg").files[0];
var formData = new FormData();
formData.append('file',file);
$.ajax({
url: "{:url('Member/change')}",
type: "POST",
data: formData,
/**
*必须false才会自动加上正确的Content-Type
*/
contentType: false,
/**
* 必须false才会避开jQuery对 formdata 的默认处理
* XMLHttpRequest会对 formdata 进行正确的处理
*/
processData: false,
success: function (data) {
if(data.code == 1){
$('#imghead').attr('src',data.data[0]);
popup('上传成功');
}else{
popup(data.message)
}
console.log(data);
},
error: function () {
alert("上传失败!");
}
});
})
</script>
... ...
... ... @@ -98,14 +98,46 @@
<script>
$(".evalstar").click(function(){
var src=$(this).children("img").attr("src");
if(src=="__TMPL__/public/assets/images/starxing.png"){
$(this).children("img").attr("src","__TMPL__/public/assets/images/starxingshi.png");
}else if(src=="__TMPL__/public/assets/images/starxingshi.png"){
$(this).children("img").attr("src","__TMPL__/public/assets/images/starxing.png")
var src=$(this).children("img").attr("src");
// console.log($(this).index)
// console.log($(this).index())
$('.evaluterank').attr('isTrue',$(this).index());
if($(this).index()==0){
if(src=="__TMPL__/public/assets/images/starxing.png"){
$(this).children("img").attr("src","__TMPL__/public/assets/images/starxingshi.png");
}else if(src=="__TMPL__/public/assets/images/starxingshi.png"){
$(this).nextAll().children("img").attr("src","__TMPL__/public/assets/images/starxing.png")
}
}else{
if(src=="__TMPL__/public/assets/images/starxing.png"){
$(this).children("img").attr("src","__TMPL__/public/assets/images/starxingshi.png");
$(this).prevAll().children("img").attr("src","__TMPL__/public/assets/images/starxingshi.png")
}else if(src=="__TMPL__/public/assets/images/starxingshi.png"){
$(this).children("img").attr("src","__TMPL__/public/assets/images/starxing.png");
$(this).nextAll().children("img").attr("src","__TMPL__/public/assets/images/starxing.png")
}
}
})
});
// 提交
$('.sub').click(function () {
var start = $('.evaluterank').attr('isTrue');
$.ajax({
type: 'POST',
url: "{:url('Member/common')}",
data: {
'start':start,
},
success: function (res) {
console.log(res);
},
error: function (res) {
console.log(res);
}
});
});
</script>
</body>
</html>
... ...
... ... @@ -22,10 +22,10 @@
<div class="header">
<div class="person_info">
<p class="person_img">
<img src="__TMPL__/public/assets/images/person_head.png" alt="">
<img src="{$list.wx_pic}" alt="">
</p>
<p class="person_name">
兔子先生
{$list.wx_name}
</p>
</div>
<p class="change">
... ... @@ -100,7 +100,7 @@
});
//我的钱包
$(".interg").click(function () {
window.location.href = 'myremain.html'
window.location.href = "{:url('Member/myBalance')}"
})
//关于我们
$(".us").click(function () {
... ...
... ... @@ -17,9 +17,18 @@
</div>
<div class="cash">
<p class="moneysign"></p>
<input type="text" placeholder="0.00" class="remainmoney">
<input type="text" placeholder="0.00" class="remainmoney" onkeyup="num(this)">
</div>
<p class="amountmoney">提现到微信零钱</p>
</div>
</body>
<script>
function num(obj){
obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
}
</script>
</html>
... ...
... ... @@ -31,6 +31,9 @@
</div>
</div>
<!--begin:提示弹层-->
<div class="pop_fn"></div>
<script>
def();
function def() {
... ... @@ -44,7 +47,7 @@ function def() {
success: function (res) {
var html = '';
$.each(res.data,function (index,val) {
html += " <div class=\"allist_item\" onclick='jump("+val.id+")'>\n" +
html += " <div class=\"allist_item\">\n" +
" <div class=\"item_head\">\n" +
" <div class=\"order\">\n" +
" <p class=\"ordername\">订单号:</p>\n" +
... ... @@ -67,7 +70,7 @@ function def() {
}
html +=
" </div>\n" +
" <div class=\"item_body\">\n" +
" <div class=\"item_body\" onclick='jump("+val.id+")'>\n" +
" <p class=\"itembody_name\">"+val.title+"</p>\n" +
" <p class=\"itembody_price\">¥"+val.money+"/天</p>\n" +
" <p class=\"itembody_date\">工作时间:"+val.start_time+"-"+val.start_time+"</p>\n" +
... ... @@ -75,12 +78,12 @@ function def() {
" <div class=\"footbtn\">\n";
// 2待审核,3审核通过,待付款,4审核未通过,5已取消,6待完成,7待评价,8已评价
if(val.orderStatus == 3){
html += "<p class=\"cancelorder\">取消订单</p>\n" +
html += "<p class=\"cancelorder\" onclick='change("+val.id+",1)'>取消订单</p>\n" +
" <p class=\"sureorder\">付款</p>" ;
}else if(val.orderStatus == 6){
html += "<p class=\"sureorder\">确认完成</p>" ;
html += "<p class=\"sureorder\" onclick='change("+val.id+",2)'>确认完成</p>" ;
}else if(val.orderStatus == 7){
html += "<p class=\"sureorder\">评价</p>\n" ;
html += "<p class=\"sureorder\" onclick='common("+val.id+")'>评价</p>\n" ;
}
html +=
" </div>\n" +
... ... @@ -95,48 +98,86 @@ function def() {
});
}
// tab
$("ul li").click(function(){
// var orderid=$(this).attr("id");
$(this).addClass("active");
$(this).siblings("li").removeClass("active");
def();
})
//评价页面
$(".sureorder").click(function(){
window.location.href='evalute.html'
})
$(".allist").click(function(){
window.location.href='ordertail.html'
})
//取消订单
window.alert = function(name){
var iframe = document.createElement("IFRAME");
iframe.style.display="none";
document.documentElement.appendChild(iframe);
window.frames[0].window.alert(name);
iframe.parentNode.removeChild(iframe);
});
// 详情
function jump(id) {
var url = "{:url('Member/detail')}";
url = url.split('.');
url = url[0] + '/id/' + id + ".html";
window.location.href = url;
}
window.confirm = function (message) {
var iframe = document.createElement("IFRAME");
iframe.style.display = "none";
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
var alertFrame = window.frames[0];
var result = alertFrame.window.confirm(message);
iframe.parentNode.removeChild(iframe);
return result;
// 取消/确认
function change(id,type) {
if(type == 1){
window.event.stopPropagation();
var a=confirm("是否取消订单");
if(a==true){
order(id,type)
}
}else{
order(id,type)
}
}
function order(id,type) {
$.ajax({
type: 'POST',
url: "{:url('Member/changeStatus')}",
data: {
'id':id,
'type':type,
},
success: function (res) {
console.log(res);
popup(res.message);
if(res.code == 1){
setTimeout("def()",2500);
}
},
error: function (res) {
console.log(res);
}
});
}
//评价页面
function common(id) {
var url = "{:url('Member/common')}";
url = url.split('.');
url = url[0] + '/id/' + id + ".html";
window.location.href = url;
}
$(".cancelorder").click(function(){
window.event.stopPropagation();
var a=confirm("是否取消订单");
if(a==true){
alert("取消订单")
}
})
//取消订单
// window.alert = function(name){
// var iframe = document.createElement("IFRAME");
// iframe.style.display="none";
// document.documentElement.appendChild(iframe);
// window.frames[0].window.alert(name);
// iframe.parentNode.removeChild(iframe);
// }
// window.confirm = function (message) {
// var iframe = document.createElement("IFRAME");
// iframe.style.display = "none";
// iframe.setAttribute("src", 'data:text/plain,');
// document.documentElement.appendChild(iframe);
// var alertFrame = window.frames[0];
// var result = alertFrame.window.confirm(message);
// iframe.parentNode.removeChild(iframe);
// return result;
// }
//
//
// $(".cancelorder").click(function(){
// window.event.stopPropagation();
// var a=confirm("是否取消订单");
// if(a==true){
// alert("取消订单")
// }
// })
</script>
</body>
</html>
... ...
... ... @@ -6,8 +6,8 @@
<link rel="stylesheet" href="https://at.alicdn.com/t/font_890739_l00sw01grqj.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/personcenter.css">
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/base.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/js/base.js"></script>
<title>我的余额</title>
</head>
... ... @@ -16,7 +16,7 @@
<div class="headmoney">
<img src="__TMPL__/public/assets/images/cbg@2x.png" alt="">
</div>
<p class="meremainmoney">0.00</p>
<p class="meremainmoney">{$list.money}</p>
<div class="memoney">
<div class="popmoney">
<p class="remainmoney-sign">
... ... @@ -30,7 +30,7 @@
</div>
<script>
$(".memoney").click(function(){
window.location.href='mybalance.html'
window.location.href="{:url('Member/getMoney')}"
})
</script>
</body>
... ...
... ... @@ -18,13 +18,19 @@
<body>
<div class="container">
<div class="head">
<p class="ordernum">订单号:201807122659</p>
<p class="orderstate">待审核</p>
<p class="ordernum">订单号:{$list.order_sn}</p>
<eq name="list.orderStatus" value="2"><p class="orderstate">待审核</p></eq>
<eq name="list.orderStatus" value="3"><p class="orderstate">待付款</p></eq>
<eq name="list.orderStatus" value="4"><p class="orderstate">审核未通过</p></eq>
<eq name="list.orderStatus" value="5"><p class="orderstate">已取消</p></eq>
<eq name="list.orderStatus" value="6"><p class="orderstate">待完成</p></eq>
<eq name="list.orderStatus" value="7"><p class="orderstate">待评价</p></eq>
<eq name="list.orderStatus" value="8"><p class="orderstate">已评价</p></eq>
</div>
<div class="ordercontent">
<p class="content_name">兼职美术老师</p>
<p class="content_price">¥999/天</p>
<p class="content_date">2018.09.20-2018.10.20</p>
<p class="content_name">{$list.title}</p>
<p class="content_price">¥{$list.money}/天</p>
<p class="content_date">{$list.start_time}-{$list.end_time}</p>
</div>
<div class="companyinfo">
<p class="signcompany">
... ...
... ... @@ -17,6 +17,23 @@
.weui-picker__item{
font-size: 0.3rem;
}
.join{
display:flex;
height: 1rem;
padding: 0 0.29rem;
align-items: center;
background: #F5F6FA;
margin-top: 0.36rem;
}
#select{
width:4rem;
height:0.5rem;
font-size: 0.3rem;
background: transparent;
margin-bottom: 1.1rem;
border:none;
outline: nones;
}
</style>
</head>
<body>
... ... @@ -33,22 +50,19 @@
</div>
</div>
<!--提交成功之后弹层-->
<div class="materialwrapper" style="display:none">
<div class="materialpop">
<p class="materialimg">
<img src="__TMPL__/public/assets/images/bicon06@2x.png" alt="">
</p>
<div class="material_name">
<p class="materialname">您已成功填写求职信息,请在个人中心</p>
<p class="materialname">
<a href="" class="myresume">我的简历</a>
进行查看
</p>
</div>
<div class="materialwrapper" style="display: none" >
<div class="materialpop">
<p class="materialimg">
<img src="__TMPL__/public/assets/images/bicon06@2x.png" alt="">
</p>
<div class="material_name">
<p class="materialname">您已成功填写求职信息,请等待审核</p>
</div>
</div>
</div>
<div class="container">
<div class="headinfo">
<input type="hidden" class="id"/>
<div class="hire">
<p class="hire_img">
<img src="__TMPL__/public/assets/images/aicon06@2x.png" alt="">
... ... @@ -63,11 +77,12 @@
<!--</p>-->
<div id="preview3" class="editpeopleimg">
<img id="imghead3" border="0" src="__TMPL__/public/assets/images/dicon02@2x.png" style="width:100%;height:100%"
<img id="imghead3" border="0" src="{$list.wx_pic}" style="width:100%;height:100%"
onclick="$('#previewImg3').click();">
</div>
<!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
<input type="file" onchange="previewImage3(this)" style="display: none;" id="previewImg3">
<input type="hidden" id="first"/>
<p class="editpeople">编辑头像</p>
</div>
<p class="row">
... ... @@ -78,14 +93,14 @@
<div class="list">
<div class="list_name">姓名</div>
<div class="listenter">
<input type="text" placeholder="向昱筱" value="{$list.name}">
<input type="text" placeholder="向昱筱" value="{$list.name}" class="name">
</div>
</div>
<div class="position">
<div class="list">
<div class="list_name">年龄</div>
<div class="listenter">
<input type="text" placeholder="22" value="{$list.age}">
<input type="text" placeholder="请输入年龄" value="{$list.age}" class="age">
</div>
</div>
</div>
... ... @@ -100,19 +115,19 @@
</div>
<p class="row">
<img src="__TMPL__/public/assets/images/bicon01@2x.png" alt="">
<img src="__TMPL__/public/assets/images/bicon01@2x.png" alt="{$list.age}">
</p>
</div>
<div class="list">
<div class="list_name">身份证号</div>
<div class="listenter">
<input type="text" placeholder="132645955876924681">
<input type="text" placeholder="请输入身份证号" value="{$list.card_num}" class="card_num">
</div>
</div>
<div class="list">
<div class="list_name">微信号</div>
<div class="listenter">
<input type="text" placeholder="132645955876924681">
<input type="text" placeholder="请输入微信号" value="{$list.wx}" class="wx">
</div>
</div>
... ... @@ -145,13 +160,19 @@
<div class="list">
<div class="list_name">赋闲时间</div>
<div class="listenter">
<input type="text" placeholder="每天晚上8点以后">
<input type="text" placeholder="请输入赋闲时间" value="{$list.free_time}" class="free_time">
</div>
</div>
<div class="list">
<p class="list_name">求职意向</p>
<div class="listenter">
<input type="text" placeholder="在家能工作的闲置工作">
<div class="listenter" style="width:4rem;">
<select name="" id="select" style="color: #aaaaaa">
<volist name="final.select" id="sel">
<option value="{$sel.id}" <eq name="sel.id" value="$list.select_id">selected</eq>>{$sel.name}</option>
</volist>
</select>
<!--<input type="text" placeholder="请输入雇佣事项" >-->
</div>
</div>
<div class="skill">
... ... @@ -160,11 +181,14 @@
</div>
<div class="skillist">
<div class="skill_item">
<div class="skill_itemname">
<!--<p class="skill_itemtext">办公软件</p>-->
<input type="text" placeholder="办公软件" class="skill_itemtext">
<p class="skill_itemimg deleteimg"><img src="__TMPL__/public/assets/images/bicon02@2x.png" alt=""></p>
</div>
<volist name="list.skill" id="skill">
<div class="skill_itemname">
<!--<p class="skill_itemtext">办公软件</p>-->
<input type="text" placeholder="办公软件" class="skill_itemtext" value="{$skill}">
<p class="skill_itemimg deleteimg"><img src="__TMPL__/public/assets/images/bicon02@2x.png" alt=""></p>
</div>
</volist>
</div>
<div class="addskill">
<input type="text" placeholder="请添加您的职业技能" class="enterskill">
... ... @@ -186,7 +210,7 @@
<p class="wire"></p>
</div>
<div class="experience">
<textarea name="" id="enterexperience" cols="30" rows="10" placeholder="请输入工作经历"></textarea>
<textarea name="" id="enterexperience" cols="30" rows="10" placeholder="请输入工作经历" >{$list.experience}</textarea>
</div>
</div>
... ... @@ -207,12 +231,12 @@
<!--</p>-->
<div id="preview" class="uploadimg">
<img id="imghead" border="0" src="__TMPL__/public/assets/images/bicon04@2x.png" style="width:100%;height:100%"
<img id="imghead" border="0" src="{$list.just}" style="width:100%;height:100%"
onclick="$('#previewImg').click();">
</div>
<!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
<input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg">
<input type="hidden" id="second"/>
<p class="uploadimgname uploadfront">点击上传正面照</p>
</div>
<div class="back">
... ... @@ -220,12 +244,12 @@
<!--<img src="__TMPL__/public/assets/images/bicon04@2x.png" alt="">-->
<!--</p>-->
<div id="preview1" class="uploadimg">
<img id="imghead1" border="0" src="__TMPL__/public/assets/images/bicon04@2x.png" style="width:100%;height:100%"
<img id="imghead1" border="0" src="{$list.back}" style="width:100%;height:100%"
onclick="$('#previewImg1').click();">
</div>
<!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
<input type="file" onchange="previewImage1(this)" style="display: none;" id="previewImg1">
<input type="hidden" id="third"/>
<p class="uploadimgname uploadback">点击上传反面照</p>
</div>
</div>
... ... @@ -252,10 +276,10 @@
<script>
var sexlist=[{
label: '男',
value: 1
value: 0
}, {
label: '女',
value: 2
value: 1
}]
$('.sexselect').on('click', function () {
... ... @@ -266,30 +290,38 @@
onConfirm: function (result) {
console.log(sexlist[result[0]].label);
$(".sexchose").html(sexlist[result[0]].label)
$(".sexchose").attr('index',sexlist[result[0]].value)
}
});
});
var list=[{
label: '小学一年级',
label: '小学',
value: 0
}, {
label: '小学二年级',
label: '初中',
value: 1
}, {
label: '高中',
value: 2
}, {
label: '大学',
value: 3
}]
$('.seclectschool').on('click', function () {
weui.picker(list, {
onChange: function (result) {
console.log(result);
},
onConfirm: function (result) {
console.log(list[result[0]].label);
$(".sex").html(list[result[0]].label)
$(".sex").html(list[result[0]].label);
$(".sex").attr('index',list[result[0]].value);
}
});
});
//职业技能
$(".enterskill").keyup(function(){
var h=$(this).val().length;
... ... @@ -339,19 +371,14 @@
'</div>'
$(".skill_item").append(text);
$(".enterskill").val("请添加您的职业技能");
$(".enterskill").val('');
$(".enterskill").attr('placeholder',"请添加您的职业技能");
}
})
});
$(".skill").on("click", ".deleteimg", function () {
$(this).parents(".skill_itemname").remove();
})
//提交时资料不完善
$(".mesub").click(function () {
popup("您好,您的资料尚未完善")
})
//上传图片
function clacImgZoomParam(maxWidth, maxHeight, width, height) {
var param = {
... ... @@ -409,9 +436,9 @@
status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
var thisFile = document.getElementById("previewImg").files[0];
getAjax(thisFile,2);
}
// 反面照
function previewImage1(file) {
$(".uploadback").css("display", "none")
... ... @@ -445,10 +472,10 @@
status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
var thisFile = document.getElementById("previewImg1").files[0];
getAjax(thisFile,3);
}
// 头像
function previewImage3(file) {
$(".uploadback").css("display", "none")
var MAXWIDTH = 50;
... ... @@ -482,9 +509,98 @@
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
var thisFile = document.getElementById("previewImg3").files[0];
getAjax(thisFile,1);
}
function getAjax(thisFile,type) {
var formData = new FormData();
formData.append('file',thisFile);
$.ajax({
url: "{:url('Member/getPic')}",
type: "POST",
data: formData,
/**
*必须false才会自动加上正确的Content-Type
*/
contentType: false,
/**
* 必须false才会避开jQuery对 formdata 的默认处理
* XMLHttpRequest会对 formdata 进行正确的处理
*/
processData: false,
success: function (data) {
console.log(type);
if(data.code == 1){
if(type == 1){
$('#first').val(data.data);
}else if(type == 2){
$('#second').val(data.data);
}else if(type == 3){
$('#third').val(data.data);
}
// popup('上传成功');
}else{
popup(data.message)
}
console.log(data);
},
error: function () {
popup("上传失败!");
}
});
}
//提交时资料不完善
$(".save").click(function () {
var wx_pic = $('#first').val();
var name = $('.name').val();
var age = $('.age').val();
var sex = $(".sexchose").attr('index');
var card_num = $(".card_num").val();
var wx = $('.wx').val();
var education = $(".sex").attr('index');
var free_time = $('.free_time').val();
var select_id = $('#select').val();
var skill = $('.skill_itemtext').val();
var experience = $('#enterexperience').val();
var face = $('#second').val();
var back = $('#third').val();
$.ajax({
type: 'POST',
url: "{:url('Member/changeResume')}",
data: {
'id' : $('.id').val(),
'wx_pic' : wx_pic,
'name' : name,
'age' : age,
'sex' : sex,
'card_num' : card_num,
'wx' : wx,
'education' : education,
'free_time' : free_time,
'select_id' : select_id,
'skill' : skill,
'experience' : experience,
'just' : face,
'back' : back,
},
success: function (res) {
if(res.code == 1){
$('.examinewrapper').css('display','block');
setTimeout(location.href="{:url('Member/index')}",20000);
}else{
popup(res.message);
}
console.log('1111111');
console.log(res);
},
error: function (res) {
console.log('33333333');
console.log(res);
}
});
})
</script>
</body>
</html>
... ...
... ... @@ -17,9 +17,13 @@ body,html{
.person_img{
width:1.2rem;
height:1.2rem;
border-radius: 50%;
}
.person_img img{
width:100%;
height:100%;
border-radius: 50%;
}
.person_name{
height:1.2rem;
... ...