浏览代码

人力资源大会

linwu 6 月之前
父节点
当前提交
6d852fa042

+ 20 - 0
app/admin/controller/Human.php

@@ -48,6 +48,16 @@ class Human extends AdminBaseController
         ajax_return();
     }
 
+    public function institutionDetail()
+    {
+        $id = input('id/d');
+        $info      = HumanInstitutionApplyModel::find($id);
+
+        return view('', [
+            'info'        => $info,
+        ]);
+    }
+
     /**
      * 企业报名
      */
@@ -82,6 +92,16 @@ class Human extends AdminBaseController
         ajax_return();
     }
 
+    public function enterpriseDetail()
+    {
+        $id = input('id/d');
+        $info      = HumanEnterpriseApplyModel::find($id);
+
+        return view('', [
+            'info'        => $info,
+        ]);
+    }
+
     /**
      * 机构列表
      */

+ 13 - 1
app/admin/view/human/enterprise_apply.html

@@ -34,6 +34,9 @@
         <div class="layui-card-body">
             <table id="{$lay_table}" lay-filter="{$lay_table}"></table>
             <script type="text/html" id="setTpl">
+                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail">
+                    <i class="layui-icon layui-icon-edit"></i>详情
+                </a>
                 <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="pass">
                     <i class="layui-icon layui-icon-edit"></i>审核通过
                 </a>
@@ -67,7 +70,7 @@
                     {field: 'suggestion', title: '对本次活动想说的话'},
                     {field: 'status_text', title: '状态', width: 100, align: 'center'},
                     {field: 'create_time', title: '申请时间', width: 160, align: 'center'},
-                    {title: '操作', width: 220, align: 'center', fixed: 'right', toolbar: '#setTpl'}
+                    {title: '操作', width: 300, align: 'center', fixed: 'right', toolbar: '#setTpl'}
                 ]
             ],
             page: true,
@@ -166,6 +169,15 @@
                     });
                     layer.close(index);
                 });
+            } else if (obj.event === 'detail') {
+                const index = layer.open({
+                    type: 2,
+                    title: '企业详情',
+                    content: "{:url('human/enterpriseDetail')}?id=" + data.id,
+                    maxmin: true,
+                    area: ['550px', '550px']
+                });
+                layer.full(index);
             }
         });
 

+ 125 - 0
app/admin/view/human/enterprise_detail.html

@@ -0,0 +1,125 @@
+<style>
+    .mt10{margin-top:10px;}
+    .pre {white-space:pre-wrap;}
+    .image {width:50px;height:50px;margin-right: 10px;}
+</style>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">参会企业</div>
+                <div class="layui-card-body" pad15>
+                    <div class="layui-row">
+                        <div class="layui-col-md3">
+                            企业名
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.name}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            参会人
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.join}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            参会手机号
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.join_mobile}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            微信号
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.wechat}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            希望合作的业务
+                        </div>
+                        <div class="layui-col-md9">
+                            {volist name="info.cooperate" id="vo"}
+                            <button type="button" class="layui-btn layui-btn-sm">{$vo}</button>
+                            {/volist}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            公司介绍
+                        </div>
+                        <div class="layui-col-md9 pre">{$info.describe}</div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            网址
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.url}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            附件
+                        </div>
+                        <div class="layui-col-md9">
+                            {volist name="info.images" id="image"}
+                            <img src="{$image}" class="image" data-index="{$key}">
+                            {/volist}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            对本次活动想说的话
+                        </div>
+                        <div class="layui-col-md9 pre">{$info.suggestion}</div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            报名时间
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.create_time}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<script>
+    layui.use(['index', 'form'], function () {
+        const $ = layui.$;
+
+        $('.image').click(function(){
+            const index = $(this).data('index');
+            layer.photos({
+                photos: {
+                    "title": "附件", //相册标题
+                    "id": 123, //相册id
+                    "start": index, //初始显示的图片序号,默认0
+                    "data": [   //相册包含的图片,数组格式
+                        {volist name="info.images" id="image"}
+                        {
+                            "alt": "",
+                            "pid": {$key}, //图片id
+                            "src": "{$image}", //原图地址
+                            "thumb": "" //缩略图地址
+                        },
+                        {/volist}
+                    ]
+                }
+                ,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
+            });
+        });
+
+    });
+</script>

+ 13 - 1
app/admin/view/human/institution_apply.html

@@ -34,6 +34,9 @@
         <div class="layui-card-body">
             <table id="{$lay_table}" lay-filter="{$lay_table}"></table>
             <script type="text/html" id="setTpl">
