diff --git a/application/api/controller/Goods.php b/application/api/controller/Goods.php
index 9daa350e3a52597184e5135612ccaf350454d3ff..f59ffbf8b0181e65ebf69dd19476c32f7fc7a628 100755
--- a/application/api/controller/Goods.php
+++ b/application/api/controller/Goods.php
@@ -242,7 +242,7 @@ class Goods extends Common
* @version 1.0.0
* @datetime 2019-05-13T21:47:41+0800
*/
- public function Comment()
+ public function Comments()
{
// 参数
$params = $this->data_post;
diff --git a/application/index/controller/Goods.php b/application/index/controller/Goods.php
index 810118814300985343e228af21a0276020aa612c..3ad3e48278da0437c1448a122c7c442d44ec31d1 100755
--- a/application/index/controller/Goods.php
+++ b/application/index/controller/Goods.php
@@ -320,7 +320,7 @@ class Goods extends Common
* @version 1.0.0
* @datetime 2019-05-13T21:47:41+0800
*/
- public function Comment()
+ public function Comments()
{
// 是否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);
}
diff --git a/application/index/view/default/goods/comments.html b/application/index/view/default/goods/comments.html
new file mode 100644
index 0000000000000000000000000000000000000000..8084effd527e45e1c5b149bfd19f632c2536fb60
--- /dev/null
+++ b/application/index/view/default/goods/comments.html
@@ -0,0 +1,40 @@
+{{if !empty($data)}}
+ {{foreach $data as $v}}
+
+
动态评分
diff --git a/application/service/GoodsCommentsService.php b/application/service/GoodsCommentsService.php index cb8d6655c7fda5808871f270d662fd21ecba7de3..397431b0426d5c2e5efef547458d648078d9b00f 100644 --- a/application/service/GoodsCommentsService.php +++ b/application/service/GoodsCommentsService.php @@ -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' => [ diff --git a/public/appmini/old/alipay/app.json b/public/appmini/old/alipay/app.json index 6a564a7baaeffddf0b6b4a36cdab6650644d494e..52281267119d71b68ca6a34de716263d8328b037 100644 --- a/public/appmini/old/alipay/app.json +++ b/public/appmini/old/alipay/app.json @@ -1,5 +1,5 @@ { - "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", diff --git a/public/appmini/old/alipay/pages/goods-comment/goods-comment.acss b/public/appmini/old/alipay/pages/goods-comment/goods-comment.acss index 912526fbe98e240fd3d08ae507e8b45eccc216ae..5706c52324be05871e3ad73f39e96a19fe9ff408 100644 --- a/public/appmini/old/alipay/pages/goods-comment/goods-comment.acss +++ b/public/appmini/old/alipay/pages/goods-comment/goods-comment.acss @@ -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 diff --git a/public/appmini/old/alipay/pages/goods-comment/goods-comment.axml b/public/appmini/old/alipay/pages/goods-comment/goods-comment.axml index fadbd77e9628d56c1130b527c572b6c10db47c8e..c2a1ea2183b63a254d820971ba407e03f8a754e1 100644 --- a/public/appmini/old/alipay/pages/goods-comment/goods-comment.axml +++ b/public/appmini/old/alipay/pages/goods-comment/goods-comment.axml @@ -27,6 +27,11 @@'+result.data.data[i]['content']+'
'; - - // 规格 - if((result.data.data[i]['msg'] || null) != null) - { - html += ''+result.data.data[i]['msg']+'
'; - } - - // 回复 - if(result.data.data[i]['is_reply'] == 1 && (result.data.data[i]['reply'] || null) != null) - { - html += '
{{$v.content}}
+ {{if !empty($v['images'])}} ++ {{foreach $v.images as $img}} +-
+
+
+
+
+
+
+ {{/foreach}}
+
+ {{/if}} + {{if !empty($v['msg'])}} +{{$v.msg}}
+ {{/if}} + {{if $v['is_reply'] eq 1 and !empty($v['reply'])}} +