init: 项目初始代码

This commit is contained in:
2026-10-14 14:00:29 +08:00
commit cc434cf89f
464 changed files with 66984 additions and 0 deletions

2
app/index/common.php Normal file
View File

@@ -0,0 +1,2 @@
<?php
// 这是系统自动生成的公共文件

25
app/index/config/lang.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | 多语言设置
// +----------------------------------------------------------------------
return [
// 默认语言
'default_lang' => env('lang.default_lang', 'zh-cn'),
// 允许的语言列表
'allow_lang_list' => ['zh-cn', 'en-us'],
// 多语言自动侦测变量名
'detect_var' => 'lang',
// 是否使用Cookie记录
'use_cookie' => true,
// 多语言cookie变量
'cookie_var' => 'think_lang',
// 扩展语言包
'extend_list' => [],
// Accept-Language转义为对应语言包名称
'accept_language' => [
'zh-cn' => 'zh-cn',
'en-us' => 'en-us'
],
// 是否支持语言分组
'allow_group' => true,
];

34
app/index/config/view.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
use think\facade\Env;
return [
// 模板引擎类型使用Think
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
// 模板变量
'tpl_replace_string' => [
'__STATIC__' => Env::get('cdn.url','/'),
'__LOCAL__' => Env::get('cdn.local','/'),
],
'tpl_cache' => false,
];

View File

@@ -0,0 +1,41 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
/**
* 关于我们
*/
class About extends Base
{
public function initialize()
{
parent::initialize();
$this->model = new \app\index\model\About();
}
/**
* 显示资源列表
*
*/
public function index()
{
$inputData = $this->request->param();
$resource = [];
// $resource['banner'] = $this->model->getAboutBanner($this->languageId,'关于我们页面-banner');
// $resource['banner_mobile'] = $this->model->getAboutBanner($this->languageId,'关于我们页面-手机-banner');
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'about');
View::assign('meta',$metaTitle);
View::assign('resource',$resource);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'about/about_us');
}
public function mileage(){
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'about/mileage');
}
}

View File

@@ -0,0 +1,249 @@
<?php
declare(strict_types=1);
namespace app\index\controller;
use app\library\LogToKafka;
use app\BaseController;
use app\index\model\Navigator;
use app\index\model\SystemConfig;
use DeviceDetector\DeviceDetector;
use DeviceDetector\Parser\Device\AbstractDeviceParser;
use GeoIp2\Database\Reader;
use think\facade\Cache;
use think\facade\Env;
use think\facade\Lang;
use think\facade\View;
/**
* 控制器基类
*/
class Base extends BaseController
{
use LogToKafka;
/**
* 平台固定为1.不是多平台
* @var int
*/
protected $platformId = 1;
/**
* 查询条件,模糊字段与值。格式 ['name'=>'test']
* @var array
*/
protected $vague = [];
/**
* 精准查询,精确字段,格式['language_id'=> 1]
* @var array
*/
protected $focus = [];
/**
* 排序字段。格式 ['sort'=>'desc']
* @var array
*/
protected $sort = [];
/**
* 模型
* @var array
*/
protected $model = null;
/**
* 语言ID
* @var int|mixed
*/
protected $languageId = 1;
/**
* 导航栏模型
* @var null
*/
protected $navModel = null;
/**
* 系统配置模型
* @var null
*/
protected $systemConfigModel = null;
/**
* 接口监控数据
* @var string[]
*/
protected $apiLog = [
'items' => '', /*项目名称*/
'forum' => '', /*模块*/
'forum_code' => '', /*模块日志编码*/
'url' => '', /*访问页*/
'refer' => '', /*访问来源*/
'click' => '', /*点击次数*/
'content' => '', /*访问内容*/
'ip' => '', /*访客IP*/
'country' => '', /*国家*/
'province' => '', /*省*/
'city' => '', /*市*/
'start_time' => '', /*点击时间*/
'drive' => '', /*PC OR 移动端*/
'system' => '', /*设备系统*/
'brower' => '', /*浏览器*/
'models' => '', /*设备型号*/
'date_time' => '' /*生成时间*/
];
/**
* 判断请求来源是否是手机设备
* @return bool
*/
private function isMobile() : bool
{
//如果有HTTP_X_WAP_PROFILE则一定是移动设备
if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
return true;
}
//如果via信息含有wap则一定是移动设备,部分服务商会屏蔽该信息
if (isset($_SERVER['HTTP_VIA']) && stristr($_SERVER['HTTP_VIA'], 'wap')) {
return true;
}
//野蛮方法,判断手机发送的客户端标志,兼容性有待提高
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$clientKeywords = ['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 void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function initialize()
{
$controller = $this->request->controller();
$this->languageId = $this->request->language_id??1;
//通过中间件过来的语言包,动态设置
Lang::setLangSet($this->request->language_code??'zh-cn');
//重新加载动态设置的语言包
$this->app->loadLangPack(Lang::getLangSet());
// 初始化公共模型
$this->navModel = new Navigator();
$this->systemConfigModel = new SystemConfig();
// 初始化公共页面,判断语言包
// 导航
$navInfo = $this->navModel->getNavInfo($this->languageId,$this->platformId,$controller);
$navInfo = recursion_func($navInfo);
$footerNavInfo = $this->navModel->getFootNavInfo($this->languageId,$this->platformId);
$footerNavInfo = recursion_func($footerNavInfo);
// 头部版本号
// 静态版本号
$version = Env::get('front.version');
// 尾部数据
$footerInfo = $this->systemConfigModel->getFooterInfo($this->languageId);
// 首页多网站切换
$multiLanguage = $this->systemConfigModel->getWebSiteInfo($this->languageId);
// 其他公共数据
// 增加标签显示
$metaTitle = $this->systemConfigModel->getMetaTitle($this->languageId,'common');
View::assign('meta',$metaTitle);
View::assign('nav_info',$navInfo);
View::assign('nav_footer_info',$footerNavInfo);
View::assign('footer_info',$footerInfo);
View::assign('multi_lang',$multiLanguage);
View::assign('ver',$version);
View::assign('is_dev',Env::get('APP_DEBUG'));
View::assign('is_mobile',$this->isMobile());
}
/**
* 访问日志监控,提交kafka生产者接口
* @return \think\response\Json
* @throws \GeoIp2\Exception\AddressNotFoundException
* @throws \MaxMind\Db\Reader\InvalidDatabaseException
*/
public function submitActionLog()
{
$inputData = $this->request->param();
$model = explode('//',$inputData['url']);
$model = explode('/',$model[1]);
$this->apiLog['items'] = Env::get('platform_name','官网');
$this->apiLog['forum'] = count($model) > 1 && $model[1] != '' ? $model[1] : 'index';
$this->apiLog['forum_code'] = 200;
$this->apiLog['url'] = $inputData['url'];
$this->apiLog['refer'] = $inputData['url'];
$this->apiLog['content'] = $inputData['content'];
$this->apiLog['click'] = $inputData['click'];
$this->apiLog['start_time'] = date('Y-m-d H:i:s',(int)ceil(($inputData['date_time'] - (int)ceil((int)$inputData['start_time'])) / 1000) );
$this->apiLog['date_time'] = date('Y-m-d H:i:s',(int)ceil($inputData['date_time'] / 1000) );
//获取应用启动时间
//获取访问设备,系统版本,浏览器,设备型号
$userAgent = $inputData['drive'];
AbstractDeviceParser::setVersionTruncation(AbstractDeviceParser::VERSION_TRUNCATION_NONE);
$dd = new DeviceDetector($userAgent);
$dd->parse();
if ($dd->isBot()) {
$this->apiLog['brower'] = '未知';
$this->apiLog['system'] = '未知';
$this->apiLog['drive'] = '未知';
$this->apiLog['models'] = '爬虫';
} else {
$clientInfo = $dd->getClient();
$osInfo = $dd->getOs();
$device = $dd->getDeviceName();
$brand = $dd->getBrandName();
$model = $dd->getModel();
$this->apiLog['brower'] = !empty($clientInfo) ? $clientInfo['name'].' '.$clientInfo['version'] : '未知';
$this->apiLog['system'] = !empty($osInfo) ? $osInfo['name'].' '.$osInfo['version'] : '未知';
$this->apiLog['models'] = $device . " " . $brand . " ". $model;
$this->apiLog['drive'] = $device;
}
//解析IP地址,得到国家,城市,地址,
$this->apiLog['ip'] = $inputData['ip'];
if (!filter_var($inputData['ip'],FILTER_VALIDATE_IP,FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE | FILTER_NULL_ON_FAILURE)) {
$this->apiLog['country'] = '本地';
$this->apiLog['province'] = '本地';
$this->apiLog['city'] = '本地';
} else {
$readerCity = new Reader(public_path() . 'GeoLite2-City.mmdb');
$record = $readerCity->city($inputData['ip']);
$country = $record->country->names['zh-CN'];
$province = $record->subdivisions[0]->names['zh-CN']??'';
$city = $record->city->names['zh-CN']??$record->city->names['en'];
$china = ['香港','澳门','台湾'];
if (in_array($country,$china)) {
$province = $city = $country;
$country = '中国';
}
$this->apiLog['country'] = $country;
$this->apiLog['province'] = $province;
$this->apiLog['city'] = $city;
}
// Cache::set('this-api-log',$this->apiLog);
// 返回信息前,写入kafka log日志
$result = $this->sendLogsToKafkaProduce($this->apiLog,'action_logs',Env::get('database.database'),'add');
return $result ? json('提交成功') : json('提交失败',504);
}
}

View File

@@ -0,0 +1,37 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
/**
* 联系我们
*/
class Contact extends Base
{
public function initialize()
{
parent::initialize();
$this->model = new \app\index\model\About();
}
/**
* 显示资源列表
*
*/
public function index()
{
$inputData = $this->request->param();
$resource = [];
// $resource['banner'] = $this->model->getAboutBanner($this->languageId,'关于我们页面-banner');
// $resource['banner_mobile'] = $this->model->getAboutBanner($this->languageId,'关于我们页面-手机-banner');
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'contact');
View::assign('meta',$metaTitle);
View::assign('resource',$resource);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'contact/contact');
}
}

View File

@@ -0,0 +1,61 @@
<?php
namespace app\index\controller;
use app\index\model\SoftManual as SoftManualModel;
use app\index\validate\SoftManual as SoftManualValidate;
use think\facade\Lang;
use think\facade\View;
/**
* Class Download
* @package app\index\controller
*/
class Download extends Base
{
public function initialize()
{
parent::initialize();
$this->model = new SoftManualModel();
}
public function index()
{
$resource = [];
$inputData = $this->request->param();
$resource['type'] = $this->model->getDownloadType();
if (isset($inputData['keyword']) && $inputData['keyword'] != '') {
$this->vague['name'] = ($inputData['keyword']);
}
// $this->request->pathinfo()
if (isset($inputData['file_type_id']) && $inputData['file_type_id'] != '' && $inputData['file_type_id'] != 0) {
$this->focus['file_type_id'] = $inputData['file_type_id'];
}
$this->sort['sort'] = 'desc';
$this->focus['status'] = "0";
$result = $this->model->getAllList($inputData,$this->vague,$this->focus,$this->sort);
// dump($result);
//构建数据
if ((isset($result['page']) && !empty($result['page'])) && !empty($result)) {
$resource['list'] = $result;
} else {
if (isset($inputData['keyword']) && $inputData['keyword'] != '') {
$this->vague['introduce'] = ($inputData['keyword']);
}
$result = $this->model->getAllList($inputData,$this->vague,$this->focus,$this->sort);
$resource['list'] = $result;
}
// dump($this->model->getLastSql());
// dump($resource);
// $resource['page'] = $result->render();
// $resource['list'] = $result->toArray();
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'download');
View::assign('meta',$metaTitle);
View::assign('resource',$resource);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'download/download');
}
}

View File

@@ -0,0 +1,105 @@
<?php
declare(strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
class Goods extends Base
{
public function initialize()
{
parent::initialize();
$this->model = new \app\index\model\Goods();
}
/**
* 显示资源列表
*/
public function index()
{
$inputData = $this->request->param();
$resource = [];
$query = [];
if (isset($inputData['model_number']) && $inputData['model_number'] != '') {
$query['model_number'] = $inputData['model_number'];
}
//分类
$resource['category'] = $this->model->getFirstLeveCategory($inputData);
$resource['checked1'] = 0;
$resource['url'] = explode('.html', $this->request->query())[0];
if (isset($inputData['cate1']) && $inputData['cate1'] != '') {
$categoryTwo = $this->model->getSecondLevelCategory($inputData);
$resource['category_two'] = $categoryTwo;
$resource['checked2'] = $inputData['cate2']??0;
}
if (isset($inputData['cate2']) && $inputData['cate2'] != '') {
$categoryThree = $this->model->getThreeLevelCategory($inputData);
$resource['category_three'] = $categoryThree;
$resource['checked3'] = $inputData['cate3']??0;
}
$forth = [
'is_all','is_recommend','is_hot','is_new'
];
//
$url = 'index/goods/index?';
for ($i=1;$i<=3;$i++) {
$cate = 'cate'.$i;
if (isset($inputData[$cate]) && $inputData[$cate] != '') {
$url .= http_build_query([$cate =>$inputData[$cate]])."&";
$resource['checked'.$i] = $inputData[$cate];
$resource['url'.$i] = rtrim($url, '&');
$query['cate'.$i] = $inputData[$cate];
}
$resource['url'] = rtrim($url, '&');
}
$resource['checked4'] = '';
foreach ($forth as $fort) {
if (isset($inputData[$fort]) && $inputData[$fort] != '') {
if ($inputData[$fort] == 1) {
$resource['checked4'] = $fort;
$query[$fort] = $inputData[$fort];
}
}
}
// 查询对应的
$goodsPaginate = $this->model->getGoodsList($query, $resource['url']);
//dump($goodsPaginate);
$resource['page'] = $goodsPaginate->render();
$resource['list'] = $goodsPaginate->toArray();
// dump($this->model->getLastSql());
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'goods_list');
View::assign('meta',$metaTitle);
View::assign('resource', $resource);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'goods/list');
}
/**
* 显示资源列表
*/
public function detail()
{
$inputData = $this->request->param();
$resource = [];
if (isset($inputData['id']) && $inputData['id'] > 0) {
$resource['bread'] = $this->model->getCategoryToParent($inputData['id']);
// dump($resource);
$goodsInfo = $this->model->getInfo($inputData);
$goodsInfo['details'] = htmlspecialchars_decode($goodsInfo['details']);
// dump($goodsInfo);
if (empty($goodsInfo) || $goodsInfo['status'] == 1) {
View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'goods/404');
}
}
$resource['goodsInfo'] = $goodsInfo;
// dump($goodsInfo);
View::assign('resource', $resource);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'goods/detail');
}
}

