linwu 1 жил өмнө
parent
commit
14595ae1cf
42 өөрчлөгдсөн 726 нэмэгдсэн , 3 устгасан
  1. 3 0
      app/admin/controller/User.php
  2. 5 0
      app/common.php
  3. 5 3
      app/mainapp/controller/Login.php
  4. 68 0
      app/mobile/ExceptionHandle.php
  5. 15 0
      app/mobile/MobileBaseController.php
  6. 17 0
      app/mobile/Request.php
  7. 39 0
      app/mobile/common.php
  8. 18 0
      app/mobile/config/view.php
  9. 14 0
      app/mobile/controller/Index.php
  10. 68 0
      app/mobile/controller/Login.php
  11. 17 0
      app/mobile/event.php
  12. 12 0
      app/mobile/middleware.php
  13. 19 0
      app/mobile/provider.php
  14. 42 0
      app/mobile/view/index/base.html
  15. 26 0
      app/mobile/view/index/index.html
  16. 29 0
      app/mobile/view/public/base.html
  17. 64 0
      app/mobile/view/public/jump.html
  18. 51 0
      app/mobile/view/public/list_load.html
  19. 15 0
      app/mobile/view/public/meta_header.html
  20. 14 0
      public/static/common/css/swiper.min.css
  21. BIN
      public/static/common/exl/article_cate.xls
  22. BIN
      public/static/common/images/default_avatar.png
  23. 0 0
      public/static/common/js/axios1.4.min.js
  24. 65 0
      public/static/common/js/copyUrl.js
  25. 1 0
      public/static/common/js/jquery-1.12.4.min.js
  26. 1 0
      public/static/common/js/layer/layer.js
  27. 1 0
      public/static/common/js/layer/mobile/layer.js
  28. 0 0
      public/static/common/js/layer/mobile/need/layer.css
  29. BIN
      public/static/common/js/layer/skin/default/icon-ext.png
  30. BIN
      public/static/common/js/layer/skin/default/icon.png
  31. 0 0
      public/static/common/js/layer/skin/default/layer.css
  32. BIN
      public/static/common/js/layer/skin/default/loading-0.gif
  33. BIN
      public/static/common/js/layer/skin/default/loading-1.gif
  34. BIN
      public/static/common/js/layer/skin/default/loading-2.gif
  35. 1 0
      public/static/common/js/swiper.min.js
  36. 0 0
      public/static/common/js/vue3.3.4.min.js
  37. 28 0
      public/static/mobile/css/style.css
  38. 0 0
      public/static/mobile/css/vant4.6.min.css
  39. 28 0
      public/static/mobile/js/axios_instance.js
  40. 34 0
      public/static/mobile/js/components/articleList.js
  41. 26 0
      public/static/mobile/js/components/voteList.js
  42. 0 0
      public/static/mobile/js/vant4.6.min.js

+ 3 - 0
app/admin/controller/User.php

@@ -543,6 +543,9 @@ class User extends BaseController
     {
         $id            = input('id/d', 0);
         $user          = UserModel::with(['broker'])->findOrEmpty($id);
+        if ($user->isempty()) {
+            $user->broker_channel = 2;
+        }
         $agentlist     = AgentModel::with('broker')->order(['id' => 'asc'])->select();
         $groupslist    = UserGroupsModel::order(['isdefault' => 'desc', 'id' => 'asc'])->select();
         $willlist      = UserWill::select();

+ 5 - 0
app/common.php

@@ -26,6 +26,11 @@ function page_result1($code = 0, $msg = '', $data = [])
     ]));
 }
 
