linwu 1 年之前
父節點
當前提交
566db036e4

+ 1 - 0
app/home/.htaccess

@@ -0,0 +1 @@
+deny from all

+ 15 - 0
app/home/HomeBaseController.php

@@ -0,0 +1,15 @@
+<?php
+namespace app\home;
+
+use app\BaseController;
+
+/**
+ * 控制器基础类
+ */
+abstract class HomeBaseController extends BaseController
+{
+    // 初始化
+    protected function initialize()
+    {}
+
+}

+ 3 - 0
app/home/common.php

@@ -0,0 +1,3 @@
+<?php
+// 应用公共文件
+

+ 18 - 0
app/home/config/view.php

@@ -0,0 +1,18 @@
+<?php
+// +----------------------------------------------------------------------
+// | 模板设置
+// +----------------------------------------------------------------------
+
+return [
+    // 模板常量
+    'tpl_replace_string' => [
+        '__STATIC__'        => '/static',
+        '__COMMON_IMAGES__' => '/static/common/images',
+        '__COMMON_CSS__'    => '/static/common/css',
+        '__COMMON_JS__'     => '/static/common/js',
+        '__HIMAGES__'       => '/static/home/images',
+        '__HCSS__'          => '/static/home/css',
+        '__HJS__'           => '/static/home/js',
+        '__COMPONENTS__'    => '/static/home/js/components',
+    ],
+];

+ 14 - 0
app/home/controller/Index.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace app\home\controller;
+
+use app\home\HomeBaseController;
+
+class Index extends HomeBaseController
+{
+    public function index()
+    {
+        return view();
+    }
+
+}

+ 17 - 0
app/home/event.php

@@ -0,0 +1,17 @@
+<?php
+// 事件定义文件
+return [
+    'bind'      => [
+    ],
+
+    'listen'    => [
+        'AppInit'  => [],
+        'HttpRun'  => [],
+        'HttpEnd'  => [],
+        'LogLevel' => [],
+        'LogWrite' => [],
+    ],
+
+    'subscribe' => [
+    ],
+];

+ 10 - 0
app/home/middleware.php

@@ -0,0 +1,10 @@
+<?php
+// 全局中间件定义文件
+return [
+    // 全局请求缓存
+    // \think\middleware\CheckRequestCache::class,
+    // 多语言加载
+    // \think\middleware\LoadLangPack::class,
+    // Session初始化
+     \think\middleware\SessionInit::class
+];

+ 9 - 0
app/home/provider.php

@@ -0,0 +1,9 @@
+<?php
+use app\ExceptionHandle;
+use app\Request;
+
+// 容器Provider定义文件
+return [
+    'think\Request'          => Request::class,
+    'think\exception\Handle' => ExceptionHandle::class,
+];

+ 12 - 0
app/home/view/index/index.html

@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="zh-cn">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1">
+    <title>晋江人力资本有限公司</title>
+    <style>img {width:1920px;height:1080px;}</style>
+</head>
+<body>
+<img src="__HIMAGES__/index.jpg" alt="">
+</body>
+</html>

+ 29 - 0
app/home/view/public/base.html

@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="zh-cn">
+<head>
+    {include file="public/meta_header"/}
+    {block name="meta"}{/block}
+    {block name="css"}{/block}
+</head>
+<body>
+<div id="app">
+    {block name="body"}{/block}
+</div>
+{block name="script"}{/block}
+<script>
+    const vue3 = {
+        setup() {
+            return v_setup();
+        }
+    };
+
+    const app = Vue.createApp(vue3)
+        .use(vant)
+        .use(vant.Lazyload);
+</script>
+{block name="vue"}{/block}
+<script>
+    app.mount('#app');
+</script>
+</body>
+</html>

+ 64 - 0
app/home/view/public/jump.html

@@ -0,0 +1,64 @@
+{extend name="public/base"/}
+{block name="css"}
+<style>
+    .icon{
+        text-align:center;
+        margin-top:50px;
+    }
+
+    .msg{
+        text-align:center;
+        margin:0;
+        padding:0;
+        font-size:24px;
+    }
+
+    .tips{
+        text-align:center;
+        margin-top:50px;
+        font-size:14px;
+        color:#aaa;
+    }
+
+    .tips .num{
+        color:#FF589B;
+    }
+</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 style="width:100%;height:46px;"></div>
+<div class="icon">
+    <van-icon name="warning-o" size="160" color="#0081ff"></van-icon>
+</div>
+<h3 class="msg">{$msg}</h3>
+<p class="tips">还有<span class="num">{{wait}}</span>秒后自动跳转</p>
+{/block}
+{block name="script"}
+<script>
+    function v_setup() {
+        let base = {};
+
+        base.wait = Vue.ref({$wait});
+        const created = () => {
+            setInterval(function () {
+                base.wait.value--;
+                if (base.wait.value === 0) {
+                    {$url}
+                }
+            }, 1000);
+        }
+        created();
+
+        return base;
+    }
+</script>
+{/block}