View File

@@ -0,0 +1,53 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
use app\index\model\Index as IndexModel;
/**
* 首页控制器
*/
class Index extends Base
{
public function initialize()
{
$this->model = new IndexModel();
parent::initialize();
}
/**
* @return string
*/
public function index():string
{
$inputData = $this->request->param();
// banner
$bannerList = $this->model->getIndexBanner($this->languageId,$inputData);
// 商品banner
$goodsBanner = $this->model->getGoodsBanner($this->languageId,$inputData);
// 获取推荐商品
$bannerListMobile = $this->model->getIndexBannerMobile($this->languageId,$inputData);
// 商品分类
$goodsCategoryList = $this->model->getIndexGoodsCategoryList($this->languageId,$inputData);
// 推荐商品
$goodsCommandList = $this->model->getIndexGoodsRecommandList($this->languageId,$inputData);
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'index');
// 首页4张图
$forthImg = $this->model->getGoodsBanner($this->languageId);
View::assign('meta',$metaTitle);
View::assign('f_image',$forthImg);
View::assign('banner_list',$bannerList);
View::assign('banner_list_mobile',$bannerListMobile);
View::assign('goods_category',$goodsCategoryList);
View::assign('goods_is_new',$goodsCommandList);
View::assign('goods_banner',$goodsBanner);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'index/index');
}
}

View File

@@ -0,0 +1,78 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
use app\index\model\Join as JoinModel;
/**
* 加入我们
*/
class Join extends Base
{
public function initialize()
{
$this->model = new JoinModel();
parent::initialize();
}
/**
* 显示资源列表
*/
public function index():string
{
$inputData = $this->request->param();
$join = [];
$join['banner'] = $this->model->getJoinBanner($this->languageId,'加入我们-banner');
$join['list'] = $this->model->getJoinList($this->languageId,$inputData);
$join['type'] = $this->model->getJoinTypeList($this->languageId,$inputData);
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'join');
View::assign('meta',$metaTitle);
View::assign('join',$join);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'join/join_us');
}
/**
* 显示详情资源列表
*/
public function detail():string
{
$inputData = $this->request->param();
//banner
$join = $this->model->getInfo($inputData);
View::assign('join',$join);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'join/join_detail');
}
/**
* 更多列表页
*/
public function list():string
{
$inputData = $this->request->param();
$where = [
'site_id' => $this->languageId,
'status' => 0,
];
if (isset($inputData['join_type_id']) && $inputData['join_type_id'] != 0) {
$where['join_type_id'] = $inputData['join_type_id'];
}
$listRow = [
'query' => ['join_type_id'=>$inputData['join_type_id']], //url额外参数
'fragment' => '', //url锚点
'var_page' => 'page', //分页变量
'list_rows' => $inputData['size']??4, //每页数量
];
$result = $this->model->where($where)->paginate($listRow);
View::assign('join',$result->render());
View::assign('list',$result->toArray());
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'join/join_list');
}
}

View File

@@ -0,0 +1,62 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
use app\index\model\News as NewsModel;
/**
* 新闻动态
*/
class News extends Base
{
public function initialize()
{
$this->model = new NewsModel();
parent::initialize();
}
/**
* 显示资源列表
*/
public function index()
{
$inputData = $this->request->param();
$news = [];
$news['banner_list'] = $this->model->getNewsBanner($this->languageId,'新闻列表页面-banner');
$news['banner_list_mobile'] = $this->model->getNewsBanner($this->languageId,'新闻列表页面-手机-banner');
$newsPaginate = $this->model->getNewsList($this->languageId,$inputData);
$news['page'] = $newsPaginate->render();
$news['list'] = $newsPaginate->toArray();
$news['type'] = $this->model->getNewsTypeList($this->languageId,$inputData);
if (!empty($news['list']['data'])) {
foreach ($news['list']['data'] as $key => $item) {
$news['list']['data'][$key]['create_time'] = date('Y年m月d日',strtotime($item['create_time']));
}
}
View::assign('news',$news);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'news/news');
}
/**
* 显示资源列表
*/
public function detail()
{
$inputData = $this->request->param();
//banner
$news = $this->model->getInfo($inputData);
$news['banner_detail'] = $this->model->getNewsBanner($this->languageId,'新闻详情页面-banner');
$news['banner_detail_mobile'] = $this->model->getNewsBanner($this->languageId,'新闻详情页面-手机-banner');
$news['create_time'] = date('Y年m月d日',strtotime($news['create_time']));
// 获取上一篇下一篇
$news['extra'] = $this->model->getPreNexInfo($inputData);
View::assign('news',$news);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'news/news_detail');
}
}

View File

@@ -0,0 +1,37 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use think\facade\Lang;
use think\facade\View;
/**
* 关于我们
*/
class Test extends Base
{
public function initialize()
{
parent::initialize();
$this->model = new \app\index\model\Test();
}
/**
* 显示资源列表
*
*/
public function index()
{
$inputData = $this->request->param();
$resource = [];
// $resource['banner'] = $this->model->getAboutBanner($this->languageId,'关于我们页面-banner');
// $resource['banner_mobile'] = $this->model->getAboutBanner($this->languageId,'关于我们页面-手机-banner');
// 增加标签显示
$metaTitle = $this->model->getMetaTitle($this->languageId,'about');
View::assign('meta',$metaTitle);
View::assign('resource',$resource);
return View::fetch(Lang::getLangSet().DIRECTORY_SEPARATOR.'about/test');
}
}

5
app/index/event.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
// 这是系统自动生成的event定义文件
return [
];

82
app/index/lang/en-us.php Normal file
View File

@@ -0,0 +1,82 @@
<?php
/**
* 英文语言包
*/
return [
'获取列表成功' => 'Get list succeeded',
'获取列表失败' => 'Failed to get list',
'提交成功' => 'Submitted successfully',
'提交失败' => 'Submission failed',
'分类参数不正确,请检查!' => 'The classification parameters are incorrect, please check!',
'获取成功' => 'Get success',
'获取失败' => 'Acquisition failed',
'新增成功' => 'Successfully added',
'新增失败' => 'Failed to add',
'修改成功' => 'Modified successfully',
'修改失败' => 'Modification failed',
'已经提交,不要重新提交' => 'Submitted, do not resubmit',
'请选择上传的文件' => 'Submitted, do not resubmit',
'上传成功' => 'Upload succeeded',
'上传失败' => 'Upload failed',
'接口密钥不正确,请检查!' => 'The interface key is incorrect, please check!',
'无效的语言包请求' => 'Invalid language pack request',
'绑定域名不正确,请检查后台设置' => 'The binding domain is incorrect. Please check the backend settings',
"上传失败。文件的最大大小为10MB" => 'Upload failed. The maximum file size is 10MB',
'上传失败。文件后缀不允许' => 'Upload failed. File suffix not allowed',
'上传失败。文件MIME类型不允许' => 'Upload failed. File MIME type not allowed',
'语言包不正确' => 'Incorrect language pack',
'平台参数错误' => 'Platform parameter error',
'平台不存在,请联系管理员' => 'The platform does not exist, please contact the administrator',
// Validate Error Message
':attribute require' => ':attribute不能为空',
':attribute must' => ':attribute必须',
':attribute must be numeric' => ':attribute必须是数字',
':attribute must be integer' => ':attribute必须是整数',
':attribute must be float' => ':attribute必须是浮点数',
':attribute must be bool' => ':attribute必须是布尔值',
':attribute not a valid email address' => ':attribute格式不符',
':attribute not a valid mobile' => ':attribute格式不符',
':attribute must be a array' => ':attribute必须是数组',
':attribute must be yes,on or 1' => ':attribute必须是yes、on或者1',
':attribute not a valid datetime' => ':attribute不是一个有效的日期或时间格式',
':attribute not a valid file' => ':attribute不是有效的上传文件',
':attribute not a valid image' => ':attribute不是有效的图像文件',
':attribute must be alpha' => ':attribute只能是字母',
':attribute must be alpha-numeric' => ':attribute只能是字母和数字',
':attribute must be alpha-numeric, dash, underscore' => ':attribute只能是字母、数字和下划线_及破折号-',
':attribute not a valid domain or ip' => ':attribute不是有效的域名或者IP',
':attribute must be chinese' => ':attribute只能是汉字',
':attribute must be chinese or alpha' => ':attribute只能是汉字、字母',
':attribute must be chinese,alpha-numeric' => ':attribute只能是汉字、字母和数字',
':attribute must be chinese,alpha-numeric,underscore, dash' => ':attribute只能是汉字、字母、数字和下划线_及破折号-',
':attribute not a valid url' => ':attribute不是有效的URL地址',
':attribute not a valid ip' => ':attribute不是有效的IP地址',
':attribute must be dateFormat of :rule' => ':attribute必须使用日期格式 :rule',
':attribute must be in :rule' => ':attribute必须在 :rule 范围内',
':attribute be notin :rule' => ':attribute不能在 :rule 范围内',
':attribute must between :1 - :2' => ':attribute只能在 :1 - :2 之间',
':attribute not between :1 - :2' => ':attribute不能在 :1 - :2 之间',
'size of :attribute must be :rule' => ':attribute长度不符合要求 :rule',
'max size of :attribute must be :rule' => ':attribute长度不能超过 :rule',
'min size of :attribute must be :rule' => ':attribute长度不能小于 :rule',
':attribute cannot be less than :rule' => ':attribute日期不能小于 :rule',
':attribute cannot exceed :rule' => ':attribute日期不能超过 :rule',
':attribute not within :rule' => '不在有效期内 :rule',
'access IP is not allowed' => '不允许的IP访问',
'access IP denied' => '禁止的IP访问',
':attribute out of accord with :2' => ':attribute和确认字段:2不一致',
':attribute cannot be same with :2' => ':attribute和比较字段:2不能相同',
':attribute must greater than or equal :rule' => ':attribute必须大于等于 :rule',
':attribute must greater than :rule' => ':attribute必须大于 :rule',
':attribute must less than or equal :rule' => ':attribute必须小于等于 :rule',
':attribute must less than :rule' => ':attribute必须小于 :rule',
':attribute must equal :rule' => ':attribute必须等于 :rule',
':attribute has exists' => ':attribute已存在',
':attribute not conform to the rules' => ':attribute不符合指定规则',
'invalid Request method' => '无效的请求类型',
'invalid token' => '令牌数据无效',
'not conform to the rules' => '规则错误',
];

8
app/index/lang/zh-cn.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
/**
* 语言包
*/
return [
'title'
];

5
app/index/middleware.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
// 这是系统自动生成的middleware定义文件
return [
];

View File

@@ -0,0 +1,80 @@
<?php
namespace app\index\middleware;
use app\index\model\Language;
use app\index\model\Site;
use think\facade\Cache;
/**
* 全局路由中间件-验证接口请求的有效性
* Class Auth
* @package app\index\middleware
*/
class Auth
{
public function handle($request, \Closure $next)
{
header("Access-Control-Allow-Origin:*");
header("Access-Control-Allow-Methods:GET, POST, PATCH, PUT, DELETE,OPTIONS");
header("Access-Control-Allow-Headers:Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With,x_requested_with,x-token");
//获取请求过来的域名与后台绑定域名是否一致
$url = $request->host();
//兼容老数据,1=英文,或者传 us-en, zh-cn,jp
$language = $request->param()['language_id']??'zh-cn';
if ($language == 'zh-cn') {
$languageId = 1;
} else {
if (is_numeric($language)) {
show(-999,lang('无效的语言包请求'));
}
$lang = new Language();
$info = $lang->where('code',$language)->where('status',0)->findOrEmpty()->toArray();
if (empty($info)) {
show(-998,lang('语言包ID不正确'));
}
$languageId = $info['id'];
}
// 查找当前品牌所有的语言站点
$site = new Site();
$domain = [];
$languageCode = '';
if (Cache::has('site_info')) {
$siteInfo = Cache::get('site_info');
$languageCode = Cache::get('language_info_'.$languageId) ?: 'zh-cn';
$domain = array_column($siteInfo,'domain');
} else {
$siteInfo = $site->where(['platform_id'=>1,'status'=>0])->select()->toArray();
$languageInfo = $site->where(['language_id'=>$languageId,'platform_id'=>1,'status'=>0])->select()->toArray();
if (!empty($languageInfo)) {
$languageCode = $languageInfo[0]['code'] ?? 'zh-cn';
}
if (!empty($siteInfo)) {
$domain = array_column($siteInfo,'domain');
}
Cache::set('site_info',$siteInfo,7200);
Cache::set('language_info_'.$languageId,$languageCode,7200);
}
//检测域名是否合法,添加测试域名
$devDomain = ['setmspace.test','setmspace.com','setmspace.cn','dev.setm.f2b211.com'];
$domain = array_column($domain,'domain');
$wholeDomain = array_merge($devDomain,$domain);
if (!in_array($url,$wholeDomain)) {
//表示请求域名不是绑定的域名,抛出异常
show(-995,lang("绑定域名不正确,请检查后台设置"));
}
//老站点英文站兼容密钥
$request->platform_id = 1;/*强制为1*/
$request->language_id = $languageId;
$request->language_code = $languageCode;
//组装语言ID请求数据
$post = $request->post();
$post['language_id'] = $languageId;
$request->withPost($post);
return $next($request);
}
}

