hrjy 3 年 前
コミット
d6d39eae92

+ 29 - 3
.idea/workspace.xml

@@ -5,7 +5,18 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="9df7b838-09db-466a-bed4-3e1ac8c3624d" name="变更" comment="commit">
+      <change afterPath="$PROJECT_DIR$/app/register/config/route.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/register/config/view.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/register/controller/Index.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/register/view/index/.vscode/settings.json" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/register/view/index/down.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/register/view/index/index.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/api/controller/AuthController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/AuthController.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/api/controller/PublicController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/PublicController.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/api/controller/auction/AuctionController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/auction/AuctionController.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/api/controller/user/UserBillController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/user/UserBillController.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/app.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/app.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -95,7 +106,7 @@
     <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/app/models/user" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/app" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.selected.package.eslint" value="(autodetect)" />
@@ -106,6 +117,7 @@
   </component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\phpstudy_pro\WWW\newQudou\app" />
       <recent name="D:\phpstudy_pro\WWW\newQudou\app\models\user" />
     </key>
   </component>
@@ -127,7 +139,14 @@
       <workItem from="1656549238140" duration="4060000" />
       <workItem from="1656635723086" duration="10490000" />
       <workItem from="1656737873362" duration="1192000" />
-      <workItem from="1656894689056" duration="3414000" />
+      <workItem from="1656894689056" duration="5262000" />
+      <workItem from="1656926476915" duration="699000" />
+      <workItem from="1656981273535" duration="4659000" />
+      <workItem from="1657067986181" duration="2908000" />
+      <workItem from="1657170689504" duration="171000" />
+      <workItem from="1657172191423" duration="1608000" />
+      <workItem from="1657240542957" duration="117000" />
+      <workItem from="1657247426337" duration="756000" />
     </task>
     <task id="LOCAL-00001" summary="commit">
       <created>1655962607195</created>
@@ -164,7 +183,14 @@
       <option name="project" value="LOCAL" />
       <updated>1656897323017</updated>
     </task>
-    <option name="localTasksCounter" value="6" />
+    <task id="LOCAL-00006" summary="commit">
+      <created>1656899076794</created>
+      <option name="number" value="00006" />
+      <option name="presentableId" value="LOCAL-00006" />
+      <option name="project" value="LOCAL" />
+      <updated>1656899076794</updated>
+    </task>
+    <option name="localTasksCounter" value="7" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">

+ 1 - 1
app/api/controller/AuthController.php