+function url(string $url = '', array $vars = [], $suffix = true, $domain = true)
+{
+    return \think\facade\Route::buildUrl($url, $vars)->suffix($suffix)->domain($domain);
+}
+
 
 /**
  * a.合成图片信息 复制一张图片的矩形区域到另外一张图片的矩形区域

+ 5 - 3
app/mainapp/controller/Login.php

@@ -68,6 +68,7 @@ class Login
     public function setWxMobile()
     {
         $openid        = input('openid/s', "");
+        $unionid       = input('unionid/s', "");
         $nickname      = input('nickname/s', "");
         $avatar        = input('avatar/s', "");
         $session_key   = base64_decode(input('session_key/s', ""));
@@ -95,13 +96,13 @@ class Login
             }
             $authsarr = [
                 'mobile' => $mobile,
-                'weixin' => $openid,
+                'weixin' => $unionid,
             ];
             $user     = $this->userRegister($userdata, input('parentid/d', 0), $authsarr);
         } else {
             $password = md5(time() . mt_rand(100000, 999999));
             $this->authsRegister($user->id, "mobile", $mobile, $password);
-            $this->authsRegister($user->id, "weixin", $openid, $password);
+            $this->authsRegister($user->id, "weixin", $unionid, $password);
         }
         page_result(0, "", ['userinfo' => $user]);
     }
@@ -112,7 +113,7 @@ class Login
         $code      = input('code/s', "");
         $wxprogram = new WxProgram();
         $resdata   = $wxprogram->auth_code2_session($code);
-        $userauths = UserAuthsModel::with('user')->where(['identifier' => $resdata['openid'], 'identitytype' => "weixin"])->findOrEmpty();
+        $userauths = UserAuthsModel::with('user')->where(['identifier' => $resdata['unionid'], 'identitytype' => "weixin"])->findOrEmpty();
         if ($userauths->isEmpty()) {
             $user = null;
         } else {
@@ -120,6 +121,7 @@ class Login
         }
         page_result(0, "", [
             'openid'      => $resdata['openid'],
+            'unionid'     => $resdata['unionid'],
             'session_key' => $resdata['session_key'],
             'userinfo'    => $user,
             'userauths'   => $userauths,

+ 68 - 0
app/mobile/ExceptionHandle.php

@@ -0,0 +1,68 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+namespace app\mobile;
+
+use think\db\exception\DataNotFoundException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\Handle;
+use think\exception\HttpException;
+use think\exception\HttpResponseException;
+use think\exception\ValidateException;
+use think\Response;
+use Throwable;
+
+/**
+ * 应用异常处理类
+ */
+class ExceptionHandle extends Handle
+{
+    /**
+     * 不需要记录信息(日志)的异常类列表
+     * @var array
+     */
+    protected $ignoreReport = [
+        HttpException::class,
+        HttpResponseException::class,
+        ModelNotFoundException::class,
+        DataNotFoundException::class,
+        ValidateException::class,
+    ];
+
+    /**
+     * 记录异常信息(包括日志或者其它方式记录)
+     *
+     * @access public
+     * @param  Throwable $exception
+     * @return void
+     */
+    public function report(Throwable $exception): void
+    {
+        // 使用内置的方式记录异常日志
+        parent::report($exception);
+    }
+
+    /**
+     * Render an exception into an HTTP response.
+     *
+     * @access public
+     * @param \think\Request   $request
+     * @param Throwable $e
+     * @return Response
+     */
+    public function render($request, Throwable $e): Response
+    {
+        // 添加自定义异常处理机制
+
+        // 其他错误交给系统处理
+        return parent::render($request, $e);
+    }
+}

+ 15 - 0
app/mobile/MobileBaseController.php

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

+ 17 - 0
app/mobile/Request.php

@@ -0,0 +1,17 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+namespace app\mobile;
+
+class Request extends \think\Request
+{
+
+}

+ 39 - 0
app/mobile/common.php

@@ -0,0 +1,39 @@
+<?php
+// 应用公共文件
+function jump($msg = '', $url = null, $wait = 3)
+{
+    if (is_null($url)) {
+        $url = 'javascript:history.back(-1);';
+    } else {
+        $url = "location.href = '" . url($url) . "'";
+    }
+
+    $result = [
+        'msg'  => $msg,
+        'url'  => $url,
+        'wait' => $wait,
+    ];
+
+    $html = view('/public/jump', $result);
+    throw new \think\exception\HttpResponseException($html);
+}
+
+function ajax_success($data)
+{
+    $res      = ['code' => 0, 'msg' => '成功', 'data' => $data];
+    $response = \think\Response::create($res, 'json');
+    throw new \think\exception\HttpResponseException($response);
+}
+
+function get_user_id()
+{
+    $sessionUserId = session('mobile.user.id');
+    if (empty($sessionUserId)) {
+        session('back_url',request()->url());
+        $response = redirect('/mobile/login/login');
+        throw new \think\exception\HttpResponseException($response);
+    }
+
+    return $sessionUserId;
+}
+

