初始上传
200
app/index/controller/Index.php
Executable file
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\Controller;
|
||||
use app\model\goods\Goods as GoodsModel;
|
||||
use app\model\web\Config as ConfigModel;
|
||||
use app\model\shop\Shop as ShopModel;
|
||||
use app\model\web\DiyView as DiyViewModel;
|
||||
use think\App;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
/**
|
||||
* 模板布局
|
||||
* @var string|bool
|
||||
*/
|
||||
protected $layout = 'base';
|
||||
|
||||
public function __construct(App $app = null){
|
||||
|
||||
//执行父类构造函数
|
||||
parent::__construct();
|
||||
|
||||
// 设置模版布局
|
||||
$app->view->engine()->layout($this->layout);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 域名默认跳转 测试提交
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
$domain = $config_model->getDomainJumpConfig();
|
||||
$jump_type = $domain[ 'data' ][ 'value' ][ 'jump_type' ];
|
||||
// 用户前台
|
||||
if ($jump_type == 1) {
|
||||
if ($this->isMobile()) {
|
||||
$domain_name_h5 = $config_model->getH5DomainName();
|
||||
$url = $domain_name_h5[ 'data' ][ 'value' ][ 'domain_name_h5' ];
|
||||
} else {
|
||||
// 检测插件是否存在
|
||||
if (addon_is_exit('pc') == 1) {
|
||||
$domain_name_pc = $config_model->getPcDomainName();
|
||||
$url = $domain_name_pc[ 'data' ][ 'value' ][ 'domain_name_pc' ];
|
||||
} else {
|
||||
$domain_name_h5 = $config_model->getH5DomainName();
|
||||
$url = $domain_name_h5[ 'data' ][ 'value' ][ 'domain_name_h5' ];
|
||||
}
|
||||
}
|
||||
$this->redirect($url);
|
||||
} elseif ($jump_type == 2) {
|
||||
// 商家管理端
|
||||
$this->redirect(url("shop/index/index"));
|
||||
} elseif ($jump_type == 3) {
|
||||
// 引导页
|
||||
return $this->center();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 端口展示中心页面
|
||||
*/
|
||||
public function center()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
$domain_name_h5 = $config_model->getH5DomainName();
|
||||
$domain_name_pc = $config_model->getPcDomainName();
|
||||
$copy = $config_model->getCopyright();
|
||||
$this->assign("h5_url", $domain_name_h5[ 'data' ][ 'value' ][ 'domain_name_h5' ]);
|
||||
$this->assign("pc_url", $domain_name_pc[ 'data' ][ 'value' ][ 'domain_name_pc' ]);
|
||||
$this->assign("copy", $copy[ 'data' ][ 'value' ]);
|
||||
$this->assign("shop_url", href_url("shop/index/index"));
|
||||
|
||||
return $this->fetch("index/center");
|
||||
}
|
||||
|
||||
private function isMobile()
|
||||
{
|
||||
// 如果有HTTP_X_WAP_PROFILE则一定是移动设备
|
||||
if (isset($_SERVER[ 'HTTP_X_WAP_PROFILE' ])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 如果via信息含有wap则一定是移动设备,部分服务商会屏蔽该信息
|
||||
|
||||
if (isset($_SERVER[ 'HTTP_VIA' ])) {
|
||||
// 找不到为flase,否则为true
|
||||
return (bool)stristr($_SERVER['HTTP_VIA'], "wap");
|
||||
}
|
||||
|
||||
// 判断手机发送的客户端标志,兼容性有待提高
|
||||
if (isset($_SERVER[ 'HTTP_USER_AGENT' ])) {
|
||||
$clientkeywords = array (
|
||||
'nokia',
|
||||
'sony',
|
||||
'ericsson',
|
||||
'mot',
|
||||
'samsung',
|
||||
'htc',
|
||||
'sgh',
|
||||
'lg',
|
||||
'sharp',
|
||||
'sie-',
|
||||
'philips',
|
||||
'panasonic',
|
||||
'alcatel',
|
||||
'lenovo',
|
||||
'iphone',
|
||||
'ipod',
|
||||
'blackberry',
|
||||
'meizu',
|
||||
'android',
|
||||
'netfront',
|
||||
'symbian',
|
||||
'ucweb',
|
||||
'windowsce',
|
||||
'palm',
|
||||
'operamini',
|
||||
'operamobi',
|
||||
'openwave',
|
||||
'nexusone',
|
||||
'cldc',
|
||||
'midp',
|
||||
'wap',
|
||||
'mobile'
|
||||
);
|
||||
|
||||
// 从HTTP_USER_AGENT中查找手机浏览器的关键字
|
||||
if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER[ 'HTTP_USER_AGENT' ]))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 协议法,因为有可能不准确,放到最后判断
|
||||
if (isset($_SERVER[ 'HTTP_ACCEPT' ])) {
|
||||
// 如果只支持wml并且不支持html那一定是移动设备
|
||||
// 如果支持wml和html但是wml在html之前则是移动设备
|
||||
if (( strpos($_SERVER[ 'HTTP_ACCEPT' ], 'vnd.wap.wml') !== false ) && ( strpos($_SERVER[ 'HTTP_ACCEPT' ], 'text/html') === false || ( strpos($_SERVER[ 'HTTP_ACCEPT' ], 'vnd.wap.wml') < strpos($_SERVER[ 'HTTP_ACCEPT' ], 'text/html') ) )) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺推广
|
||||
* return
|
||||
*/
|
||||
public function shopUrl()
|
||||
{
|
||||
//获取商品sku_id
|
||||
$shop_model = new ShopModel();
|
||||
$res = $shop_model->qrcode(1);
|
||||
// dump($res);exit;
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机端预览
|
||||
*/
|
||||
public function h5Preview()
|
||||
{
|
||||
$id = input('id', 0);
|
||||
$type = input('type', '');
|
||||
|
||||
if ($type == 'page') {
|
||||
$diy_view = new DiyViewModel();
|
||||
$res = $diy_view->qrcode([
|
||||
'site_id' => 1,
|
||||
'id' => $id,
|
||||
'app_type' => 'h5'
|
||||
])[ 'data' ][ 'path' ][ 'h5' ];
|
||||
} elseif ($type == 'goods') {
|
||||
$goods_model = new GoodsModel();
|
||||
$res = $goods_model->qrcode($id, '', 1)[ 'data' ][ 'path' ][ 'h5' ];
|
||||
} else {
|
||||
$shop_model = new ShopModel();
|
||||
$res = $shop_model->qrcode(1)[ 'data' ][ 'path' ][ 'h5' ];
|
||||
}
|
||||
|
||||
$this->assign('h5_data', $res);
|
||||
$this->assign('is_mobile', isMobile());
|
||||
return $this->fetch("index/h5_preview");
|
||||
}
|
||||
|
||||
}
|
||||
46
app/index/view/base.html
Executable file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1" />
|
||||
<title>首页</title>
|
||||
<link rel="icon" type="image/x-icon" href="__STATIC__/img/shop_bitbug_favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="INDEX_CSS/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/css/layui.css" />
|
||||
<script src="__STATIC__/js/jquery-3.1.1.js"></script>
|
||||
<script src="__STATIC__/ext/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['layer', 'upload', 'element'], function() {});
|
||||
window.ns_url = {
|
||||
baseUrl: "ROOT_URL/",
|
||||
route: ['install', '{:request()->controller()}', '{:request()->action()}'],
|
||||
};
|
||||
window.regexp_config = {:json_encode(config('regexp'))};
|
||||
</script>
|
||||
<script src="__STATIC__/js/common.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="body-content">
|
||||
<div class="head-block">
|
||||
<div class="head-block-title">
|
||||
<div class="head-block-left">
|
||||
<div>
|
||||
<img src="INDEX_IMG/logo_new.png"/>
|
||||
</div>
|
||||
<span>单商户V5版</span>
|
||||
</div>
|
||||
<div class="head-block-right">
|
||||
<a href="http://www.niushop.com" class="other-links-text" target="_blank">官方网站</a>
|
||||
<span>|</span>
|
||||
<a href="http://bbs.niushop.com" class="other-links-text" target="_blank">技术论坛</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{__CONTENT__}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
82
app/index/view/index/center.html
Executable file
@@ -0,0 +1,82 @@
|
||||
<link rel="stylesheet" type="text/css" href="INDEX_CSS/center.css" />
|
||||
<div class="guide-top">
|
||||
<div><img src="INDEX_IMG/back1.png"/></div>
|
||||
<span></span>
|
||||
<p>欢迎使用</p>
|
||||
<p>NIUSHOP商城系统</p>
|
||||
</div>
|
||||
<div class="guide-links">
|
||||
<a href="http://www.niushop.com" target="_blank">
|
||||
<li>
|
||||
<div>
|
||||
<img class="no-select" src="INDEX_IMG/no_niuku.png">
|
||||
<img class="selected" src="INDEX_IMG/niuku.png">
|
||||
<p>官网</p>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
<a href="{$pc_url}" target="_blank">
|
||||
<li>
|
||||
<div>
|
||||
<img class="no-select" src="INDEX_IMG/no_pc.png">
|
||||
<img class="selected" src="INDEX_IMG/pc.png">
|
||||
<p>PC端</p>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
<a href="">
|
||||
<li class="li-selected">
|
||||
<div>
|
||||
<img class="no-select" src="INDEX_IMG/no_guide.png">
|
||||
<img class="selected" src="INDEX_IMG/guide.png">
|
||||
<p>引导页</p>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
<a onclick="getShopUrl()" target="_blank">
|
||||
<li>
|
||||
<div>
|
||||
<img class="no-select" src="INDEX_IMG/no_h5.png">
|
||||
<img class="selected" src="INDEX_IMG/h5.png">
|
||||
<p>手机端</p>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
<a href="{$shop_url}" target="_blank">
|
||||
<li>
|
||||
<div>
|
||||
<img class="no-select" src="INDEX_IMG/no_shop.png">
|
||||
<img class="selected" src="INDEX_IMG/shop.png">
|
||||
<p>网站后台</p>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="guide-forter">
|
||||
<p><a href="https://beian.miit.gov.cn/" target="_blank">{$copy.icp}</a></p>
|
||||
<p><a href="{$copy.copyright_link}" target="_blank">{$copy.company_name}</a></p>
|
||||
<div>
|
||||
{if $copy.logo}
|
||||
<a href="{$copy.copyright_link}" target="_blank"><img src="{:img($copy.logo)}"></a>
|
||||
{else/}
|
||||
<a href="{$copy.copyright_link}" target="_blank"><img src="INDEX_IMG/footer_logo.png"></a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$(".guide-links>a li").hover(function(){
|
||||
$(".guide-links>a li").removeClass("li-selected");
|
||||
$(this).addClass("li-selected");
|
||||
|
||||
},function(){
|
||||
$(".guide-links>a li").removeClass("li-selected");
|
||||
$(".guide-links>a:nth-child(3) li").addClass("li-selected");
|
||||
})
|
||||
});
|
||||
|
||||
function getShopUrl() {
|
||||
window.open("{:url('index/index/h5preview')}")
|
||||
}
|
||||
</script>
|
||||
88
app/index/view/index/h5_preview.html
Executable file
@@ -0,0 +1,88 @@
|
||||
<style>
|
||||
.head-block{
|
||||
display: none;
|
||||
}
|
||||
.page-content{
|
||||
height: 100vh;
|
||||
padding: 10px 0;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
.content{
|
||||
width: 375px;
|
||||
background-color: #f9f9f9;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
}
|
||||
.content #iframe{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.content .empty{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #666;
|
||||
justify-content: center;
|
||||
}
|
||||
.content .qrcode-wrap {
|
||||
background: #f4f6f8;
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
right: -240px;
|
||||
top: 20%;
|
||||
max-width: 130px;
|
||||
max-height: 130px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content .qrcode-wrap img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.content .qrcode-wrap .tips {
|
||||
font-size: 12px;
|
||||
margin: 10px 0 0 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.content .qrcode-wrap input {
|
||||
margin-top: 30px;
|
||||
}
|
||||
.text-color{
|
||||
color: #105CFB !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
{if !$is_mobile}
|
||||
<div class="page-content">
|
||||
<div class="content">
|
||||
{if $h5_data && $h5_data['status']}
|
||||
<iframe id="iframe" src="{$h5_data['url']}" frameborder="0"></iframe>
|
||||
{else /}
|
||||
<div class="empty">手机端未开启,请联系管理员。</div>
|
||||
<!-- <p>当前手机页面无法访问</p>-->
|
||||
<!-- <a href="https://www.kancloud.cn/niucloud/niushop_b2c_v4/1842146" class="text-color" target="_blank">请检查手机端域名配置以及伪静态</a>-->
|
||||
{/if}
|
||||
{if $h5_data && $h5_data['status']}
|
||||
<div class="qrcode-wrap">
|
||||
<img src="{:img($h5_data['img'])}" alt="推广二维码">
|
||||
<p class="tips text-color">扫码访问店铺 <a class="text-color" href="javascript:ns.copy('h5_preview_1');">复制链接</a></p>
|
||||
<input type="text" id="h5_preview_1" value="{$h5_data['url']}" readonly="">
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
{if $is_mobile}
|
||||
window.location.href = "{$h5_data['url']}";
|
||||
{/if}
|
||||
</script>
|
||||
22
app/index/view/public/css/center.css
Executable file
@@ -0,0 +1,22 @@
|
||||
.body-content{margin: 0 !important;width: 100%;min-height: calc(100vh - 0px);background: url("../img/back.jpg") no-repeat center / contain;background-size: 100% 100% ;overflow: auto;position: relative;background-attachment: fixed;}
|
||||
.guide-top {width: 1200px;margin:0 auto;overflow: hidden}
|
||||
.guide-top>div {width: 38.5px; height: 38.5px;margin:0 auto;margin-top:134px;}
|
||||
.guide-top>span { display: block;width: 15px;height: 4px;background: #fff;margin: 15px auto 10px;}
|
||||
.guide-top>p {text-align: center;color:#fff;font-size: 24px; margin:10px 0}
|
||||
.guide-links {background: rgba(255, 255, 255, 0.83);width: 1200px;margin:95px auto 0;display: flex}
|
||||
.guide-links>a{ cursor:pointer; display: block;width: 240px;height: 320px;overflow: hidden;text-decoration: none;border-right: 1px solid #ccc; }
|
||||
.guide-links>a:nth-child(5){ border:0px}
|
||||
.guide-links li {width:240px;height: 320px;overflow: hidden}
|
||||
.guide-links li img {width: 39.5px;height: 39.5px;display: block;margin:115px auto 0}
|
||||
.guide-links li p {text-align: center;font-size: 20px;color:#000;margin-top: 15px}
|
||||
.guide-forter {width: 1200px;margin:0 auto;margin-top: 95px}
|
||||
.guide-forter>a {display: block}
|
||||
.guide-forter p{text-align: center;padding: 3px 0px}
|
||||
.guide-forter p a{color:#6D7278;font-size: 16px;}
|
||||
.guide-forter div {width: 150px;height: 50px;margin: 0 auto;line-height: 50px;text-align: center;}
|
||||
.guide-forter img {height: auto;width: auto;max-width: 150px;max-height: 50px;}
|
||||
.guide-links li .selected{ display: none}
|
||||
.guide-links li.li-selected{background: #155FFA;}
|
||||
.guide-links li.li-selected .no-select{display: none}
|
||||
.guide-links li.li-selected .selected{display: block}
|
||||
.guide-links li.li-selected p{color: #fff}
|
||||
42
app/index/view/public/css/style.css
Executable file
@@ -0,0 +1,42 @@
|
||||
*{
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
body{
|
||||
font-family:Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size:12px;
|
||||
color: #333;
|
||||
background-color: #edf0f3;
|
||||
}
|
||||
ul{
|
||||
list-style:none;
|
||||
}
|
||||
a{
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover{
|
||||
color:#FF6A00;
|
||||
text-decoration:none;
|
||||
}
|
||||
input,button,select{
|
||||
vertical-align:middle;
|
||||
outline: none;
|
||||
}
|
||||
.fc-690{
|
||||
color:#333;
|
||||
}
|
||||
.fs-14{
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
img{width: 100%; height:100%}
|
||||
.guide {display: flex;position: relative;}
|
||||
.head-block {position: fixed;height:60px;width: 100%;overflow: hidden;background:rgba(0, 0, 0, 0.19);top: 0;left:0}
|
||||
.head-block-title {width: 1200px; height:60px;margin: 0 auto}
|
||||
.head-block .head-block-left {display: flex;float: left}
|
||||
.head-block .head-block-left>div{width: 140px; height:60px;}
|
||||
.head-block .head-block-left span{color:#fff;font-size: 14px;display: inline-block;padding-top: 25px;padding-left: 15px;}
|
||||
.head-block .head-block-right {float: right;height: 60px;line-height: 60px}
|
||||
.head-block .head-block-right a{color:#fff;text-decoration: none;font-size: 14px}
|
||||
.head-block .head-block-right span{color:#fff;font-size: 16px}
|
||||
BIN
app/index/view/public/img/ajax-loader.gif
Executable file
|
After Width: | Height: | Size: 847 B |
BIN
app/index/view/public/img/back.jpg
Executable file
|
After Width: | Height: | Size: 151 KiB |
BIN
app/index/view/public/img/back1.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/index/view/public/img/footer_logo.png
Executable file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
app/index/view/public/img/forum.png
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
app/index/view/public/img/guide.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
app/index/view/public/img/h5.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/index/view/public/img/install_complete.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/index/view/public/img/loading1.gif
Executable file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
app/index/view/public/img/logo.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/index/view/public/img/logo_new.png
Executable file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
app/index/view/public/img/niuku.png
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
app/index/view/public/img/no_guide.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
app/index/view/public/img/no_h5.png
Executable file
|
After Width: | Height: | Size: 1015 B |
BIN
app/index/view/public/img/no_niuku.png
Executable file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
app/index/view/public/img/no_pc.png
Executable file
|
After Width: | Height: | Size: 937 B |
BIN
app/index/view/public/img/no_shop.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
app/index/view/public/img/official_website.png
Executable file
|
After Width: | Height: | Size: 513 B |
BIN
app/index/view/public/img/pc.png
Executable file
|
After Width: | Height: | Size: 981 B |
BIN
app/index/view/public/img/shop.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
app/index/view/public/img/site_backstage.png
Executable file
|
After Width: | Height: | Size: 870 B |
BIN
app/index/view/public/img/site_index.png
Executable file
|
After Width: | Height: | Size: 908 B |
BIN
app/index/view/public/img/success.png
Executable file
|
After Width: | Height: | Size: 326 B |