@@ -36,7 +36,7 @@ class AuthController
      */
     public function login(Request $request)
     {
-        $user = User::where('account', $request->param('account'))->find();
+        $user = User::where('account|phone', $request->param('account'))->find();
         if ($user) {
             if ($user->pwd !== md5($request->param('password')))
                 return app('json')->fail('账号或密码错误');

+ 2 - 1
app/api/controller/PublicController.php

@@ -47,6 +47,7 @@ class PublicController
         $explosive_money = sys_data('index_categy_images') ?: [];//TODO 首页超值爆款
         $site_name = sys_config('site_name');
         $routine_index_page = sys_data('routine_index_page');
+        $new_banner = sys_data('new_home_banner');
         $info['fastInfo'] = $routine_index_page[0]['fast_info'] ?? '';//sys_config('fast_info');//TODO 快速选择简介
         $info['bastInfo'] = $routine_index_page[0]['bast_info'] ?? '';//sys_config('bast_info');//TODO 精品推荐简介
         $info['firstInfo'] = $routine_index_page[0]['first_info'] ?? '';//sys_config('first_info');//TODO 首发新品简介
@@ -73,7 +74,7 @@ class PublicController
         }
         $newGoodsBananr = sys_config('new_goods_bananr');
         $tengxun_map_key = sys_config('tengxun_map_key');
-        return app('json')->successful(compact('filing_info','banner', 'menus', 'roll', 'info', 'activity', 'lovely', 'benefit', 'likeInfo', 'logoUrl', 'couponList', 'site_name', 'subscribe', 'newGoodsBananr', 'tengxun_map_key', 'explosive_money'));
+        return app('json')->successful(compact('filing_info','banner', 'menus', 'roll', 'info', 'activity', 'lovely', 'benefit', 'likeInfo', 'logoUrl', 'couponList', 'site_name', 'subscribe', 'newGoodsBananr', 'tengxun_map_key', 'explosive_money','new_banner'));
     }
 
     /**

+ 1 - 0
app/api/controller/auction/AuctionController.php

@@ -287,6 +287,7 @@ class AuctionController
                 ->alias('a')
                 ->field('a.*,u.nickname,u.avatar')
                 ->leftJoin('user u', 'a.uid = u.uid')
+                ->order('sort DESC')
                 ->page($data['page'], $data['limit'])
                 ->select();
 

+ 77 - 0
app/api/controller/user/UserBillController.php

@@ -333,6 +333,83 @@ class UserBillController
                             $item['wap_poster'] = UtilService::setHttpType($posterInfo['thumb_path'], 1);
                     }
                 }
+            }else if ($type == 3) {
+                //公众号
+                $name = $user['uid'] . '_' . $user['is_promoter'] . '_user_wap.jpg';
+                $imageInfo = SystemAttachment::getInfo($name, 'name');
+                //检测远程文件是否存在
+                if (isset($imageInfo['att_dir']) && strstr($imageInfo['att_dir'], 'http') !== false && curl_file_exist($imageInfo['att_dir']) === false) {
+                    $imageInfo = null;
+                    SystemAttachment::where(['name' => $name])->delete();
+                }
+                if (!$imageInfo) {
+//                    $qr_code = QrcodeService::getForeverQrcode('spread', $user['uid']);
+//                    if (isset($qr_code['url'])) {
+//                        $urlCode = $qr_code['url'];
+//                    } else {
+                    $codeUrl = set_http_type($siteUrl . '/register?spread=' . $user['uid'], 1);//二维码链接
+                    $imageInfo = UtilService::getQRCodePath($codeUrl, $name);
+                    if (is_string($imageInfo)) return app('json')->fail('二维码生成失败', ['error' => $imageInfo]);
+                    SystemAttachment::attachmentAdd($imageInfo['name'], $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
+                    $urlCode = $imageInfo['dir'];
+//                    }
+                } else $urlCode = $imageInfo['att_dir'];
+                if ($imageInfo['image_type'] == 1) $urlCode = $siteUrl . $urlCode;
+                $siteUrl = set_http_type($siteUrl, 1);
+                $filelink = [
+                    'Bold' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
+                    'Normal' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
+                ];
+                if (!file_exists($filelink['Bold'])) return app('json')->fail('缺少字体文件Bold');
+                if (!file_exists($filelink['Normal'])) return app('json')->fail('缺少字体文件Normal');
+                foreach ($routineSpreadBanner as $key => &$item) {
+                    $posterInfo = '海报生成失败:(';
+                    $config = array(
+                        'image' => array(
+                            array(
+                                'url' => $urlCode,     //二维码资源
+                                'stream' => 0,
+                                'left' => 225,
+                                'top' => 913,
+                                'right' => 0,
+                                'bottom' => 0,
+                                'width' => 300,
+                                'height' => 300,
+                                'opacity' => 100
+                            )
+                        ),
+                        'text' => array(
+                            array(
+                                'text' => $user['nickname'],
+                                'left' => 250,
+                                'top' => 840,
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
+                                'fontSize' => 16,             //字号
+                                'fontColor' => '40,40,40',       //字体颜色
+                                'angle' => 0,
+                            ),
+                            array(
+                                'text' => '邀请您加入' . sys_config('site_name'),
+                                'left' => 250,
+                                'top' => 880,
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],     //字体文件
+                                'fontSize' => 16,             //字号
+                                'fontColor' => '40,40,40',       //字体颜色
+                                'angle' => 0,
+                            )
+                        ),
+                        'background' => $item['pic']
+                    );
+                    $resWap = $resWap && $posterInfo = UtilService::setSharePoster($config, 'wap/spread/poster');
+                    if (!is_array($posterInfo)) return app('json')->fail($posterInfo);
+                    SystemAttachment::attachmentAdd($posterInfo['name'], $posterInfo['size'], $posterInfo['type'], $posterInfo['dir'], $posterInfo['thumb_path'], 1, $posterInfo['image_type'], $posterInfo['time'], 2);
+                    if ($resWap) {
+                        if ($posterInfo['image_type'] == 1)
+                            $item['wap_poster'] = $siteUrl . $posterInfo['thumb_path'];
+                        else
+                            $item['wap_poster'] = UtilService::setHttpType($posterInfo['thumb_path'], 1);
+                    }
+                }
             }
             if ($resRoutine && $resWap) return app('json')->successful($routineSpreadBanner);
             else return app('json')->fail('生成图片失败');

+ 25 - 0
app/register/config/route.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+// +----------------------------------------------------------------------
+// | 应用设置
+// +----------------------------------------------------------------------
+
+return [
+    // 是否强制使用路由
+    'url_route_must'        => false,
+    // 合并路由规则
+    'route_rule_merge'      => true,
+    // 路由是否完全匹配
+    'route_complete_match'  => false,
+    // 是否自动转换URL中的控制器和操作名
+    'url_convert'           => true,
+];

+ 20 - 0
app/register/config/view.php

@@ -0,0 +1,20 @@
+<?php
+// +----------------------------------------------------------------------
+// | 模板设置
+// +----------------------------------------------------------------------
+
+return [
+    // 模板后缀
+    'view_suffix'  => 'html',
+    // 模板路径
+    'view_path'    => app_path('view'),
+    // 视图输出字符串内容替换
+    'tpl_replace_string'       => [
+        '{__PUBLIC_PATH}' =>  '/',              //public 目录
+        '{__STATIC_PATH}' =>  '/static/',       //全局静态目录
+        '{__PLUG_PATH}'   =>  '/static/plug/',  //全局静态插件
+        '{__ADMIN_PATH}'  =>  '/system/',        //后台目录
+        '{__FRAME_PATH}'  =>  '/system/frame/',  //后台框架
+        '{__MODULE_PATH}' =>  '/system/module/', //后台模块
+    ]
+];

+ 25 - 0
app/register/controller/Index.php

@@ -0,0 +1,25 @@
+<?php
+
+
+namespace app\register\controller;
+
+
+use app\models\system\Site;
+use crmeb\basic\BaseController;
+
+class Index extends BaseController
+{
+    public function index()
+    {
+        $apk = sys_config('apk', '');
+        $this->assign('apk', $apk);
+        return $this->fetch();
+    }
+
+    public function down()
+    {
+        $apk = sys_config('apk', '');
+        $this->assign('apk', $apk);
+        return $this->fetch();
+    }
+}

+ 3 - 0
app/register/view/index/.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "liveServer.settings.port": 5501
+}

+ 99 - 0
app/register/view/index/down.html

@@ -0,0 +1,99 @@
+<!doctype html>
+<html>
+<head>
+    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
+    <style>
+        .div {
+            width: 100%;
+            height: 100%;
+            position: relative;
+        }
+
+        .button {
+            margin-left: 10%;
+            position: absolute;
+            bottom: 40px;
+            width: 80%;
+            text-align: center;
+            z-index: 999;
+            height: 140px;
+            font-size: 32px;
+            line-height: 140px;
+            letter-spacing: 5px;
+            background-color: #32baff;
+            border-radius: 5px;
+            color: white;
+
+        }
+
+        .img {
+            position: relative;
+            width: 100%;
+        }
+
+        img {
+            max-width: 100%;
+            height: auto;
+        }
+
+        .weixin-tip {
+            display: none;
+            position: fixed;
+            left: 0;
+            top: 0;
+            bottom: 0;
+            background: rgba(0, 0, 0, 0.8);
+            filter: alpha(opacity=80);
+            height: 100%;
+            width: 100%;
+            z-index: 100;
+        }
+
+        .weixin-tip p {
+            text-align: center;
+            margin-top: 10%;
+            padding: 0 5%;
+        }
+
+        * {
+            padding: 0;
+            margin: 0;
+            box-sizing: border-box
+        }
+
+    </style>
+</head>
+<body>
+<div class="div">
+    <img class="img" src="/static/img/down.jpg"/>
+    <a href="{$apk}" downLoad="易趣G.apk">
+        <div class="button">Android版本下载</div>
+    </a>
+</div>
+<div class="weixin-tip">
+    <p>
+        <img src="/static/img/live_weixin.png" alt="微信打开"/>
+    </p>
+</div>
+</body>
+<script>
+    $(window).on("load", function () {
+        var winHeight = $(window).height();
+
+        function is_weixin() {
+            var ua = navigator.userAgent.toLowerCase();
+            if (ua.match(/MicroMessenger/i) == "micromessenger") {
+                return true;
+            } else {
+                return false;
+            }
+        }
+
+        var isWeixin = is_weixin();
+        if (isWeixin) {
+            $(".weixin-tip").css("height", winHeight);
+            $(".weixin-tip").show();
+        }
+    })
+</script>
+</html>

+ 210 - 0
app/register/view/index/index.html

@@ -0,0 +1,210 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta name="misapplication-tap-highlight" content="no"/>
+    <meta name="HandheldFriendly" content="true"/>
+    <meta name="MobileOptimized" content="320"/>
+    <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
+    <script typet="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
+</head>
+<body>
+<div class="container">
+    <div class="loginTitle">欢迎注册喜嗨购</div>
+    <div class="loginText">请认真填写个人信息</div>
+    <div class="login-box">
+        <div class="username">账号</div>
+        <input class="input-box" type="email" id="phone" name="phone" placeholder="请输入手机号"/>
+    </div>
+    <div class="login-box">
+        <div class="username">验证码</div>
+        <div class="flex">
+            <input class="input-box" style="width: 50%" id="code" type="number" name="code" placeholder="请输入验证码">
+            <div class="code" id="daojishi" onclick="verification()">发送验证码</div>
+        </div>
+    </div>
+    <div class="login-box">
+        <div class="username">登录密码</div>
+        <input class="input-box" id="loginPass" type="password" name="loginPass" placeholder="请输入登录密码">
+    </div>
+    <div class="login-box">
+        <div class="username">邀请码</div>
+        <input class="input-box" id="invitation" type="text" disabled="disabled" name="invitation" placeholder="请输入邀请码">
+    </div>
+    <div class="flex">
+        <div class="login" onclick="fnLogin()">注册</div>
+        <div class="login"><a href="{:url('down')}">下载APP</a></div>
+    </div>
+</div>
+</body>
+<script type="text/javascript">
+    var url = location.search;
+    if (url.indexOf("?") != -1) {
+        var str = url.substr(1);
+        strs = str.split("=");
+        var invitation = strs[1];
+        document.getElementById('invitation').value = invitation;
+    }
+
+    function fnLogin() {
+        var phone = document.getElementById("phone").value;
+        var loginPass = document.getElementById("loginPass").value;
+        var code = document.getElementById("code").value;
+        var invitation = document.getElementById("invitation").value;
+        if (phone == '') {
+            window.alert("请输入账号");
+            return false;
+        }
+        if (code == '') {
+            window.alert("请输入验证码");
+            return false;
+        }
+        if (loginPass == '') {
+            window.alert("请输入登录密码");
+            return false;
+        }
+        if (invitation == '') {
+            window.alert("请输入邀请码");
+            return false;
+        }
+        $.ajax({
+            type: "post",
+            url: "http://new.yiqushangshi.com/api/register",
+            data: {account: phone, captcha: code, password: loginPass, spread: invitation},
+            dataType: "json",
+            success: function (data) {
+                window.alert(data.msg);
+                if (data.msg === '注册成功')
+                    window.location.href = "{:url('down')}"
+            }
+        });
+    }
+
+    function verification() {
+        var phone = document.getElementById("phone").value;
+        if (phone == '') {
+            window.alert("请输入手机号");
+            return false;
+        }
+        if (!/^1[3|4|5|6|7|8|9]\d{9}$/.test(phone)) {
+            window.alert('请输入正确的手机号');
+            return;
+        }
+
+        var timer = null;
+        var count = 60;
+        var codeText = $('#daojishi').text();
+
+        if (codeText == '发送验证码') {
+            timer = setInterval(function () {
+                count--;
+                $('#daojishi').text(count);
+                if (count <= 0) {
+                    clearInterval(timer);
+                    $('#daojishi').text('发送验证码');
+                }
+            }, 1000);
+        }
+        if (codeText != '发送验证码') {
+            return
+        }
+        $.ajax({
+            type: "post",
+            url: "http://new.yiqushangshi.com/api/register/verify",
+            data: {phone: phone, type: 'register'},
+            dataType: "json",
+            success: function (data) {
+                window.alert(data.msg);
+
+            }
+        });
+    }
+</script>
+<style type="text/css">
+    * {
+        margin: 0;
+        padding: 0;
+        font-family: 微软雅黑;
+        font-size: 12px;
+        min-height: 100%;
+    }
+
+    .container {
+        padding: 10% 30px 0px 30px;
+    }
+
+    .loginTitle {
+        font-weight: bold;
+        color: #32baff;
+        font-size: 29px;
+        padding-bottom: 25px;
+    }
+
+    .loginText {
+        font-weight: 500;
+        color: #333333;
+        font-size: 17px;
+        margin-bottom: 15px;
+    }
+
+    .login-box {
+        width: 100%;
+        font-size: 16px;
+        padding-top: 15px;
+    }
+
+    .username {
+        display: block;
+        padding-bottom: 12px;
+        font-weight: 500;
+        color: #333333;
+        font-size: 16px;
+
+    }
+
+    .input-box {
+        border: none;
+        padding: 10px 8px;
+        outline: none;
+        width: 100%;
+        background-color: #F5F5F5;
+        border-radius: 9px;
+        color: #32baff;
+    }
+
+    .input-box::placeholder {
+        color: #bbbbbb;
+    }
+
+    .code {
+        background-color: #32baff;
+        border-radius: 5px;
+        font-weight: 500;
+        color: #FFFFFF;
+        font-size: 13px;
+        padding: 6px 8px;
+    }
+
+    .login {
+        background-color: #32baff;
+        color: #FFFFFF;
+        text-align: center;
+        width: 130px;
+        line-height: 40px;
+        border-radius: 25px;
+        margin-top: 30px;
+    }
+
+    .login > a {
+        color: #FFFFFF;
+        text-decoration: none;
+    }
+
+    .flex {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+    }
+</style>
+</html>

+ 1 - 1
config/app.php

@@ -27,7 +27,7 @@ return [
     // 自动多应用模式
     'auto_multi_app'   => true,
     // 应用映射(自动多应用模式有效)
-    'app_map'          => ['*'=>'', 'api'=>'api', 'admin'=>'admin','wap'=>'wap'],
+    'app_map'          => ['*'=>'', 'api'=>'api', 'admin'=>'admin','wap'=>'wap', 'register' => 'register'],
     // 域名绑定(自动多应用模式有效)
     'domain_bind'      => [],
     // 禁止URL访问的应用列表(自动多应用模式有效)