+ 51 - 0
app/home/view/public/list_load.html

@@ -0,0 +1,51 @@
+<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+    <van-list
+            v-model:loading="loading"
+            :finished="finished"
+            finished-text="没有更多了"
+            @load="onList"
+    >
+        [list]
+    </van-list>
+</van-pull-refresh>
+
+<script>
+    function list_load(url, form = {}) {
+        let base = {};
+
+        base.form = Vue.reactive(form);
+        base.page = Vue.ref(1);
+        base.loading = Vue.ref(false);
+        base.finished = Vue.ref(false);
+        base.refreshing = Vue.ref(false);
+        base.list = Vue.reactive([]);
+
+        base.onList = () => {
+            let param = {...base.form};
+            param.page = base.page.value;
+            base.page.value++;
+
+            postJson(url, param).then( ({data}) => {
+                base.loading.value = false;
+                if (base.refreshing.value) base.refreshing.value = false;
+                if (data.length === 0) {
+                    base.finished.value = true;
+                } else {
+                    base.list.push(...data);
+                }
+            });
+
+        };
+
+        base.onRefresh = () => {
+            base.list = Vue.reactive([]);
+            base.page.value = 1;
+            base.loading.value = true;
+            base.finished.value = false;
+
+            base.onList();
+        };
+
+        return base;
+    }
+</script>

+ 15 - 0
app/home/view/public/meta_header.html

@@ -0,0 +1,15 @@
+<meta charset="utf-8">
+<title>演示项目</title>
+<meta name="renderer" content="webkit">
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"/>
+<meta name="apple-mobile-web-app-capable" content="yes" />
+<meta name="apple-mobile-web-app-status-bar-style" content="black" />
+<link rel="stylesheet" href="__MCSS__/vant4.6.min.css">
+<link rel="stylesheet" href="__MCSS__/style.css">
+<script src="__COMMON_JS__/vue3.3.4.min.js"></script>
+<script src="__MJS__/vant4.6.min.js"></script>
+<script src="__COMMON_JS__/axios1.4.min.js"></script>
+<script>
+    const baseUrl = "{:url('/')}";
+</script>
+<script src="__MJS__/axios_instance.js"></script>

+ 1 - 1
app/middleware.php

@@ -6,5 +6,5 @@ return [
     // 多语言加载
     // \think\middleware\LoadLangPack::class,
     // Session初始化
-     \think\middleware\SessionInit::class
+//     \think\middleware\SessionInit::class
 ];

+ 0 - 39
app/mobile/MobileBaseController.php

@@ -12,43 +12,4 @@ abstract class MobileBaseController extends BaseController
     protected function initialize()
     {}
 
-
-
-    /**
-     * 等于条件
-     */
-    protected function dealEqualInput($equal_array,$result=[])
-    {
-        foreach ($equal_array as $k => $v) {
-            if (!is_numeric($k)) {
-                $value = input($k);
-            } else {
-                $value = input($v);
-            }
-            if (!empty($value)) {
-                $result[] = [$v, '=', $value];
-            }
-        }
-
-        return $result;
-    }
-
-    /**
-     * like条件
-     */
-    protected function dealLikeInput($like_array,$result=[])
-    {
-        foreach ($like_array as $k => $v) {
-            if (!is_numeric($k)) {
-                $value = input($k);
-            } else {
-                $value = input($v);
-            }
-            if (!empty($value)) {
-                $result[] = [$v, 'like', "%{$value}%"];
-            }
-        }
-
-        return $result;
-    }
 }

+ 1 - 1
app/mobile/middleware.php

@@ -6,5 +6,5 @@ return [
     // 多语言加载
     // \think\middleware\LoadLangPack::class,
     // Session初始化
-    // \think\middleware\SessionInit::class
+     \think\middleware\SessionInit::class
 ];

二進制
public/static/home/images/index.jpg


+ 3 - 1
public/static/mobile/js/axios_instance.js

@@ -13,9 +13,11 @@ async function postJson(url,data,error) {
             const data = result.data;
             if (data.code === 1) {
                 if (typeof error === 'function') {
-                    return error(data);
+                    error(data);
+                    return false;
                 } else {
                     vant.showToast(data.msg);
+                    return false;
                 }
             } else if (data.code === 401) {
                 location.href = '/mobile/login/login';