+ 18 - 0
app/mobile/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',
+        '__MIMAGES__'       => '/static/mobile/images',
+        '__MCSS__'          => '/static/mobile/css',
+        '__MJS__'           => '/static/mobile/js',
+        '__COMPONENTS__'    => '/static/mobile/js/components',
+    ],
+];

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

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

+ 68 - 0
app/mobile/controller/Login.php

@@ -0,0 +1,68 @@
+<?php
+
+namespace app\mobile\controller;
+
+use app\mobile\MobileBaseController;
+
+class Login extends MobileBaseController
+{
+    public function login()
+    {
+        halt('https://www.jucai.gov.cn/api/auth/wechat_auth?url=' . urlencode(url('/mobile/login/wechatBack')));
+        return redirect('https://www.jucai.gov.cn/api/auth/wechat_auth?url=' . urlencode(url('/mobile/login/wechatBack')));
+    }
+
+    /**
+     * 微信回调
+     */
+    public function wechatBack()
+    {
+        $param   = input('param.');
+        halt($param);
+        $open_id = $param['openid'];
+
+        //登录
+        $user = UserModel::where(['openid' => $open_id])->find();
+        if (empty($user)) {
+            $user = UserModel::create([
+                'nickname'  => $param['nickname'],
+                'avatar'    => $param['headimgurl'],
+                'openid'    => $open_id,
+                'unionid'   => $param['unionid'],
+                'logintime' => time(),
+                'loginip'   => request()->ip(),
+            ]);
+        } else {
+            $user->logintime = time();
+            $user->loginip   = request()->ip();
+            $user->save();
+        }
+
+        session('mobile.user.id', $user['id']);
+
+        $back_url = '/';
+        if (session('?back_url')) {
+            $back_url = session('back_url');
+            session('back_url', null);
+        }
+
+        return redirect($back_url);
+    }
+
+    public function login1()
+    {
+        session('mobile.user.id', 1);
+        $back_url = '/';
+        if (session('?back_url')) {
+            $back_url = session('back_url');
+            session('back_url', null);
+        }
+        return redirect($back_url);
+    }
+
+    public function logout()
+    {
+        session('mobile.user.id', null);
+        return '退出';
+    }
+}

+ 17 - 0
app/mobile/event.php

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

+ 12 - 0
app/mobile/middleware.php

@@ -0,0 +1,12 @@
+<?php
+
+return [
+    // 全局请求缓存
+    // \think\middleware\CheckRequestCache::class,
+    // 多语言加载
+    // \think\middleware\LoadLangPack::class,
+    // Session初始化
+    \think\middleware\SessionInit::class,
+    // 页面Trace调试
+    // \think\middleware\TraceDebug::class,
+];

+ 19 - 0
app/mobile/provider.php

@@ -0,0 +1,19 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+use app\mobile\ExceptionHandle;
+use app\mobile\Request;
+
+// 容器Provider定义文件
+return [
+    'think\Request'          => Request::class,
+    'think\exception\Handle' => ExceptionHandle::class,
+];

+ 42 - 0
app/mobile/view/index/base.html