+                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail">
+                    <i class="layui-icon layui-icon-edit"></i>详情
+                </a>
                 <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="pass">
                     <i class="layui-icon layui-icon-edit"></i>审核通过
                 </a>
@@ -66,7 +69,7 @@
                     {field: 'suggestion', title: '对本次活动想说的话'},
                     {field: 'status_text', title: '状态', width: 100, align: 'center'},
                     {field: 'create_time', title: '申请时间', width: 160, align: 'center'},
-                    {title: '操作', width: 220, align: 'center', fixed: 'right', toolbar: '#setTpl'}
+                    {title: '操作', width: 300, align: 'center', fixed: 'right', toolbar: '#setTpl'}
                 ]
             ],
             page: true,
@@ -165,6 +168,15 @@
                     });
                     layer.close(index);
                 });
+            } else if (obj.event === 'detail') {
+                const index = layer.open({
+                    type: 2,
+                    title: '机构详情',
+                    content: "{:url('human/institutionDetail')}?id=" + data.id,
+                    maxmin: true,
+                    area: ['550px', '550px']
+                });
+                layer.full(index);
             }
         });
 

+ 115 - 0
app/admin/view/human/institution_detail.html

@@ -0,0 +1,115 @@
+<style>
+    .mt10{margin-top:10px;}
+    .pre {white-space:pre-wrap;}
+    .image {width:50px;height:50px;margin-right: 10px;}
+</style>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">参会机构</div>
+                <div class="layui-card-body" pad15>
+                    <div class="layui-row">
+                        <div class="layui-col-md3">
+                            机构名
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.name}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            参会人
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.join}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            参会手机号
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.join_mobile}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            微信号
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.wechat}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            机构介绍
+                        </div>
+                        <div class="layui-col-md9 pre">{$info.describe}</div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            网址
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.url}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            附件
+                        </div>
+                        <div class="layui-col-md9">
+                            {volist name="info.images" id="image"}
+                            <img src="{$image}" class="image" data-index="{$key}">
+                            {/volist}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            对本次活动想说的话
+                        </div>
+                        <div class="layui-col-md9 pre">{$info.suggestion}</div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            报名时间
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.create_time}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<script>
+    layui.use(['index', 'form'], function () {
+        const $ = layui.$;
+
+        $('.image').click(function(){
+            const index = $(this).data('index');
+            layer.photos({
+                photos: {
+                    "title": "附件", //相册标题
+                    "id": 123, //相册id
+                    "start": index, //初始显示的图片序号,默认0
+                    "data": [   //相册包含的图片,数组格式
+                        {volist name="info.images" id="image"}
+                        {
+                            "alt": "",
+                            "pid": {$key}, //图片id
+                            "src": "{$image}", //原图地址
+                            "thumb": "" //缩略图地址
+                        },
+                        {/volist}
+                    ]
+                }
+                ,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
+            });
+        });
+
+    });
+</script>

+ 1 - 0
app/common/model/HumanEnterpriseApplyModel.php

@@ -12,6 +12,7 @@ class HumanEnterpriseApplyModel extends BaseModel
 
     protected $type = [
         'cooperate' => 'array',
+        'images' => 'array',
     ];
 
     // 常量

+ 4 - 0
app/common/model/HumanInstitutionApplyModel.php

@@ -10,6 +10,10 @@ class HumanInstitutionApplyModel extends BaseModel
     //自动完成
     protected $autoWriteTimestamp = true;
 
+    protected $type = [
+        'images' => 'array',
+    ];
+
     // 常量
     const STATUS = [1 => '待审核', 2 => '审核通过', 3 => '审核不通过'];
 

+ 3 - 3
app/mobile/controller/Human.php

