Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
99dde851
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,发现更多精彩内容 >>
提交
99dde851
编写于
10月 11, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
评论展示图片
上级
02b2bc2c
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
162 addition
and
57 deletion
+162
-57
application/api/controller/Goods.php
application/api/controller/Goods.php
+1
-1
application/index/controller/Goods.php
application/index/controller/Goods.php
+3
-3
application/index/view/default/goods/comments.html
application/index/view/default/goods/comments.html
+40
-0
application/index/view/default/goods/index.html
application/index/view/default/goods/index.html
+1
-1
application/service/GoodsCommentsService.php
application/service/GoodsCommentsService.php
+14
-0
public/appmini/old/alipay/app.json
public/appmini/old/alipay/app.json
+2
-2
public/appmini/old/alipay/pages/goods-comment/goods-comment.acss
...appmini/old/alipay/pages/goods-comment/goods-comment.acss
+15
-3
public/appmini/old/alipay/pages/goods-comment/goods-comment.axml
...appmini/old/alipay/pages/goods-comment/goods-comment.axml
+5
-0
public/appmini/old/alipay/pages/goods-comment/goods-comment.js
...c/appmini/old/alipay/pages/goods-comment/goods-comment.js
+11
-1
public/appmini/old/baidu/pages/goods-comment/goods-comment.css
...c/appmini/old/baidu/pages/goods-comment/goods-comment.css
+15
-3
public/appmini/old/baidu/pages/goods-comment/goods-comment.js
...ic/appmini/old/baidu/pages/goods-comment/goods-comment.js
+12
-2
public/appmini/old/baidu/pages/goods-comment/goods-comment.swan
.../appmini/old/baidu/pages/goods-comment/goods-comment.swan
+5
-0
public/appmini/old/weixin/app.js
public/appmini/old/weixin/app.js
+1
-1
public/appmini/old/weixin/pages/goods-comment/goods-comment.js
...c/appmini/old/weixin/pages/goods-comment/goods-comment.js
+12
-2
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml
...appmini/old/weixin/pages/goods-comment/goods-comment.wxml
+5
-0
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxss
...appmini/old/weixin/pages/goods-comment/goods-comment.wxss
+15
-3
public/static/index/default/css/goods.css
public/static/index/default/css/goods.css
+4
-1
public/static/index/default/js/goods.js
public/static/index/default/js/goods.js
+1
-34
未找到文件。
application/api/controller/Goods.php
浏览文件 @
99dde851
...
...
@@ -242,7 +242,7 @@ class Goods extends Common
* @version 1.0.0
* @datetime 2019-05-13T21:47:41+0800
*/
public
function
Comment
()
public
function
Comment
s
()
{
// 参数
$params
=
$this
->
data_post
;
...
...
application/index/controller/Goods.php
浏览文件 @
99dde851
...
...
@@ -320,7 +320,7 @@ class Goods extends Common
* @version 1.0.0
* @datetime 2019-05-13T21:47:41+0800
*/
public
function
Comment
()
public
function
Comment
s
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
...
...
@@ -358,13 +358,13 @@ class Goods extends Common
'is_public'
=>
1
,
);
$data
=
GoodsCommentsService
::
GoodsCommentsList
(
$data_params
);
// 返回数据
$result
=
[
'number'
=>
$number
,
'total'
=>
$total
,
'page_total'
=>
$page_total
,
'data'
=>
$
data
[
'data'
]
,
'data'
=>
$
this
->
fetch
(
null
,
[
'data'
=>
$data
[
'data'
]])
,
];
return
DataReturn
(
'请求成功'
,
0
,
$result
);
}
...
...
application/index/view/default/goods/comments.html
0 → 100644
浏览文件 @
99dde851
{{if !empty($data)}}
{{foreach $data as $v}}
<article
class=
"am-comment"
>
<img
src=
"{{$v.user.avatar}}"
class=
"am-comment-avatar"
alt=
"{{$v.user.user_name_view}}"
/>
<div
class=
"am-comment-main"
>
<header
class=
"am-comment-hd"
>
<div
class=
"am-comment-meta"
>
<span
class=
"am-comment-author"
>
{{$v.user.user_name_view}}
</span>
评论于
<time>
{{$v.add_time_time}}
</time>
</div>
</header>
<div
class=
"am-comment-bd"
>
<p>
{{$v.content}}
</p>
{{if !empty($v['images'])}}
<ul
class=
"am-cf comment-images"
>
{{foreach $v.images as $img}}
<li
class=
"am-fl"
>
<div
class=
"am-gallery-item"
>
<a
href=
"{{$img}}"
target=
"_blank"
>
<img
src=
"{{$img}}"
class=
"am-img-thumbnail am-radius"
/>
</a>
</div>
</li>
{{/foreach}}
</ul>
{{/if}}
{{if !empty($v['msg'])}}
<p
class=
"comment-spec"
>
{{$v.msg}}
</p>
{{/if}}
{{if $v['is_reply'] eq 1 and !empty($v['reply'])}}
<div
class=
"comment-reply"
>
<span
class=
"comment-reply-title"
>
管理员回复:
</span>
<span
class=
"comment-reply-desc"
>
{{$v.reply}}
</span>
</div>
{{/if}}
</div>
</div>
</article>
{{/foreach}}
{{/if}}
\ No newline at end of file
application/index/view/default/goods/index.html
浏览文件 @
99dde851
...
...
@@ -481,7 +481,7 @@
</div>
<!-- 评论 -->
<div
class=
"am-tab-panel am-fade goods-comment"
data-goods-id=
"{{$goods.id}}"
data-url=
"{{:MyUrl('index/goods/comment')}}"
>
<div
class=
"am-tab-panel am-fade goods-comment"
data-goods-id=
"{{$goods.id}}"
data-url=
"{{:MyUrl('index/goods/comment
s
')}}"
>
<div
class=
"am-cf score-container"
>
<div
class=
"score am-fl"
>
<p
class=
"name"
>
动态评分
</p>
...
...
application/service/GoodsCommentsService.php
浏览文件 @
99dde851
...
...
@@ -220,6 +220,20 @@ class GoodsCommentsService
$v
[
'user'
]
=
$user
;
}
// 图片
if
(
isset
(
$v
[
'images'
]))
{
if
(
!
empty
(
$v
[
'images'
]))
{
$images
=
json_decode
(
$v
[
'images'
],
true
);
foreach
(
$images
as
&
$img
)
{
$img
=
ResourcesService
::
AttachmentPathViewHandle
(
$img
);
}
$v
[
'images'
]
=
$images
;
}
}
// 获取商品信息
$goods_params
=
[
'where'
=>
[
...
...
public/appmini/old/alipay/app.json
浏览文件 @
99dde851
{
"pages"
:
[
"pages/user-order/user-order"
,
"pages"
:
[
"pages/index/index"
,
"pages/goods-category/goods-category"
,
"pages/cart/cart"
,
...
...
@@ -14,7 +14,7 @@
"pages/buy/buy"
,
"pages/user-address/user-address"
,
"pages/user-address-save/user-address-save"
,
"pages/user-order/user-order"
,
"pages/user-order-detail/user-order-detail"
,
"pages/user-order-comments/user-order-comments"
,
"pages/user-faovr/user-faovr"
,
...
...
public/appmini/old/alipay/pages/goods-comment/goods-comment.acss
浏览文件 @
99dde851
...
...
@@ -81,18 +81,30 @@
.base-content {
padding: 10rpx;
}
.base-content .content, .base-content .reply {
.base-content .content,
.base-content .reply {
line-height: 46rpx;
font-size: 30rpx;
}
.base-content .spec {
.base-content .spec,
.base-content .reply,
.base-content .images {
margin-top: 20rpx;
}
.base-content .spec {
color: #B0B0B0;
}
.base-content .reply {
margin-top: 20rpx;
padding-top: 20rpx;
}
.base-content .reply-desc {
color: #905602;
}
.base-content .images image {
width: 100rpx;
height: 100rpx;
padding: 5rpx;
}
.base-content .images image:not(:last-child) {
margin-right: 10rpx;
}
\ No newline at end of file
public/appmini/old/alipay/pages/goods-comment/goods-comment.axml
浏览文件 @
99dde851
...
...
@@ -27,6 +27,11 @@
</view>
<view class="base-content oh">
<view class="content cr-666">{{item.content}}</view>
<view a:if="{{(item.images || null) != null && item.images.length > 0}}" class="images oh">
<block a:for="{{item.images}}" a:for-index="ix" a:for-item="iv">
<image class="br" onTap="images_show_event" data-index="{{index}}" data-ix="{{ix}}" src="{{iv}}" mode="aspectFit"></image>
</block>
</view>
<view a:if="{{(item.msg || null) != null}}" class="spec">{{item.msg}}</view>
<view a:if="{{item.is_reply == 1 && (item.reply || null) != null}}" class="reply br-t-dashed">
<text class="cr-888">管理员回复:</text>
...
...
public/appmini/old/alipay/pages/goods-comment/goods-comment.js
浏览文件 @
99dde851
...
...
@@ -77,7 +77,7 @@ Page({
});
my
.
request
({
url
:
app
.
get_request_url
(
"
comment
"
,
"
goods
"
),
url
:
app
.
get_request_url
(
"
comment
s
"
,
"
goods
"
),
method
:
"
POST
"
,
data
:
{
goods_id
:
this
.
data
.
params
.
goods_id
,
page
:
this
.
data
.
data_page
},
dataType
:
"
json
"
,
...
...
@@ -154,4 +154,14 @@ Page({
scroll_lower
(
e
)
{
this
.
get_data_list
();
},
// 图片预览
images_show_event
(
e
)
{
var
index
=
e
.
target
.
dataset
.
index
;
var
ix
=
e
.
target
.
dataset
.
ix
;
my
.
previewImage
({
current
:
ix
,
urls
:
this
.
data
.
data_list
[
index
][
'
images
'
],
});
},
});
public/appmini/old/baidu/pages/goods-comment/goods-comment.css
浏览文件 @
99dde851
...
...
@@ -81,18 +81,30 @@
.base-content
{
padding
:
10
rpx
;
}
.base-content
.content
,
.base-content
.reply
{
.base-content
.content
,
.base-content
.reply
{
line-height
:
46
rpx
;
font-size
:
30
rpx
;
}
.base-content
.spec
{
.base-content
.spec
,
.base-content
.reply
,
.base-content
.images
{
margin-top
:
20
rpx
;
}
.base-content
.spec
{
color
:
#B0B0B0
;
}
.base-content
.reply
{
margin-top
:
20
rpx
;
padding-top
:
20
rpx
;
}
.base-content
.reply-desc
{
color
:
#905602
;
}
.base-content
.images
image
{
width
:
100
rpx
;
height
:
100
rpx
;
padding
:
5
rpx
;
}
.base-content
.images
image
:not
(
:last-child
)
{
margin-right
:
10
rpx
;
}
\ No newline at end of file
public/appmini/old/baidu/pages/goods-comment/goods-comment.js
浏览文件 @
99dde851
...
...
@@ -77,7 +77,7 @@ Page({
});
swan
.
request
({
url
:
app
.
get_request_url
(
"
comment
"
,
"
goods
"
),
url
:
app
.
get_request_url
(
"
comment
s
"
,
"
goods
"
),
method
:
"
POST
"
,
data
:
{
goods_id
:
this
.
data
.
params
.
goods_id
,
page
:
this
.
data
.
data_page
},
dataType
:
"
json
"
,
...
...
@@ -153,5 +153,15 @@ Page({
// 滚动加载
scroll_lower
(
e
)
{
this
.
get_data_list
();
}
},
// 图片预览
images_show_event
(
e
)
{
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
ix
=
e
.
currentTarget
.
dataset
.
ix
;
swan
.
previewImage
({
current
:
this
.
data
.
data_list
[
index
][
'
images
'
][
ix
],
urls
:
this
.
data
.
data_list
[
index
][
'
images
'
],
});
},
});
\ No newline at end of file
public/appmini/old/baidu/pages/goods-comment/goods-comment.swan
浏览文件 @
99dde851
...
...
@@ -27,6 +27,11 @@
</view>
<view class="base-content oh">
<view class="content cr-666">{{item.content}}</view>
<view s-if="(item.images || null) != null && item.images.length > 0" class="images oh">
<block s-for="iv,ix in item.images" s-key="key">
<image class="br" bindtap="images_show_event" data-index="{{index}}" data-ix="{{ix}}" src="{{iv}}" mode="aspectFit"></image>
</block>
</view>
<view s-if="(item.msg || null) != null" class="spec">{{item.msg}}</view>
<view s-if="item.is_reply == 1 && (item.reply || null) != null" class="reply br-t-dashed">
<text class="cr-888">管理员回复:</text>
...
...
public/appmini/old/weixin/app.js
浏览文件 @
99dde851
...
...
@@ -65,7 +65,7 @@ App({
// 请求地址
request_url
:
"
{{request_url}}
"
,
request_url
:
'
http://tp5-dev.com/
'
,
request_url
:
'
https://test.shopxo.net/
'
,
//
request_url: 'https://test.shopxo.net/',
// 基础信息
application_title
:
"
{{application_title}}
"
,
...
...
public/appmini/old/weixin/pages/goods-comment/goods-comment.js
浏览文件 @
99dde851
...
...
@@ -12,7 +12,7 @@ Page({
},
onLoad
(
params
)
{
//params['goods_id']=
2
;
//params['goods_id']=
9
;
this
.
setData
({
params
:
params
});
this
.
init
();
},
...
...
@@ -77,7 +77,7 @@ Page({
});
wx
.
request
({
url
:
app
.
get_request_url
(
"
comment
"
,
"
goods
"
),
url
:
app
.
get_request_url
(
"
comment
s
"
,
"
goods
"
),
method
:
"
POST
"
,
data
:
{
goods_id
:
this
.
data
.
params
.
goods_id
,
page
:
this
.
data
.
data_page
},
dataType
:
"
json
"
,
...
...
@@ -154,4 +154,14 @@ Page({
scroll_lower
(
e
)
{
this
.
get_data_list
();
},
// 图片预览
images_show_event
(
e
)
{
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
ix
=
e
.
currentTarget
.
dataset
.
ix
;
wx
.
previewImage
({
current
:
this
.
data
.
data_list
[
index
][
'
images
'
][
ix
],
urls
:
this
.
data
.
data_list
[
index
][
'
images
'
],
});
},
});
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxml
浏览文件 @
99dde851
...
...
@@ -27,6 +27,11 @@
</view>
<view class="base-content oh">
<view class="content cr-666">{{item.content}}</view>
<view wx:if="{{(item.images || null) != null && item.images.length > 0}}" class="images oh">
<block wx:for="{{item.images}}" wx:key="iv" wx:for-index="ix" wx:for-item="iv">
<image class="br" bindtap="images_show_event" data-index="{{index}}" data-ix="{{ix}}" src="{{iv}}" mode="aspectFit"></image>
</block>
</view>
<view wx:if="{{(item.msg || null) != null}}" class="spec">{{item.msg}}</view>
<view wx:if="{{item.is_reply == 1 && (item.reply || null) != null}}" class="reply br-t-dashed">
<text class="cr-888">管理员回复:</text>
...
...
public/appmini/old/weixin/pages/goods-comment/goods-comment.wxss
浏览文件 @
99dde851
...
...
@@ -81,18 +81,30 @@
.base-content {
padding: 10rpx;
}
.base-content .content, .base-content .reply {
.base-content .content,
.base-content .reply {
line-height: 46rpx;
font-size: 30rpx;
}
.base-content .spec {
.base-content .spec,
.base-content .reply,
.base-content .images {
margin-top: 20rpx;
}
.base-content .spec {
color: #B0B0B0;
}
.base-content .reply {
margin-top: 20rpx;
padding-top: 20rpx;
}
.base-content .reply-desc {
color: #905602;
}
.base-content .images image {
width: 100rpx;
height: 100rpx;
padding: 5rpx;
}
.base-content .images image:not(:last-child) {
margin-right: 10rpx;
}
\ No newline at end of file
public/static/index/default/css/goods.css
浏览文件 @
99dde851
...
...
@@ -64,10 +64,13 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
/* 商品评论 */
.goods-comment
.am-comment
{
margin-top
:
15px
;
text-align
:
left
;
}
.goods-comment
.am-comment-main
{
border
:
1px
solid
#eee
;
}
.goods-comment
.comment-spec
{
margin-top
:
5px
;
color
:
#B0B0B0
;
}
.goods-comment
.comment-spec
{
color
:
#B0B0B0
;
}
.comment-reply
{
border-top
:
1px
dashed
#eee
;
margin-top
:
10px
;
padding-top
:
10px
;
}
.goods-comment
.am-comment
.am-comment-hd
{
background
:
#fbfbfb
;
}
.goods-comment
.am-comment
.am-comment-main
:after
{
border-right-color
:
#fbfbfb
;
}
.goods-comment
.comment-images
,
.goods-comment
.comment-spec
{
margin-top
:
5px
;
}
.goods-comment
.comment-images
img
{
width
:
50px
;
height
:
50px
;
border
:
1px
solid
#eee
;
}
.goods-comment
.comment-images
li
:not
(
:last-child
)
{
margin-right
:
5px
;
}
.comment-reply-title
{
color
:
#666
;
}
.comment-reply-desc
{
color
:
#905602
;
}
...
...
public/static/index/default/js/goods.js
浏览文件 @
99dde851
...
...
@@ -46,40 +46,7 @@ function GoodsCommentsHtml(page)
$
(
'
.goods-page-no-data
'
).
addClass
(
'
none
'
);
if
(
result
.
code
==
0
)
{
var
html
=
''
;
for
(
var
i
in
result
.
data
.
data
)
{
html
+=
'
<article class="am-comment">
'
;
html
+=
'
<img src="
'
+
result
.
data
.
data
[
i
][
'
user
'
][
'
avatar
'
]
+
'
" class="am-comment-avatar" alt="
'
+
result
.
data
.
data
[
i
][
'
user
'
][
'
user_name_view
'
]
+
'
" />
'
;
html
+=
'
<div class="am-comment-main">
'
;
html
+=
'
<header class="am-comment-hd">
'
;
html
+=
'
<div class="am-comment-meta">
'
;
html
+=
'
<span class="am-comment-author">
'
+
result
.
data
.
data
[
i
][
'
user
'
][
'
user_name_view
'
]
+
'
</span>
'
;
html
+=
'
评论于 <time datetime="">
'
+
result
.
data
.
data
[
i
][
'
add_time_time
'
]
+
'
</time>
'
;
html
+=
'
</div>
'
;
html
+=
'
</header>
'
;
html
+=
'
<div class="am-comment-bd">
'
;
html
+=
'
<p>
'
+
result
.
data
.
data
[
i
][
'
content
'
]
+
'
</p>
'
;
// 规格
if
((
result
.
data
.
data
[
i
][
'
msg
'
]
||
null
)
!=
null
)
{
html
+=
'
<p class="comment-spec">
'
+
result
.
data
.
data
[
i
][
'
msg
'
]
+
'
</p>
'
;
}
// 回复
if
(
result
.
data
.
data
[
i
][
'
is_reply
'
]
==
1
&&
(
result
.
data
.
data
[
i
][
'
reply
'
]
||
null
)
!=
null
)
{
html
+=
'
<div class="comment-reply">
'
;
html
+=
'
<span class="comment-reply-title">管理员回复:</span>
'
;
html
+=
'
<span class="comment-reply-desc">
'
+
result
.
data
.
data
[
i
][
'
reply
'
]
+
'
</span>
'
;
html
+=
'
</div>
'
;
}
html
+=
'
</div>
'
;
html
+=
'
</article>
'
;
}
$
(
'
.goods-comment-content
'
).
html
(
html
);
$
(
'
.goods-comment-content
'
).
html
(
result
.
data
.
data
);
$
(
'
.goods-page-container
'
).
html
(
PageLibrary
(
result
.
data
.
total
,
result
.
data
.
number
,
page
,
2
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录