28
app/index/model/About.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* @mixin \think\Model
*/
class About extends BaseModel
{
/**
* @param $languageId
* @param $data
* @return array|string[]
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAboutBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 广告页模型
* @mixin \think\Model
*/
class AdvertisePage extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' =>'int',
'name' =>'string',
'sort' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
}

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* @mixin \think\Model
*/
class AdvertiseSpace extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' =>'int',
'name' =>'string',
'advertise_page_id'=>'int',
'max_num' =>'int',
'width' =>'int',
'height' =>'int',
'sort' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 广告模型
* @mixin \think\Model
*/
class Advertisement extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' =>'int',
'advertise_space_id' =>'int',
'command' =>'string',
'name' =>'string',
'image' =>'string',
'url' =>'string',
'start_time' =>'int',
'stop_time' =>'int',
'play_order' =>'int',
'sort' =>'int',
'status' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
}

View File

@@ -0,0 +1,20 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* @mixin \think\Model
*/
class Attribute extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' => 'int',
'name' =>'string',
'create_time' =>'int',
'update_time' =>'int',
];
}

View File

@@ -0,0 +1,247 @@
<?php
declare(strict_types=1);
namespace app\index\model;
use think\Model;
/**
* 模型基类
* @mixin \think\Model
*/
class BaseModel extends Model
{
protected $autoWriteTimestamp = true;
/**
* 获取列表
* @param array $data 查询条件
* @param mixed $simple 模糊搜索条件
* @param mixed $focus 精准搜索条件
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAllList($data,$simple = null,$focus = null,$sort = null)
{
$fields = array_keys($this->schema);
$collection = $this->where(function ($query) use ($data,$fields,$simple,$focus) {
//模糊查询条件
if (!empty($simple)) {
foreach ($simple as $key => $item) {
if (in_array($key,$fields)) {
$query->where($key,'like',"%".$item."%");
}
}
}
//精准查询
if (!empty($focus)) {
foreach ($focus as $key => $item) {
if (in_array($key,$fields)) {
$query->where($key,$item);
}
}
}
});
if (isset($data['page']) && isset($data['size'])) {
$count = $collection->count() ?: 0;
$page = $collection->limit($data['size'])->page($data['page'])->order($sort)->select()->toArray();
return ['page'=>$page,'count'=>$count];
} else {
return $collection->order($sort)->select()->toArray();
}
}
/**
* 获取详情
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getInfo($data)
{
$result = $this->find($data['id']);
return $result ? $result->toArray() : [];
}
/**
* 增加数据
* @param $data
* @return bool
*/
public function addData($data)
{
return $this->save($data);
}
/**
* 编辑数据
* @param $data
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function editData($data)
{
$result = $this->find($data['id']);
return $result && $result->save($data);
}
/**
* 删除数据
* @param $id
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function delData($id)
{
$result = $this->find($id['id']);
if ($result) {
return $result->delete();
}
return false;
}
/**
* 查询对应ID有没有子项目,比如菜单类,通过ID查询子菜单是否存在
* @param $data
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function checkChildren($data)
{
$result = $this->where('pid',$data['id'])->find();
return (bool)$result;
}
/**
* 批量编辑数据
* @param $data
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function batchEditData($data)
{
$result = $result1 = true;
foreach ($data as $item) {
$models = $this->find($item['id']);
if ($models) {
$result1 = $models->save($item);
}
$result = $result && $result1;
}
return $result;
}
/**
* 批量删除数据
* @param $data
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function batchDelData($data)
{
return $this->destroy($data);
}
/**
* 获取最新一条数据
* @return array|Model|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getLatestData($data)
{
return $this->where($data)->order($this->pk,'desc')->find();
}
/**
* 获取语言名称
* @param $id
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getLanguageName($id)
{
$site = Site::find($id);
$result = Language::find($site['language_id']);
return $result ? $result['name'] : '';
}
/**
* 获取国家名称
* @param $id
* @return mixed|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getCountryName($id)
{
$result = Country::find($id);
return $result ? $result['zh'] : '';
}
/**
* 通过ID获取广告位名称
* @param $id
* @return mixed|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAdvertiseSpaceNameById($id)
{
$result = AdvertiseSpace::find($id);
return $result ? $result['name'] : '';
}
/**
* 通过广告页ID,获取对应的BANNER
* @param $languageId
* @param $spaceId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getBanner($languageId,$spaceId):array
{
$where = [
'site_id' => $languageId,
'advertise_space_id' => $spaceId
];
return Advertisement::field(['id','image'])->where($where)->select()->toArray();
}
/**
* 获取浏览器标签
* @param int $languageId
* @param string $type
* @return array
*/
public function getMetaTitle(int $languageId,string $type) : array
{
$result = SystemConfig::field('name,value')->where('site_id',$languageId)->where('pos',$type)->column('value','name');
if (empty($result)) {
return SystemConfig::field('name,value')->where('site_id',$languageId)->where('pos','common')->column('value','name');
}
return $result;
}
}

75
app/index/model/Brand.php Normal file
View File

@@ -0,0 +1,75 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
*
*/
class Brand extends BaseModel
{
/**
* 获取首页品牌矩阵
* @param $data
* @param $languageId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getBrandList($languageId,$data):array
{
$where = [
'site_id' => $languageId,
'status' => 0,
];
if (isset($data['brand_type_id']) && $data['brand_type_id'] != 0) {
$where['brand_type_id'] = $data['brand_type_id'];
}
return $this->where($where)->order('sort','desc')->select()->toArray();
}
/**
* 获取品牌矩阵分类
* @param $languageId
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getBrandTypeList($languageId,$data):array
{
$result = BrandType::where('site_id',$languageId)->select()->toArray();
if (!empty($result)) {
$arr[] = [
'id' => 0,
'name' => '全部',
];
$result = array_merge($arr,$result);
foreach ($result as $key => $item) {
$result[$key]['is_display'] = !empty($data) ? isset($data['brand_type_id']) && $data['brand_type_id'] == $item['id'] : $item['id'] == 0;
}
return $result;
}
return [];
}
/**
* @param $languageId
* @param $data
* @return array|string[]
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getBrandBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
}

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 文章分类
*
*/
class BrandType extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'site_id' =>'int',
'name' =>'string',
'desc' =>'string',
'icon' =>'string',
'sort' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
}

View File

@@ -0,0 +1,14 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
use think\Model;
/**
* @mixin \think\Model
*/
class Common extends Model
{
//
}

View File

@@ -0,0 +1,14 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
use think\Model;
/**
* @mixin \think\Model
*/
class Concept extends Model
{
//
}

View File

@@ -0,0 +1,28 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* @mixin \think\Model
*/
class Contact extends BaseModel
{
/**
* @param $languageId
* @param $data
* @return array|string[]
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAboutBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
}

305
app/index/model/Goods.php Normal file
View File

@@ -0,0 +1,305 @@
<?php
declare(strict_types=1);
namespace app\index\model;
use app\api\model\GoodsAttribute;
use app\api\model\GoodsBuyNow;
use app\api\model\GoodsConnect;
use app\api\model\GoodsImages;
use app\api\model\GoodsSoftManual;
use think\facade\Env;
/**
* 商品模型
* @mixin \think\Model
*/
class Goods extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' =>'int',
'name' =>'string',
'main_img' =>'string',
'model_number' =>'string',
'goods_category_id' =>'int',
'price' =>'int',
'is_new' =>'int',
'is_discount' =>'int',
'details' =>'string',
'title' =>'string',
'keywords' =>'string',
'description' =>'string',
'sort' =>'int',
'status' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
/**
* 商品链接关联模型
*/
public function GoodsBuyNow()
{
return $this->hasMany(GoodsBuyNow::class);
}
/**
* 商品关联商品
*/
public function GoodsConnect()
{
return $this->hasMany(GoodsConnect::class);
}
/**
* 商品手册关联模型
* @return \think\model\relation\HasMany
*/
public function GoodsSoftManual()
{
return $this->hasMany(GoodsSoftManual::class);
}
/**
* 商品主图关联模型
* @return \think\model\relation\HasMany
*/
public function GoodsImages()
{
return $this->hasMany(GoodsImages::class);
}
/**
* 商品属性关联
* @return \think\model\relation\HasMany
*/
public function goodsAttr()
{
return $this->hasMany(GoodsAttribute::class);
}
/**
* 获取父级分类
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getFirstLeveCategory($data)
{
return GoodsCategory::where('pid',0)->where('status',0)->where('site_id',1)->order('sort','desc')->select()->toArray();
}
/**
* 获取二级分类
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getSecondLevelCategory($data)
{
return GoodsCategory::where('pid',$data['cate1'])->where('status',0)->where('site_id',1)->order('sort','desc')->select()->toArray();
}
/**
* 获取三级分类
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getThreeLevelCategory($data)
{
return GoodsCategory::where('pid',$data['cate2'])->where('status',0)->where('site_id',1)->order('sort','desc')->select()->toArray();
}
/**
* 获取所有子分类
* @param $id
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAllSonCategory($id)
{
$arr = GoodsCategory::where('status',0)->where('site_id',1)->order('sort','desc')->select()->toArray();
$feeds = category_to_all_children_id($arr,$id);
return $feeds;
}
/**
* 获取列表
* @param array $data 查询条件
* @return \think\Paginator
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getGoodsList($data,$qstring)
{
$qs = explode('index/goods/index?',$qstring);
parse_str($qs[1],$out);
$query = $queryOther = [];
$forth = [
'is_all','is_recommend','is_hot','is_new'
];
foreach ($forth as $f) {
if (in_array($f,array_keys($data))) {
$queryOther[$f] = $data[$f];
}
}
// 判断是否选择了分类
for ($i=1;$i<=3;$i++) {
if (isset($data['cate'.$i])) {
// 如果是3级分类
if ($i === 3 && $data['cate'.$i] != 0) {
$query['goods_category_id'] = $data['cate'.$i];
}
// 如果是2级分类
if ($i === 2 && $data['cate'.$i] != 0) {
$arr = array_column($this->getThreeLevelCategory(['cate2'=>$data['cate2']]),'id');
array_push($arr,(int)$data['cate2']);
$query['goods_category_id'] = $arr;
}
// 如果是1级分类
if ($i === 1 && $data['cate'.$i] != 0) {
$query['goods_category_id'] = $this->getAllSonCategory($data['cate1']);
}
}
}
$collection = $this->where('status',0);
if (isset($data['model_number'])) {
$collection = $collection->where('model_number','like','%'.$data['model_number'].'%')->whereOr('name','like','%'.$data['model_number'].'%')->whereOr('title','like','%'.$data['model_number'].'%');
} else {
//查询
if (!empty($queryOther) && !isset($queryOther['is_all'])) {
$collection = $collection->where($queryOther);
}
if (!empty($query) && is_array($query['goods_category_id'])) {
// 表示是非3级分类
$collection = $collection->whereIn('goods_category_id',$query['goods_category_id']);
} else {
$collection = $collection->where($query);
}
}
$pageNum = SystemConfig::where('pos','goods')->where('name','list_num')->find()->toArray();
$listRow = [
'query' => $out, //url额外参数
'fragment' => '', //url锚点
'var_page' => 'page', //分页变量
'list_rows' => (int)$pageNum['value']??4, //每页数量
];
//return $collection->order('create_time','desc')->paginate($listRow);
$resutl = $collection->order('create_time','desc')->paginate($listRow);
//dump($this->getLastSql());
return $resutl;
}
/**
* 通过商品ID,查出所有父级分类
*/
public function getCategoryToParent($id)
{
$goods = $this->where('id',$id)->find()->toArray();
$data = GoodsCategory::where('status',0)->order('sort','desc')->select()->toArray();
$arr = category_to_all_pid($data,$goods['goods_category_id']);
$arr = GoodsCategory::whereIn('id',$arr)->order('sort','desc')->select()->toArray();
$url = '';
for ($i=0;$i<=count($arr)-1;$i++) {
$cate = 'cate'.($i + 1);
$url .= http_build_query([$cate =>$arr[$i]['id']])."&";
$arr[$i]['qs'] = rtrim($url,'&');
}
$arr[0]['qs'] = 'cate1='.$arr[0]['id'];
return $arr;
}
public function getInfo($data)
{
$result = $this->where('status',0)->find($data['id']);
if ($result) {
$goodsAttribute = $result->goodsAttr()->select()->toArray();
$attr = $img = [];
if ($goodsAttribute) {
foreach ($goodsAttribute as $item) {
$attr[] = array_merge($item,['attribute_name'=>Attribute::where('id',$item['attribute_id'])->value('name')]);
}
}
$images = $result->goodsImages()->select()->toArray();
$connect = $result->goodsConnect()->select()->toArray();
if (!empty($connect)) {
foreach ($connect as $item) {
$res = $this->where('status',0)->find($item['connect_good_id']);
if ($item['connect_good_id'] != 0 && $item['connect_good_id'] != '' && $res) {
$tmp = $this->where('status',0)->find($item['connect_good_id'])->toArray();
$tmp['main_img'] = Env::get('QINIU.cdn').$tmp['main_img'];
$connectData[] = array_merge($item,$tmp);
}
}
}
//处理相关下载
$relate = $result->GoodsSoftManual()->select()->toArray();
$newRelate = [];
foreach ($relate as $item) {
$soft = SoftManual::where('status',0)->find($item['soft_manual_id']);
if ($soft) {
$btn = SoftManualBtn::where('soft_manual_id',$item['soft_manual_id'])->select()->toArray();
$soft = $soft->toArray();
$soft['btn'] = $btn;
$newRelate[] = array_merge($soft,[]);
}
}
if (!empty($newRelate)) {
foreach ($newRelate as $key => $item) {
$newRelate[$key]['image'] = Env::get('QINIU.cdn').$item['image'];
foreach ($item['btn'] as $item1) {
$tmp = [
'url' => Env::get('QINIU.cdn').$item1['url'],
'name' => $item1['file_name']
];
$arr[$item1['btn_tips']][] = array_merge($tmp,[]);
}
unset($newRelate[$key]['btn']);
$newRelate[$key]['getSoftBtn'] = $arr;
$arr = [];
}
}
//处理图片
$result['main_img'] = Env::get('QINIU.cdn').$result['main_img'];
// $img[0] = ['image'=>$result['main_img']];
foreach ($images as $item) {
$img[] = ['image'=>Env::get('QINIU.cdn').$item['image']];
}
//
$categoryName = GoodsCategory::find($result['goods_category_id']);
$result['category_name'] = $categoryName['name'];
//buynow
$result['buy_now'] = $result->goodsBuyNow()->select()->toArray();
$result['goods_attribute'] = $attr;
$result['relate_download'] = $newRelate;
$result['images'] = empty($img) ? [['image'=>$result['main_img']]] : $img;
$result['connect'] = empty($connectData) ? [] : $connectData;
return $result->toArray();
} else {
return [];
}
}
}

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 商品分类
* @mixin \think\Model
*/
class GoodsCategory extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' =>'int',
'name' =>'int',
'desc' =>'int',
'pid' =>'int',
'icon' =>'int',
'sort' =>'int',
'status' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
}