@@ -0,0 +1,42 @@
+{extend name="public/base"/}
+{block name="css"}
+
+{/block}
+{block name="body"}
+<van-nav-bar
+        class="nav-theme"
+        :fixed="true"
+        :placeholder="true"
+        left-text="返回"
+        left-arrow
+        @click-left="onBack"
+>
+    <template #title>
+        <span class="text-white">首页</span>
+    </template>
+</van-nav-bar>
+<van-tabbar v-model="active" @change="onTab" :placeholder="true">
+    <van-tabbar-item icon="wap-home-o">首页</van-tabbar-item>
+    <van-tabbar-item icon="description">文章</van-tabbar-item>
+    <van-tabbar-item icon="user-circle-o">我的</van-tabbar-item>
+</van-tabbar>
+{/block}
+{block name="script"}
+<script>
+    function v_setup() {
+        let base = {};
+
+        base.active = Vue.ref(0);
+
+        base.onBack = () => {
+            alert(1);
+        }
+
+        base.onTab = (index) => {
+            alert(index)
+        }
+
+        return base;
+    }
+</script>
+{/block}

+ 26 - 0
app/mobile/view/index/index.html

@@ -0,0 +1,26 @@
+{extend name="public/base"/}
+{block name="css"}
+
+{/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>
+
+{/block}
+{block name="script"}
+<script>
+    function v_setup() {
+        return {};
+    }
+</script>
+{/block}
+{block name="vue"}
+<script src="__COMPONENTS__/voteList.js"></script>
+{/block}

+ 29 - 0
app/mobile/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/mobile/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/mobile/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/mobile/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>

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 14 - 0
public/static/common/css/swiper.min.css


BIN
public/static/common/exl/article_cate.xls


BIN
public/static/common/images/default_avatar.png


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/static/common/js/axios1.4.min.js


+ 65 - 0
public/static/common/js/copyUrl.js

@@ -0,0 +1,65 @@
+function CopyToClipboard(input) {
+	var textToClipboard = input;
+
+	var success = true;
+	if (window.clipboardData) { // Internet Explorer
+		window.clipboardData.setData("Text", textToClipboard);
+	} else {
+		// create a temporary element for the execCommand method
+		var forExecElement = CreateElementForExecCommand(textToClipboard);
+
+		/* Select the contents of the element 
+		    (the execCommand for 'copy' method works on the selection) */
+		SelectContent(forExecElement);
+
+		var supported = true;
+
+		// UniversalXPConnect privilege is required for clipboard access in Firefox
+		try {
+			if (window.netscape && netscape.security) {
+				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+			}
+
+			// Copy the selected content to the clipboard
+			// Works in Firefox and in Safari before version 5
+			success = document.execCommand("copy", false, null);
+		} catch (e) {
+			success = false;
+		}
+
+		// remove the temporary element
+		document.body.removeChild(forExecElement);
+	}
+
+	if (success) {
+		layer.msg("复制成功!");
+	} else {
+		layer.msg("复制失败,你要复制的内容为:"+textToClipboard);
+	}
+}
+
+function CreateElementForExecCommand(textToClipboard) {
+	var forExecElement = document.createElement("div");
+	// place outside the visible area
+	forExecElement.style.position = "absolute";
+	forExecElement.style.left = "-10000px";
+	forExecElement.style.top = "-10000px";
+	// write the necessary text into the element and append to the document
+	forExecElement.textContent = textToClipboard;
+	document.body.appendChild(forExecElement);
+	// the contentEditable mode is necessary for the  execCommand method in Firefox
+	forExecElement.contentEditable = true;
+
+	return forExecElement;
+}
+
+function SelectContent(element) {
+	// first create a range
+	var rangeToSelect = document.createRange();
+	rangeToSelect.selectNodeContents(element);
+
+	// select the contents
+	var selection = window.getSelection();
+	selection.removeAllRanges();
+	selection.addRange(rangeToSelect);
+}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 0
public/static/common/js/jquery-1.12.4.min.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 0
public/static/common/js/layer/layer.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 0
public/static/common/js/layer/mobile/layer.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/static/common/js/layer/mobile/need/layer.css


BIN
public/static/common/js/layer/skin/default/icon-ext.png


BIN
public/static/common/js/layer/skin/default/icon.png


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/static/common/js/layer/skin/default/layer.css


BIN
public/static/common/js/layer/skin/default/loading-0.gif


BIN
public/static/common/js/layer/skin/default/loading-1.gif


BIN
public/static/common/js/layer/skin/default/loading-2.gif


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 0
public/static/common/js/swiper.min.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/static/common/js/vue3.3.4.min.js


+ 28 - 0
public/static/mobile/css/style.css

@@ -0,0 +1,28 @@
+body {
+    --red:#e54d42;
+    --pink:#FF589B;
+    --blue: #0081ff;
+    --green: #39b54a;
+    --gray: #666;
+    background:#f8f9fb;
+    font-family: "Microsoft Yahei",arial,"Hiragino Sans GB","Hiragino Sans GB W3",宋体,simsun;
+    color:#333;
+}
+
+html {
+    box-sizing: border-box;
+}
+*, *:before, *:after {
+    box-sizing: inherit;
+}
+
+.nav-theme,.nav-theme .van-nav-bar{background:var(--blue);}
+.nav-theme .van-nav-bar__title,.nav-theme .van-nav-bar__text,.nav-theme .van-icon{color:white;}
+.van-swipe {background:white;}
+
+.article-list article{box-shadow:0 0 6px rgba(0, 0, 0, 0.028), 0 0 18px rgba(0, 0, 0, 0.042), 0 0 80px rgba(0, 0, 0, 0.07);border-radius: 5px;width:95%;height:110px;margin:10px auto;display:flex;align-items:center;background:white;padding:5px 10px;}
+.article-list article .s-left {height:90px;display:flex;flex-direction:column;width: 100%;}
+.article-list article .s-left.image {width: calc(100% - 120px);}
+.article-list article .s-left .s-title{font-size: 16px;text-overflow: ellipsis;display: -webkit-box;overflow: hidden;-webkit-box-orient: vertical;-webkit-line-clamp: 3;text-align:left;}
+.article-list article .s-left .s-time{font-size: 12px;color:#999;margin-top:auto;}
+.article-list article .s-right {width:110px;margin-left:auto;}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/static/mobile/css/vant4.6.min.css


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

@@ -0,0 +1,28 @@
+const axios_instance = axios.create({
+    baseURL: baseUrl + "mobile",
+    timeout: 30000,
+    headers: {'X-Requested-With':'XMLHttpRequest'},
+    withCredentials: true,
+});
+
+async function postJson(url,data,error) {
+    return  new Promise((resolve, reject) => {
+        axios_instance.post(url, JSON.stringify(data), {
+            headers: { 'Content-Type': 'application/json;charset=UTF-8' }
+        }).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);
+        });
+    });
+}