@@ -15,11 +15,11 @@ class Human extends MobileBaseController
 {
     protected function initialize()
     {
-        $open_id = session('mobile.human.open_id');
+        /*$open_id = session('mobile.human.open_id');
         if (empty($open_id)) {
             $response = redirect('https://www.jucai.gov.cn/api/auth/wechat_auth?url=' . urlencode(url('/mobile/login/humanLogin')));
             throw new \think\exception\HttpResponseException($response);
-        }
+        }*/
     }
 
     /**
@@ -48,7 +48,7 @@ class Human extends MobileBaseController
             ajax_return(1, $e->getError());
         }
 
-        $data['open_id'] = session('mobile.human.open_id');
+//        $data['open_id'] = session('mobile.human.open_id');
         HumanInstitutionApplyModel::create($data);
 
         ajax_return();

+ 6 - 0
app/mobile/controller/Index.php

@@ -36,4 +36,10 @@ class Index extends MobileBaseController
         ]);
     }
 
+    public function uploadImage()
+    {
+        $file = request()->file('image');
+        // 上传到本地服务器
+        $savename = \think\facade\Filesystem::putFile( 'topic', $file);
+    }
 }

+ 47 - 0
app/mobile/controller/Upload.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace app\mobile\controller;
+
+
+use app\mobile\MobileBaseController;
+
+class Upload extends MobileBaseController
+{
+
+    /**
+     * 文件上传
+     */
+    public function file()
+    {
+        $file     = request()->file("file");
+        $savename = \think\facade\Filesystem::disk('public')->putFile('files', $file);
+        if ($file) {
+            $filename = str_replace(strrchr($_FILES['file']['name'], "."), "", $_FILES['file']['name']);
+            ajax_return(0, '', [
+                'src'   => request()->domain() . "/storage/" . str_replace("\\", "/", $savename),
+                'path'  => "./storage/" . str_replace("\\", "/", $savename),
+                'title' => $filename,
+            ]);
+        } else {
+            ajax_return(1, '上传失败,请稍后重试');
+        }
+    }
+
+    /**
+     * 图片上传
+     */
+    public function image()
+    {
+        $file     = request()->file("file");
+        $savename = \think\facade\Filesystem::disk('public')->putFile('images', $file);
+        if ($file) {
+            $filename = str_replace(strrchr($_FILES['file']['name'], "."), "", $_FILES['file']['name']);
+            ajax_return(0, '', [
+                'src'   => request()->domain() . "/storage/" . str_replace("\\", "/", $savename),
+                'title' => $filename,
+            ]);
+        } else {
+            ajax_return(1, '上传失败,请稍后重试');
+        }
+    }
+}

+ 46 - 11
app/mobile/view/human/enterprise_form.html

@@ -65,16 +65,33 @@
                 </van-row>
             </template>
         </van-field>
-        <van-cell-group>
-            <van-field
-                    v-model="form.suggestion"
-                    rows="3"
-                    autosize
-                    label="活动建议"
-                    type="textarea"
-                    placeholder="请输入对本次活动想说的话"
-            ></van-field>
-        </van-cell-group>
+        <van-field
+                v-model="form.url"
+                type="text"
+                label="官网"
+                placeholder="请输入官网"
+        ></van-field>
+        <van-field
+                v-model="form.describe"
+                rows="3"
+                autosize
+                label="公司介绍"
+                type="textarea"
+                placeholder="请输入公司介绍"
+        ></van-field>
+        <van-field label="附件(海报,名片等)">
+            <template #input>
+                <van-uploader v-model="fileList" :before-read="uploadImage" :before-delete="deleteImage"></van-uploader>
+            </template>
+        </van-field>
+        <van-field
+                v-model="form.suggestion"
+                rows="3"
+                autosize
+                label="活动建议"
+                type="textarea"
+                placeholder="请输入对本次活动想说的话"
+        ></van-field>
     </van-cell-group>
     <div style="margin: 16px;">
         <van-button round block type="primary" native-type="submit">
@@ -115,7 +132,8 @@
         }
 
         base.form = Vue.reactive({
-            cooperate: []
+            cooperate: [],
+            images: [],
         });
         base.onBack = () => {
             location.href = "{:url('human/index')}";
@@ -133,6 +151,23 @@
             });
         };
 
+        //图片上传
+        base.fileList = Vue.ref([]);
+        base.uploadImage = (file) => {
+            const formData = new FormData();
+            formData.append("file", file);
+
+            postFile("upload/image",formData).then(({data})=>{
+                base.form.images.push(data.src);
+            });
+
+            return true;
+        };
+        base.deleteImage = (file,param) => {
+            base.form.images.splice(param.index,1);
+            return true;
+        };
+
         return base;
     }
 </script>

+ 20 - 11
app/mobile/view/human/index.html

@@ -1,31 +1,34 @@
 {extend name="public/base_human"/}
 {block name="css"}
 <style>
-    .title-box {padding-top:20px;}
+    .title-box {padding-top:90px;color:white;}
     .title {text-align: center;}
     .btn-box {width:80%;margin:0 auto;padding-top:20px;}
-    .btn-box .van-button {margin-top:50px;}
+    .btn-box .van-button {margin-top:30px;}
+    .content-box {height: calc(100vh - 46px);width:100vw;box-sizing: border-box;background-image: url("/static/mobile/images/bg_human.jpg");background-size:cover;background-repeat: no-repeat;}
 </style>
 {/block}
 {block name="body"}
 <van-nav-bar
         class="nav-theme"
