Browse Source

Merge branch 'dev' of http://gogs.gisvg.com/YDM/caiping into dev

tdj 8 months ago
parent
commit
aedb7cede3

+ 2 - 3
app/admin/controller/project/Cost.php

@@ -212,7 +212,7 @@ class Cost extends BaseController
             $openid = get_login_admin('openid');
             $follow_project_id = Db::name('follow_project')->where('openid',$openid)->find();
 
-            // halt($follow_project_id);
+            // halt($openid,$follow_project_id);
 
             if (isset($param["project_start_time"])) {
                 $param["project_start_time"] = $param["project_start_time"] ? strtotime($param["project_start_time"]) : 0;
@@ -259,7 +259,6 @@ class Cost extends BaseController
                 $where3[] = ['sent_review_unit_name', 'like', '%' . $param['sent_review_unit_name']. '%'];
             }
 
-            $this->see_auth = $see_auth;
             $list = $this->model
                 ->where('id','in',$follow_project_id)
                 ->where($where3)->where(function ($query) use ($where,$where2) {
@@ -279,7 +278,7 @@ class Cost extends BaseController
                     }
 
                     $item->creator = Db::name("admin")->where("id",$item->creator)->value("nickname");
-                    $item->self_id = $this->see_auth;
+
                     //作业人
                     $operate_team_names = null;
                     $operate_team_names_ids = explode(",", $item->operate_team);

+ 1 - 1
app/admin/controller/project/CostCompany.php

@@ -345,6 +345,7 @@ class CostCompany extends BaseController
             $order = empty($param['order']) ? 'project_receive_time desc,id desc' : $param['order'];
             $openid = get_login_admin('openid');
             $follow_project_id = Db::name('follow_project')->where('openid',$openid)->find();
+            // halt($openid,$follow_project_id);
             $list = $this->model
                 ->where('id','in',$follow_project_id)
                 ->where($where)->where($where3)
@@ -359,7 +360,6 @@ class CostCompany extends BaseController
                     if ( ($item->province&&$item->city&&$item->area)) {
                         $item->project_region = $item->province . '-' . $item->city . '-' . $item->area;
                     }
-                    $item->self_id = $this->see_auth;
                     //作业人
                     $item->operate_name = Db::name("admin")->where("id", $item->operate_head)->value("nickname");
                     $operate_team_names = null;

+ 11 - 7
app/mobile/controller/Temporary.php

@@ -99,13 +99,17 @@ class Temporary extends BaseController
         if (!empty($param['entrust_unit_name'])) {
             $where3[] = ['entrust_unit_name', 'like', '%' . $param['entrust_unit_name'] . '%'];
         }
-
-        $res = Db::name('follow_project')->where('openid',$param['openid'])->value('project_id');
-        $list = $this->model->where($where3)->where('id','in',$res)
-            ->order("create_time desc")->paginate(9999, false, ['query' => $param])
-            ->each(function ($item) {})->toArray();
-        halt($list);
-        $data = $list["data"];
+        if(isset($param['openid'])){
+            $res = Db::name('follow_project')->where('openid',$param['openid'])->value('project_id');
+            $list = $this->model->where($where3)->where('id','in',$res)
+                ->order("create_time desc")->paginate(9999, false, ['query' => $param])
+                ->each(function ($item) {})->toArray();
+            $data = $list["data"];
+        }else{
+            $data = [];
+        }
+        // halt($list);
+        // $data = $list["data"];
         // halt($real_list);
         View::assign("detail", $data);
         return view();

+ 41 - 68
app/mobile/view/temporary/kan_list.html

@@ -67,8 +67,7 @@
                                 <span style="width:14vw;"><b>查看详情</b></span>
                                 <span><img src="{__MOBILE__}/img/right.png" alt=""
                                            style="width: 4vw;height: 3.5vw;"></span>
-                                <span class="dot-img1">{if $vo.red}<img src="{__MOBILE__}/img/dot.png" alt=""
-                                                                        style="width: 4.5vw;">{/if}</span>
+
                             </span>
 
                     </div>
@@ -87,7 +86,7 @@
                                                 {case 3}<span style="color: #16b777">已审定</span>{/case}
                                                 {default /}未知
                                             {/switch}
-                                        
+
                                         </b>
                                     </span>
                                     <span>
@@ -198,71 +197,7 @@
         </div>
 
     </div>
-    <div class="footer">
-
-        <div class="footer_ge">
-            <!-- <a href="{:url('mobile/index/main')}" title="首页">
-        <div class="footer_icon footer_icon1"></div>
-        首页
-    </a> -->
-            <a href="{:url('mobile/index/main')}" title="首页">
-                <div class="dot">
-                    <div>
-                        <div class="footer_icon footer_icon1"></div>
-                        <div>首页</div>
-                    </div>
-                    <div class="dot-img">
-                        <!--<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;">-->
-                    </div>
-                </div>
-
-            </a>
-        </div>
-        <div class="footer_ge">
-            <a href="{:url('mobile/index/kan_list')}" title="看板" style="color: #187FDD;">
-                <div class="dot">
-                    <div>
-                        <div class="footer_icon footer_icon2"></div>
-                        <div>看板</div>
-                    </div>
-                    <div class="dot-img">
-                        {if $red_kan}<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;"> {/if}
-                    </div>
-                </div>
-
-            </a>
-        </div>
-        <div class="footer_ge">
-            <a href="{:url('mobile/index/pending')}" title="待处理">
-                <div class="dot">
-                    <div>
-                        <div class="footer_icon footer_icon3"></div>
-                        <div>待处理</div>
-                    </div>
-                    <div class="dot-img">
-                        {if $red} <img src="{__MOBILE__}/img/dot.png" alt=""
-                                       style="width: 1.2vh;margin-left: -4.5vw;">{/if}
-                    </div>
-                </div>
 
-            </a>
-        </div>
-        <div class="footer_ge">
-            <a href="{:url('mobile/index/person')}" title="我的">
-                <div class="dot">
-                    <div>
-                        <div class="footer_icon footer_icon4"></div>
-                        <div>我的</div>
-                    </div>
-                    <div class="dot-img">
-                        <!-- <img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;"> -->
-                    </div>
-                </div>
-
-            </a>
-        </div>
-
-    </div>
 </div>
 <script src="{__MOBILE__}/mobileSelect-master/js/mobileSelect.js"></script>
 <script src="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/layui.js"></script>
@@ -314,6 +249,44 @@
         mask.classList.remove('show');
         dialog.classList.remove('show');
     });
+
+    const WECHAT_APPID = 'wx52b56e5d84b68877';
+    const WECHAT_SECRET = '4e673d40629698a52aed41339f1c2ab4';
+    let openid;
+    $(document).ready(function() {
+        var urlParams = new URLSearchParams(window.location.search);
+        var code = urlParams.get('code');
+        if (!code) {
+            // 没有code,重定向到微信授权页面获取code
+            var REDIRECT_URI = encodeURIComponent(window.location.href);
+            var authUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + WECHAT_APPID +
+                '&redirect_uri=' + REDIRECT_URI +
+                '&response_type=code&scope=snsapi_base&state=123#wechat_redirect';
+            window.location.href = authUrl;
+        } else {
+            // 使用code换取access_token和openid
+            $.ajax({
+                url: '/wechat/officialaccount/OAuthUserGetOpenId',
+                method: 'GET',
+                data: { code: code },
+                success: function(response) {
+                    if(response.subscribe == 0){
+
+                        var Url = 'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzk0ODYwMzUwNg==&scene=110#wechat_redirect';
+                        window.location.href = Url;
+                    }else{
+                        // var REDIRECT_URI = window.location.href;
+                        // console.log(REDIRECT_URI,response)
+
+                        window.location.href = window.location.href +"&openid=" + response['openid'];
+
+                    }
+
+                }
+            });
+        }
+    });
+
 </script>
 
 <script>
@@ -452,7 +425,7 @@
             document.activeElement.blur();
         });
 
-        
+
     });
 </script>