+ 34 - 0
public/static/mobile/js/components/articleList.js

@@ -0,0 +1,34 @@
+app.component('article-list', {
+    template: `
+    <div class="article-list">
+        <article v-for="item in list" @click="toDetail(item.id)">
+            <section class="s-left" :class="{image:!!item.header_image}">
+                <div class="s-title">{{item.title}}</div>
+                <div class="s-time">{{item.update_time}}</div>
+            </section>
+            <section class="s-right" v-if="item.header_image">
+                <van-image
+                        width="110"
+                        height="85"
+                        fit="cover"
+                        :src="item.header_image"
+                ></van-image>
+            </section>
+        </article>
+    </div>
+    `,
+    data() {
+        return {}
+    },
+    props: {
+        list: {
+            type: Array,
+            default: [],
+        },
+    },
+    methods: {
+        toDetail(id) {
+            location.href = "/mobile/article/detail.html?id=" + id;
+        },
+    },
+});

+ 26 - 0
public/static/mobile/js/components/voteList.js

@@ -0,0 +1,26 @@
+app.component('vote-list', {
+    template: `
+    <div class="article-list">
+        <article v-for="item in list" @click="toDetail(item.id)">
+            <section class="s-left">
+                <div class="s-title">{{item.title}}</div>
+                <div class="s-time">{{item.start_time}} 至 {{item.end_time}}</div>
+            </section>
+        </article>
+    </div>
+    `,
+    data() {
+        return {}
+    },
+    props: {
+        list: {
+            type: Array,
+            default: [],
+        },
+    },
+    methods: {
+        toDetail(id) {
+            location.href = "/mobile/vote/detail.html?id=" + id;
+        },
+    },
+});

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/static/mobile/js/vant4.6.min.js


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно