Silent 6 年之前
父節點
當前提交
bae984e265

+ 10 - 0
app/Http/Controllers/Admin/SettingController.php

xqd
@@ -50,4 +50,14 @@ class SettingController extends Controller
         }
         return $this->showMessage('操作成功');
     }
+
+    public function system(Request $request)
+    {
+        $check_card_location = $this->model->firstOrCreate(['key' => 'check_card_location'], ['key_show' => '39.916527,116.397128']);
+        $check_card_radius = $this->model->firstOrCreate(['key' => 'check_card_radius'], ['key_show' => '1000']);
+
+        list($pre_uri, $model, $model_name) = array($this->pre_uri, $this->model, $this->model_name);
+
+        return view($this->view_path . 'system', compact('pre_uri', 'model', 'model_name', 'check_card_location', 'check_card_radius'));
+    }
 }

+ 60 - 0
resources/views/admin/settings/system.blade.php

xqd
@@ -0,0 +1,60 @@
+@extends('admin.layout')
+<style type="text/css">
+
+</style>
+@section('header')
+
+@endsection
+
+@section('content')
+<div id="sg-main-container-sg">
+    <div class="wrapper wrapper-content animated fadeInRight">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title">
+                        <h5>系统配置</h5>
+                        <div class="ibox-tools">
+                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="ibox-content">
+                        <form class="form-horizontal" method="POST" action="{{ $pre_uri . 'updateSystem' }}">
+                            {{ csrf_field() }}
+
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-sm-offset-1 control-label">打卡位置</label>
+                                <div class="col-sm-8">
+                                    <input class="form-control" type="text" name="check_card_location" value="{{ $check_card_location->value }}" readonly>
+                                </div>
+                            </div>
+
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-sm-offset-1 control-label">打卡半径(米)</label>
+                                <div class="col-sm-8">
+                                    <input class="form-control" type="text" name="check_card_radius" value="{{ $check_card_radius->value }}">
+                                </div>
+                            </div>
+
+                            <div class="form-group row">
+                                <div class="col-sm-8 col-sm-offset-3">
+                                    <button type="submit" class="btn btn-sm btn-primary">保存设置</button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+@endsection
+
+@section('footer')
+<script type="text/javascript">
+$(function () {
+
+})
+</script>
+@endsection

+ 4 - 1
wechat/app.js

xqd
@@ -40,10 +40,13 @@ App({
             encryptedData: info.encryptedData
           },
           success: info => {
-            console.log(info);
+            // console.log(info);
             if (info.data.status == 'success') {
               wx.setStorageSync('pt_student', info.data.data);
               getApp().globalData.ptStudent = info.data.data;
+              wx.switchTab({
+                url: '/pages/index/index',
+              })
             }
           }
         });

+ 1 - 0
wechat/pages/index/index.js

xqd
@@ -29,6 +29,7 @@ Page({
       }
     })
     var pt_student = wx.getStorageSync('pt_student')
+    
     if (!pt_student) {
       wx.redirectTo({
         url: '/pages/login/index',

+ 0 - 3
wechat/pages/login/index.js

xqd
@@ -19,9 +19,6 @@ Page({
   bindGetUserInfo: function (e) {
     if(e.detail.errMsg == 'getUserInfo:ok') {
       app.login(e.detail)
-      wx.redirectTo({
-        url: '/pages/index/index',
-      })
     }
   },
 

+ 1 - 1
wechat/project.config.json

xqd
@@ -9,7 +9,7 @@
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.1.1",
-	"appid": "wxfb6faa99fcc0f67a",
+	"appid": "wx8350ebbd5f8943ae",
 	"projectname": "PianoTime",
 	"condition": {
 		"search": {