Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
5e89503a
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5e89503a
编写于
8月 11, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品封面图片优化
上级
c7f5f4bf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
40 addition
and
50 deletion
+40
-50
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+5
-5
application/index/controller/Goods.php
application/index/controller/Goods.php
+1
-1
application/index/view/default/goods/index.html
application/index/view/default/goods/index.html
+1
-1
application/index/view/default/index/index.html
application/index/view/default/index/index.html
+1
-1
application/service/GoodsService.php
application/service/GoodsService.php
+27
-37
sourcecode/alipay/pages/index/index.axml
sourcecode/alipay/pages/index/index.axml
+1
-1
sourcecode/baidu/pages/index/index.swan
sourcecode/baidu/pages/index/index.swan
+1
-1
sourcecode/qq/pages/index/index.qml
sourcecode/qq/pages/index/index.qml
+1
-1
sourcecode/toutiao/pages/index/index.ttml
sourcecode/toutiao/pages/index/index.ttml
+1
-1
sourcecode/weixin/pages/index/index.wxml
sourcecode/weixin/pages/index/index.wxml
+1
-1
未找到文件。
application/admin/view/default/goods/save_info.html
浏览文件 @
5e89503a
...
...
@@ -151,12 +151,12 @@
</select>
</div>
<div
class=
"am-form-group am-form-file"
>
<label
class=
"block"
>
首页推荐
图片
<span
class=
"am-form-group-label-tips"
>
留空则取相册第一张图
</span></label>
<ul
class=
"plug-file-upload-view goods-recommended-images-view"
data-form-name=
"
home_recommended_
images"
data-max-number=
"1"
data-dialog-type=
"images"
>
{{if !empty($data['
home_recommended_
images'])}}
<label
class=
"block"
>
封面
图片
<span
class=
"am-form-group-label-tips"
>
留空则取相册第一张图
</span></label>
<ul
class=
"plug-file-upload-view goods-recommended-images-view"
data-form-name=
"images"
data-max-number=
"1"
data-dialog-type=
"images"
>
{{if !empty($data['images'])}}
<li>
<input
type=
"text"
name=
"
home_recommended_images"
value=
"{{$data.home_recommended_
images}}"
/>
<img
src=
"{{$data.
home_recommended_
images}}"
/>
<input
type=
"text"
name=
"
images"
value=
"{{$data.
images}}"
/>
<img
src=
"{{$data.images}}"
/>
<i>
×
</i>
</li>
{{/if}}
...
...
application/index/controller/Goods.php
浏览文件 @
5e89503a
...
...
@@ -128,7 +128,7 @@ class Goods extends Common
'is_home_recommended'
=>
1
,
],
'order_by'
=>
'sales_count desc'
,
'field'
=>
'id,title,title_color,price,images
,home_recommended_images
'
,
'field'
=>
'id,title,title_color,price,images'
,
'n'
=>
16
,
];
$like_goods
=
GoodsService
::
GoodsList
(
$params
);
...
...
application/index/view/default/goods/index.html
浏览文件 @
5e89503a
...
...
@@ -582,7 +582,7 @@
<li>
<div
class=
"i-pic limit"
>
<a
href=
"{{:$v['goods_url']}}"
>
<img
alt=
"{{$v.title}}"
src=
"{{$v.
home_recommended_
images}}"
/>
<img
alt=
"{{$v.title}}"
src=
"{{$v.images}}"
/>
</a>
<a
href=
"{{:$v['goods_url']}}"
>
<p
class=
"am-text-truncate-2 am-margin-bottom-xs"
{{
if
!
empty
($
v.title_color
)}}
style=
"color:{{$v.title_color}};"
{{/
if
}}
>
{{$v.title}}
</p>
...
...
application/index/view/default/index/index.html
浏览文件 @
5e89503a
...
...
@@ -253,7 +253,7 @@
}
}
{{/php}}
<img
src=
"{{$goods.
home_recommended_
images}}"
alt=
"{{$goods.title}}"
class=
"goods-images"
/>
<img
src=
"{{$goods.images}}"
alt=
"{{$goods.title}}"
class=
"goods-images"
/>
</a>
<div
class=
"outer-con"
>
<div
class=
"goods-title am-text-truncate-2 am-margin-bottom-xs"
>
...
...
application/service/GoodsService.php
浏览文件 @
5e89503a
...
...
@@ -347,9 +347,34 @@ class GoodsService
$v
[
'goods_url'
]
=
MyUrl
(
'index/goods/index'
,
[
'id'
=>
$v
[
'id'
]]);
}
// 获取相册
if
(
$is_photo
&&
!
empty
(
$v
[
'id'
]))
{
$v
[
'photo'
]
=
Db
::
name
(
'GoodsPhoto'
)
->
where
([
'goods_id'
=>
$v
[
'id'
],
'is_show'
=>
1
])
->
order
(
'sort asc'
)
->
select
();
if
(
!
empty
(
$v
[
'photo'
]))
{
foreach
(
$v
[
'photo'
]
as
&
$vs
)
{
$vs
[
'images_old'
]
=
$vs
[
'images'
];
$vs
[
'images'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$vs
[
'images'
]);
}
}
}
// 商品封面图片
if
(
isset
(
$v
[
'images'
]))
{
// 不存在则读取相册第一张图片
if
(
empty
(
$v
[
'images'
]))
{
// 是否已存在相册
if
(
empty
(
$v
[
'photo'
])
||
empty
(
$v
[
'photo'
][
0
])
||
empty
(
$v
[
'photo'
][
0
][
'images_old'
]))
{
$v
[
'images'
]
=
Db
::
name
(
'GoodsPhoto'
)
->
where
([
'goods_id'
=>
$v
[
'id'
],
'is_show'
=>
0
])
->
order
(
'sort asc'
)
->
value
(
'images'
);
}
else
{
$v
[
'images'
]
=
$v
[
'photo'
][
0
][
'images_old'
];
}
}
$v
[
'images_old'
]
=
$v
[
'images'
];
$v
[
'images'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'images'
]);
}
...
...
@@ -361,27 +386,6 @@ class GoodsService
$v
[
'video'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'video'
]);
}
// 商品首页推荐图片,不存在则使用商品封面图片
if
(
isset
(
$v
[
'home_recommended_images'
]))
{
if
(
empty
(
$v
[
'home_recommended_images'
]))
{
if
(
isset
(
$v
[
'images'
]))
{
$v
[
'home_recommended_images'
]
=
$v
[
'images'
];
}
else
{
if
(
!
empty
(
$v
[
'id'
]))
{
$images
=
Db
::
name
(
'Goods'
)
->
where
([
'id'
=>
$v
[
'id'
]])
->
value
(
'images'
);
$v
[
'home_recommended_images'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$images
);
}
}
}
else
{
$v
[
'home_recommended_images_old'
]
=
$v
[
'home_recommended_images'
];
$v
[
'home_recommended_images'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'home_recommended_images'
]);
}
}
// PC内容处理
if
(
isset
(
$v
[
'content_web'
]))
{
...
...
@@ -424,20 +428,6 @@ class GoodsService
$v
[
'category_text'
]
=
implode
(
','
,
$category_name
);
}
// 获取相册
if
(
$is_photo
&&
!
empty
(
$v
[
'id'
]))
{
$v
[
'photo'
]
=
Db
::
name
(
'GoodsPhoto'
)
->
where
([
'goods_id'
=>
$v
[
'id'
],
'is_show'
=>
1
])
->
order
(
'sort asc'
)
->
select
();
if
(
!
empty
(
$v
[
'photo'
]))
{
foreach
(
$v
[
'photo'
]
as
&
$vs
)
{
$vs
[
'images_old'
]
=
$vs
[
'images'
];
$vs
[
'images'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$vs
[
'images'
]);
}
}
}
// 规格基础
if
(
isset
(
$v
[
'spec_base'
]))
{
...
...
@@ -790,7 +780,7 @@ class GoodsService
}
// 其它附件
$data_fields
=
[
'
home_recommended_
images'
,
'video'
];
$data_fields
=
[
'images'
,
'video'
];
$attachment
=
ResourcesService
::
AttachmentParams
(
$params
,
$data_fields
);
if
(
$attachment
[
'code'
]
!=
0
)
{
...
...
@@ -821,7 +811,7 @@ class GoodsService
'images'
=>
isset
(
$photo
[
'data'
][
0
])
?
$photo
[
'data'
][
0
]
:
''
,
'photo_count'
=>
count
(
$photo
[
'data'
]),
'is_home_recommended'
=>
isset
(
$params
[
'is_home_recommended'
])
?
intval
(
$params
[
'is_home_recommended'
])
:
0
,
'
home_recommended_images'
=>
$attachment
[
'data'
][
'home_recommended_
images'
],
'
images'
=>
$attachment
[
'data'
][
'
images'
],
'brand_id'
=>
isset
(
$params
[
'brand_id'
])
?
intval
(
$params
[
'brand_id'
])
:
0
,
'video'
=>
$attachment
[
'data'
][
'video'
],
'seo_title'
=>
empty
(
$params
[
'seo_title'
])
?
''
:
$params
[
'seo_title'
],
...
...
sourcecode/alipay/pages/index/index.axml
浏览文件 @
5e89503a
...
...
@@ -48,7 +48,7 @@
<view class="goods-list" a:if="{{floor.goods.length > 0}}">
<view a:for="{{floor.goods}}" a:for-item="goods" class="goods bg-white">
<navigator url="/pages/goods-detail/goods-detail?goods_id={{goods.id}}" hover-class="none">
<image src="{{goods.
home_recommended_
images}}" mode="aspectFit" />
<image src="{{goods.images}}" mode="aspectFit" />
<view class="goods-base">
<view class="goods-title single-text">{{goods.title}}</view>
<view class="sales-price">{{price_symbol}}{{goods.min_price}}</view>
...
...
sourcecode/baidu/pages/index/index.swan
浏览文件 @
5e89503a
...
...
@@ -48,7 +48,7 @@
<view class="goods-list" s-if="floor.goods.length > 0">
<view s-for="goods, index in floor.goods" s-key="keys" class="goods bg-white">
<navigator url="/pages/goods-detail/goods-detail?goods_id={{goods.id}}" hover-class="none">
<image src="{{goods.
home_recommended_
images}}" mode="aspectFit" />
<image src="{{goods.images}}" mode="aspectFit" />
<view class="goods-base">
<view class="goods-title single-text">{{goods.title}}</view>
<view class="sales-price">{{price_symbol}}{{goods.min_price}}</view>
...
...
sourcecode/qq/pages/index/index.qml
浏览文件 @
5e89503a
...
...
@@ -48,7 +48,7 @@
<
view
class
=
"
goods-list
"
qq
:
if
=
"
{{floor.goods.length > 0}}
"
>
<
view
qq
:
for
=
"
{{floor.goods}}
"
qq
:
key
=
"
keys
"
qq
:
for
-
item
=
"
goods
"
class
=
"
goods bg-white
"
>
<
navigator
url
=
"
/pages/goods-detail/goods-detail?goods_id={{goods.id}}
"
hover
-
class
=
"
none
"
>
<
image
src
=
"
{{goods.
home_recommended_
images}}
"
mode
=
"
aspectFit
"
/>
<
image
src
=
"
{{goods.images}}
"
mode
=
"
aspectFit
"
/>
<
view
class
=
"
goods-base
"
>
<
view
class
=
"
goods-title single-text
"
>
{{
goods
.
title
}}
<
/view
>
<
view
class
=
"
sales-price
"
>
{{
price_symbol
}}{{
goods
.
min_price
}}
<
/view
>
...
...
sourcecode/toutiao/pages/index/index.ttml
浏览文件 @
5e89503a
...
...
@@ -51,7 +51,7 @@
<view class="goods-list" tt:if="{{floor.goods.length > 0}}">
<view tt:for="{{floor.goods}}" tt:key="keys" tt:for-item="goods" class="goods bg-white">
<navigator url="/pages/goods-detail/goods-detail?goods_id={{goods.id}}" hover-class="none">
<image src="{{goods.
home_recommended_
images}}" mode="aspectFit" />
<image src="{{goods.images}}" mode="aspectFit" />
<view class="goods-base">
<view class="goods-title single-text">{{goods.title}}</view>
<view class="sales-price">{{price_symbol}}{{goods.min_price}}</view>
...
...
sourcecode/weixin/pages/index/index.wxml
浏览文件 @
5e89503a
...
...
@@ -48,7 +48,7 @@
<view class="goods-list" wx:if="{{floor.goods.length > 0}}">
<view wx:for="{{floor.goods}}" wx:key="keys" wx:for-item="goods" class="goods bg-white">
<navigator url="/pages/goods-detail/goods-detail?goods_id={{goods.id}}" hover-class="none">
<image src="{{goods.
home_recommended_
images}}" mode="aspectFit" />
<image src="{{goods.images}}" mode="aspectFit" />
<view class="goods-base">
<view class="goods-title single-text">{{goods.title}}</view>
<view class="sales-price">{{price_symbol}}{{goods.min_price}}</view>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录