-        :fixed="true"
         :placeholder="true"
 >
     <template #title>
         <span class="text-white">首页</span>
     </template>
 </van-nav-bar>
-<div class="title-box">
-    <h3 class="title">民营经济与人力资源服务发展大会</h3>
-    <h3 class="title">暨人力资源服务供需对接会</h3>
+<div class="content-box">
+    <div class="title-box">
+        <h3 class="title">民营经济与人力资源服务发展大会</h3>
+        <h3 class="title">暨人力资源服务供需对接会</h3>
+    </div>
+    <div class="btn-box">
+        <van-button type="primary" size="large" block @click="toEnterprise">企业报名</van-button>
+        <van-button type="primary" size="large" block @click="toInstitution">机构报名</van-button>
+        <van-button type="primary" size="large" block @click="toDescribe">大会介绍</van-button>
+        <van-button type="primary" size="large" block @click="toJinjiang">晋江介绍</van-button>
+    </div>
 </div>
-<div class="btn-box">
-    <van-button type="primary" size="large" block @click="toEnterprise">企业报名</van-button>
-    <van-button type="primary" size="large" block @click="toInstitution">机构报名</van-button>
-</div>
-
 {/block}
 {block name="script"}
 <script>
@@ -38,6 +41,12 @@
         base.toInstitution = () => {
             location.href = "{:url('human/institutionForm')}";
         };
+        base.toDescribe = () => {
+            alert('敬请期待');
+        };
+        base.toJinjiang = () => {
+            alert('敬请期待');
+        };
 
 
         return base;

+ 47 - 11
app/mobile/view/human/institution_form.html

@@ -47,16 +47,33 @@
                 label="微信号"
                 placeholder="请输入微信号"
         ></van-field>
-        <van-cell-group>
-            <van-field
-                    v-model="form.suggestion"
-                    rows="3"
-                    autosize
-                    label="活动建议"
-                    type="textarea"
-                    placeholder="请输入对本次活动想说的话"
-            ></van-field>
-        </van-cell-group>
+        <van-field
+                v-model="form.url"
+                type="text"
+                label="官网"
+                placeholder="请输入官网"
+        ></van-field>
+        <van-field
+                v-model="form.describe"
+                rows="3"
+                autosize
+                label="公司介绍"
+                type="textarea"
+                placeholder="请输入公司介绍"
+        ></van-field>
+        <van-field label="附件(海报,名片等)">
+            <template #input>
+                <van-uploader v-model="fileList" :before-read="uploadImage" :before-delete="deleteImage"></van-uploader>
+            </template>
+        </van-field>
+        <van-field
+                v-model="form.suggestion"
+                rows="3"
+                autosize
+                label="活动建议"
+                type="textarea"
+                placeholder="请输入对本次活动想说的话"
+        ></van-field>
     </van-cell-group>
     <div style="margin: 16px;">
         <van-button round block type="primary" native-type="submit">
@@ -70,7 +87,9 @@
     function v_setup() {
         let base = {};
 
-        base.form = Vue.reactive({});
+        base.form = Vue.reactive({
+            images: [],
+        });
         base.onBack = () => {
             location.href = "{:url('human/index')}";
         };
@@ -87,6 +106,23 @@
             });
         };
 
+        //图片上传
+        base.fileList = Vue.ref([]);
+        base.uploadImage = (file) => {
+            const formData = new FormData();
+            formData.append("file", file);
+
+            postFile("upload/image",formData).then(({data})=>{
+                base.form.images.push(data.src);
+            });
+
+            return true;
+        };
+        base.deleteImage = (file,param) => {
+            base.form.images.splice(param.index,1);
+            return true;
+        };
+
         return base;
     }
 </script>

二进制
public/static/mobile/images/bg_human.jpg


+ 22 - 0
public/static/mobile/js/axios_instance.js

@@ -25,4 +25,26 @@ async function postJson(url,data,error) {
             return resolve(data);
         });
     });
+}
+
+async function postFile(url,data,error) {
+    return  new Promise((resolve, reject) => {
+        axios_instance.post(url, data, {
+            headers: { 'Content-Type': 'application/form-data' }
+        }).then((result) => {
+            const data = result.data;
+            if (data.code === 1) {
+                if (typeof error === 'function') {
+                    error(data);
+                    return false;
+                } else {
+                    vant.showToast(data.msg);
+                    return false;
+                }
+            } else if (data.code === 401) {
+                location.href = '/mobile/login/login';
+            }
+            return resolve(data);
+        });
+    });
 }