137
app/index/model/Index.php Normal file
View File

@@ -0,0 +1,137 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* 首页
*/
class Index extends BaseModel
{
protected $name = 'advertisement';
/**
* 首页banner
* @param $data
* @param $languageId
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getIndexBanner($languageId,$data):array
{
$where = [
'site_id' => $languageId,
'advertise_space_id' => 1
];
return $this->where($where)->select()->toArray();
}
/**
* 首页banner
* @param $data
* @param $languageId
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getIndexBannerMobile($languageId,$data):array
{
$where = [
'site_id' => $languageId,
'advertise_space_id' => 9
];
return $this->where($where)->select()->toArray();
}
/**
* 获取首页品牌矩阵
* @param $data
* @param $languageId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getIndexGoodsCategoryList($languageId,$data):array
{
$where = [
'site_id' => $languageId,
'status' => 0,
'pid' => 0
];
return GoodsCategory::where($where)->order('sort','desc')->select()->toArray();
}
/**
* @param $languageId
* @param $inputData
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getIndexGoodsRecommandList($languageId,$inputData):array
{
$where = [
'site_id' => $languageId,
'status' => 0,
'is_recommend' => 0
];
$isNew = SystemConfig::where('pos','index')->where('name','is_new_num')->find()->toArray();
return Goods::where($where)->order('sort','desc')->page(0)->limit((int)$isNew['value'])->select()->toArray();
}
/**
* @param $languageId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getGoodsBanner($languageId):array
{
$where = [
'site_id' => $languageId,
];
$newData = SystemConfig::field('name,pos,value,image,type')->where($where)->where('pos','index_goods')->column('pos,value,image,type','name');
$ret = [
'goods_one' => [
'value' => '',
'image' => ''
],
'goods_two' => [
'value' => '',
'image' => ''
],
'goods_three' => [
'value' => '',
'image' => ''
],
'goods_four' => [
'value' => '',
'image' => ''
],
];
if (!empty($newData)) {
foreach ($newData as $key => $value) {
if ($value['image']) {
$images = json_decode($value['image'],true);
$newData[$key]['value'] = $value['value']??'';
$newData[$key]['image'] = $images[0]['image']??'';
} else {
$newData[$key]['value'] = '';
$newData[$key]['image'] = '';
}
}
return $newData;
} else {
return $ret;
}
}
}

69
app/index/model/Join.php Normal file
View File

@@ -0,0 +1,69 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
*
*/
class Join extends BaseModel
{
/**
* 获取首页品牌矩阵
* @param $data
* @param $languageId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getJoinList($languageId,$data):array
{
$where = [
'site_id' => $languageId,
'status' => 0,
];
if (isset($data['join_type_id']) && $data['join_type_id'] != 0) {
$where['join_type_id'] = $data['join_type_id'];
}
return $this->where($where)->order('sort','desc')->select()->toArray();
}
/**
* 获取品牌矩阵分类
* @param $languageId
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getJoinTypeList($languageId,$data):array
{
$result = JoinType::where('site_id',$languageId)->select()->toArray();
if (!empty($result)) {
foreach ($result as $key => $item) {
$result[$key]['is_display'] = !empty($data) ? isset($data['join_type_id']) && $data['join_type_id'] == $item['id'] : $item['id'] == 0;
}
return $result;
}
return [];
}
/**
* @param $languageId
* @param $data
* @return array|string[]
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getJoinBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
}

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 文章分类
*
*/
class JoinType extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'site_id' =>'int',
'name' =>'string',
'desc' =>'string',
'icon' =>'string',
'sort' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 语言包模型
* @mixin \think\Model
*/
class Language extends BaseModel
{
protected $schema = [
'id' => 'int',
'name' => 'string',
'code' => 'string',
'icon' => 'string',
'locale' => 'string',
'coin' => 'string',
'sort' => 'int',
'status' => 'int',
'create_time' => 'int',
'update_time' => 'int'
];
/**
* 获取列表
* @param array $data 查询条件
* @param mixed $simple 模糊搜索条件
* @param mixed $focus 精准搜索条件
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAllList($data,$simple = null,$focus = null,$sort = null)
{
$lang = Site::where('platform_id',$data['platform_id'])->column('language_id');
return $this->order($sort)->where('id','in',$lang)->select()->toArray();
}
}

View File

@@ -0,0 +1,83 @@
<?php
namespace app\index\model;
use think\helper\Str;
/**
* @mixin \think\Model
*/
class Navigator extends BaseModel
{
protected $schema = [
'id' => 'int',
'platform_id' => 'int',
'site_id' => 'int',
'language_id' => 'int',
'pid' => 'int',
'name' => 'string',
'desc' => 'string',
'icon' => 'string',
'link' => 'string',
'sort' => 'int',
'status' => 'int',
'is_top' => 'int',
'is_foot' => 'int',
'create_time' => 'int',
'update_time' => 'int'
];
/**
* 获取首页导航菜单
* @param $language_id
* @param $platform_id
* @param $controller
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getNavInfo($language_id,$platform_id,$controller):array
{
$result = $this->where(function($query) use ($language_id,$platform_id) {
$query->where('is_top',0)->where('status',0)->where('platform_id',$platform_id);
})->order('sort','desc')->select()->toArray();
if (!empty($result)) {
foreach ($result as $key => $item) {
if (isset($controller) && $controller != '') {
$url = explode('/',$item['url']);
if (count($url) <= 2 && $controller == 'Index') {
$result[$key]['is_show'] = true;
} else {
if (count($url) > 2) {
if ($url[2] == Str::snake($controller)) {
$result[$key]['is_show'] = true;
} else {
$result[$key]['is_show'] = false;
}
} else {
$result[$key]['is_show'] = false;
}
}
}
}
}
return $result;
}
/**
* 获取首页导航菜单
* @param $language_id
* @param $platform_id
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getFootNavInfo($language_id,$platform_id):array
{
return $this->where(function($query) use ($language_id,$platform_id) {
$query->where('is_foot',0)->where('status',0)->where('platform_id',$platform_id);
})->order('sort','desc')->select()->toArray();
}
}

105
app/index/model/News.php Normal file
View File

@@ -0,0 +1,105 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* 新闻模型
*/
class News extends BaseModel
{
protected $connection = 'yc';
/**
* 获取新闻动态矩阵
* @param $data
* @param $languageId
* @return \think\Paginator
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getNewsList($languageId,$data)
{
$where = [
'site_id' => $languageId,
'status' => 0,
];
if (isset($data['news_type_id']) && $data['news_type_id'] != 0) {
$where['news_type_id'] = $data['news_type_id'];
}
$listRow = [
'query' => isset($data['news_type_id']) ? ['news_type_id'=>$data['news_type_id']??0] : [], //url额外参数
'fragment' => '', //url锚点
'var_page' => 'page', //分页变量
'list_rows' => $data['size']??6, //每页数量
];
return $this->where($where)->order('create_time','desc')->paginate($listRow);
}
/**
* 获取品牌矩阵分类
* @param $languageId
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getNewsTypeList($languageId,$data):array
{
$result = NewsType::where('site_id',$languageId)->select()->toArray();
if (!empty($result)) {
$arr[] = [
'id' => 0,
'name' => '全部新闻',
];
$result = array_merge($arr,$result);
foreach ($result as $key => $item) {
$result[$key]['is_display'] = !empty($data) ? isset($data['news_type_id']) && $data['news_type_id'] == $item['id'] : $item['id'] == 0;
}
return $result;
}
return [];
}
/**
* @param $languageId
* @param $data
* @return array|string[]
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getNewsBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
/**
* 获取上一篇,下一篇
*/
public function getPreNexInfo($data)
{
if (isset($data['id'])) {
$info = $this->find($data['id'])->toArray();
// 下一条
$next = $this->field(['id','title'])->where('news_type_id',$info['news_type_id'])->where('id','>',$data['id'])->limit(1)->select()->toArray();
// 上一条
$pre = $this->field(['id','title'])->where('news_type_id',$info['news_type_id'])->where('id','<',$data['id'])->limit(1)->select()->toArray();
return [
'pre' => empty($pre) ? [] : $pre[0],
'next' => empty($next) ? [] : $next[0]
];
}
return [];
}
}

View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 文章分类
*
*/
class NewsType extends BaseModel
{
protected $connection = 'yc';
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'site_id' =>'int',
'name' =>'string',
'desc' =>'string',
'icon' =>'string',
'sort' =>'int',
'create_time' =>'int',
'update_time' =>'int',
];
}

View File

@@ -0,0 +1,40 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* 平台模型
* @mixin \think\Model
*/
class Platform extends BaseModel
{
protected $schema = [
'id' => 'int',
'vi_color1' => 'string',
'vi_color2' => 'string',
'vi_color3' => 'string',
'language_id' => 'int',
'coin_id' => 'int',
'name' => 'string',
'desc' => 'string',
'icon' => 'string',
'sort' => 'int',
'status' => 'int',
'create_time' => 'int',
'update_time' => 'int',
];
/**
* @param string $platformName
* @return int
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getPlatformId(string $platformName):int
{
$result = $this->where('name',$platformName)->find();
return $result ? $result->id : 0;
}
}

View File

@@ -0,0 +1,27 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* @mixin \think\Model
*/
class Product extends BaseModel
{
/**
* @param $languageId
* @param $data
* @return array|string[]
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getProductBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
}

View File

@@ -0,0 +1,64 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* @mixin \think\Model
*/
class ReCenter extends BaseModel
{
protected $name = 'resource';
/**
* 获取页面banner
* @param $languageId
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getResourceBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
/**
* @param $languageId
* @param $data
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getResourceList($languageId,$data):array
{
return $this->where('site_id',$languageId)->where('status',0)->order('sort','desc')->select()->toArray();
}
/**
* 获取上一篇,下一篇
*/
public function getPreNexInfo($data)
{
if (isset($data['id'])) {
// 下一条
$next = $this->field(['id','title'])->where('id','>',$data['id'])->limit(1)->select()->toArray();
// 上一条
$pre = $this->field(['id','title'])->where('id','<',$data['id'])->limit(1)->select()->toArray();
return [
'pre' => empty($pre) ? [] : $pre[0],
'next' => empty($next) ? [] : $next[0]
];
}
return [];
}
}

20
app/index/model/Site.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace app\index\model;
/**
* 站点模型
* @mixin \think\Model
*/
class Site extends BaseModel
{
/**
* 获取当前品牌对应站点的域名
* @param int $platformId
* @return array
*/
public function getDomainsList(int $platformId):array
{
return $this->where('platform_id',$platformId)->column(['domain','language_id']);
}
}

View File

@@ -0,0 +1,126 @@
<?php
namespace app\index\model;
use app\api\model\FileType;
use think\facade\Env;
/**
* @mixin \think\Model
*/
class SoftManual extends BaseModel
{
protected $schema = [
'id' => 'int',
'platform_id' => 'int',
'site_id' => 'int',
'language_id' => 'int',
'file_type_id' => 'int',
'name' => 'string',
'introduce' => 'string',
'support' => 'string',
'os' => 'string',
'download_count'=> 'int',
'status' => 'int',
'create_time' => 'int',
'update_time' => 'int',
];
public function getSoftBtn()
{
return $this->hasMany(SoftManualBtn::class);
}
/**
* 获取列表
* @param array $data 查询条件
* @param mixed $simple 模糊搜索条件
* @param mixed $focus 精准搜索条件
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAllList($data,$simple = null,$focus = null,$sort = null)
{
$fields = array_keys($this->schema);
$collection = $this->where(function ($query) use ($data,$fields,$simple,$focus) {
//模糊查询条件
if (!empty($simple)) {
foreach ($simple as $key => $item) {
if (in_array($key,$fields)) {
$query->whereOr($key,'like',"%".$item."%");
}
}
}
//精准查询
if (!empty($focus)) {
foreach ($focus as $key => $item) {
if (in_array($key,$fields)) {
$query->where($key,$item);
}
}
}
});
// $listRow = [
// 'query' => 'index/download/index', //url额外参数
// 'fragment' => '', //url锚点
// 'var_page' => 'page', //分页变量
// 'list_rows' => $data['size']??4, //每页数量
// ];
// return $collection->order($sort)->with('getSoftBtn')->paginate($listRow);
$arr = [];
if (isset($data['page']) && isset($data['size'])) {
$count = $collection->count() ?: 0;
$page = $collection->limit($data['size'])->page($data['page'])->order($sort)->with('getSoftBtn')->select()->toArray();
// if (!empty($page)) {
// foreach ($page as $key => $item) {
// $page[$key]['image'] = Env::get('QINIU.cdn').$item['image'];
// foreach ($item['getSoftBtn'] as $item1) {
// $tmp = [
// 'url' => Env::get('QINIU.cdn').$item1['url'],
// 'name' => $item1['file_name']
// ];
// $arr[$item1['btn_tips']][] = array_merge($tmp,[]);
// }
// $page[$key]['getSoftBtn'] = $arr;
// $arr = [];
// }
// }
return ['page'=>$page,'count'=>$count];
} else {
$resData = $collection->order($sort)->with('getSoftBtn')->select()->toArray();
// dump($resData);
// if (!empty($resData)) {
// foreach ($resData as $key => $item) {
// $resData[$key]['image'] = Env::get('QINIU.cdn').$item['image'];
// $tmp = [];
// foreach ($item['getSoftBtn'] as $item1) {
// $tmp = [
// 'url' => Env::get('QINIU.cdn').$item1['url'],
// 'name' => $item1['file_name']
// ];
// $arr[$item1['btn_tips']][] = array_merge($tmp,[]);
// }
// $resData[$key]['getSoftBtn'] = $arr;
// }
// }
// dump($this->getLastSql());
return $resData;
}
}
/**
* 获取分类
*/
public function getDownloadType()
{
return FileType::select()->toArray();
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace app\index\model;
/**
* @mixin \think\Model
*/
class SoftManualBtn extends BaseModel
{
protected $schema = [
'id' => 'int',
'soft_manual_id'=> 'int',
'btn_tips' => 'string',
'url' => 'string',
'file_name' => 'string',
'create_time' => 'int',
'update_time' => 'int',
];
}

View File

@@ -0,0 +1,78 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* 系统配置
* @mixin \think\Model
*/
class SystemConfig extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' =>'int',
'type' =>'int',
'page' =>'string',
'pos' =>'string',
'name' =>'string',
'value' =>'string',
'image' =>'string',
'create_time' =>'int',
'update_time' =>'int'
];
/**
* 获取尾部信息
* @param $languageId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getFooterInfo($languageId):array
{
$result = $this->field(['name','value','image'])->where(['site_id'=>$languageId,'pos'=>'footer'])->select()->toArray();
if (!empty($result)) {
$newData = [];
foreach ($result as $value) {
if ($value['image']) {
$images = json_decode($value['image'],true);
$newData[$value['name']]['value'] = $value['value'] != '' ? $value['value'] : $images[0]['image'];
} else {
$newData[$value['name']]['value'] = '';
}
}
return $newData;
}
return [];
}
/**
* 获取尾部信息
* @param $languageId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getWebSiteInfo($languageId):array
{
$result = $this->field(['name','value','image'])->where(['site_id'=>$languageId,'pos'=>'index'])->select()->toArray();
if (!empty($result)) {
$newData = [];
foreach ($result as $value) {
if ($value['image']) {
$images = json_decode($value['image'],true);
$newData[$value['name']]['value'] = $value['value'] != '' ? $value['value'] : $images[0]['image'];
} else {
$newData[$value['name']]['value'] = '';
}
}
return $newData;
}
return [];
}
}

28
app/index/model/Test.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
/**
* @mixin \think\Model
*/
class Test extends BaseModel
{
/**
* @param $languageId
* @param $data
* @return array|string[]
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAboutBanner($languageId,$data):array
{
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
if (!empty($space)) {
return $this->getBanner($languageId,$space[0]['id']);
}
return ['image' => ''];
}
}

67
app/index/route/v1.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
use think\facade\Route;
Route::get('/','\\app\\index\\controller\\Index@index');
Route::group('index',function () {
/**
* 前台访问日志监控提交kafka
*/
Route::group('base',function () {
Route::post('submitActionLog','Base@submitActionLog');
Route::post('sal','Base@submitActionLog');
});
/**
* 首页
*/
Route::group('index',function (){
Route::get('/','Index@index');
Route::get('index','Index@index');
});
/**
* 关于我们
*/
Route::group('about',function () {
Route::get('/','About@index');
Route::get('index','About@index');
});
/**
* 产品
*/
Route::group('goods',function () {
Route::get('/','Goods@index');
Route::get('index','Goods@index');
Route::get('detail','Goods@detail');
});
/**
* 联系我们
*/
Route::group('contact',function () {
Route::get('/','Contact@index');
Route::get('index','Contact@index');
});
/**
* 关于我们
*/
Route::group('about',function () {
Route::get('/','About@index');
Route::get('index','About@index');
});
/**
* 下载
*/
Route::group('download',function () {
Route::get('/','Download@index');
Route::get('index','Download@index');
});
/**
* 行为日志
*/
Route::group('action',function () {
Route::get('submit_action_log','Action@submitActionLog');
});
})->prefix('\\app\\index\\controller\\')->middleware([
app\index\middleware\Auth::class
]);

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class About extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class Brand extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class Common extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class Concept extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class Contact extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class Join extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class News extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class Product extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class ReCenter extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
}

View File

@@ -0,0 +1,41 @@
<?php
declare (strict_types = 1);
namespace app\index\validate;
use think\Validate;
class SoftManual extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [
'id' => ['require','integer','gt:0'],
'page' => ['integer','gt:0'],
'size' => ['integer','gt:0'],
'site_id' => ['integer','gt:0'],
'file_type_id' => ['integer','gt:0'],
'name' => ['length:1,40'],
'introduce' => ['length:1,255'],
'support' => ['length:1,255'],
'os' => ['length:1,60'],
'download_count'=> ['integer','gt:0'],
];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [];
protected $scene = [
'index' => ['page','size','name'],
'read' => ['id'],
];
}

View File

@@ -0,0 +1,531 @@
{include file='zh-cn/common/header' title='关于我们' keywords='关于我们'
description='关于我们'} {include file='zh-cn/common/nav' }
<!-- breadcrumb-area start -->
<style>
@media screen and (min-width: 1460px) {
.swt-Container {
width: 1620px;
}
}
.swt-Container {
margin-left: auto;
margin-right: auto;
}
.tech {
background-color: white;
}
.tech1 {
padding-bottom: 130px;
}
.tech .title {
height: 180px;
line-height: 180px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
}
.techcon {
height: 350px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
margin-top: 20px;
}
.techcon .text img {
margin-top: 80px;
margin-left: 65px;
}
.techcon .tech-img img {
margin-top: 25px;
margin-left: 65px;
width: 720px;
height: 300px;
border-radius: 8px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 16px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon > div {
width: 50%;
}
.achive {
height: 460px;
text-align: center;
background-color: white !important;
}
.achive .title,
.timeline .title,
.tech .title {
height: 180px;
line-height: 180px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
}
.timeline{
padding-bottom: 100px;
}
.achive .number {
height: 200px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
display: flex;
}
.achive .number .achive_shuju {
width: 25%;
}
.achive .number .achive_shuju .title1 {
margin-top: 40px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
}
.achive .number .achive_shuju .subtitle1 {
margin-top: 16px;
font-size: 18px;
font-family: Montserrat-Regular, Montserrat;
font-weight: 400;
color: #707070;
}
.timeline {
/*background: #f2f2f2 !important;*/
font-family: Montserrat, Montserrat;
}
.timeline1 {
display: flex;
}
.timeline-con {
width: 85%;
height: 665px;
background-color: white;
border-radius: 16px;
}
.timeline-time {
width: 15%;
}
.tech {
background-color: white;
}
.tech1 {
padding-bottom: 130px;
}
.techcon {
height: 350px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
margin-top: 20px;
}
.techcon > div {
width: 50%;
}
.techcon .text img {
margin-top: 80px;
margin-left: 65px;
}
.techcon .text .year {
margin-left: 65px;
margin-top: 40px;
font-size: 28px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 26px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 16px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon .tech-img img {
margin-top: 25px;
margin-left: 65px;
}
@media screen and (min-width: 1461px) and (max-width: 1720px) {
.techcon {
height: 300px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
}
.techcon .text img {
margin-top: 50px;
}
.techcon .tech-img img {
width: 550px;
margin-top: 35px;
margin-left: 65px;
}
}
@media screen and (max-width: 1459px) {
.techcon {
height: 250px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
}
.techcon .text img {
margin-top: 40px;
margin-left: 65px;
}
.techcon .text .year {
margin-left: 65px;
margin-top: 20px;
font-size: 22px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 26px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 12px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon .tech-img img {
width: 440px;
margin-top: 25px;
margin-left: 15px;
}
}
.box {
width: 100%;
display: flex;
}
.event_year {
width: 100px;
text-align: center;
float: left;
margin-top: 10px;
}
.event_year li {
height: 50px;
line-height: 50px;
border-left: 1px solid #d4d4d4;
font-size: 18px;
color: #828282;
cursor: pointer;
}
.event_year li.current {
border-left: 4px solid #0066ff;
color: #004bfa;
font-weight: 600;
}
.event_year li label {
width:140px;
}
.event_list li span {
width: 127px;
text-align: right;
display: block;
float: left;
margin-top: 10px;
}
.event_list li p {
width: 90%;
margin-left: 24px;
display: inline-block;
padding-left: 10px;
line-height: 25px;
_float: left;
font-size: 16px;
margin-bottom: 10px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 20px;
}
.event_list li p span {
width: 100%;
text-align: left;
padding: 0 15px 10px 15px;
background: #fff;
margin: 0;
margin-left: 30px;
}
.titlelist {
line-height: 24px;
color: #8c8c8c;
padding-bottom: 20px;
}
.titlelist dt {
font-weight: bold;
color: #666;
white-space: nowrap;
margin: 10px;
}
.titlelist dd {
padding-left: 13px;
}
.con_event_list {
width: 98%;
height: 91%;
overflow: auto;
margin: 30px 10px;
}
.event_list {
width: 98%;
background: url('__LOCAL__assets/images/greyline.png') 50px 0 repeat-y;
}
.event_list h3 {
margin: 0 0 0 35px;
font-size: 24px;
padding-left: 40px;
background: url('__LOCAL__assets/images/greyyuandian.png') 3px 3px no-repeat;
height: 38px;
font-size: 20px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 30px;
}
.backgroundimg {
background: url('__LOCAL__assets/images/yaundian.png') 3px 3px no-repeat !important;
}
</style>
<div class="breadcrumb-area">
<img log="img" src="__LOCAL__assets/images/about-banner.jpg" alt="Product" />
</div>
<!-- breadcrumb-area end --><!-- Service Area Start -->
<div class="service-area product-bg pd-80">
<div class="container">
<div class="row d-flex justify-content-center align-items-center about-bg">
<div class="col-lg-7 col-xl-7 col-md-12 col-sm-12 col-xs-12 p-0">
<div class="service-left img-none">
<img
log="img"
src="__LOCAL__assets/images/about-img01.jpg"
alt="Product"
/>
</div>
</div>
<div class="col-lg-5 col-xl-5 col-md-12 col-sm-12 col-xs-12">
<div class="service-right-content">
<h2 class="title">
品牌简介
<div class="eng-text">Brand Profile</div>
</h2>
<p class="para-1">
牛顿定律(NTONPOWER)是深圳市元创时代科技有限公司旗下的全球化科技品牌,成立于2015年,专注于智能充电领域的技术创新。公司以严谨的科学方法和系统性研究为导向,致力于在消费电子充电领域提供创新的技术解决方案。
</p>
</div>
</div>
</div>
</div>
<div class="container pd-64">
<div class="row d-flex justify-content-center align-items-center about-bg">
<div class="col-lg-5 col-xl-5 col-md-12 col-sm-12 col-xs-12">
<div class="service-right-content">
<h2 class="title">
品牌使命
<div class="eng-text">Brand Interpretation</div>
</h2>
<p class="para-1">
让生活电力十足。Power Up Your Life.<br />
以科学家严谨求真的精神和创新探索的态度,用智能充电科技释放生活的无限可能。<br />
● 安全:智能防护,守护充电瞬间<br />
● 实用:精准设计,满足多元场景 <br />
● 创新:突破技术边界,简化使用体验
</p>
</div>
</div>
<div class="col-lg-7 col-xl-7 col-md-12 col-sm-12 col-xs-12 p-0">
<div class="service-left text-xxl-end">
<img
log="img"
src="__LOCAL__assets/images/about-img02.jpg"
alt="Product"
/>
</div>
</div>
</div>
</div>
<div class="timeline Container">
<div class="swt-Container">
<div class="title">品牌里程</div>
<div class="timeline1 swt-Container">
<div class="box">
<div class="timeline-time">
<ul class="event_year">
<li class="current"><label for="2015-2017">2015-2017</label></li>
<li><label for="2018-2021">2018-2021</label></li>
<li><label for="2022">2022</label></li>
<li><label for="2023">2023</label></li>
<li><label for="2024">2024</label></li>
<li><label for="2025">2025</label></li>
</ul>
</div>
<div class="timeline-con">
<div class="con_event_list">
<ul class="event_list">
<div>
<h3 id="2015-2017" class="backgroundimg">创立初期(2015-2017年)</h3>
<li>
<p>
<span
>2015年,牛顿定律(NTONPOWER)成立,专注于智能生活充电产品(如:插线板、充电头)。</span
>
</p>
</li>
</div>
<div>
<h3 id="2018-2021">快速发展期(2018-2021年)</h3>
<li>
<p>
<span
>专注智能充电生态,创新覆盖多元应用场景。海外线上销售稳居行业前十,业务覆盖全球30多个国家   ,引领行业创新发展。</span
>
</p>
</li>
</div>
<div>
<h3 id="2022">2022</h3>
<li>
<p>
<span
>拓展国内线上电商渠道,加强本土市场品牌认知度。</span
>
</p>
</li>
</div>
<div>
<h3 id="2023">2023</h3>
<li>
<p>
<span
>插线板全球销量1000万台。</span
>
</p>
</li>
</div>
<div>
<h3 id="2024">2024</h3>
<li>
<p>
<span
>用户规模突破海内外用户3500万+、全球社交媒体粉丝60万+。</span
>
</p>
</li>
</div>
<div>
<h3 id="2025">2025</h3>
<li>
<p>
<span
>全面进军新消费平台、锂电池和充电宝赛道,构建便携能源生态系统。</span
>
</p>
</li>
</div>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tech Container">
<div class="swt-Container tech1">
<div class="title">所获荣誉</div>
<div class="techcon swt-Container">
<div class="text">
<img src="__LOCAL__assets/images/lichengbei.png" />
<div class="context">
<p>旅行便携类 海外TOP 10</p>
</div>
</div>
<div class="tech-img">
<img src="__LOCAL__assets/images/gywm2.jpg" />
</div>
</div>
<div class="techcon swt-Container">
<div class="text">
<img src="__LOCAL__assets/images/lichengbei.png" />
<div class="context">
<p>斩获红点奖、缪斯设计奖</p>
</div>
</div>
<div class="tech-img">
<img src="__LOCAL__assets/images/gywm1.jpg" />
</div>
</div>
</div>
</div>
</div>
<script
type="text/javascript"
src="https://code.jquery.com/jquery-3.6.0.min.js"
></script>
<script>
$(function () {
$('label').click(function () {
$('.event_year>li').removeClass('current')
$(this).parent('li').addClass('current')
var year = $(this).attr('for')
$('#' + year)
.parent()
.prevAll('div')
.slideUp(800)
$('#' + year)
.parent()
.slideDown(800)
.nextAll('div')
.slideDown(800)
$('#' + year)
.parent()
.css('color', 'red')
.nextAll('div')
.css('color', 'black')
//
$('h3').removeClass('backgroundimg')
$('#' + year).addClass('backgroundimg')
})
})
</script>
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script' }

View File

@@ -0,0 +1,453 @@
{include file='zh-cn/common/header' title='关于我们' keywords='关于我们'
description='关于我们'} {include file='zh-cn/common/nav' }
<!-- breadcrumb-area start -->
<style>
@media screen and (min-width: 1460px) {
.swt-Container {
width: 1620px;
}
}
.swt-Container {
margin-left: auto;
margin-right: auto;
}
.tech {
background-color: white;
}
.tech1 {
padding-bottom: 130px;
}
.tech .title {
height: 180px;
line-height: 180px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
}
.techcon {
height: 350px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
margin-top: 20px;
}
.techcon .text img {
margin-top: 80px;
margin-left: 65px;
}
.techcon .tech-img img {
margin-top: 25px;
margin-left: 65px;
width: 720px;
height: 300px;
border-radius: 8px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 16px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon > div {
width: 50%;
}
.achive {
height: 460px;
text-align: center;
background-color: white !important;
}
.achive .title,
.timeline .title,
.tech .title {
height: 180px;
line-height: 180px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
}
.timeline{
padding-bottom: 100px;
}
.achive .number {
height: 200px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
display: flex;
}
.achive .number .achive_shuju {
width: 25%;
}
.achive .number .achive_shuju .title1 {
margin-top: 40px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
}
.achive .number .achive_shuju .subtitle1 {
margin-top: 16px;
font-size: 18px;
font-family: Montserrat-Regular, Montserrat;
font-weight: 400;
color: #707070;
}
.timeline {
background: #f2f2f2 !important;
font-family: Montserrat, Montserrat;
}
.timeline1 {
display: flex;
}
.timeline-con {
width: 85%;
height: 665px;
background-color: white;
border-radius: 16px;
}
.timeline-time {
width: 15%;
}
.tech {
background-color: white;
}
.tech1 {
padding-bottom: 130px;
}
.techcon {
height: 350px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
margin-top: 20px;
}
.techcon > div {
width: 50%;
}
.techcon .text img {
margin-top: 80px;
margin-left: 65px;
}
.techcon .text .year {
margin-left: 65px;
margin-top: 40px;
font-size: 28px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 26px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 16px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon .tech-img img {
margin-top: 25px;
margin-left: 65px;
}
@media screen and (min-width: 1461px) and (max-width: 1720px) {
.techcon {
height: 300px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
}
.techcon .text img {
margin-top: 50px;
}
.techcon .tech-img img {
width: 550px;
margin-top: 35px;
margin-left: 65px;
}
}
@media screen and (max-width: 1459px) {
.techcon {
height: 250px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
}
.techcon .text img {
margin-top: 40px;
margin-left: 65px;
}
.techcon .text .year {
margin-left: 65px;
margin-top: 20px;
font-size: 22px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 26px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 12px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon .tech-img img {
width: 440px;
margin-top: 25px;
margin-left: 15px;
}
}
.box {
width: 100%;
display: flex;
}
.event_year {
width: 100px;
text-align: center;
float: left;
margin-top: 10px;
}
.event_year li {
height: 50px;
line-height: 50px;
border-left: 1px solid #d4d4d4;
font-size: 18px;
color: #828282;
cursor: pointer;
}
.event_year li.current {
border-left: 4px solid #0066ff;
color: #004bfa;
font-weight: 600;
}
.event_year li label {
width:140px;
}
.event_list li span {
width: 127px;
text-align: right;
display: block;
float: left;
margin-top: 10px;
}
.event_list li p {
width: 90%;
margin-left: 24px;
display: inline-block;
padding-left: 10px;
line-height: 25px;
_float: left;
font-size: 16px;
margin-bottom: 10px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 20px;
}
.event_list li p span {
width: 100%;
text-align: left;
padding: 0 15px 10px 15px;
background: #fff;
margin: 0;
margin-left: 30px;
}
.titlelist {
line-height: 24px;
color: #8c8c8c;
padding-bottom: 20px;
}
.titlelist dt {
font-weight: bold;
color: #666;
white-space: nowrap;
margin: 10px;
}
.titlelist dd {
padding-left: 13px;
}
.con_event_list {
width: 98%;
height: 91%;
overflow: auto;
margin: 30px 10px;
}
.event_list {
width: 98%;
background: url('__LOCAL__assets/images/greyline.png') 50px 0 repeat-y;
}
.event_list h3 {
margin: 0 0 0 35px;
font-size: 24px;
padding-left: 40px;
background: url('__LOCAL__assets/images/greyyuandian.png') 3px 3px no-repeat;
height: 38px;
font-size: 20px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 30px;
}
.backgroundimg {
background: url('__LOCAL__assets/images/yaundian.png') 3px 3px no-repeat !important;
}
</style>
<div class="breadcrumb-area">
<img log="img" src="__LOCAL__assets/images/about-banner.jpg" alt="Product" />
</div>
<!-- breadcrumb-area end --><!-- Service Area Start -->
<div class="service-area product-bg pd-80">
<div class="timeline Container">
<div class="swt-Container">
<div class="title">品牌里程</div>
<div class="timeline1 swt-Container">
<div class="box">
<div class="timeline-time">
<ul class="event_year">
<li class="current"><label for="2015-2017">2015-2017</label></li>
<li><label for="2018-2021">2018-2021</label></li>
<li><label for="2022">2022</label></li>
<li><label for="2023">2023</label></li>
<li><label for="2024">2024</label></li>
<li><label for="2025">2025</label></li>
</ul>
</div>
<div class="timeline-con">
<div class="con_event_list">
<ul class="event_list">
<div>
<h3 id="2015-2017" class="backgroundimg">创立初期(2015-2017年)</h3>
<li>
<p>
<span
>2015年,牛顿定律(NTONPOWER)成立,专注于智能生活充电产品(如:插线板、充电头)。</span
>
</p>
</li>
</div>
<div>
<h3 id="2018-2021">快速发展期(2018-2021年)</h3>
<li>
<p>
<span
>专注智能充电生态,创新覆盖多元应用场景。海外线上销售稳居行业前十,业务覆盖全球30多个国家   ,引领行业创新发展。</span
>
</p>
</li>
</div>
<div>
<h3 id="2022">2022</h3>
<li>
<p>
<span
>拓展国内线上电商渠道,加强本土市场品牌认知度。</span
>
</p>
</li>
</div>
<div>
<h3 id="2023">2023</h3>
<li>
<p>
<span
>插线板全球销量1000万台。</span
>
</p>
</li>
</div>
<div>
<h3 id="2024">2024</h3>
<li>
<p>
<span
>用户规模突破海内外用户3500万+、全球社交媒体粉丝60万+。</span
>
</p>
</li>
</div>
<div>
<h3 id="2025">2025</h3>
<li>
<p>
<span
>全面进军新消费平台、锂电池和充电宝赛道,构建便携能源生态系统。</span
>
</p>
</li>
</div>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script
type="text/javascript"
src="https://code.jquery.com/jquery-3.6.0.min.js"
></script>
<script>
$(function () {
$('label').click(function () {
$('.event_year>li').removeClass('current')
$(this).parent('li').addClass('current')
var year = $(this).attr('for')
$('#' + year)
.parent()
.prevAll('div')
.slideUp(800)
$('#' + year)
.parent()
.slideDown(800)
.nextAll('div')
.slideDown(800)
$('#' + year)
.parent()
.css('color', 'red')
.nextAll('div')
.css('color', 'black')
//
$('h3').removeClass('backgroundimg')
$('#' + year).addClass('backgroundimg')
})
})
</script>
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script' }

View File

@@ -0,0 +1,311 @@
{include file='zh-cn/common/header' title='关于我们' keywords='关于我们'
description='关于我们'} {include file='zh-cn/common/nav' }
<!-- breadcrumb-area start -->
<style>
@media screen and (min-width: 1460px) {
.swt-Container {
width: 1620px;
}
}
.swt-Container {
margin-left: auto;
margin-right: auto;
}
.tech {
background-color: white;
}
.tech1 {
padding-bottom: 130px;
}
.tech .title {
height: 180px;
line-height: 180px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
}
.techcon {
height: 350px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
margin-top: 20px;
}
.techcon .text img {
margin-top: 80px;
margin-left: 65px;
}
.techcon .tech-img img {
margin-top: 25px;
margin-left: 65px;
width: 720px;
height: 300px;
border-radius: 8px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 16px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon > div {
width: 50%;
}
.achive {
height: 460px;
text-align: center;
background-color: white !important;
}
.achive .title,
.timeline .title,
.tech .title {
height: 180px;
line-height: 180px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
}
.timeline{
padding-bottom: 100px;
}
.achive .number {
height: 200px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
text-align: center;
display: flex;
}
.achive .number .achive_shuju {
width: 25%;
}
.achive .number .achive_shuju .title1 {
margin-top: 40px;
font-size: 32px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
}
.achive .number .achive_shuju .subtitle1 {
margin-top: 16px;
font-size: 18px;
font-family: Montserrat-Regular, Montserrat;
font-weight: 400;
color: #707070;
}
.timeline {
background: #f2f2f2 !important;
font-family: Montserrat, Montserrat;
}
.timeline1 {
display: flex;
}
.timeline-con {
width: 85%;
height: 665px;
background-color: white;
border-radius: 16px;
}
.timeline-time {
width: 15%;
}
.tech {
background-color: white;
}
.tech1 {
padding-bottom: 130px;
}
.techcon {
height: 350px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
margin-top: 20px;
}
.techcon > div {
width: 50%;
}
.techcon .text img {
margin-top: 80px;
margin-left: 65px;
}
.techcon .text .year {
margin-left: 65px;
margin-top: 40px;
font-size: 28px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 26px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 16px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon .tech-img img {
margin-top: 25px;
margin-left: 65px;
}
@media screen and (min-width: 1461px) and (max-width: 1720px) {
.techcon {
height: 300px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
}
.techcon .text img {
margin-top: 50px;
}
.techcon .tech-img img {
width: 550px;
margin-top: 35px;
margin-left: 65px;
}
}
@media screen and (max-width: 1459px) {
.techcon {
height: 250px;
background-color: #f2f2f2;
display: flex;
border-radius: 16px;
}
.techcon .text img {
margin-top: 40px;
margin-left: 65px;
}
.techcon .text .year {
margin-left: 65px;
margin-top: 20px;
font-size: 22px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
color: #000000;
line-height: 26px;
}
.techcon .text .context {
margin-left: 65px;
width: 80%;
font-size: 12px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
color: #707070;
line-height: 26px;
margin-top: 14px;
}
.techcon .tech-img img {
width: 440px;
margin-top: 25px;
margin-left: 15px;
}
}
</style>
<div class="breadcrumb-area">
<img log="img" src="__LOCAL__assets/images/about-banner.jpg" alt="Product" />
</div>
<!-- breadcrumb-area end --><!-- Service Area Start -->
<div class="service-area product-bg pd-80">
<div class="container">
<div class="row d-flex justify-content-center align-items-center about-bg">
<div class="col-lg-7 col-xl-7 col-md-12 col-sm-12 col-xs-12 p-0">
<div class="service-left img-none">
<img
log="img"
src="__LOCAL__assets/images/about-img01.jpg"
alt="Product"
/>
</div>
</div>
<div class="col-lg-5 col-xl-5 col-md-12 col-sm-12 col-xs-12">
<div class="service-right-content">
<h2 class="title">
品牌简介
<div class="eng-text">Brand Profile</div>
</h2>
<p class="para-1">
牛顿定律(NTONPOWER)是深圳市元创时代科技有限公司旗下的全球化科技品牌,成立于2015年,专注于智能充电领域的技术创新。公司以严谨的科学方法和系统性研究为导向,致力于在消费电子充电领域提供创新的技术解决方案。
</p>
</div>
</div>
</div>
</div>
<div class="container pd-64">
<div class="row d-flex justify-content-center align-items-center about-bg">
<div class="col-lg-5 col-xl-5 col-md-12 col-sm-12 col-xs-12">
<div class="service-right-content">
<h2 class="title">
品牌使命
<div class="eng-text">Brand Interpretation</div>
</h2>
<p class="para-1">
让生活电力十足。Power Up Your Life.<br />
以科学家严谨求真的精神和创新探索的态度,用智能充电科技释放生活的无限可能。<br />
● 安全:智能防护,守护充电瞬间<br />
● 实用:精准设计,满足多元场景 <br />
● 创新:突破技术边界,简化使用体验
</p>
</div>
</div>
<div class="col-lg-7 col-xl-7 col-md-12 col-sm-12 col-xs-12 p-0">
<div class="service-left text-xxl-end">
<img
log="img"
src="__LOCAL__assets/images/about-img02.jpg"
alt="Product"
/>
</div>
</div>
</div>
</div>
<div class="tech Container">
<div class="swt-Container tech1">
<div class="title">品牌活动</div>
<div class="techcon swt-Container">
<div class="text">
<img src="__LOCAL__assets/images/lichengbei.png" />
<div class="context">
<p>旅行便携类 海外TOP 10</p>
</div>
</div>
<div class="tech-img">
<img src="__LOCAL__assets/images/gywm2.jpg" />
</div>
</div>
<div class="techcon swt-Container">
<div class="text">
<img src="__LOCAL__assets/images/lichengbei.png" />
<div class="context">
<p>斩获红点奖、缪斯设计奖</p>
</div>
</div>
<div class="tech-img">
<img src="__LOCAL__assets/images/gywm1.jpg" />
</div>
</div>
</div>
</div>
</div>
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script' }

View File

@@ -0,0 +1,65 @@
<!-- Footer Area Start -->
<div class="footer-area">
<div class="footer-container">
<div class="footer-top">
<div class="container">
<div class="row">
<!-- Start single blog -->
{foreach $nav_footer_info as $nav}
<div class="col-md-6 col-sm-4 col-lg-1 mb-md-30px mb-lm-30px">
<div class="single-wedge">
<a class="single-link" log="a" href="{$nav.url}"><h4 class="footer-herading">{$nav.name}</h4></a>
{if isset($nav.children)}
<div class="footer-links">
<div class="footer-row">
<ul class="align-items-center">
{foreach $nav.children as $nav1}
<li class="li"><a log="a" class="single-link" log="a" href="{$nav1.url}">{$nav1.name}</a></li>
{/foreach}
</ul>
</div>
</div>
{/if}
</div>
<div></div>
</div>
{/foreach}
<div class="col-md-6 col-sm-6 col-lg-6 mb-md-30px mb-lm-30px md-blank"></div>
<!-- End single blog --><!-- Start single blog -->
<div class="col-md-3 col-lg-3 col-md-6 col-sm-6 pl-120px text-tel">
<div class="single-wedge">
<h4 class="footer-herading">全国统一服务热线</h4>
<div class="footer-links">
<!-- News letter area -->
<p class="phone m-0">
<span><a log="a" href="tel:{$footer_info.contact.value}">{$footer_info.contact.value}</a> </span>
</p>
<!-- News letter area End -->
</div>
</div>
</div>
<!-- End single blog -->
</div>
</div>
</div>
<div class="footer-bottom">
<div class="container">
<div class="line-footer-top">
<div class="row flex-md-row-reverse align-items-center">
<div class="col-md-12 text-center text-md-start">
<p class="copy-text">
{$footer_info.copyright.value}(<a
log="a"
rel="nofollow"
href="https://beian.miit.gov.cn/#/Integrated/index"
target="_blank"
>{$footer_info.beian1.value}</a
>)
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="zxx">
<head>
<meta charset="UTF-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="robots" content="index, follow" />
<title>{$meta['meta_title']??''}</title>
<meta name="keywords" content="{$meta['meta_keyword']??''}" />
<meta name="description" content="{$meta['meta_description']??''}" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
{if false == $is_dev}
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
{/if}
<!-- Add site Favicon -->
<!-- <link rel="shortcut icon" href="__LOCAL__assets/images/favicon/favicon.ico" type="image/png" />-->
<link rel="icon" href="__LOCAL__assets/images/logo.svg" />
<link rel="stylesheet" href="__LOCAL__assets/css/vendor/vendor.min.css" />
<link rel="stylesheet" href="__LOCAL__assets/css/plugins/plugins.min.css" />
<link rel="stylesheet" href="__LOCAL__assets/css/style.min.css" />
<link rel="stylesheet" href="__LOCAL__assets/css/jquery.bxslider.css" />
</head>
<body>

View File

@@ -0,0 +1,146 @@
<!-- Header Area Start -->
<header>
<div class="header-main sticky-nav">
<div class="container position-relative">
<div class="row">
<div class="col-auto align-self-center">
<div class="header-logo">
<a log="a" href="{:url('/')}"><img log="img" src="__LOCAL__assets/images/logo/logo.png" alt="Site Logo" /></a>
</div>
</div>
<div class="col align-self-center d-none d-lg-block">
<div class="main-menu">
<ul>
{foreach $nav_info as $item}
<li class="dropdown position-static">
{if isset($item['children'])}
<a log="a" href="{$item.url}">{$item.name} <i class="fa fa-angle-down"></i></a>
<ul class="mega-menu d-block">
<li class="d-flex">
{foreach $item['children'] as $it}
<span><a log="a" href="{$it.url}"><img log="img" src="__STATIC__{$it.icon}" /></a></span>
{if isset($it['children'])}
<ul class="d-block">
<li class="title"><a log="a" href="{$it.url}">{$it.name}</a></li>
{foreach $it['children'] as $it1}
<li><a log="a" href="{$it1.url}">{$it1.name}</a></li>
{/foreach}
</ul>
{else}
<ul class="d-block">
<li class="title"><a log="a" href="{$it.url}">{$it.name}</a></li>
</ul>
{/if}
{/foreach}
</li>
</ul>
{else}
<a log="a" href="{$item.url}">{$item.name}</a>
{/if}
</li>
{/foreach}
</ul>
</div>
</div>
<!-- Header Action Start -->
<div class="col col-lg-auto align-self-center pl-0">
<div class="header-actions">
<!-- Single Wedge Start -->
<a log="a" href="#" class="header-action-btn" data-bs-toggle="modal" data-bs-target="#searchActive"
><i class="pe-7s-search"></i>
</a>
<div class="col align-self-center d-none d-lg-block">
<div class="main-menu">
<ul>
<li class="dropdown">
<a log="a" href="{$multi_lang['cn_web']['value']}">中文 <i class="fa fa-angle-down"></i></a>
<ul class="sub-menu">
<li><a log="a" href="https://www.ntonpower.com">EN</a></li>
</ul>
</li>
</ul>
</div>
</div>
<!-- Single Wedge End -->
<a log="a" href="#offcanvas-mobile-menu" class="header-action-btn header-action-btn-menu offcanvas-toggle d-lg-none"
><i class="pe-7s-menu"></i
></a>
<!-- Header Action End -->
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Header Area End -->
<!-- OffCanvas Cart End --><!-- OffCanvas Menu Start -->
<div id="offcanvas-mobile-menu" class="offcanvas offcanvas-mobile-menu">
<button class="offcanvas-close"></button>
<div class="inner customScroll">
<div class="offcanvas-menu mb-4">
<ul>
<li>
<a href="#"><span class="menu-text">中文</span></a>
<ul class="sub-menu">
<li>
<a log="a" href="https://www.ntonpower.com"><span class="menu-text">EN</span></a>
</li>
</ul>
</li>
{foreach $nav_info as $item}
<li>
<a log="a" href="{$item.url}"><span class="menu-text">{$item.name}</span></a>
{if isset($item['children'])}
<ul class="sub-menu">
{foreach $item['children'] as $it1}
<li>
<a href="#"><span class="menu-text">{$it1.name}</span></a>
<ul class="sub-menu">
{if isset($it1['children'])}
{foreach $it1['children'] as $it2}
<li><a href="{$it2.url}">{$it2.name}</a></li>
{/foreach}
{else}
<li><a href="{$it1.url}">{$it1.name}</a></li>
{/if}
</ul>
</li>
{/foreach}
</ul>
{/if}
</li>
{/foreach}
</ul>
</div>
<!-- OffCanvas Menu End -->
<div class="payment-img">
<a log="a" href="#"><img log="img" src="assets/images/zhihu.png" alt="" /></a>
<a log="a" href="#"><img log="img" src="assets/images/weibo.png" alt="" /></a>
<a log="a" href="#"><img log="img" src="assets/images/facebook.png" alt="" /></a>
<a log="a" href="#"><img log="img" src="assets/images/Youtube.png" alt="" /></a>
</div>
</div>
</div>
<!-- OffCanvas Menu End -->
<!-- Banner Area End -->
<!-- Search Modal Start -->
<div class="modal popup-search-style" id="searchActive">
<button type="button" class="close-btn" data-bs-dismiss="modal"><span aria-hidden="true">&times;</span></button>
<div class="modal-overlay">
<div class="modal-dialog p-0" role="document">
<div class="modal-content">
<div class="modal-body">
<h2>搜索您的产品</h2>
<form class="navbar-form position-relative" role="search" action="{:url('index/goods/index')}">
<div class="form-group">
<input type="text" class="form-control" name="model_number" placeholder="请输入产品型号..." />
</div>
<button type="submit" class="submit-btn"><i class="pe-7s-search"></i></button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Search Modal End -->

View File

@@ -0,0 +1,21 @@
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/Swiper/6.3.5/swiper-bundle.min.js"></script>
<script src="__LOCAL__assets/js/vendor/vendor.min.js"></script>
<script src="__LOCAL__assets/js/jquery.bxslider.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.setmspace').bxSlider({
slideWidth: 1920,
infiniteLoop: false,
hideControlOnEnd: true,
slideMargin: 10,
auto: true
})
})
</script>
<script type="text/javascript" src="__LOCAL__assets/js/action.js"></script>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="__LOCAL__assets/js/plugins/plugins.min.js"></script>
<!-- Main Js -->
<script src="__LOCAL__assets/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,31 @@
{include file='zh-cn/common/header' title='联系我们' keywords='联系我们' description='联系我们'} {include file='zh-cn/common/nav'}
<!-- breadcrumb-area start -->
<div class="breadcrumb-area">
<img log="img" src="__LOCAL__assets/images/download-img.jpg" alt="Product" />
<div class="container">
<div class="breadcrumb-title">和我们谈谈</div>
</div>
</div>
<!-- breadcrumb-area end --><!-- Contact Area Start -->
<div class="contact-area pt-100px pb-100px product-bg">
<div class="container">
<div class="contact-wrapper">
<div class="row">
<div class="col-lg-12 col-xl-12 col-md-12 col-sm-12 col-xs-12">
<div class="contact-info">
<div class="single-contact">
<div class="icon-box"><img log="img" src="__LOCAL__assets/images/tel.png" /></div>
<div class="info-box">
<h5 class="title">400-6696-298</h5>
<b>全国统一服务热线</b>
<p>周一至周五:上午9:00 —下午6:00</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Contact Area End -->
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script'}

View File

@@ -0,0 +1,93 @@
{include file='zh-cn/common/header' title='服务与支持' keywords='服务与支持' description='服务与支持'} {include file='zh-cn/common/nav' }
<!-- breadcrumb-area start -->
<div class="breadcrumb-area">
<img log="img" src="__LOCAL__assets/images/download-bg.jpg" alt="Product" />
<div class="container">
<div class="breadcrumb-title">服务与支持</div>
</div>
<div class="container newsletter-area">
<div class="news-letter-form">
<div id="mc_embed_signup" class="subscribe-form">
<form
id="mc-embedded-subscribe-form"
class="validate"
novalidate=""
name="mc-embedded-subscribe-form"
method="get"
action="{:url('index/download/index')}"
>
<div id="mc_embed_signup_scroll" class="mc-form">
<input class="email" type="text" required="" placeholder="输入型号搜索" name="keyword" value="" />
<div class="clear">
<button id="mc-embedded-subscribe" class="button" type="submit">
<i class="pe-7s-search f-20"></i>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- product details description area start -->
<div class="description-review-area product-bg pb-100px" data-aos="fade-up" data-aos-delay="200">
<div class="container">
<div class="description-review-wrapper pt-xxl-5">
<div class="description-review-topbar nav">
{if count($resource.type) > 0} {foreach $resource.type as $type}
<a log="a"
class="{if ($type.id == Request()->param('file_type_id')) || (Request()->param('file_type_id') == '' && $type.id == 1)}active{else}{/if}"
href="{:url('index/download/index',['file_type_id'=>$type.id])}"
>{$type.name}</a
>
{/foreach} {/if}
</div>
<div class="tab-content">
<div id="down-details{$type.id}" class="tab-pane active">
<div class="container">
{if count($resource.list) > 0} {foreach $resource.list as $list}
<div class="shop-list-wrapper description-review-bottom">
<div class="row">
<div class="col-lg-12 col-xl-4 col-md-12 col-sm-12 col-xs-12">
<div class="updoanlod">
<div class="thumb">
<a log="a" href="__STATIC__{$list.getSoftBtn.0.url}" class="image"
><img log="img" src="__STATIC__{$list.image}" alt="Product"
/></a>
</div>
</div>
</div>
<div class="col-lg-12 col-xl-8 col-md-12 col-sm-12 col-xs-12">
<div class="content-desc-wrap">
<div class="content">
<h5 class="title"><a log="a" href="__STATIC__{$list.getSoftBtn.0.url}">{$list.name}</a></h5>
{$list.introduce | raw}
</div>
<div class="download-text">
<b>适合型号:</b>
<p>{$list.support}</p>
<b>支持系统:</b>
<p>{$list.os}</p>
</div>
<a
log="a"
class="btn btn-primary mt-4"
data-aos="fade-up"
data-aos-delay="200"
href="__STATIC__{$list.getSoftBtn.0.url}"
>
{$list.getSoftBtn.0.btn_tips}
</a>
</div>
</div>
</div>
</div>
{/foreach} {/if}
</div>
</div>
</div>
</div>
</div>
</div>
<!-- breadcrumb-area end -->
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script' }

View File

@@ -0,0 +1,90 @@
{include file='zh-cn/common/header' title='商品详情' keywords='商品详情' description='商品详情'} {include file='zh-cn/common/nav' }
<!-- Search Modal End -->
<!-- OffCanvas Menu End --><!-- breadcrumb-area start -->
<div class="container">
<div class="row align-items-center justify-content-center">
<div class="col-12">
<!-- breadcrumb-list start -->
<ul class="breadcrumb-list">
<li class="breadcrumb-item"><a log="a" href="{:url('index/index/index')}">首页</a></li>
{foreach $resource.bread as $key => $bread}
<span>></span>
<li class="breadcrumb-item"><a log="a" href="{:url('index/goods/index?'.$bread.qs)}">{$bread.name}</a></li>
{/foreach}
</ul>
<!-- breadcrumb-list end -->
</div>
</div>
</div>
<!-- breadcrumb-area end --><!-- Goods Details Area Start -->
<div class="product-details-area pb-100px">
<div class="container">
<div class="row">
<div class="col-lg-5 col-sm-12 col-xs-12 mb-lm-30px mb-md-30px mb-sm-30px">
<!-- Swiper -->
<div class="swiper-container zoom-top">
<div class="single-product-slider-wrapper swiper-wrapper">
{foreach $resource.goodsInfo.images as $img}
<div class="swiper-slide zoom-image-hover">
<img log="img" class="img-responsive m-auto" src="{$img.image}" alt="" />
</div>
{/foreach}
</div>
</div>
<div class="swiper-container zoom-thumbs mt-20px">
<div class="swiper-wrapper">
{foreach $resource.goodsInfo.images as $img}
<div class="swiper-slide">
<img log="img" class="img-responsive m-auto" src="{$img.image}" alt="" />
</div>
{/foreach}
</div>
</div>
</div>
<div class="col-lg-7 col-sm-12 col-xs-12" data-aos="fade-up" data-aos-delay="200">
<div class="product-details-content quickview-content ml-25px">
<h2>{$resource.goodsInfo.name}</h2>
<p class="mb-0">{$resource.goodsInfo.description}</p>
<div class="line-shape-top"></div>
<div class="pro-details-categories-info pro-details-same-style">
<ul>
<li><span>型号:</span>{$resource.goodsInfo.model_number}</li>
<li><span>类型:</span>{$resource.goodsInfo.category_name}</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- product details description area start -->
<div class="description-review-area pb-100px" data-aos="fade-up" data-aos-delay="200">
<div class="container">
<div class="description-review-wrapper">
<div class="description-review-topbar nav">
<a log="a" class="active" data-bs-toggle="tab" href="#des-details1">图文详情描述</a>
<a log="a" data-bs-toggle="tab" href="#des-details2">规格参数</a>
</div>
<div class="tab-content description-review-bottom">
<div id="des-details1" class="tab-pane active">
<div class="product-description-wrapper">{$resource.goodsInfo.details | raw}</div>
</div>
<div id="des-details2" class="tab-pane">
<div class="product-anotherinfo-wrapper text-start">
<div class="row">
{if count($resource.goodsInfo.goods_attribute) > 0} {foreach $resource.goodsInfo.goods_attribute as $attr}
<div class="col-lg-12 col-xl-12 col-md-12 col-sm-12 col-xs-12">
<ul>
<li><span>{$attr.attribute_name}</span><em>{$attr.value}</em></li>
</ul>
</div>
{/foreach} {/if}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- product details description area end -->
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script'}

View File

@@ -0,0 +1,144 @@
{include file='zh-cn/common/header' title='商品列表' keywords='商品列表' description='商品列表'} {include file='zh-cn/common/nav' }
<div class="cation-bg">
<div class="cation-content container">
<!-- 可以删除 -->
<div class="cation-middle">
<dl class="cation-list">
<dt>一级分类</dt>
<dd>
{foreach $resource.category as $cate}
<a
log="a"
href="{:url('index/goods/index',['cate1' => $cate.id])}"
rel="{$cate.name}"
name="mode"
class="default {if $resource['checked1'] == $cate.id} on {else} {/if}"
>{$cate.name}</a
>
{/foreach}
</dd>
</dl>
<dl class="cation-list">
<dt>二级分类</dt>
<dd>
{if !empty($resource.category_two)} {foreach $resource.category_two as $cate2}
<a
log="a"
href="{:url($resource['url1'],['cate2' => $cate2.id])}"
rel="{$cate2.name}"
name="theme"
class="default {if $resource['checked2'] == $cate2.id} on {else} {/if}"
>{$cate2.name}</a
>
{/foreach} {else}
<a log="a" class="default"></a>
{/if}
</dd>
</dl>
<dl class="cation-list">
<dt>三级分类</dt>
<dd>
{if !empty($resource.category_three)} {foreach $resource.category_three as $cate3}
<a
log="a"
href="{:url($resource['url2'],['cate3' => $cate3.id])}"
rel="{$cate3.name}"
name="theme"
class="default {if $resource['checked3'] == $cate3.id} on {else} {/if}"
>{$cate3.name}</a
>
{/foreach} {else}
<a log="a" class="default"></a>
{/if}
</dd>
</dl>
</div>
<div>
<dl class="cation-all">
<dd>
<a
log="a"
href="{:url($resource['url'],['is_all'=>1])}"
rel="全部"
name="system"
class="default{if $resource['checked4'] == 'is_all'} on {else} {/if}"
>全部</a
>
<a
log="a"
href="{:url($resource['url'],['is_recommend'=> 0])}"
rel="推荐"
name="system"
class="default{if $resource['checked4'] == 'is_recommend'} on {else} {/if}"
>推荐</a
>
<a
log="a"
href="{:url($resource['url'],['is_hot'=> 0])}"
rel="热门"
name="system"
class="default{if $resource['checked4'] == 'is_hot'} on {else} {/if}"
>热门</a
>
<a
log="a"
href="{:url($resource['url'],['is_new'=> 0])}"
rel="最新"
name="system"
class="default{if $resource['checked4'] == 'is_new'} on {else} {/if}"
>最新</a
>
</dd>
</dl>
</div>
</div>
</div>
<!-- list S-->
<div class="product-bg">
<div class="container">
<div class="row">
<div class="col">
<div class="tab-conten">
<div class="tab-pane fade show active" id="tab-jewelry">
<div class="row">
{if count($resource.list.data) > 0} {foreach $resource.list.data as $goods}
<div class="col-lg-3 col-xl-3 col-md-6 col-sm-6 col-xs-6 mb-30px">
<!-- Single Prodect -->
<div class="product">
<div class="thumb">
<a log="a" href="{:url('index/goods/detail',['id'=>$goods.id])}" class="image"
><img log="img" src="__STATIC__{$goods.main_img}" alt="Product"
/></a>
</div>
<div class="content">
<h5 class="title"><a log="a" href="{:url('index/goods/detail',['id'=>$goods.id])}">{$goods.name}</a></h5>
<span>{$goods.model_number}</span>
</div>
<a log="a" href="{:url('index/goods/detail',['id'=>$goods.id])}"
><button title="Add To Cart" class="add-to-cart">了解详情</button></a
>
</div>
</div>
{/foreach} {else}
<div class="container">
<div class="list-bg-non">
<!-- Single Prodect -->
<p class="list-non">暂无商品</p>
</div>
</div>
{/if}
</div>
</div>
</div>
</div>
<!-- Pagination Area Start -->
<div class="pro-pagination-style text-center mb-5" data-aos="fade-up" data-aos-delay="200">
<div class="pages">{$resource.page | raw}</div>
</div>
<!-- Pagination Area End -->
</div>
<!-- Tab Content Area End -->
</div>
</div>
<!-- list e-->
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script' }

View File

@@ -0,0 +1,112 @@
{include file='zh-cn/common/header' title='首页' keywords='首页' description='首页'} {include file='zh-cn/common/nav' }
<!-- Hero/Intro Slider Start -->
<div class="setmspace">
{foreach $banner_list as $item}
<div class="slide"><a log="a" href="{$item.url}"><img log="img" src="__STATIC__{$item.image}" /></a></div>
{/foreach}
</div>
<!-- Banner Area End --><!-- Goods Area Start -->
<div class="product-area">
<div class="container">
<div class="cate-list">
<ul>
{foreach $nav_info as $item} {if isset($item.children)} {if $item.id === 1} {foreach $item.children as $it1}
<li>
<a log="a" href="{$it1.url}"
><img log="img" src="__STATIC__{$it1.icon}" alt="" />
<p>{$it1.name}</p>
</a>
</li>
{/foreach} {/if} {/if} {/foreach}
</ul>
</div>
<!-- Section Title & Tab Start -->
<div class="row">
<!-- Section Title Start -->
<!-- Section Title End -->
<!-- Goods Area End --><!-- Testimonial Area Start -->
<div class="banner-area-2 mt-60px">
<div class="container">
<div class="row m-0">
<div class="col-md-7 p-0">
<div class="single-banner nth-child-1">
<img log="img" src="__STATIC__{$f_image['goods_one']['image']??''}" alt="" />
<div class="banner-content nth-child-1">
<span class="title">{$f_image['goods_one']['value']??"" | raw }</span>
</div>
</div>
</div>
<div class="col-md-5 p-0">
<div class="single-banner nth-child-2 mb-lm-30px mt-lm-30px">
<img log="img" src="__STATIC__{$f_image['goods_two']['image']??''}" alt="" />
<div class="banner-content nth-child-2">
<span class="title">{$f_image['goods_two']['value']??"" | raw }</span>
</div>
</div>
<div class="single-banner nth-child-3">
<img log="img" src="__STATIC__{$f_image['goods_three']['image']??''}" alt="" />
<div class="banner-content nth-child-3">
<span class="title">{$f_image['goods_three']['value']??"" | raw }</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Deal Area Start -->
<div class="deal-area mt-60px">
<div class="deal-inner position-relative">
<img log="img" src="__STATIC__{$f_image['goods_four']['image']??''}" alt="" />
<div class="deal-wrapper">
<p>SETMSPACE</p>
<h3 class="title">
{$f_image['goods_four']['value']??"" | raw }
</h3>
</div>
</div>
</div>
<!-- Section Title & Tab End -->
<div class="product-bg">
<div class="container">
<div class="row">
<div class="col">
<div class="tab-content mt-60px">
<div class="section-title text-center mb-60px">
<h2 class="title">新品推荐</h2>
</div>
<!-- 1st tab start -->
<div class="tab-pane fade show active" id="tab-jewelry">
<div class="row">
{foreach $goods_is_new as $good}
<div class="col-lg-4 col-xl-4 col-md-6 col-sm-6 col-xs-6 mb-30px">
<!-- Single Prodect -->
<div class="product">
<div class="thumb">
<a log="a" href="{:url('index/goods/detail?id='.$good.id)}" class="image"
><img log="img" src="__STATIC__{$good.main_img}" alt="Product"
/></a>
</div>
<div class="content">
<h5 class="title"><a log="a" href="{:url('index/goods/detail?id='.$good.id)}">{$good.name}</a></h5>
<span>{$good.model_number}</span>
</div>
<a log="a" href="{:url('index/goods/detail?id='.$good.id)}">
<button title="Add To Cart" class="add-to-cart">了解详情</button>
</a>
</div>
</div>
{/foreach}
</div>
</div>
<!-- 1st tab end -->
</div>
</div>
</div>
</div>
</div>
{include file='zh-cn/common/footer'} {include file='zh-cn/common/script' }