Merge branch 'dev' into cssupdate
This commit is contained in:
@@ -45,7 +45,13 @@ class DataMigration extends Command
|
||||
// $this->migrateProductAttr();
|
||||
|
||||
// 迁移产品
|
||||
$this->migrateProduct();
|
||||
// $this->migrateProduct();
|
||||
|
||||
// 迁移产品关联产品数据
|
||||
// $this->migrateProductRelated();
|
||||
|
||||
// 迁移产品购买链接
|
||||
// $this->migrateProductPurchaseLinks();
|
||||
|
||||
// 迁移文章
|
||||
// $this->migrateArticle([
|
||||
@@ -168,18 +174,25 @@ class DataMigration extends Command
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$tree = array_to_tree($category, 0, 'pid', 1);
|
||||
// 处理数据
|
||||
$this->handlerProductCategory(array_to_tree($category, 0, 'pid', 1), $tco_category_map);
|
||||
$this->handlerProductCategory($tree, $tco_category_map);
|
||||
}
|
||||
private function handlerProductCategory($category, $map) {
|
||||
private function handlerProductCategory($category, $map, $path = []) {
|
||||
foreach ($category as $val) {
|
||||
$key = sprintf("%s_%s", $val['id'], $val['country_code']);
|
||||
if ($val['pid'] == 0) {
|
||||
$path = [];
|
||||
} else {
|
||||
if (!in_array($val['pid'], $path)) $path[] = $val['pid'];
|
||||
}
|
||||
$item = [
|
||||
'id' => $val['id'],
|
||||
'language_id' => $val['country_code'] == 'ZH' ? 1 : 2,
|
||||
'unique_id' => uniqid('PRO_CATE_'),
|
||||
'pid' => $val['pid'],
|
||||
'name' => $val['name'],
|
||||
'path' => implode(',', $path),
|
||||
'icon' => $val['icon'],
|
||||
'desc' => $val['description'],
|
||||
'related_tco_category' => isset($map[$key]) ? implode(',', $map[$key]) : '',
|
||||
@@ -189,7 +202,7 @@ class DataMigration extends Command
|
||||
];
|
||||
Db::name('product_category')->insert($item);
|
||||
if (isset($val['children'])) {
|
||||
$this->handlerProductCategory($val['children'], $map);
|
||||
$this->handlerProductCategory($val['children'], $map, $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,15 +258,27 @@ class DataMigration extends Command
|
||||
|
||||
$old_db = Db::connect('old');
|
||||
|
||||
$success_map = [];
|
||||
$success_arr = include_once(runtime_path() . 'product_success.php');
|
||||
foreach ($success_arr as $so) {
|
||||
$success_map['p_' . $so['cod_product_id']] = $so;
|
||||
}
|
||||
|
||||
$products = $old_db->name('product')
|
||||
->where('id', '=', 128)
|
||||
->where('country_code', 'in', ['ZH', 'US'])
|
||||
->where('id', '>', 0)
|
||||
->order(['id' => 'asc'])
|
||||
->cursor();
|
||||
|
||||
$total = 0;
|
||||
$uploadMgr = new UploadMannager();
|
||||
foreach ($products as $v)
|
||||
{
|
||||
$start = microtime(true);
|
||||
if (isset($success_map['p_' . $v['id']])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
// 处理封面图片
|
||||
@@ -262,8 +287,10 @@ class DataMigration extends Command
|
||||
if ($image_ret['code'] == 0) {
|
||||
$image = $image_ret['data']['path'];
|
||||
} else {
|
||||
if ($image_ret['code'] != 400) {
|
||||
$image = $image_ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
// 处理视频
|
||||
$video = '';
|
||||
@@ -271,8 +298,10 @@ class DataMigration extends Command
|
||||
if ($video_ret['code'] == 0) {
|
||||
$video = $video_ret['data']['path'];
|
||||
} else {
|
||||
if ($video_ret['code'] != 400) {
|
||||
$video = $video_ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
// 处理详情中图片
|
||||
$content = preg_replace_callback('/<img[^>]*src=[\'"]([^\'"]*?)[\'"][^>]*>/is', function($matches) use ($uploadMgr) {
|
||||
@@ -287,11 +316,11 @@ class DataMigration extends Command
|
||||
return '<img src="解析替换图片失败,请手动处理" alt="" />';
|
||||
}
|
||||
return '<img src="' . $file_path . '" alt="" />';
|
||||
}, $v['ld_md_content']);
|
||||
}, $v['ld_md_content']??'');
|
||||
|
||||
$item = [
|
||||
'language_id' => $v['country_code'] == 'ZH' ? 1 : 2,
|
||||
'category_id' => '',
|
||||
'category_id' => $v['cid'],
|
||||
'spu' => $v['brand_id'],
|
||||
'name' => $v['name'],
|
||||
'short_name' => $v['shortname'],
|
||||
@@ -302,21 +331,22 @@ class DataMigration extends Command
|
||||
'is_sale' => $v['is_onsale'],
|
||||
'is_new' => $v['isnew'],
|
||||
'is_hot' => $v['ishot'],
|
||||
'is_show' => $v['is_show'],
|
||||
'sort' => $v['sort'],
|
||||
'is_show' => $v['is_show'] == 0 ? 1 : 0,
|
||||
'sort' => $v['sort'] == 9999 ? 0 : $v['sort'],
|
||||
'detail' => $content,
|
||||
'status' => $v['stat'] == -1 ? -1 : 1,
|
||||
'seo_title' => $v['seo_title'],
|
||||
'seo_keywords' => $v['seo_keyword'],
|
||||
'seo_desc' => $v['seo_description'],
|
||||
'created_at' => date('Y-m-d H:i:s', $v['createtime']),
|
||||
'updated_at' => date('Y-m-d H:i:s', $v['updatetime']),
|
||||
'updated_at' => $v['updatetime'] == 0 ? date('Y-m-d H:i:s', $v['createtime']) : date('Y-m-d H:i:s', $v['updatetime']),
|
||||
'deleted_at' => $v['stat'] == -1 ? date('Y-m-d H:i:s') : null,
|
||||
];
|
||||
// 保存产品数据
|
||||
$id = Db::name('product')->insertGetId($item);
|
||||
|
||||
// 保存产品参数数据
|
||||
if (!empty($v['product_view'])) {
|
||||
$prarms = [];
|
||||
$views = unserialize($v['product_view']);
|
||||
foreach ($views as $p) {
|
||||
@@ -327,6 +357,7 @@ class DataMigration extends Command
|
||||
];
|
||||
}
|
||||
Db::name('product_params')->insertAll($prarms);
|
||||
}
|
||||
|
||||
// 保存sku数据
|
||||
$skus = [];
|
||||
@@ -350,6 +381,7 @@ class DataMigration extends Command
|
||||
if (!isset($images[$pkey])) {
|
||||
$images[$pkey] = [];
|
||||
$images[$pkey]['sku'] = $im['sku'];
|
||||
$images[$pkey]['attrs'] = [];
|
||||
}
|
||||
|
||||
// 处理图册
|
||||
@@ -365,6 +397,10 @@ class DataMigration extends Command
|
||||
$photo_album[$pkey] = [];
|
||||
}
|
||||
$photo_album[$pkey][] = $photos_ret['data']['path'];
|
||||
} else {
|
||||
if ($photos_ret['code'] != 400) {
|
||||
$photo_album[$pkey][] = json_encode($photos_ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -372,19 +408,21 @@ class DataMigration extends Command
|
||||
// 处理属性
|
||||
$attrs = json_decode($im['image_color'], true);
|
||||
if (!empty($attrs)) {
|
||||
foreach ($attrs as $k => $at) {
|
||||
foreach ($attrs as $attr) {
|
||||
foreach ($attr as $k => $at) {
|
||||
if ($k != 'sort') {
|
||||
$attr_value = $at;
|
||||
if (in_array($k, ['颜色', 'Color'])) {
|
||||
if ($k == 'Color') $k = '颜色';
|
||||
$attr_value = '/static/common/images/colors/' . $at . '.png';
|
||||
}
|
||||
$images[$pkey]['attrs'] = [
|
||||
$images[$pkey]['attrs'][] = [
|
||||
'attr_id' => $attrs_map[$v['country_code']][$k],
|
||||
'attr_value' => $attr_value,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$attr_value = $im['image_color'];
|
||||
if (empty($attr_value) || $attr_value == '[]') {
|
||||
@@ -402,20 +440,21 @@ class DataMigration extends Command
|
||||
'attr_value' => $attr_value,
|
||||
];
|
||||
if (
|
||||
empty($images[$pkey]['attrs']) ||
|
||||
(!empty($images[$pkey]['attrs']) && empty(array_intersect($images[$pkey]['attrs'], $attr_arr)))
|
||||
empty($images[$pkey]['attrs']) || !array_some($images[$pkey]['attrs'], function($k, $v) use($attr_arr) {
|
||||
return $v == $attr_arr;
|
||||
})
|
||||
) {
|
||||
|
||||
$images[$pkey]['attrs'][] = $attr_arr;
|
||||
file_put_contents(runtime_path() . 'attrs.txt', json_encode($attr_arr));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($photo_album)) {
|
||||
foreach ($images as $key => $image) {
|
||||
if (isset($photo_album[$key])) {
|
||||
$images[$key]['photo_album'] = $photo_album[$key];
|
||||
}
|
||||
file_put_contents(runtime_path() . 'images.txt', json_encode($images, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||
file_put_contents(runtime_path() . 'photo_album.txt', json_encode($photo_album, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
$two_images = $old_db->name('product_two_img')
|
||||
->where('product_id', '=', $v['id'])
|
||||
@@ -428,56 +467,74 @@ class DataMigration extends Command
|
||||
if (!empty($ti['image_color'])) {
|
||||
$tpkey = md5($ti['image_color']);
|
||||
}
|
||||
if (!empty($ti['image_url'])) {
|
||||
if (!empty($ti['image_url']) && $ti['image_url'] != '[]') {
|
||||
$main_image_ret = $uploadMgr->upload($uploadMgr->download($ti['image_url']), 'image', 'product');
|
||||
if ($main_image_ret['code'] == 0) {
|
||||
$ti['image_url'] = $main_image_ret['data']['path'];
|
||||
}
|
||||
}
|
||||
$skus[] = ['main_image' => $ti['image_url'], 'image_color' => $ti['image_color'], 'pkey' => $tpkey];
|
||||
if (\think\helper\Str::endsWith($ti['image_color'], ['.png', '.jpg', 'jpeg', '.gif'])) {
|
||||
$arrt_ret = $uploadMgr->upload($uploadMgr->download($ti['image_color']), 'image', 'product');
|
||||
if ($arrt_ret['code'] == 0) {
|
||||
$ti['image_color'] = $arrt_ret['data']['path'];
|
||||
}
|
||||
}
|
||||
$skus[] = [
|
||||
'main_image' => $ti['image_url'],
|
||||
'attrs' => [[
|
||||
'attr_id' => $attrs_map[$v['country_code']]['颜色'],
|
||||
'attr_value' => $ti['image_color'],
|
||||
]],
|
||||
'pkey' => $tpkey
|
||||
];
|
||||
}
|
||||
|
||||
if (!empty($skus)) {
|
||||
$temp = [];
|
||||
$temp_images = [];
|
||||
foreach ($skus as $idx => $sku) {
|
||||
if (isset($images[$sku['pkey']])) {
|
||||
$skus[$idx]['product_id'] = $id;
|
||||
$skus[$idx]['sku'] = $images[$sku['pkey']]['sku'];
|
||||
$skus[$idx]['photo_album'] = $images[$sku['pkey']]['photo_album'];
|
||||
if (isset($images[$sku['pkey']])) {
|
||||
$skus[$idx]['sku'] = $images[$sku['pkey']]['sku']??null;
|
||||
$skus[$idx]['photo_album'] = $images[$sku['pkey']]['photo_album']??null;
|
||||
if (!empty($images[$sku['pkey']]['attrs'])) {
|
||||
$skus[$idx]['attrs'] = $images[$sku['pkey']]['attrs'];
|
||||
}
|
||||
} else {
|
||||
if (!empty($images[$idx])) {
|
||||
$temp = $images[$idx];
|
||||
if (empty($temp_images)) {
|
||||
$temp_images = array_values($images);
|
||||
}
|
||||
if (!empty($temp_images[$idx])) {
|
||||
$temp = $temp_images[$idx];
|
||||
}
|
||||
if (!empty($temp)) {
|
||||
$skus[$idx]['product_id'] = $id;
|
||||
$skus[$idx]['sku'] = $temp['sku'];
|
||||
$skus[$idx]['photo_album'] = $temp['photo_album'];
|
||||
$skus[$idx]['sku'] = $temp['sku']??null;
|
||||
$skus[$idx]['photo_album'] = $temp['photo_album']??null;
|
||||
if (!empty($temp['attrs'])) {
|
||||
$skus[$idx]['attrs'] = $temp['attrs'];
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($skus[$idx]['pkey']);
|
||||
unset($skus[$idx]['image_color']);
|
||||
}
|
||||
} else {
|
||||
foreach ($images as $image) {
|
||||
$skus[] = [
|
||||
'product_id' => $id,
|
||||
'sku' => $image['sku'],
|
||||
'sku' => $image['sku']??null,
|
||||
'main_image' => '',
|
||||
'photo_album' => $image['photo_album'],
|
||||
'photo_album' => $image['photo_album']??null,
|
||||
'skus' => $image['attrs']
|
||||
];
|
||||
}
|
||||
}
|
||||
file_put_contents(runtime_path() . 'skus.txt', json_encode($skus, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||
// throw new \Exception("exit;");
|
||||
|
||||
foreach ($skus as $sku) {
|
||||
$sku_id = Db::name('product_sku')->insertGetId([
|
||||
'product_id' => $sku['product_id'],
|
||||
'sku' => $sku['sku'],
|
||||
'main_image' => $sku['main_image'],
|
||||
'photo_album' => json_encode($sku['photo_album']),
|
||||
'sku' => $sku['sku']??'',
|
||||
'main_image' => $sku['main_image']??'',
|
||||
'photo_album' => !empty($sku['photo_album']) ? json_encode($sku['photo_album']) : null,
|
||||
]);
|
||||
if (!empty($sku['attrs'])) {
|
||||
foreach ($sku['attrs'] as $attr) {
|
||||
@@ -491,13 +548,21 @@ class DataMigration extends Command
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
$this->println(sprintf('迁移产品ID:%s => %s', $v['id'], $id));
|
||||
$total += 1;
|
||||
file_put_contents(
|
||||
runtime_path() . 'product_success.txt',
|
||||
sprintf('["ow_product_id" => %d, "cod_product_id" => %d]'.PHP_EOL, $id, $v['id']),
|
||||
FILE_APPEND
|
||||
);
|
||||
$this->println(sprintf('迁移产品ID:%s => %s 【耗时:%s】', $v['id'], 0, round(microtime(true) - $start, 2) . 's'));
|
||||
} catch (\Throwable $th) {
|
||||
Db::rollback();
|
||||
file_put_contents(
|
||||
runtime_path() . 'product_throwable.txt',
|
||||
sprintf('【%s】 产品【%s】,迁移失败,错误【%s:%d】' . PHP_EOL, date('Y-h-d H:i:s'), $v['id'], $th->getMessage(), $th->getLine())
|
||||
sprintf('【%s】 产品【%s】,迁移失败,错误【%s:%d】' . PHP_EOL, date('Y-h-d H:i:s'), $v['id'], $th->getMessage(), $th->getLine()),
|
||||
FILE_APPEND
|
||||
);
|
||||
file_put_contents(
|
||||
runtime_path() . 'product_throwable_details.txt',
|
||||
@@ -505,6 +570,74 @@ class DataMigration extends Command
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->println(sprintf('迁移产品完成,共迁移 %s 条数据', $total));
|
||||
}
|
||||
|
||||
// 迁移产品关联产品数据
|
||||
private function migrateProductRelated()
|
||||
{
|
||||
$sources = include_once(runtime_path() . 'product_success.php');
|
||||
$maps = [];
|
||||
foreach ($sources as $so) {
|
||||
$maps[$so['cod_product_id']] = $so;
|
||||
}
|
||||
|
||||
$old_db = Db::connect('old');
|
||||
$related = $old_db->name('product_related')
|
||||
->where('country_code', 'in', ['ZH', 'US'])
|
||||
->where('stat', '=', 0)
|
||||
->cursor();
|
||||
|
||||
$data = [];
|
||||
foreach ($related as $rl) {
|
||||
if (empty($maps[$rl['product_id']]) || empty($maps[$rl['related_product_id']])) {
|
||||
continue;
|
||||
}
|
||||
$data[] = [
|
||||
'product_id' => $maps[$rl['product_id']]['ow_product_id'],
|
||||
'related_product_id' => $maps[$rl['related_product_id']]['ow_product_id'],
|
||||
'desc' => empty($rl['related_desc']) ? null : $rl['related_desc'],
|
||||
'sort' => $rl['related_sort'] == 9999 ? 0 : $rl['related_sort']
|
||||
];
|
||||
}
|
||||
Db::name('product_related')->insertAll($data);
|
||||
}
|
||||
|
||||
// 迁移产品购买链接
|
||||
private function migrateProductPurchaseLinks()
|
||||
{
|
||||
$platform_maps = [
|
||||
1 => 2,
|
||||
2 => 1,
|
||||
3 => 3,
|
||||
4 => 4
|
||||
];
|
||||
|
||||
$sources = include_once(runtime_path() . 'product_success.php');
|
||||
$maps = [];
|
||||
foreach ($sources as $so) {
|
||||
$maps[$so['cod_product_id']] = $so;
|
||||
}
|
||||
|
||||
$old_db = Db::connect('old');
|
||||
$links = $old_db->name('product_purchase_links')
|
||||
->where('country_code', 'in', ['ZH', 'US'])
|
||||
->where('link', '<>', '')
|
||||
->cursor();
|
||||
|
||||
foreach ($links as $link) {
|
||||
if (empty($maps[$link['product_id']])) {
|
||||
continue;
|
||||
}
|
||||
$item = [
|
||||
'language_id' => $link['country_code'] == 'ZH' ? 1 : 2,
|
||||
'product_id' => $maps[$link['product_id']]['ow_product_id'],
|
||||
'platform_id' => $platform_maps[$link['platform_id']],
|
||||
'link' => $link['link']
|
||||
];
|
||||
Db::name('product_purchase_link')->insert($item);
|
||||
}
|
||||
}
|
||||
|
||||
// 迁移文章
|
||||
@@ -758,11 +891,13 @@ class UploadMannager
|
||||
private $password = 'Aa-1221';
|
||||
private $token = '';
|
||||
private $retrys = [];
|
||||
private $maps = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// 登录获取token
|
||||
$this->token = $this->getAuthorization();
|
||||
$this->maps = include_once(runtime_path() . 'fiber_product_image_mapping.php');
|
||||
}
|
||||
|
||||
// 下载图片
|
||||
@@ -805,21 +940,14 @@ class UploadMannager
|
||||
|
||||
$file_path = self::DOWNLOAD_TEMP_PATH . $file_name;
|
||||
if (file_exists($file_path)) {
|
||||
if (!is_valid_image($file_path)) {
|
||||
return '';
|
||||
}
|
||||
return $file_path;
|
||||
}
|
||||
|
||||
// 使用file_get_contents下载
|
||||
// $opts = [
|
||||
// 'http' => [
|
||||
// 'method' => 'GET',
|
||||
// 'header' => 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
|
||||
// ]
|
||||
// ];
|
||||
// $context = stream_context_create($opts);
|
||||
// $file = file_get_contents($url, false, $context);
|
||||
|
||||
// 使用curl下载
|
||||
$file = $this->file_get_withcurl($url);
|
||||
$file = file_get_withcurl($url);
|
||||
$dir = dirname($file_path);
|
||||
if (!is_dir($dir)) {
|
||||
mkdir($dir, 0777, true);
|
||||
@@ -828,34 +956,17 @@ class UploadMannager
|
||||
return $file_path;
|
||||
}
|
||||
|
||||
// 使用curl下载图片
|
||||
private function file_get_withcurl($url)
|
||||
{
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // 连接超时 10 秒
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30); // 传输超时 30 秒
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // 跟随重定向
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0'); // 模拟浏览器 UA
|
||||
|
||||
$data = curl_exec($ch);
|
||||
if ($data === false) {
|
||||
error_log(sprintf('cURL Error: %s; URL: %s', curl_error($ch), $url));
|
||||
return false;
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// 上传图片
|
||||
public function upload($file_path, $field_name, $module = 'unknown') {
|
||||
if (empty($file_path)) {
|
||||
return ['code' => 0, 'msg' => 'file_path为空', 'data' => ['path' => '']];
|
||||
return ['code' => 400, 'msg' => 'file_path为空', 'data' => ['path' => '']];
|
||||
}
|
||||
if (\think\helper\Str::startsWith($file_path, 'http')) {
|
||||
return ['code' => 0, 'msg' => 'file_path为http', 'data' => ['path' => $file_path]];
|
||||
}
|
||||
if (isset($this->maps[$file_path])) {
|
||||
return ['code' => 0, 'msg' => '成功', 'data' => ['path' => $this->maps[$file_path]]];
|
||||
}
|
||||
|
||||
switch($field_name){
|
||||
case 'image':
|
||||
@@ -939,3 +1050,48 @@ class UploadMannager
|
||||
return $result['data']['token'];
|
||||
}
|
||||
}
|
||||
|
||||
// 使用curl下载图片
|
||||
function file_get_withcurl($url)
|
||||
{
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // 连接超时 10 秒
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 60); // 传输超时 30 秒
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // 跟随重定向
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0'); // 模拟浏览器 UA
|
||||
|
||||
$data = curl_exec($ch);
|
||||
if ($data === false) {
|
||||
file_put_contents(runtime_path() . 'file_get_withcurl.txt', sprintf('cURL Error: %s; URL: %s' . PHP_EOL, curl_error($ch), $url), FILE_APPEND);
|
||||
return false;
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// 检查图片是否有效
|
||||
function is_valid_image($filepath)
|
||||
{
|
||||
try {
|
||||
$image_size = getimagesize($filepath);
|
||||
if ($image_size === false) {
|
||||
return false;
|
||||
}
|
||||
[$width, $height] = $image_size;
|
||||
return $width > 0 && $height > 0;
|
||||
} catch (\Throwable $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 根据自定义函数检查数组
|
||||
function array_some($array, callable $ca): bool
|
||||
{
|
||||
foreach ($array as $k => $v) {
|
||||
if ($ca($k, $v)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class Attachment extends Common
|
||||
])
|
||||
->withSearch(['name'], ['name' => $param['keyword']??null])
|
||||
->language($this->lang_id)
|
||||
->category($param['id']??null)
|
||||
->category($param['id']??$video_categorys[0]['id']??null)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->paginate([
|
||||
'list_rows' => $param['size'],
|
||||
|
||||
@@ -121,6 +121,7 @@ abstract class Common extends BaseController
|
||||
$products = ProductModel::field([
|
||||
'id',
|
||||
'name',
|
||||
'short_name',
|
||||
'cover_image',
|
||||
])
|
||||
->language($language)
|
||||
|
||||
@@ -26,7 +26,14 @@ class Index extends Common
|
||||
View::assign('featured_topics', $banner['featured_topics']);
|
||||
View::assign('video', array_shift($banner['video']));
|
||||
View::assign('scenes', $banner['scenes']);
|
||||
View::assign('brand_story', $banner['brand_story']);
|
||||
View::assign('brand_story', array_map(function($item) {
|
||||
$item['year'] = '';
|
||||
$arr = explode('-', $item['title']);
|
||||
if (count($arr) > 1) {
|
||||
$item['year'] = $arr[0];
|
||||
}
|
||||
return $item;
|
||||
}, $banner['brand_story']??null));
|
||||
View::assign('data_statistics', $banner['data_statistics']);
|
||||
|
||||
// 获取明星产品/热点产品
|
||||
@@ -45,7 +52,7 @@ class Index extends Common
|
||||
private function getBannerData()
|
||||
{
|
||||
$banners = SysBannerModel::with(['items' => function($query) {
|
||||
$query->where('type', '=', 'image')->where('status', '=', 1)->order(['sort' => 'asc', 'id' => 'desc']);
|
||||
$query->where('type', 'IN', ['image', 'video'])->where('status', '=', 1)->order(['sort' => 'asc', 'id' => 'desc']);
|
||||
}])
|
||||
->uniqueLabel([
|
||||
'BANNER_67f61cd70e8e1',
|
||||
|
||||
@@ -22,12 +22,100 @@ use think\helper\Arr;
|
||||
*/
|
||||
class Product extends Common
|
||||
{
|
||||
// 产品分类
|
||||
// 产品分类 - 查看顶层分类
|
||||
public function category()
|
||||
{
|
||||
// 参数
|
||||
$param = request()->param(['id']);
|
||||
|
||||
// 获取分类及产品信息
|
||||
$categorys_data = ProductCategoryModel::field(['id', 'pid', 'name', 'path', 'level'])
|
||||
->language($this->lang_id)
|
||||
->displayed(true)
|
||||
->children($param['id'])
|
||||
->order(['pid' => 'asc', 'sort' => 'asc', 'id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$list = [];
|
||||
if (!empty($categorys_data)) {
|
||||
// 分组分类
|
||||
$list = array_filter($categorys_data, fn($it) => $it['level'] == 2);
|
||||
foreach ($list as &$it) {
|
||||
$it['children'] = array_column(array_filter($categorys_data, fn($v) => in_array($it['id'], explode(',', $v['path']))), 'id');
|
||||
}
|
||||
unset($it);
|
||||
|
||||
// 获取分类下的产品信息
|
||||
if (!empty($list)) {
|
||||
$product_model = new ProductModel;
|
||||
$sql = $product_model->field([
|
||||
'id',
|
||||
'category_id',
|
||||
'spu',
|
||||
'name',
|
||||
'cover_image',
|
||||
'is_new',
|
||||
'(' . $list[0]['id'] . ')' => 'group_mark'
|
||||
])
|
||||
->byCategory(data_get($list[0], 'children'))
|
||||
->language($this->lang_id)
|
||||
->enabled(true)
|
||||
->onSale(true)
|
||||
->onShelves(true)
|
||||
->append(['p' => $list[0]['id']])
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->limit(5)
|
||||
->buildSql();
|
||||
$query = \think\facade\Db::table("($sql) as a");
|
||||
foreach ($list as $it) {
|
||||
$query = $query->union(function($query) use($product_model, $it) {
|
||||
$query->model($product_model)
|
||||
->name($product_model->getName())
|
||||
->field([
|
||||
'id',
|
||||
'category_id',
|
||||
'spu',
|
||||
'name',
|
||||
'cover_image',
|
||||
'is_new',
|
||||
'(' . $it['id'] . ')' => 'group_mark'
|
||||
])
|
||||
->byCategory($it['children'])
|
||||
->language($this->lang_id)
|
||||
->enabled(true)
|
||||
->onSale(true)
|
||||
->onShelves(true)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->limit(5);
|
||||
});
|
||||
}
|
||||
$pros = $query->select();
|
||||
if (!empty($pros)) {
|
||||
$pros_map = [];
|
||||
foreach ($pros as $pro) {
|
||||
$pros_map[$pro['group_mark']][] = $pro;
|
||||
}
|
||||
foreach ($list as &$it) {
|
||||
if (isset($pros_map[$it['id']])) {
|
||||
$it['products'] = $pros_map[$it['id']];
|
||||
}
|
||||
unset($it['children']);
|
||||
}
|
||||
unset($it);
|
||||
}
|
||||
}
|
||||
}
|
||||
View::assign('list', $list);
|
||||
|
||||
return View::fetch('category');
|
||||
}
|
||||
// 产品分类 - 查看子类
|
||||
public function subcategory()
|
||||
{
|
||||
// 参数
|
||||
$param = request()->param(['id']);
|
||||
|
||||
$focus_image = [];
|
||||
// 获取产品分类页焦点横幅
|
||||
$banner = SysBannerModel::with(['items' => function($query) {
|
||||
@@ -60,6 +148,7 @@ class Product extends Common
|
||||
->child($param['id'], true)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->select();
|
||||
|
||||
if (!$categorys_data->isEmpty()) {
|
||||
if ($categorys_data->count() > 1) {
|
||||
// 当分类数不只一个时,当前分类下有子分类,移除当前分类,只输出子分类
|
||||
@@ -151,7 +240,40 @@ class Product extends Common
|
||||
}
|
||||
View::assign('categorys_data', $categorys_data);
|
||||
|
||||
return View::fetch('category');
|
||||
return View::fetch('subcategory');
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品搜索
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$keywords = request()->param('keywords', '');
|
||||
|
||||
// 关键词搜索
|
||||
$products = ProductModel::field([
|
||||
'id',
|
||||
'name',
|
||||
'short_name',
|
||||
'cover_image',
|
||||
'spu'
|
||||
])
|
||||
->where(fn ($query) => $query->withSearch(['keywords'], ['keywords' => $keywords]))
|
||||
->language($this->lang_id)
|
||||
->enabled(true)
|
||||
->onSale(true)
|
||||
->onShelves(true)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->select()
|
||||
->each(function ($item) use($keywords) {
|
||||
$item['spu'] = str_replace($keywords, '<strong class="redpoint">'.$keywords.'</strong>', $item['spu']);
|
||||
$item['name'] = str_replace($keywords, '<strong class="redpoint">'.$keywords.'</strong>', $item['name']);
|
||||
$item['short_name'] = str_replace($keywords, '<strong class="redpoint">'.$keywords.'</strong>', $item['short_name']);
|
||||
return $item;
|
||||
});
|
||||
View::assign('products', $products);
|
||||
|
||||
return View::fetch('search');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -334,7 +456,7 @@ class Product extends Common
|
||||
|
||||
$newpros = [];
|
||||
// 获取新品上市产品
|
||||
$products = ProductModel::field(['id', 'category_id', 'name', 'spu', 'cover_image'])
|
||||
$products = ProductModel::field(['id', 'category_id', 'name', 'spu', 'cover_image', 'is_new'])
|
||||
->language($this->lang_id)
|
||||
->enabled(true)
|
||||
->onSale(true)
|
||||
@@ -343,24 +465,45 @@ class Product extends Common
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->select();
|
||||
if (!$products->isEmpty()) {
|
||||
// 按分类分组产品
|
||||
$products_map = [];
|
||||
foreach ($products as $product) {
|
||||
$products_map[$product['category_id']][] = $product;
|
||||
}
|
||||
// 获取产品分类信息
|
||||
$categorys = ProductCategoryModel::field(['id', 'name'])
|
||||
->byPks(array_keys($products_map))
|
||||
$categorys = ProductCategoryModel::field(['id', 'name', 'path', 'level'])
|
||||
->where(function($query) use($products) {
|
||||
$query->where('id', 'IN', Arr::pluck($products, 'category_id'))->whereOr('level', '=', 2);
|
||||
})
|
||||
->language($this->lang_id)
|
||||
->displayed(true)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->order(['sort' => 'asc', 'id' => 'asc'])
|
||||
->select();
|
||||
if (!$categorys->isEmpty()) {
|
||||
// 根据产品分类path信息分组
|
||||
$map = [];
|
||||
foreach ($categorys as $category) {
|
||||
$map[$category['id']] = $category;
|
||||
}
|
||||
$pro_map = [];
|
||||
foreach ($products as $pro) {
|
||||
if (!isset($map[$pro['category_id']])) {
|
||||
continue;
|
||||
}
|
||||
$m = $map[$pro['category_id']];
|
||||
$pro_map[$m['path']][] = $pro;
|
||||
}
|
||||
|
||||
// 获取二级分类下的产品信息
|
||||
foreach ($categorys as $val) {
|
||||
if ($val['level'] != 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($pro_map as $k => $pro) {
|
||||
if (in_array($val['id'], explode(',', $k))) {
|
||||
$newpros[] = [
|
||||
'category' => $category,
|
||||
'products' => $products_map[$category['id']] ?? [],
|
||||
'category' => $val,
|
||||
'products' => $pro,
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
return [
|
||||
'header_navigation' => [
|
||||
'product_categorys' => 'Products'
|
||||
'product_categorys' => 'Products',
|
||||
'store' => 'Store'
|
||||
],
|
||||
'header_search' => [
|
||||
'history' => 'Search History',
|
||||
@@ -163,6 +164,9 @@ return [
|
||||
'send_success' => 'Add Success!',
|
||||
'send_fail' => 'Add Fail!',
|
||||
],
|
||||
'product_newpro' => [
|
||||
'view_all' => 'View all'
|
||||
],
|
||||
'product_detail' => [
|
||||
'detail_section_title' => 'Product Description',
|
||||
'related_products' => 'Related Products',
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
return [
|
||||
'header_navigation' => [
|
||||
'product_categorys' => '产品列表'
|
||||
'product_categorys' => '产品列表',
|
||||
'store' => '店铺'
|
||||
],
|
||||
'header_search' => [
|
||||
'hot_product' => '热销产品',
|
||||
@@ -163,6 +164,9 @@ return [
|
||||
'send_success' => '信息已成功提交',
|
||||
'send_fail' => '信息提交失败',
|
||||
],
|
||||
'product_newpro' => [
|
||||
'view_all' => '查看全部'
|
||||
],
|
||||
'product_detail' => [
|
||||
'detail_section_title' => '产品详情',
|
||||
'related_products' => '相关产品',
|
||||
|
||||
@@ -4,6 +4,7 @@ declare (strict_types = 1);
|
||||
namespace app\index\model;
|
||||
|
||||
use app\common\model\ProductBaseModel;
|
||||
use think\facade\Db;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
@@ -74,4 +75,10 @@ class ProductModel extends ProductBaseModel
|
||||
{
|
||||
$query->where('is_new', '=', (int)$stat);
|
||||
}
|
||||
|
||||
// 关键词搜索
|
||||
public function searchKeywordsAttr($query, string $keywords)
|
||||
{
|
||||
$query->whereRaw('BINARY spu LIKE "%' . $keywords . '%" OR BINARY name LIKE "%' . $keywords . '%" OR BINARY short_name LIKE "%' . $keywords . '%"');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
{notempty name="video_categorys"}
|
||||
<div class="hd">
|
||||
<ul>
|
||||
{volist name="video_categorys" id="vca"}
|
||||
<li class="vli {eq name='vca.id' value='$Request.get.id'}von{/eq}">
|
||||
{volist name="video_categorys" id="vca" key="k"}
|
||||
<li class="vli {if condition='($Request.has.id && $Request.get.id==$vca.id) || (!$Request.has.id && $k==1)'}von{/if}">
|
||||
<a href="{:url('attachment/video', ['id' => $vca.id])}" style="display: block;">{$vca.name}</a>
|
||||
</li>
|
||||
{/volist}
|
||||
|
||||
@@ -167,9 +167,9 @@
|
||||
<div class="bs_swcontainer">
|
||||
<div class="swiper-pagination bs_pagination"></div>
|
||||
<hr>
|
||||
<!-- <span class="time1">2021</span> -->
|
||||
<!-- <span class="time2">2022</span> -->
|
||||
<!-- <span class="time3">2023</span> -->
|
||||
{volist name="brand_story" id="story" key="k"}
|
||||
<span class="time{$k}">{$story.year}</span>
|
||||
{/volist}
|
||||
</div>
|
||||
<div class="swiper-container bs_bts">
|
||||
<img class="slideshow-btn swiper-button-next" src="static/index/temp_images/rightcheck.png" alt="" />
|
||||
@@ -243,12 +243,14 @@
|
||||
</div>
|
||||
{/notempty}
|
||||
<!-- 底部固定提示 -->
|
||||
{eq name="Request.cookie.think_lang" value="en-us"}
|
||||
<div class="oricofixd-info">
|
||||
<div class="ofiinfo">We use cookies to ensure you get the best experience on our website. By
|
||||
continuing to browse, you agree to our use of cookies.</div>
|
||||
<div class="ofibt"><button>OK,got it!</button></div>
|
||||
<div class="oficlose"><span class="close-btn">×</span></div>
|
||||
</div>
|
||||
{/eq}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
71
app/index/view/product/category.bak.html
Normal file
71
app/index/view/product/category.bak.html
Normal file
@@ -0,0 +1,71 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" href="__CSS__/category.css" type="text/css" />
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="orico_Page_products">
|
||||
{notempty name="focus_image"}
|
||||
<div class="focus_image">
|
||||
{volist name="focus_image" id="fimg"}
|
||||
<a {notempty name="fimg.link"}href="{$fimg.link}"{/notempty}><img src="{$fimg.image}" alt="" /></a>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
<!-- 首页主题内容 -->
|
||||
<div class="pageMain">
|
||||
{notempty name="categorys_data"}
|
||||
{volist name="categorys_data" id="vo"}
|
||||
<div class="ori-pd-title">
|
||||
<span>{$vo.name}</span>
|
||||
{eq name="vo.level" value="2"}
|
||||
<a href="{:url('product/category', ['id' => $vo.id])}">查看更多</a>
|
||||
{/eq}
|
||||
</div>
|
||||
{notempty name="vo.products"}
|
||||
<div class="ori-pd-list">
|
||||
{volist name="vo.products" id="vp"}
|
||||
<a class="oripditem" href="{:url('product/detail', ['id' => $vp.id])}">
|
||||
<div>
|
||||
{volist name="vp.sku" id="vs" key="vs_idx"}
|
||||
<img src="{$vs.main_image}" id="sku_image_{$vs.id}" class="prdimg {eq name='vs_idx' value='1'}prdimg-show{/eq}" />
|
||||
{/volist}
|
||||
</div>
|
||||
<div class="prdName">{$vp.name}</div>
|
||||
<div class="prddec">{$vp.spu}</div>
|
||||
{notempty name="vp.colors"}
|
||||
<div class="prd-colors">
|
||||
{volist name="vp.colors" id="vc" key="vc_idx"}
|
||||
<div class="prdolorit {eq name='vc_idx' value='1'}on{/eq}" data-sku_id="{$vc.sku_id}">
|
||||
{assign name="color_type" value=":rgb_or_image($vc.attr_value)" /}
|
||||
{eq name="color_type" value="IMAGE"}
|
||||
<img src="{$vc.attr_value}" />
|
||||
{elseif condition="$color_type == 'RGB'" /}
|
||||
<span class="rgb_hex" {:style(['background-color'=>$vc.attr_value])}></span>
|
||||
{/eq}
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
</a>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
{/volist}
|
||||
{/notempty}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.prd-colors .prdolorit').click(function(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
var sku_id = $(this).data('sku_id');
|
||||
$('#sku_image_' + sku_id).addClass('prdimg-show').siblings().removeClass('prdimg-show');
|
||||
$(this).addClass('on').siblings().removeClass('on');
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,71 +1,36 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" href="__CSS__/category.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/product_category.css" type="text/css" />
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="orico_Page_products">
|
||||
{notempty name="focus_image"}
|
||||
<div class="focus_image">
|
||||
{volist name="focus_image" id="fimg"}
|
||||
<a {notempty name="fimg.link"}href="{$fimg.link}"{/notempty}><img src="{$fimg.image}" alt="" /></a>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
<!-- 首页主题内容 -->
|
||||
<div class="orico_Page_category">
|
||||
<!--首页主题内容 -->
|
||||
<div class="pageMain">
|
||||
{notempty name="categorys_data"}
|
||||
{volist name="categorys_data" id="vo"}
|
||||
{volist name="list" id="vo"}
|
||||
<div class="cat">
|
||||
<div class="ori-pd-title">
|
||||
<span>{$vo.name}</span>
|
||||
{eq name="vo.level" value="2"}
|
||||
<a href="{:url('product/category', ['id' => $vo.id])}">查看更多</a>
|
||||
{/eq}
|
||||
<div class="catname">{$vo.name}</div>
|
||||
<a class="catmore" href="{:url('product/subcategory', ['id' => $vo.id])}">
|
||||
<span class="tmore">{:lang('product_newpro.view_all')}</span>
|
||||
<img src="/static/index/images/more.png" class="catmoreImg" />
|
||||
</a>
|
||||
</div>
|
||||
{notempty name="vo.products"}
|
||||
<div class="ori-pd-list">
|
||||
{volist name="vo.products" id="vp"}
|
||||
<a class="oripditem" href="{:url('product/detail', ['id' => $vp.id])}">
|
||||
{volist name="vo.products" id="pro"}
|
||||
<a class="oripditem" href="{:url('product/detail', ['id' => $pro.id])}">
|
||||
<div>
|
||||
{volist name="vp.sku" id="vs" key="vs_idx"}
|
||||
<img src="{$vs.main_image}" id="sku_image_{$vs.id}" class="prdimg {eq name='vs_idx' value='1'}prdimg-show{/eq}" />
|
||||
{/volist}
|
||||
<img src="{$pro.cover_image}" class="prdimg prdimg-show" />
|
||||
</div>
|
||||
<div class="prdName">{$vp.name}</div>
|
||||
<div class="prddec">{$vp.short_name}</div>
|
||||
{notempty name="vp.colors"}
|
||||
<div class="prd-colors">
|
||||
{volist name="vp.colors" id="vc" key="vc_idx"}
|
||||
<div class="prdolorit {eq name='vc_idx' value='1'}on{/eq}" data-sku_id="{$vc.sku_id}">
|
||||
{assign name="color_type" value=":rgb_or_image($vc.attr_value)" /}
|
||||
{eq name="color_type" value="IMAGE"}
|
||||
<img src="{$vc.attr_value}" />
|
||||
{elseif condition="$color_type == 'RGB'" /}
|
||||
<span class="rgb_hex" {:style(['background-color'=>$vc.attr_value])}></span>
|
||||
<div class="prdName">{$pro.name}</div>
|
||||
<div class="prddec">{$pro.spu}</div>
|
||||
{eq name="pro.is_new" value="1"}
|
||||
<div class="newcp">New</div>
|
||||
{/eq}
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
</a>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
</div>
|
||||
{/volist}
|
||||
{/notempty}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.prd-colors .prdolorit').click(function(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
var sku_id = $(this).data('sku_id');
|
||||
$('#sku_image_' + sku_id).addClass('prdimg-show').siblings().removeClass('prdimg-show');
|
||||
$(this).addClass('on').siblings().removeClass('on');
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,308 +0,0 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}
|
||||
{notempty name="product.seo_title"}<title>{$product.seo_title}</title>{else /}{__BLOCK__}{/notempty}
|
||||
{/block}
|
||||
{block name="seo"}
|
||||
{notempty name="product.seo_keywords"}
|
||||
<meta name="keywords" content="{$product.seo_keywords}" />
|
||||
<meta name="description" content="{$product.seo_desc}" />
|
||||
{else/}
|
||||
{__BLOCK__}
|
||||
{/notempty}
|
||||
{/block}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/product_detail.css" />
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="orico_Page_prdetail">
|
||||
<!--产品详情内容 -->
|
||||
<div class="oriprdetail">
|
||||
<!--产品路径-->
|
||||
<div class="product_address">
|
||||
<a class="pathname" href="/">首页</a>
|
||||
{volist name="product_categorys" id="ca"}
|
||||
<div class="arrow"></div>
|
||||
<a class="pathname" href="{:url('product/category', ['id' => $ca.id])}">{$ca.name}</a>
|
||||
{/volist}
|
||||
</div>
|
||||
<!-- 产品主图切换和参数详情-->
|
||||
<div class="cp">
|
||||
<!--左边图片 -->
|
||||
<div class="cpfl">
|
||||
<div class="preview">
|
||||
<div class="smallImg">
|
||||
<div class="scrollbutton smallImgUp disabled"></div>
|
||||
<div id="imageMenu">
|
||||
<ul id="image_list">
|
||||
<li id="onlickImg" class="on">
|
||||
<img src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35-C3-2.jpg">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35-C3-PNG.png">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35-C3-SIZE.jpg">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35u3&c3-800-1.jpg">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35u3&c3-800-2.jpg">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35u3&c3-800-3.jpg">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35u3&c3-800-5.jpg">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35u3&c3-800-6.jpg">
|
||||
</li>
|
||||
<li class=""> <img
|
||||
src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35u3&c3-800-4.png">
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="scrollbutton smallImgDown"></div>
|
||||
</div><!--smallImg end-->
|
||||
<div id="vertical" class="bigImg">
|
||||
<img src="https://www.orico.com.cn/uploads/product/DD35-C3/DD35-C3-SIZE.jpg"
|
||||
id="midimg">
|
||||
</div><!--bigImg end-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右边产品详情 -->
|
||||
<div class="cprh">
|
||||
<div class="cpcon">
|
||||
<p class="ctit1">{$product.name|default=''}</p>
|
||||
<p>{$product.desc|default=''}</p>
|
||||
<div class="proTfg">
|
||||
<ul class="swt-Table">
|
||||
{volist name="product_params" id="pp"}
|
||||
<li class="Table-Row">
|
||||
<div class="ms3 Table-Cell">{$pp.name}</div>
|
||||
<div class="ms2 Table-Cell"></div>
|
||||
<div class="ms4 Table-Cell">{$pp.value}</div>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 颜色-->
|
||||
{volist name="product_sku_attrs" id="ps"}
|
||||
<div class="prcolors">
|
||||
<div class="dt">{$ps.attr_name}</div>
|
||||
<ul class="dowebok">
|
||||
{volist name="ps.attr_values" id="pv" key="k"}
|
||||
{assign name="attr_value_type" value=":rgb_or_image($pv.attr_value)" /}
|
||||
<a {eq name='k' value='1' }class="on" {/eq} data-sku_id="{$pv.sku_id}">
|
||||
{eq name="attr_value_type" value="IMAGE"}
|
||||
<span class="itemcolor"><img src="{$pv.attr_value}" /></span>
|
||||
{elseif condition="$attr_value_type == 'RGB'" /}
|
||||
<span class="itemcolor" {:style(['background-color'=>$pv.attr_value])}></span>
|
||||
{else /}
|
||||
<span>{$pv.attr_value}</span>
|
||||
{/eq}
|
||||
</a>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
<!-- 按钮-->
|
||||
<div class="buy">
|
||||
{volist name="product_purchase_links" id="ppp"}
|
||||
<a class="thebt bttype1" href="{$ppp.link}">{$ppp.platform_name}</a>
|
||||
{/volist}
|
||||
<a class="thebt bttype3" id="open_form_modal">{:lang('product_detail.display_form')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 产品介绍详情-->
|
||||
<div class="oriprInfo">
|
||||
<div class="titleprinfo">
|
||||
<a href="#detail">{:lang('product_detail.detail_section_title')}</a>
|
||||
<span>|</span>
|
||||
<a href="#related">{:lang('product_detail.related_products')}</a>
|
||||
</div>
|
||||
<!-- 富文本渲染-->
|
||||
<div class="products_des" id="detail">
|
||||
{$product.detail|default=''|raw}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 相关产品 -->
|
||||
{notempty name="product_related"}
|
||||
<div id="related">
|
||||
<p>{:lang('product_detail.related_products')}</p>
|
||||
<div>
|
||||
<ul>
|
||||
{volist name="product_related" id="related"}
|
||||
<li>
|
||||
<a href="{:url('product/detail', ['id' => $related.id])}">
|
||||
<img src="{$related.cover_img}" alt="{$related.name}" />
|
||||
<p>{$related.name}</p>
|
||||
<p>{$related.spu}</p>
|
||||
</a>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/notempty}
|
||||
<!-- 弹框-->
|
||||
<div id="form_modal" class="XJmodal">
|
||||
<div class="XJmodal-content">
|
||||
<span class="close">×</span>
|
||||
<h2>{:lang('product_detail.display_form')}</h2>
|
||||
<form action="" method="post" autocomplete="off">
|
||||
<div class="tkitem">
|
||||
<div class="form-group">
|
||||
<label for="firstName">
|
||||
<strong style="color: red; margin-right: 0.3125rem;"> * </strong>
|
||||
{:lang('product_detail.form_name')}</label>
|
||||
<div>
|
||||
<input type="text" name="first_name" id="firstName"
|
||||
placeholder="{:lang('product_detail.form_first_name_placeholder')}" class="detail-w">
|
||||
<input type="text" name="last_name" id="lastName"
|
||||
placeholder="{:lang('product_detail.form_last_name_placeholder')}" class="detail-w">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="corp">
|
||||
<strong style="color: red; margin-right: 0.3125rem;"> * </strong>
|
||||
{:lang('product_detail.form_corp')}
|
||||
</label>
|
||||
<input type="text" name="corp_name" id="corp" class="detail-w01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tkitem">
|
||||
<div class="form-group">
|
||||
<label for="email">
|
||||
<strong style="color: red; margin-right: 0.3125rem;"> * </strong> Email
|
||||
{:lang('product_detail.form_email')}
|
||||
</label>
|
||||
<input type="text" name="email" id="email" class="detail-w01">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="phone">
|
||||
<strong style="color: red; margin-right: 0.3125rem;"> * </strong> Phone
|
||||
{:lang('product_detail.form_phone')}
|
||||
</label>
|
||||
<input type="text" name="phone" id="phone" class="detail-w01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tkitem">
|
||||
<div class="form-group">
|
||||
<label for="country">
|
||||
<strong style="color: red; margin-right: 0.3125rem;"> * </strong>
|
||||
{:lang('product_detail.form_country')}
|
||||
</label>
|
||||
<select name="country_name" id="country">
|
||||
<option value="">{:lang('product_detail.form_country_placeholder')}</option>
|
||||
{volist name="country_list" id="country"}
|
||||
<option value="{$country}">{$country}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="industry">
|
||||
<strong style="color: red; margin-right: 0.3125rem;"> * </strong>
|
||||
{:lang('product_detail.form_industry')}
|
||||
</label>
|
||||
<input type="text" name="industry" id="industry" class="detail-w01">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tkitem">
|
||||
<div class="form-group" style="width: 100%;margin-right: 0px;">
|
||||
<label for="message">
|
||||
<strong style="color: red; margin-right: 0.3125rem;"> * </strong>
|
||||
{:lang('product_detail.form_inquiry')}
|
||||
</label>
|
||||
<textarea name="message" id="message"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" id="send" class="submit-btn">{:lang('product_detail.form_submit')}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 点击主图放大图片观看 -->
|
||||
<div class="enlarge-img">
|
||||
<div class="scrollbutton_01 smallImgUp"></div>
|
||||
<img />
|
||||
<div class="scrollbutton_01 smallImgDown"></div>
|
||||
<div class="close"><span>x</span></div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
// 切换图册
|
||||
$('.prcolors .dowebok a').click(function () {
|
||||
// 移除所有 .on 类
|
||||
$(this).addClass('on').siblings('a').removeClass('on');
|
||||
// 获取当前点击的元素的 data-sku_id 值
|
||||
var skuId = $(this).data('sku_id');
|
||||
// 根据 skuId 显示对应的预览
|
||||
$('#preview' + skuId).show().siblings('.preview').hide();
|
||||
})
|
||||
|
||||
// 获取模态框和打开按钮以及关闭按钮
|
||||
var modal = $("#form_modal");
|
||||
var openBtn = $("#open_form_modal");
|
||||
var closeBtn = $(".close");
|
||||
// 打开模态框
|
||||
openBtn.click(function () {
|
||||
modal.show();
|
||||
});
|
||||
// 关闭模态框
|
||||
closeBtn.click(function () {
|
||||
modal.hide();
|
||||
});
|
||||
// 当用户点击模态框外部时,关闭模态框
|
||||
$(window).click(function (event) {
|
||||
if (event.target === modal[0]) {
|
||||
modal.hide();
|
||||
}
|
||||
});
|
||||
// 处理表单提交
|
||||
modal.find("form").submit(function (e) {
|
||||
e.preventDefault();
|
||||
var formData = $(this).serialize();
|
||||
// 这里可以添加代码将formData发送到服务器
|
||||
// 例如通过AJAX
|
||||
console.log("提交的数据: " + formData);
|
||||
// 提交成功后可以选择关闭模态框
|
||||
modal.hide();
|
||||
});
|
||||
|
||||
// 提交询盘
|
||||
$('#send').click(function () {
|
||||
var form = $(this).parents('form');
|
||||
$.ajax({
|
||||
url: "{:url('product/inquiry')}",
|
||||
type: 'POST',
|
||||
data: form.serialize(),
|
||||
success: function (r) {
|
||||
if (r.code == 0) {
|
||||
form[0].reset(); // 重置表单
|
||||
modal.hide();
|
||||
}
|
||||
alert(r.msg);
|
||||
},
|
||||
error: function (e) {
|
||||
console.error(e);
|
||||
}
|
||||
})
|
||||
});
|
||||
/*图片放大效果*/
|
||||
$(".bigImg").click(function () {
|
||||
$(".enlarge-img").show();
|
||||
});
|
||||
$(".enlarge-img .close").click(function () {
|
||||
$(".enlarge-img").hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -31,42 +31,37 @@
|
||||
<div class="cpfl">
|
||||
{volist name="product_skus" id="sku" key="idx"}
|
||||
<div class="preview" id="preview{$sku.id}" {neq name="idx" value="1"}style="display:none"{/neq}>
|
||||
<div class="smallImg">
|
||||
<!-- 左边切换按钮 -->
|
||||
<div class="scrollbutton smallImgUp disabled"></div>
|
||||
<!-- 小图片预览 -->
|
||||
<div id="imageMenu">
|
||||
<ul class="image_list">
|
||||
{if condition="!empty($product.video_img) && !empty($product.video_url) && $idx == 1"}
|
||||
<div class="smallImg">
|
||||
<!-- 小图片预览 -->
|
||||
<div id="imageMenu">
|
||||
<ul class="image_list">
|
||||
<li id="onlickImg"><img src="{:thumb($product.video_img)}" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 产品视频 -->
|
||||
<div class="bigImg" id="vertical">
|
||||
<video poster="{$product.video_img}" controls="controls" width="100%" height="100%">
|
||||
<source src="{$product.video_url}" type="video/mp4"/>
|
||||
</video>
|
||||
</div>
|
||||
<li id="onlickImg"><img src="{:thumb($product.video_img)}" data-url="{$product.video_url}" /></li>
|
||||
{/if}
|
||||
<div class="smallImg">
|
||||
<!-- 小图片预览 -->
|
||||
<div id="imageMenu">
|
||||
<ul class="image_list">
|
||||
{volist name="sku.photo_album" id="photo"}
|
||||
<li id="onlickImg"><img src="{:thumb($photo)}" /></li>
|
||||
<li id="onlickImg"><img src="{:thumb($photo)}" data-url="{$photo}" /></li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 右边切换按钮 -->
|
||||
<div class="scrollbutton smallImgDown"></div>
|
||||
</div>
|
||||
<!-- 产品大图 -->
|
||||
<div class="bigImg" id="vertical">
|
||||
<!-- 左边切换按钮 -->
|
||||
<div class="scrollbutton smallImgUp disabled"></div>
|
||||
<!-- 主图 -->
|
||||
{if condition="!empty($product.video_img) && !empty($product.video_url) && $idx == 1"}
|
||||
<!-- 如果有视频情况下默认先显示视频 -->
|
||||
<video poster="{$product.video_img}" autoplay="autoplay" muted="muted" loop="loop" id="video" controls>
|
||||
<source src="{$product.video_url}" type="video/mp4" />
|
||||
</video>
|
||||
{else/}
|
||||
{notempty name="sku.photo_album[0]"}
|
||||
<img src="{$sku.photo_album[0]}" id="midimg" />
|
||||
{/notempty}
|
||||
<!-- 右边切换按钮 -->
|
||||
<div class="scrollbutton smallImgDown"></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
@@ -110,8 +105,8 @@
|
||||
</div>
|
||||
<!-- 按钮-->
|
||||
<div class="buy">
|
||||
{volist name="product_purchase_links" id="ppp"}
|
||||
<a class="thebt bttype1" href="{$ppp.link}">{$ppp.platform_name}</a>
|
||||
{volist name="product_purchase_links" id="ppp" key="k"}
|
||||
<a class="thebt bttype{$k}" href="{$ppp.link}">{$ppp.platform_name}</a>
|
||||
{/volist}
|
||||
<a class="thebt bttype3" id="open_form_modal">{:lang('product_detail.display_form')}</a>
|
||||
</div>
|
||||
@@ -121,8 +116,10 @@
|
||||
<div class="oriprInfo">
|
||||
<div class="titleprinfo">
|
||||
<a href="#detail" class="checkshow">{:lang('product_detail.detail_section_title')}</a>
|
||||
{notempty name="product_related"}
|
||||
<span>|</span>
|
||||
<a href="#related">{:lang('product_detail.related_products')}</a></div>
|
||||
{/notempty}
|
||||
<!-- 富文本渲染-->
|
||||
<div class="products_des" id="detail">
|
||||
{$product.detail|default=''|raw}
|
||||
@@ -137,7 +134,7 @@
|
||||
{volist name="product_related" id="related"}
|
||||
<li>
|
||||
<a href="{:url('product/detail', ['id' => $related.id])}">
|
||||
<img src="{$related.cover_img}" alt="{$related.name}" />
|
||||
<img src="{$related.cover_image}" alt="{$related.name}" />
|
||||
<p>{$related.name}</p>
|
||||
<p>{$related.spu}</p>
|
||||
</a>
|
||||
|
||||
@@ -16,26 +16,22 @@
|
||||
<div class="cat">
|
||||
<h1 class="ori-pd-title">
|
||||
<div class="catname">{$vo.category.name}</div>
|
||||
<a class="catmore">
|
||||
<span class="tmore">View all</span>
|
||||
<img src="/static/index/images/more.png" class="catmoreImg" />
|
||||
</a>
|
||||
</h1>
|
||||
<div class="ori-pd-list">
|
||||
{volist name="vo.products" id="pro"}
|
||||
<a class="oripditem" href="{:url('product/detail', ['id' => $pro.id])}">
|
||||
<!-- <div class="oNpicoNEW">New</div> -->
|
||||
<img src="{$pro.cover_image}" class="prdimg prdimg-show" />
|
||||
<div class="prdName">{$pro.name}</div>
|
||||
<div class="prddec">{$pro.spu}</div>
|
||||
{eq name="pro.is_new" value="1"}
|
||||
<div class="newcp">New</div>
|
||||
{/eq}
|
||||
</a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" href="__CSS__/product_category.css" type="text/css" />
|
||||
{block name="main"}
|
||||
<div class="orico_Page_category">
|
||||
<!--首页主题内容 -->
|
||||
<div class="pageMain">
|
||||
<div class="cat">
|
||||
<div class="ori-pd-title">
|
||||
<div class="catname">Power Strip</div>
|
||||
<a class="catmore">
|
||||
<span class="tmore">View all</span>
|
||||
<img src="/static/index/images/more.png" class="catmoreImg" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="ori-pd-list">
|
||||
<a class="oripditem">
|
||||
<div>
|
||||
<img src="/static/index/images/ORCIO-HSQ-02H-800-220.jpg" class="prdimg prdimg-show" />
|
||||
</div>
|
||||
<div class="prdName">ORICO 5 in 1 Travel Power Strip</div>
|
||||
<div class="prddec">ORICO-AP3-2A3U</div>
|
||||
<div class="newcp">New</div>
|
||||
</a>
|
||||
<a class="oripditem">
|
||||
<div>
|
||||
<img src="/static/index/images/ORCIO-HSQ-02H-800-220.jpg" class="prdimg prdimg-show" />
|
||||
</div>
|
||||
<div class="prdName">ORICO 5 in 1 Travel Power Strip</div>
|
||||
<div class="prddec">ORICO-AP3-2A3U</div>
|
||||
<div class="newcp">New</div>
|
||||
</a>
|
||||
<a class="oripditem">
|
||||
<div>
|
||||
<img src="/static/index/images/ORCIO-HSQ-02H-800-220.jpg" class="prdimg prdimg-show" />
|
||||
</div>
|
||||
<div class="prdName">ORICO 5 in 1 Travel Power Strip</div>
|
||||
<div class="prddec">ORICO-AP3-2A3U</div>
|
||||
</a>
|
||||
<a class="oripditem">
|
||||
<div>
|
||||
<img src="/static/index/images/ORCIO-HSQ-02H-800-220.jpg" class="prdimg prdimg-show" />
|
||||
</div>
|
||||
<div class="prdName">ORICO 5 in 1 Travel Power Strip</div>
|
||||
<div class="prddec">ORICO-AP3-2A3U</div>
|
||||
</a>
|
||||
<a class="oripditem">
|
||||
<div>
|
||||
<img src="/static/index/images/ORCIO-HSQ-02H-800-220.jpg" class="prdimg prdimg-show" />
|
||||
</div>
|
||||
<div class="prdName">ORICO 5 in 1 Travel Power Strip</div>
|
||||
<div class="prddec">ORICO-AP3-2A3U</div>
|
||||
<div class="newcp">New</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -7,24 +7,30 @@
|
||||
<div class="orico_Page_search">
|
||||
<div class="searchMain">
|
||||
<!-- 搜索框 -->
|
||||
<form action="{:url('product/search')}" method="get">
|
||||
<div class="search-ipt">
|
||||
<input class="ssipt" placeholder="请搜索" />
|
||||
<img src="/static/index/images/ssico.png" class="ssico" />
|
||||
<input class="ssipt" name="keywords" value="{$Request.param.keywords}" placeholder="请搜索" />
|
||||
<img src="__IMAGES__/ssico.png" class="ssico" />
|
||||
</div>
|
||||
</form>
|
||||
<!-- 搜索结果列表-->
|
||||
<ul class="seul">
|
||||
<a>
|
||||
{volist name="products" id="pro"}
|
||||
<a href="{:url('product/detail', ['id' => $pro['id']])}">
|
||||
<li class="seitme">
|
||||
<div class="imgb">
|
||||
<img src="/static/index/images/ORCIO-HSQ-02H-800-220.jpg" class="search-pr-img" />
|
||||
<img src="{$pro.cover_image}" class="search-pr-img" />
|
||||
</div>
|
||||
<div class="prInfp">
|
||||
<div class="txt1"><strong class="redpoint">电脑</strong>显示器支架</div>
|
||||
<div class="txt2"> ORICO-HSQ-02Q </div>
|
||||
<div class="txt3"> ORICO-HSQ-02Q </div>
|
||||
<div class="txt1">{$pro.name|raw}</div>
|
||||
{notempty name="pro.short_name"}
|
||||
<div class="txt2">{$pro.short_name|raw}</div>
|
||||
{/notempty}
|
||||
<div class="txt3">{$pro.spu|raw}</div>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" href="__CSS__/product_subcategory.css" type="text/css" />
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="orico_Page_subcategory">
|
||||
<!--公共头部-->
|
||||
@@ -1,4 +1,5 @@
|
||||
<!-- 英文官网有-->
|
||||
{eq name="$Request.cookie.think_lang" value="en-us"}
|
||||
<div class="oricoCont">
|
||||
<div class="ctitem">
|
||||
<img src="__IMAGES__/customer-service.png" class="ctimg" />
|
||||
@@ -11,6 +12,7 @@
|
||||
<span class="ctdec">Need to contact us? Just send us an e-mail at odmmarket@orico.com.cn</span>
|
||||
</div>
|
||||
</div>
|
||||
{/eq}
|
||||
<footer class="orico_footer">
|
||||
<div class="fotter">
|
||||
<!--中间信息-->
|
||||
@@ -67,8 +69,9 @@
|
||||
<div class="ftopicos">
|
||||
<ul>
|
||||
{volist name="media_config" id="vo"}
|
||||
<a href="{$vo.url.value}"><img src="{$vo.image.value}" {if condition="!empty($vo.image.extra)"
|
||||
}style="{$vo.image.extra}" {/if} /></a>
|
||||
<a href="{$vo.url.value}">
|
||||
<img src="{$vo.image.value}" {if condition="!empty($vo.image.extra)"}style="{$vo.image.extra}" {/if} />
|
||||
</a>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<ul class="navItem_cyleft">
|
||||
{volist name="header_categorys" id="vo"}
|
||||
<li class="{$key == 0 ? 'it_active' : ''}">
|
||||
<a href="javascript:void(0);">{$vo.name}</a>
|
||||
<a href="{:url('product/category', ['id' => $vo.id])}">{$vo.name}</a>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
@@ -87,8 +87,11 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 英文官网才有-->
|
||||
<a class="storetopbt"><img src="__IMAGES__/shopico.png" class="storeImgico" />Store </a>
|
||||
{notempty name="basic_config['navigation_store_url']['value']"}
|
||||
<a class="storetopbt" href="{$basic_config['navigation_store_url']['value']}">
|
||||
<img src="__IMAGES__/shopico.png" class="storeImgico" />{:lang('header_navigation.store')}
|
||||
</a>
|
||||
{/notempty}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -109,7 +112,7 @@
|
||||
<div class="popitem">
|
||||
<a href="{:url('product/detail', ['id' => $vo.id])}"><img src="{$vo.cover_image}" class="popimg" /></a>
|
||||
<div class="productName">{$vo.name}</div>
|
||||
<div class="produc-dec">{$vo.name}</div>
|
||||
<div class="produc-dec">{$vo.short_name}</div>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<header class="narsPage-head">
|
||||
<div class="headcenter">
|
||||
<img class="logico" style="cursor:pointer;" src="__IMAGES__/logo_nas.png" />
|
||||
<a href="{:url('/index/topic/nas/index')}">
|
||||
<img class="logico" style="cursor:pointer;" src="__IMAGES__/logo_nas_{:cookie('think_lang')}.png" />
|
||||
</a>
|
||||
{notempty name="header_navigation"}
|
||||
<nav class="headnav">
|
||||
{volist name="header_navigation" id="nav" key="idx"}
|
||||
|
||||
@@ -27,26 +27,19 @@
|
||||
{/notempty}
|
||||
{notempty name="data.cyber.down_items"}
|
||||
<div class="nDtopIt2">
|
||||
<a href="https://appversion.oriconas.com/api/latest/url?appcode=cyberdata&platform=android" download="">
|
||||
<div class="nDitImg"><img src="/uploads/default/2025/0417/组 259.png">
|
||||
<div class="yy_name">Android</div>
|
||||
<div class="dwbt">Download</div>
|
||||
</div>
|
||||
</a>
|
||||
{volist name="data.cyber.down_items" id="it"}
|
||||
<a {notempty name="it.link"}href="{$it.link}"{/notempty}>
|
||||
<div class="nDitImg">
|
||||
<img src="{$it.image}" />
|
||||
{eq name=":cookie('think_lang')" value="en-us"}
|
||||
<div {:style(['color'=>$it.title_txt_color])}>{$it.title}</div>
|
||||
<div>Download</div>
|
||||
<div class="yy_name" {:style(['color'=>$it.title_txt_color])}>{$it.title}</div>
|
||||
<div class="dwbt">Download</div>
|
||||
{/eq}
|
||||
</div>
|
||||
</a>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
|
||||
</div>
|
||||
{/notempty}
|
||||
<!-- 微链接 -->
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<a class="nhlplxwmit nhlplxwmit-w1" {notempty name="co.link"}href="{$co.link}"{/notempty} {eq name="idx" value="3"}style="margin-right: 0;"{/eq}>
|
||||
<img src="{$co.image}" class="lximg" />
|
||||
{if condition="!empty($co.desc) && str_contains($co.desc, '<img')"}
|
||||
<img src="{:get_path_from_img_tag($co.desc)}" class="lxewmimg">
|
||||
<img src="{:get_path_from_img_tag($co.desc)}" class="lxewmimg" />
|
||||
<span class="t1" {:style(['color'=>$co.title_txt_color])}>{$co.title}</span>
|
||||
{else/}
|
||||
<span class="t1" {:style(['color'=>$co.title_txt_color])}>{$co.title}</span>
|
||||
@@ -73,7 +73,7 @@
|
||||
<a class="nhlplxwmit nhlplxwmit-w2" {notempty name="co.link"}href="{$co.link}"{/notempty} {eq name="idx%4" value="0"}style="margin-right: 0;"{/eq}>
|
||||
<img src="{$co.image}" class="lximg" />
|
||||
{if condition="!empty($co.desc) && str_contains($co.desc, '<img')"}
|
||||
<img src="{:get_path_from_img_tag($co.desc)}" class="lxewmimg">
|
||||
<img src="{:get_path_from_img_tag($co.desc)}" class="lxewmimg" />
|
||||
<span class="t1" {:style(['color'=>$co.title_txt_color])}>{$co.title}</span>
|
||||
{else/}
|
||||
<span class="t1" {:style(['color'=>$co.title_txt_color])}>{$co.title}</span>
|
||||
@@ -132,12 +132,20 @@
|
||||
});
|
||||
$('.nhlplxwmit:not(:first)').hover(function () {
|
||||
// 当鼠标移入时,显示.lxewmimg 并隐藏.lximg
|
||||
$(this).find('.lxewmimg').show();
|
||||
$(this).find('.lximg').hide();
|
||||
var lxe = $(this).find('.lxewmimg');
|
||||
var lxi = $(this).find('.lximg');
|
||||
if (lxe.length > 0) {
|
||||
lxe.show();
|
||||
lxi.hide();
|
||||
}
|
||||
}, function () {
|
||||
// 当鼠标移出时,隐藏.lxewmimg 并显示.lximg
|
||||
$(this).find('.lxewmimg').hide();
|
||||
$(this).find('.lximg').show();
|
||||
var lxe = $(this).find('.lxewmimg');
|
||||
var lxi = $(this).find('.lximg');
|
||||
if (lxe.length > 0) {
|
||||
lxe.hide();
|
||||
lxi.show();
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": ">=4.2",
|
||||
"topthink/think-trace": "^1.0"
|
||||
"topthink/think-trace": "^1.0",
|
||||
"swoole/ide-helper": "^6.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -31,8 +31,8 @@ class CreateProduct extends Migrator
|
||||
$table->addColumn('language_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '语言ID'])
|
||||
->addColumn('category_id', 'integer', ['signed' => false , 'null' => true, 'comment' => '分类ID'])
|
||||
->addColumn('spu', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '产品规格'])
|
||||
->addColumn('name', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '产品名称'])
|
||||
->addColumn('short_name', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '产品简称'])
|
||||
->addColumn('name', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '产品名称'])
|
||||
->addColumn('short_name', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '产品简称'])
|
||||
->addColumn('cover_image', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '产品封面图片'])
|
||||
->addColumn('desc', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '产品描述'])
|
||||
->addColumn('video_img', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '产品视频封面'])
|
||||
@@ -47,7 +47,7 @@ class CreateProduct extends Migrator
|
||||
->addColumn('status', 'boolean', ['null' => false, 'default' => 1, 'comment' => '状态:1启用,-1禁用'])
|
||||
->addColumn('seo_title', 'string', ['limit' => 255, 'default' => null, 'comment' => 'seo标题'])
|
||||
->addColumn('seo_keywords', 'string', ['limit' => 255, 'default' => null, 'comment' => 'seo关建词'])
|
||||
->addColumn('seo_desc', 'string', ['limit' => 255, 'default' => null, 'comment' => 'seo描述'])
|
||||
->addColumn('seo_desc', 'string', ['limit' => 512, 'default' => null, 'comment' => 'seo描述'])
|
||||
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addColumn('updated_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'update' => 'CURRENT_TIMESTAMP', 'comment' => '更新时间'])
|
||||
->addColumn('deleted_at', 'timestamp', ['null' => true, 'comment' => '删除时间'])
|
||||
|
||||
@@ -30,7 +30,7 @@ class CreateProductParams extends Migrator
|
||||
$table = $this->table('product_params', ['engine' => 'InnoDB', 'comment' => '产品参数表']);
|
||||
$table->addColumn('product_id', 'integer', ['signed' => false , 'null' => false, 'comment' => '产品ID'])
|
||||
->addColumn('name', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '参数名'])
|
||||
->addColumn('value', 'string', ['limit' => 125, 'null' => false, 'default' => '', 'comment' => '参数值'])
|
||||
->addColumn('value', 'string', ['limit' => 1024, 'null' => false, 'default' => '', 'comment' => '参数值'])
|
||||
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addColumn('updated_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'update' => 'CURRENT_TIMESTAMP', 'comment' => '更新时间'])
|
||||
->create();
|
||||
|
||||
2
public/migrate_temp_images/.gitignore
vendored
Normal file
2
public/migrate_temp_images/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
BIN
public/static/index/images/logo_nas_en-us.png
Normal file
BIN
public/static/index/images/logo_nas_en-us.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user