Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
8e548619
ShopXO
项目概览
starsw001
/
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,发现更多精彩内容 >>
提交
8e548619
编写于
5月 15, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品评论
上级
71a7c9b7
变更
22
展开全部
隐藏空白更改
内联
并排
Showing
22 changed file
with
650 addition
and
282 deletion
+650
-282
application/admin/controller/Answer.php
application/admin/controller/Answer.php
+8
-10
application/admin/controller/Goodscomments.php
application/admin/controller/Goodscomments.php
+11
-23
application/admin/view/default/answer/index.html
application/admin/view/default/answer/index.html
+48
-52
application/admin/view/default/answer/save_info.html
application/admin/view/default/answer/save_info.html
+15
-0
application/admin/view/default/goodscomments/index.html
application/admin/view/default/goodscomments/index.html
+51
-37
application/admin/view/default/goodscomments/save_info.html
application/admin/view/default/goodscomments/save_info.html
+106
-0
application/index/controller/Answer.php
application/index/controller/Answer.php
+22
-3
application/index/controller/Goods.php
application/index/controller/Goods.php
+4
-0
application/index/view/default/answer/index.html
application/index/view/default/answer/index.html
+5
-1
application/index/view/default/goods/index.html
application/index/view/default/goods/index.html
+30
-0
application/index/view/default/order/comments.html
application/index/view/default/order/comments.html
+3
-3
application/index/view/default/order/index.html
application/index/view/default/order/index.html
+4
-4
application/plugins/answers/service/Service.php
application/plugins/answers/service/Service.php
+0
-2
application/service/AnswerService.php
application/service/AnswerService.php
+13
-21
application/service/GoodsCommentsService.php
application/service/GoodsCommentsService.php
+147
-9
config/shopxo.sql
config/shopxo.sql
+36
-36
public/static/admin/default/css/answer.css
public/static/admin/default/css/answer.css
+37
-3
public/static/admin/default/css/goodscomments.css
public/static/admin/default/css/goodscomments.css
+29
-7
public/static/admin/default/js/answer.js
public/static/admin/default/js/answer.js
+10
-9
public/static/admin/default/js/goodscomments.js
public/static/admin/default/js/goodscomments.js
+25
-0
public/static/index/default/css/goods.css
public/static/index/default/css/goods.css
+24
-60
public/static/index/default/js/goods.js
public/static/index/default/js/goods.js
+22
-2
未找到文件。
application/admin/controller/Answer.php
浏览文件 @
8e548619
...
...
@@ -77,14 +77,13 @@ class Answer extends Common
'm'
=>
$page
->
GetPageStarNumber
(),
'n'
=>
$number
,
'where'
=>
$where
,
'is_public'
=>
0
,
);
$data
=
AnswerService
::
AnswerList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
//
状态
//
静态数据
$this
->
assign
(
'common_is_show_list'
,
lang
(
'common_is_show_list'
));
// 是否
$this
->
assign
(
'common_is_text_list'
,
lang
(
'common_is_text_list'
));
// 参数
...
...
@@ -110,10 +109,11 @@ class Answer extends Common
{
// 获取列表
$data_params
=
array
(
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
[
'id'
=>
intval
(
$params
[
'id'
])],
'field'
=>
'*'
,
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
[
'id'
=>
intval
(
$params
[
'id'
])],
'field'
=>
'*'
,
'is_public'
=>
0
,
);
$ret
=
AnswerService
::
AnswerList
(
$data_params
);
...
...
@@ -133,10 +133,8 @@ class Answer extends Common
}
$this
->
assign
(
'data'
,
$data
);
//
状态
//
静态数据
$this
->
assign
(
'common_is_show_list'
,
lang
(
'common_is_show_list'
));
// 是否
$this
->
assign
(
'common_is_text_list'
,
lang
(
'common_is_text_list'
));
// 参数
...
...
application/admin/controller/Goodscomments.php
浏览文件 @
8e548619
...
...
@@ -13,7 +13,7 @@ namespace app\admin\controller;
use
app\service\GoodsCommentsService
;
/**
* 商品评
价
管理
* 商品评
论
管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
...
...
@@ -85,6 +85,7 @@ class Goodscomments extends Common
// 静态数据
$this
->
assign
(
'common_is_show_list'
,
lang
(
'common_is_show_list'
));
$this
->
assign
(
'common_is_text_list'
,
lang
(
'common_is_text_list'
));
$this
->
assign
(
'rating_list'
,
GoodsCommentsService
::
$rating_list
);
$this
->
assign
(
'business_type_list'
,
GoodsCommentsService
::
$business_type_list
);
// 参数
...
...
@@ -110,34 +111,21 @@ class Goodscomments extends Common
{
// 获取列表
$data_params
=
array
(
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
[
'id'
=>
intval
(
$params
[
'id'
])],
'
field'
=>
'*'
,
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
[
'id'
=>
intval
(
$params
[
'id'
])],
'
is_public'
=>
0
,
);
$ret
=
GoodsCommentsService
::
AnswerList
(
$data_params
);
// 内容
if
(
!
empty
(
$ret
[
'data'
][
0
][
'content'
]))
{
$ret
[
'data'
][
0
][
'content'
]
=
str_replace
(
'<br />'
,
"
\n
"
,
$ret
[
'data'
][
0
][
'content'
]);
}
// 回复内容
if
(
!
empty
(
$ret
[
'data'
][
0
][
'reply'
]))
{
$ret
[
'data'
][
0
][
'reply'
]
=
str_replace
(
'<br />'
,
"
\n
"
,
$ret
[
'data'
][
0
][
'reply'
]);
}
$ret
=
GoodsCommentsService
::
GoodsCommentsList
(
$data_params
);
$data
=
empty
(
$ret
[
'data'
][
0
])
?
[]
:
$ret
[
'data'
][
0
];
}
$this
->
assign
(
'data'
,
$data
);
//
状态
//
静态数据
$this
->
assign
(
'common_is_show_list'
,
lang
(
'common_is_show_list'
));
// 是否
$this
->
assign
(
'common_is_text_list'
,
lang
(
'common_is_text_list'
));
$this
->
assign
(
'rating_list'
,
GoodsCommentsService
::
$rating_list
);
$this
->
assign
(
'business_type_list'
,
GoodsCommentsService
::
$business_type_list
);
// 参数
unset
(
$params
[
'id'
]);
...
...
@@ -163,7 +151,7 @@ class Goodscomments extends Common
// 开始处理
$params
=
input
();
return
GoodsCommentsService
::
Answer
Save
(
$params
);
return
GoodsCommentsService
::
GoodsComments
Save
(
$params
);
}
/**
...
...
application/admin/view/default/answer/index.html
浏览文件 @
8e548619
...
...
@@ -78,15 +78,15 @@
<table
class=
"am-table am-table-striped am-table-hover am-text-middle m-t-10"
>
<thead>
<tr>
<th
class=
"am-hide-
sm-only
"
>
用户信息
</th>
<th
class=
"am-hide-
md-down
"
>
用户信息
</th>
<th
class=
"am-hide-sm-only"
>
联系信息
</th>
<th>
标题
</th>
<th
class=
"am-hide-sm-only"
>
内容
</th>
<th
class=
"am-hide-sm-only"
>
标题
</th>
<th>
内容
</th>
<th
class=
"am-hide-sm-only"
>
回复内容
</th>
<th
class=
"am-hide-sm-only"
>
访问次数
</th>
<th
class=
"am-hide-sm-only"
>
回复时间
</th>
<th
class=
"am-hide-sm-only"
>
创建时间
</th>
<th
>
是否
显示
</th>
<th
class=
"am-hide-sm-only"
>
显示
</th>
<th>
更多
</th>
<th>
操作
</th>
</tr>
...
...
@@ -95,23 +95,19 @@
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr
id=
"data-list-{{$v.id}}"
{{
if
$
v
['
is_show
']
eq
0}}
class=
"am-active"
{{/
if
}}
>
<td
class=
"am-hide-sm-only"
>
{{if !empty($v['username'])}}
{{$v.username}}
{{if !empty($v['nickname'])}}
({{$v.nickname}})
{{/if}}
{{if !empty($v['gender_text'])}}
({{$v.gender_text}})
{{/if}}
{{/if}}
{{if !empty($v['mobile'])}}
<br
/>
{{$v.mobile}}
{{/if}}
{{if empty($v['username']) and empty($v['mobile'])}}
<span
class=
"cr-ddd"
>
空
</span>
{{/if}}
</td>
<td
class=
"user-info am-hide-md-down"
>
{{if !empty($v['user'])}}
<img
src=
"{{$v.user.avatar}}"
alt=
"{{$v.user.user_name_view}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
<ul
class=
"user-base"
>
<li>
名称:{{if empty($v['user']['username'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.username}}{{/if}}
</li>
<li>
昵称:{{if empty($v['user']['nickname'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.nickname}}{{/if}}
</li>
<li>
手机:{{if empty($v['user']['mobile'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.mobile}}{{/if}}
</li>
<li>
邮箱:{{if empty($v['user']['email'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.email}}{{/if}}
</li>
</ul>
{{else /}}
用户信息异常
{{/if}}
</td>
<td
class=
"am-hide-sm-only"
>
{{if !empty($v['name']) and !empty($v['tel'])}}
{{$v.name}}
...
...
@@ -125,8 +121,8 @@
<span
class=
"cr-ddd"
>
未填写
</span>
{{/if}}
</td>
<td>
{{$v.title}}
</td>
<td
class=
"
am-hide-sm-only
"
>
<td
class=
"am-hide-sm-only"
>
{{$v.title}}
</td>
<td
class=
"
content-info
"
>
<div
class=
"reply-content"
>
{{$v.content|raw}}
</div>
...
...
@@ -143,7 +139,7 @@
<td
class=
"am-hide-sm-only"
>
{{$v.access_count}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.reply_time}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time}}
</td>
<td>
<td
class=
"am-hide-sm-only"
>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_show'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/answer/statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{$v['is_show']}}"
data-is-update-status=
"1"
></a>
</td>
<td>
...
...
@@ -158,22 +154,18 @@
<div
class=
"am-popup-bd"
>
<dl
class=
"dl-content"
>
<dt>
用户信息
</dt>
<dd>
{{if !empty($v['username'])}}
{{$v.username}}
{{if !empty($v['nickname'])}}
({{$v.nickname}})
{{/if}}
{{if !empty($v['gender_text'])}}
({{$v.gender_text}})
{{/if}}
{{/if}}
{{if !empty($v['mobile'])}}
<br
/>
{{$v.mobile}}
{{/if}}
{{if empty($v['username']) and empty($v['mobile'])}}
<span
class=
"cr-ddd"
>
空
</span>
{{/if}}
<dd
class=
"user-info"
>
{{if !empty($v['user'])}}
<img
src=
"{{$v.user.avatar}}"
alt=
"{{$v.user.user_name_view}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
<ul
class=
"user-base"
>
<li>
名称:{{if empty($v['user']['username'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.username}}{{/if}}
</li>
<li>
昵称:{{if empty($v['user']['nickname'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.nickname}}{{/if}}
</li>
<li>
手机:{{if empty($v['user']['mobile'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.mobile}}{{/if}}
</li>
<li>
邮箱:{{if empty($v['user']['email'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$v.user.email}}{{/if}}
</li>
</ul>
{{else /}}
用户信息异常
{{/if}}
</dd>
<dt>
联系人
</dt>
...
...
@@ -223,13 +215,11 @@
</div>
</td>
<td
class=
"view-operation"
>
<a
href=
"{{:MyUrl('admin/answer/saveinfo', array_merge($params, ['id'=>$v['id']]))}}"
>
<button
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-icon-edit"
>
编辑
</button>
</a>
<a
href=
"{{:MyUrl('admin/answer/saveinfo', array_merge($params, ['id'=>$v['id']]))}}"
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block am-icon-edit"
>
编辑
</a>
{{if $v['is_reply'] eq 0}}
<button
class=
"am-btn am-btn-success am-btn-xs am-radius submit-reply am-icon-gavel"
data-am-modal=
"{target: '#my-popup-reply'}"
data-json=
'{{:json_encode($v)}}'
>
回复
</button>
<button
class=
"am-btn am-btn-success am-btn-xs am-radius
am-btn-block
submit-reply am-icon-gavel"
data-am-modal=
"{target: '#my-popup-reply'}"
data-json=
'{{:json_encode($v)}}'
>
回复
</button>
{{/if}}
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o submit-delete"
data-url=
"{{:MyUrl('admin/answer/delete')}}"
data-id=
"{{$v.id}}"
>
删除
</button>
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-
btn-block am-
icon-trash-o submit-delete"
data-url=
"{{:MyUrl('admin/answer/delete')}}"
data-id=
"{{$v.id}}"
>
删除
</button>
</td>
</tr>
{{/foreach}}
...
...
@@ -250,21 +240,27 @@
</div>
<div
class=
"am-popup-bd"
>
<dl
class=
"dl-content"
>
<dt>
联系人
</dt>
<dd>
<span
class=
"reply-name"
></span>
-
<span
class=
"reply-tel"
></span>
</dd>
<dt>
用户信息
</dt>
<dd
class=
"user-info"
>
<img
src=
"{{$attachment_host}}/static/common/images/user-img-sm.gif"
class=
"am-img-thumbnail am-radius am-align-left"
/>
<ul
class=
"user-base"
>
<li
class=
"username"
>
名称:
<span>
...
</span></li>
<li
class=
"nickname"
>
昵称:
<span>
...
</span></li>
<li
class=
"mobile"
>
手机:
<span>
...
</span></li>
<li
class=
"email"
>
邮箱:
<span>
...
</span></li>
</ul>
</dd>
</dl>
<form
class=
"am-form form-validation"
action=
"{{:MyUrl('admin/answer/reply')}}"
method=
"POST"
request-type=
"ajax-reload"
enctype=
"multipart/form-data"
>
<form
class=
"am-form form-validation
-reply
"
action=
"{{:MyUrl('admin/answer/reply')}}"
method=
"POST"
request-type=
"ajax-reload"
enctype=
"multipart/form-data"
>
<div
class=
"am-form-group"
>
<label>
回复内容
</label>
<textarea
name=
"reply"
rows=
"5"
class=
"am-radius"
placeholder=
"回复内容格式 2~230 个字符"
data-validation-message=
"回复内容格式 2~230 个字符"
m
axlength=
"230"
></textarea>
<textarea
name=
"reply"
rows=
"5"
class=
"am-radius"
placeholder=
"回复内容格式 2~230 个字符"
data-validation-message=
"回复内容格式 2~230 个字符"
m
inlength=
"2"
maxlength=
"230"
required
></textarea>
</div>
<div
class=
"am-form-group reply-submit am-form-group-refreshing t-c"
>
<input
type=
"hidden"
name=
"id"
value=
""
/>
<button
type=
"submit"
class=
"am-btn am-btn-success am-radius am-btn-sm"
data-am-loading=
"{loadingText:'处理中...'}"
data-status=
"0"
>
回复
</button>
<button
type=
"submit"
class=
"am-btn am-btn-success am-radius am-btn-sm"
data-am-loading=
"{loadingText:'处理中...'}"
>
回复
</button>
</div>
</form>
</div>
...
...
application/admin/view/default/answer/save_info.html
浏览文件 @
8e548619
...
...
@@ -15,6 +15,21 @@
</span>
<a
href=
"{{:MyUrl('admin/answer/index', $params)}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-alert am-alert-secondary user-info"
data-am-alert
>
<p
class=
"title"
>
用户信息
</p>
{{if !empty($data['user'])}}
<img
src=
"{{$data.user.avatar}}"
alt=
"{{$data.user.user_name_view}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
<ul
class=
"user-base"
>
<li>
名称:{{if empty($data['user']['username'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.username}}{{/if}}
</li>
<li>
昵称:{{if empty($data['user']['nickname'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.nickname}}{{/if}}
</li>
<li>
手机:{{if empty($data['user']['mobile'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.mobile}}{{/if}}
</li>
<li>
邮箱:{{if empty($data['user']['email'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.email}}{{/if}}
</li>
</ul>
{{else /}}
用户信息异常
{{/if}}
</div>
<div
class=
"am-form-group"
>
<label>
联系人
</label>
<input
type=
"text"
name=
"name"
placeholder=
"联系人"
maxlength=
"30"
data-validation-message=
"联系人格式最多 30 个字符"
class=
"am-radius"
value=
"{{if !empty($data['name'])}}{{$data.name}}{{/if}}"
/>
...
...
application/admin/view/default/goodscomments/index.html
浏览文件 @
8e548619
...
...
@@ -97,8 +97,9 @@
<th
class=
"am-hide-md-down"
>
商品信息
</th>
<th
class=
"am-hide-md-down"
>
用户信息
</th>
<th
class=
"am-hide-sm-only"
>
业务类型
</th>
<th>
评价内容
</th>
<th
class=
"am-hide-sm-only"
>
是否回复
</th>
<th>
评论内容
</th>
<th
class=
"am-hide-sm-only"
>
评分
</th>
<th
class=
"am-hide-sm-only"
>
回复
</th>
<th
class=
"am-hide-sm-only"
>
匿名
</th>
<th
class=
"am-hide-sm-only"
>
显示
</th>
<th>
更多
</th>
...
...
@@ -110,20 +111,14 @@
{{foreach $data_list as $v}}
<tr
id=
"data-list-{{$v.id}}"
{{
if
$
v
['
is_show
']
eq
0}}
class=
"am-active"
{{/
if
}}
>
<td
class=
"goods-info am-hide-md-down"
>
{{if !empty($v['
user
'])}}
{{if !empty($v['
goods
'])}}
<div
class=
"base"
>
<a
href=
"{{$v.goods.goods_url}}"
target=
"_blank"
>
<img
src=
"{{$v.goods.images}}"
alt=
"{{$v.goods.title}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
</a>
<a
class=
"am-text-top"
href=
"{{$v.goods.goods_url}}"
target=
"_blank"
>
{{if mb_strlen($v['goods']['title']) gt 23}}
{{:mb_substr($v['goods']['title'], 0, 23, 'utf-8')}} ...
{{else /}}
{{$v.goods.title}}
{{/if}}
</a>
<a
class=
"am-text-top"
href=
"{{$v.goods.goods_url}}"
target=
"_blank"
>
{{$v.goods.title}}
</a>
</div>
<p>
¥{{$v.goods.
min_
price}}
</p>
<p>
¥{{$v.goods.price}}
</p>
{{else /}}
商品信息异常
{{/if}}
...
...
@@ -142,21 +137,22 @@
{{/if}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.business_type_text}}
</td>
<td>
<td
class=
"content-info"
>
<div
class=
"reply-content"
>
{{$v.content}}
</div>
</td>
<td
class=
"am-hide-sm-only"
>
{{if $v['is_reply'] eq 1 and !empty($v['reply'])}}
已回复
{{else /}}
<span
class=
"cr-ddd"
>
未回复
</span>
{{/if}}
<span
class=
"am-badge am-radius {{$rating_list[$v['rating']]['badge']}}"
>
{{$v.rating_text}}
</span>
</td>
<td
class=
"am-hide-sm-only"
>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_reply'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/goodscomments/statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{$v['is_reply']}}"
data-field=
"is_reply"
></a>
</td>
<td
class=
"am-hide-sm-only"
>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_anonymous'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/goodscomments/statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{$v['is_anonymous']}}"
data-field=
"is_anonymous"
></a>
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.is_anonymous_text}}
</td>
<td
class=
"am-hide-sm-only"
>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_show'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/goodscomments/statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{$v['is_show']}}"
data-is-update-status=
"1"
></a>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_show'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/goodscomments/statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{$v['is_show']}}"
data-
field=
"is_show"
data-
is-update-status=
"1"
></a>
</td>
<td>
<span
class=
"am-icon-caret-down c-p"
data-am-modal=
"{target: '#my-popup{{$v.id}}'}"
>
查看更多
</span>
...
...
@@ -171,20 +167,14 @@
<dl
class=
"dl-content"
>
<dt>
商品信息
</dt>
<dd
class=
"goods-info am-hide-md-down"
>
{{if !empty($v['
user
'])}}
{{if !empty($v['
goods
'])}}
<div
class=
"base"
>
<a
href=
"{{$v.goods.goods_url}}"
target=
"_blank"
>
<img
src=
"{{$v.goods.images}}"
alt=
"{{$v.goods.title}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
</a>
<a
class=
"am-text-top"
href=
"{{$v.goods.goods_url}}"
target=
"_blank"
>
{{if mb_strlen($v['goods']['title']) gt 23}}
{{:mb_substr($v['goods']['title'], 0, 23, 'utf-8')}} ...
{{else /}}
{{$v.goods.title}}
{{/if}}
</a>
<a
class=
"am-text-top"
href=
"{{$v.goods.goods_url}}"
target=
"_blank"
>
{{$v.goods.title}}
</a>
</div>
<p>
¥{{$v.goods.
min_
price}}
</p>
<p>
¥{{$v.goods.price}}
</p>
{{else /}}
商品信息异常
{{/if}}
...
...
@@ -208,8 +198,13 @@
<dt>
业务类型
</dt>
<dd>
{{$v.business_type_text}}
</dd>
<dt>
评价内容
</dt>
<dd>
{{$v.content|raw}}
</dd>
<dt>
评论内容
</dt>
<dd>
{{$v.content}}
</dd>
<dt>
评分
</dt>
<dd>
<span
class=
"am-badge am-radius {{$rating_list[$v['rating']]['badge']}}"
>
{{$v.rating_text}}
</span>
</dd>
<dt>
是否匿名
</dt>
<dd>
{{$v.is_anonymous_text}}
</dd>
...
...
@@ -224,7 +219,7 @@
<dd>
{{if $v['is_reply'] eq 1 and !empty($v['reply'])}}
<div
class=
"reply-content"
>
{{$v.reply
|raw
}}
{{$v.reply}}
</div>
{{else /}}
<span
class=
"cr-ddd"
>
未回复
</span>
...
...
@@ -270,21 +265,40 @@
</div>
<div
class=
"am-popup-bd"
>
<dl
class=
"dl-content"
>
<dt>
联系人
</dt>
<dd>
<span
class=
"reply-name"
></span>
-
<span
class=
"reply-tel"
></span>
<dt>
商品信息
</dt>
<dd
class=
"goods-info"
>
<div
class=
"base"
>
<a
href=
"javascript:;"
target=
"_blank"
>
<img
src=
"{{$attachment_host}}/static/common/images/user-img-sm.gif"
alt=
"{{$v.goods.title}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
</a>
<a
class=
"am-text-top title"
href=
"javascript:;"
target=
"_blank"
>
...
</a>
</div>
<p
class=
"price"
>
...
</p>
</dd>
<dt>
用户信息
</dt>
<dd
class=
"user-info"
>
<img
src=
"{{$attachment_host}}/static/common/images/user-img-sm.gif"
class=
"am-img-thumbnail am-radius am-align-left"
/>
<ul
class=
"user-base"
>
<li
class=
"username"
>
名称:
<span>
...
</span></li>
<li
class=
"nickname"
>
昵称:
<span>
...
</span></li>
<li
class=
"mobile"
>
手机:
<span>
...
</span></li>
<li
class=
"email"
>
邮箱:
<span>
...
</span></li>
</ul>
</dd>
<dt>
评论内容
</dt>
<dd
class=
"content"
>
...
</dd>
</dl>
<form
class=
"am-form form-validation
"
action=
"{{:MyUrl('admin/goodscomments/reply')}}"
method=
"POST"
request-type=
"ajax-reload"
enctype=
"multipart/form-data
"
>
<form
class=
"am-form form-validation
-reply"
action=
"{{:MyUrl('admin/goodscomments/reply')}}"
method=
"POST"
request-type=
"ajax-reload
"
>
<div
class=
"am-form-group"
>
<label>
回复内容
</label>
<textarea
name=
"reply"
rows=
"5"
class=
"am-radius"
placeholder=
"回复内容格式
2~230 个字符"
data-validation-message=
"回复内容格式 2~230 个字符"
maxlength=
"230"
></textarea>
<textarea
name=
"reply"
rows=
"5"
class=
"am-radius"
placeholder=
"回复内容格式
1~230 个字符"
data-validation-message=
"回复内容格式 1~230 个字符"
minlength=
"1"
maxlength=
"230"
required
></textarea>
</div>
<div
class=
"am-form-group reply-submit am-form-group-refreshing t-c"
>
<input
type=
"hidden"
name=
"id"
value=
""
/>
<button
type=
"submit"
class=
"am-btn am-btn-success am-radius am-btn-sm"
data-am-loading=
"{loadingText:'处理中...'}"
data-status=
"0"
>
回复
</button>
<button
type=
"submit"
class=
"am-btn am-btn-success am-radius am-btn-sm"
data-am-loading=
"{loadingText:'处理中...'}"
>
回复
</button>
</div>
</form>
</div>
...
...
application/admin/view/default/goodscomments/save_info.html
0 → 100644
浏览文件 @
8e548619
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/goodscomments/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/goodscomments/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"fs-16"
>
商品评论编辑
</span>
<a
href=
"{{:MyUrl('admin/goodscomments/index', $params)}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-alert am-alert-secondary goods-info"
data-am-alert
>
<p
class=
"title"
>
商品信息
</p>
{{if !empty($data['goods'])}}
<div
class=
"base"
>
<a
href=
"{{$data.goods.goods_url}}"
target=
"_blank"
>
<img
src=
"{{$data.goods.images}}"
alt=
"{{$data.goods.title}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
</a>
<a
class=
"am-text-top"
href=
"{{$data.goods.goods_url}}"
target=
"_blank"
>
{{$data.goods.title}}
</a>
</div>
<p>
¥{{$data.goods.price}}
</p>
{{else /}}
商品信息异常
{{/if}}
</div>
<div
class=
"am-alert am-alert-secondary user-info"
data-am-alert
>
<p
class=
"title"
>
用户信息
</p>
{{if !empty($data['user'])}}
<img
src=
"{{$data.user.avatar}}"
alt=
"{{$data.user.user_name_view}}"
class=
"am-img-thumbnail am-radius am-align-left"
/>
<ul
class=
"user-base"
>
<li>
名称:{{if empty($data['user']['username'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.username}}{{/if}}
</li>
<li>
昵称:{{if empty($data['user']['nickname'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.nickname}}{{/if}}
</li>
<li>
手机:{{if empty($data['user']['mobile'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.mobile}}{{/if}}
</li>
<li>
邮箱:{{if empty($data['user']['email'])}}
<span
class=
"cr-ccc"
>
未填写
</span>
{{else /}}{{$data.user.email}}{{/if}}
</li>
</ul>
{{else /}}
用户信息异常
{{/if}}
</div>
<div
class=
"am-form-group"
>
<label>
业务类型
<span
class=
"am-form-group-label-tips-must"
>
必选
</span></label>
<select
name=
"business_type"
class=
"chosen-select"
data-placeholder=
"业务类型..."
data-validation-message=
"请选择业务类型"
required
>
{{if !empty($business_type_list)}}
{{foreach $business_type_list as $k=>$v}}
<option
value=
"{{$k}}"
{{
if
isset
($
data
['
business_type
'])
and
$
data
['
business_type
']
eq
$
k
}}
selected
{{/
if
}}
>
{{$v}}
</option>
{{/foreach}}
{{/if}}
</select>
</div>
<div
class=
"am-form-group"
>
<label>
评论内容
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<textarea
name=
"content"
class=
"am-radius"
rows=
"4"
minlength=
"6"
maxlength=
"230"
data-validation-message=
"评论内容 6~230 个字符之间"
required
>
{{if !empty($data['content'])}}{{$data.content}}{{/if}}
</textarea>
</div>
<div
class=
"am-form-group"
>
<label>
回复内容
</label>
<textarea
class=
"am-radius"
name=
"reply"
rows=
"4"
maxlength=
"230"
placeholder=
"回复内容最多 230 个字符"
data-validation-message=
"回复内容最多 230 个字符"
>
{{if !empty($data['reply'])}}{{$data.reply}}{{/if}}
</textarea>
</div>
<div
class=
"am-form-group"
>
<label>
回复时间
</label>
<input
type=
"text"
name=
"reply_time"
class=
"am-form-field am-radius Wdate"
placeholder=
"生日"
data-validation-message=
"生日格式有误"
{{
if
!
empty
($
data
)}}
value=
"{{if isset($data['reply_time_time'])}}{{$data.reply_time_time}}{{/if}}"
{{/
if
}}
onclick=
"WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})"
autocomplete=
"off"
/>
</div>
<div
class=
"am-form-group"
>
<label>
评分
<span
class=
"am-form-group-label-tips-must"
>
必选
</span></label>
<select
name=
"rating"
class=
"chosen-select"
data-placeholder=
"评分..."
data-validation-message=
"请选择评分"
required
>
{{if !empty($business_type_list)}}
{{foreach $rating_list as $k=>$v}}
<option
value=
"{{$k}}"
{{
if
isset
($
data
['
rating
'])
and
$
data
['
rating
']
eq
$
k
}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
{{/if}}
</select>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
是否已回复
</label>
<input
name=
"is_reply"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
isset
($
data
['
is_reply
'])
and
$
data
['
is_reply
']
eq
1}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
是否匿名
</label>
<input
name=
"is_anonymous"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
isset
($
data
['
is_anonymous
'])
and
$
data
['
is_anonymous
']
eq
1}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
是否显示
</label>
<input
name=
"is_show"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
isset
($
data
['
is_show
'])
and
$
data
['
is_show
']
eq
1}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<input
type=
"hidden"
name=
"id"
{{
if
!
empty
($
data
['
id
'])}}
value=
"{{$data.id}}"
{{/
if
}}
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/index/controller/Answer.php
浏览文件 @
8e548619
...
...
@@ -80,10 +80,8 @@ class Answer extends Common
$data
=
AnswerService
::
AnswerList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
//
状态
//
静态数据
$this
->
assign
(
'common_is_show_list'
,
lang
(
'common_is_show_list'
));
// 是否
$this
->
assign
(
'common_is_text_list'
,
lang
(
'common_is_text_list'
));
// 参数
...
...
@@ -91,5 +89,26 @@ class Answer extends Common
return
$this
->
fetch
();
}
/**
* 问答删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
*/
public
function
Delete
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
$params
=
input
();
$params
[
'user_type'
]
=
'user'
;
$params
[
'user'
]
=
$this
->
user
;
return
AnswerService
::
AnswerDelete
(
$params
);
}
}
?>
\ No newline at end of file
application/index/controller/Goods.php
浏览文件 @
8e548619
...
...
@@ -91,6 +91,10 @@ class Goods extends Common
// 二维码
$this
->
assign
(
'qrcode_url'
,
MyUrl
(
'index/qrcode/index'
,
[
'content'
=>
urlencode
(
base64_encode
(
MyUrl
(
'index/goods/index'
,
[
'id'
=>
$goods_id
],
true
,
true
)))]));
// 商品评分
$goods_score
=
GoodsCommentsService
::
GoodsCommentsScore
(
$goods_id
);
$this
->
assign
(
'goods_score'
,
$goods_score
[
'data'
]);
// 商品访问统计
GoodsService
::
GoodsAccessCountInc
([
'goods_id'
=>
$goods_id
]);
...
...
application/index/view/default/answer/index.html
浏览文件 @
8e548619
...
...
@@ -90,12 +90,13 @@
<th
class=
"am-hide-sm-only"
>
是否显示
</th>
<th
class=
"am-hide-sm-only"
>
回复时间
</th>
<th
class=
"am-hide-sm-only"
>
时间
</th>
<th
class=
"am-hide-sm-only"
>
操作
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<tr
id=
"data-list-{{$v.id}}"
>
<td>
{{$v.name}}
</td>
<td>
{{$v.tel}}
</td>
<td>
{{$v.title}}
</td>
...
...
@@ -110,6 +111,9 @@
<td
class=
"am-hide-sm-only"
>
{{$v.is_show_text}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.reply_time}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time}}
</td>
<td
class=
"view-operation"
>
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block am-icon-trash-o submit-delete"
data-url=
"{{:MyUrl('index/answer/delete')}}"
data-id=
"{{$v.id}}"
>
删除
</button>
</td>
</tr>
{{/foreach}}
{{/if}}
...
...
application/index/view/default/goods/index.html
浏览文件 @
8e548619
...
...
@@ -432,6 +432,36 @@
<!-- 评论 -->
<div
class=
"am-tab-panel am-fade goods-comment"
data-goods-id=
"{{$goods.id}}"
data-url=
"{{:MyUrl('index/goods/comment')}}"
>
<div
class=
"am-cf score-container"
>
<div
class=
"score am-fl"
>
<p
class=
"name"
>
动态评分
</p>
<p
class=
"value"
>
{{$goods_score.avg}}
</p>
</div>
<div
class=
"am-progress am-fr"
>
{{if isset($goods_score['avg']) and $goods_score['avg'] gt 0 and !empty($goods_score['rating'])}}
{{foreach $goods_score.rating as $score}}
<div
class=
"am-progress-bar
{{switch score.rating}}
{{case 1}}
am-progress-bar-danger
{{/case}}
{{case 2}}
am-progress-bar-warning
{{/case}}
{{case 3}}
am-progress-bar-secondary
{{/case}}
{{case 5}}
am-progress-bar-success
{{/case}}
{{/switch}}"
style=
"width: {{$score.portion}}%"
>
{{$score.name}}({{$score.portion}}%)
</div>
{{/foreach}}
{{else /}}
没有评分数据
{{/if}}
</div>
</div>
<div
class=
"goods-comment-content"
></div>
<div
class=
"goods-page-container"
></div>
<div
class=
"table-no goods-page-no-data none"
>
...
...
application/index/view/default/order/comments.html
浏览文件 @
8e548619
...
...
@@ -32,7 +32,7 @@
<tr>
<th>
商品信息
</th>
<th
class=
"am-hide-sm-only"
>
单价
</th>
<th>
评
价
内容
</th>
<th>
评
论
内容
</th>
</tr>
</thead>
<tbody>
...
...
@@ -79,7 +79,7 @@
</ul>
<input
type=
"text"
name=
"rating[]"
value=
""
class=
"input-rating"
data-validation-message=
"请选择评分"
required
/>
</div>
<textarea
name=
"content[]"
class=
"am-radius"
rows=
"4"
minlength=
"6"
maxlength=
"2
00"
data-validation-message=
"评价内容 6~20
0 个字符之间"
required
></textarea>
<textarea
name=
"content[]"
class=
"am-radius"
rows=
"4"
minlength=
"6"
maxlength=
"2
30"
data-validation-message=
"评论内容 6~23
0 个字符之间"
required
></textarea>
<input
type=
"hidden"
name=
"goods_id[]"
value=
"{{$goods.goods_id}}"
/>
</td>
</tr>
...
...
@@ -100,7 +100,7 @@
</div>
</form>
{{else /}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
你已进行过评
价
</div>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
你已进行过评
论
</div>
{{/if}}
</div>
</div>
...
...
application/index/view/default/order/index.html
浏览文件 @
8e548619
...
...
@@ -102,9 +102,9 @@
</select>
</td>
<td>
<span>
评
价
:
</span>
<select
name=
"is_comments"
class=
"chosen-select"
data-placeholder=
"评
价
状态..."
>
<option
value=
"-1"
>
评
价
状态...
</option>
<span>
评
论
:
</span>
<select
name=
"is_comments"
class=
"chosen-select"
data-placeholder=
"评
论
状态..."
>
<option
value=
"-1"
>
评
论
状态...
</option>
{{if !empty($common_comments_status_list)}}
{{foreach $common_comments_status_list as $comments}}
<option
value=
"{{$comments.value}}"
{{
if
isset
($
params
['
is_comments
'])
and
$
params
['
is_comments
']
eq
$
comments
['
value
']}}
selected
{{/
if
}}
>
{{$comments.name}}
</option>
...
...
@@ -204,7 +204,7 @@
<button
type=
"button"
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-icon-check-circle-o am-btn-block submit-ajax submit-confirm"
data-url=
"{{:MyUrl('index/order/collect')}}"
data-id=
"{{$order.id}}"
data-view=
"reload"
data-msg=
"请仔细确认已收到货物、确认继续吗?"
>
收货
</button>
{{/if}}
{{if in_array($order['status'], [4]) and $order['user_is_comments'] eq 0}}
<a
href=
"{{:MyUrl('index/order/comments', ['id'=>$order['id']])}}"
target=
"_blank"
class=
"am-btn am-btn-primary am-btn-xs am-radius am-icon-heart-o am-btn-block"
>
评
价
</a>
<a
href=
"{{:MyUrl('index/order/comments', ['id'=>$order['id']])}}"
target=
"_blank"
class=
"am-btn am-btn-primary am-btn-xs am-radius am-icon-heart-o am-btn-block"
>
评
论
</a>
{{/if}}
{{if in_array($order['status'], [4,5,6])}}
<button
type=
"button"
class=
"am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o am-btn-block submit-delete"
data-url=
"{{:MyUrl('index/order/delete')}}"
data-id=
"{{$order.id}}"
data-view=
"reload"
>
删除
</button>
...
...
application/plugins/answers/service/Service.php
浏览文件 @
8e548619
...
...
@@ -323,7 +323,6 @@ class Service
{
// 条件
$where
=
[
[
'is_delete_time'
,
'='
,
0
],
[
'is_show'
,
'='
,
1
],
];
...
...
@@ -382,7 +381,6 @@ class Service
}
// 条件
$where
=
[
[
'is_delete_time'
,
'='
,
0
],
[
'is_show'
,
'='
,
1
],
[
'id'
,
'='
,
intval
(
$params
[
'id'
])],
];
...
...
application/service/AnswerService.php
浏览文件 @
8e548619
...
...
@@ -63,12 +63,16 @@ class AnswerService
// 用户信息
if
(
isset
(
$v
[
'user_id'
]))
{
$user
=
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$v
[
'user_id'
]])
->
field
(
'username,nickname,mobile,gender,avatar'
)
->
find
();
$v
[
'username'
]
=
empty
(
$user
[
'username'
])
?
''
:
$user
[
'username'
];
$v
[
'nickname'
]
=
empty
(
$user
[
'nickname'
])
?
''
:
$user
[
'nickname'
];
$v
[
'mobile'
]
=
empty
(
$user
[
'mobile'
])
?
''
:
$user
[
'mobile'
];
$v
[
'avatar'
]
=
empty
(
$user
[
'avatar'
])
?
''
:
$user
[
'avatar'
];
$v
[
'gender_text'
]
=
isset
(
$user
[
'gender'
])
?
$common_gender_list
[
$user
[
'gender'
]][
'name'
]
:
''
;
$user
=
UserService
::
GetUserViewInfo
(
$v
[
'user_id'
]);
if
(
!
isset
(
$params
[
'is_public'
])
||
$params
[
'is_public'
]
==
1
)
{
$v
[
'user'
]
=
[
'avatar'
=>
$user
[
'avatar'
],
'user_name_view'
=>
$user
[
'user_name_view'
],
];
}
else
{
$v
[
'user'
]
=
$user
;
}
}
// 是否显示
...
...
@@ -126,9 +130,7 @@ class AnswerService
*/
public
static
function
AnswerListWhere
(
$params
=
[])
{
$where
=
[
[
'is_delete_time'
,
'='
,
0
],
];
$where
=
[];
// id
if
(
!
empty
(
$params
[
'id'
]))
...
...
@@ -304,22 +306,12 @@ class AnswerService
$where
[
'user_id'
]
=
$params
[
'user'
][
'id'
];
}
// 获取数据
$temp
=
Db
::
name
(
'Answer'
)
->
where
(
$where
)
->
field
(
'id'
)
->
find
();
if
(
empty
(
$temp
))
{
return
DataReturn
(
'资源不存在或已被删除'
,
-
1
);
}
// 开始删除
$data
=
[
'is_delete_time'
=>
time
(),
];
if
(
Db
::
name
(
'Answer'
)
->
where
(
$where
)
->
update
(
$data
))
if
(
Db
::
name
(
'Answer'
)
->
where
(
$where
)
->
delete
())
{
return
DataReturn
(
'删除成功'
,
0
);
}
return
DataReturn
(
'删除失败'
,
-
1
);
return
DataReturn
(
'删除失败
或数据不存在
'
,
-
1
);
}
/**
...
...
application/service/GoodsCommentsService.php
浏览文件 @
8e548619
...
...
@@ -28,8 +28,18 @@ class GoodsCommentsService
'order'
=>
'订单'
,
];
// 评分
public
static
$rating_list
=
[
0
=>
[
'name'
=>
'未评分'
,
'badge'
=>
''
],
1
=>
[
'name'
=>
'1分'
,
'badge'
=>
'am-badge-danger'
],
2
=>
[
'name'
=>
'2分'
,
'badge'
=>
'am-badge-warning'
],
3
=>
[
'name'
=>
'3分'
,
'badge'
=>
'am-badge-secondary'
],
4
=>
[
'name'
=>
'4分'
,
'badge'
=>
'am-badge-primary'
],
5
=>
[
'name'
=>
'5分'
,
'badge'
=>
'am-badge-success'
],
];
/**
* 订单评
价
* 订单评
论
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -74,12 +84,12 @@ class GoodsCommentsService
[
'checked_type'
=>
'isset'
,
'key_name'
=>
'content'
,
'error_msg'
=>
'评
价
内容有误'
,
'error_msg'
=>
'评
论
内容有误'
,
],
[
'checked_type'
=>
'is_array'
,
'key_name'
=>
'content'
,
'error_msg'
=>
'评
价
内容数据格式有误'
,
'error_msg'
=>
'评
论
内容数据格式有误'
,
],
[
'checked_type'
=>
'empty'
,
...
...
@@ -108,7 +118,7 @@ class GoodsCommentsService
}
if
(
$order
[
'user_is_comments'
]
!=
0
)
{
return
DataReturn
(
'该订单你已进行过评
价
'
,
-
10
);
return
DataReturn
(
'该订单你已进行过评
论
'
,
-
10
);
}
// 处理数据
...
...
@@ -129,11 +139,11 @@ class GoodsCommentsService
if
(
Db
::
name
(
'GoodsComments'
)
->
insertGetId
(
$data
)
<=
0
)
{
Db
::
rollback
();
return
DataReturn
(
'评
价
内容添加失败'
,
-
100
);
return
DataReturn
(
'评
论
内容添加失败'
,
-
100
);
}
}
// 订单评
价
状态更新
// 订单评
论
状态更新
if
(
!
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
update
([
'user_is_comments'
=>
time
(),
'upd_time'
=>
time
()]))
{
Db
::
rollback
();
...
...
@@ -141,7 +151,7 @@ class GoodsCommentsService
}
Db
::
commit
();
return
DataReturn
(
'评
价
成功'
,
0
);
return
DataReturn
(
'评
论
成功'
,
0
);
}
/**
...
...
@@ -201,6 +211,9 @@ class GoodsCommentsService
}
$v
[
'msg'
]
=
empty
(
$msg
)
?
null
:
$msg
;
// 评分
$v
[
'rating_text'
]
=
self
::
$rating_list
[
$v
[
'rating'
]][
'name'
];
// 是否
$v
[
'is_reply_text'
]
=
isset
(
$common_is_text_list
[
$v
[
'is_reply'
]])
?
$common_is_text_list
[
$v
[
'is_reply'
]][
'name'
]
:
''
;
$v
[
'is_anonymous_text'
]
=
isset
(
$common_is_text_list
[
$v
[
'is_anonymous'
]])
?
$common_is_text_list
[
$v
[
'is_anonymous'
]][
'name'
]
:
''
;
...
...
@@ -347,6 +360,76 @@ class GoodsCommentsService
return
$where
;
}
/**
* 评论保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-07-17
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
GoodsCommentsSave
(
$params
=
[])
{
// 参数校验
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
[
'checked_type'
=>
'in'
,
'key_name'
=>
'business_type'
,
'checked_data'
=>
array_keys
(
self
::
$business_type_list
),
'error_msg'
=>
'请选择业务类型'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'content'
,
'checked_data'
=>
'6,230'
,
'error_msg'
=>
'评论内容 6~230 个字符之间'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'reply'
,
'checked_data'
=>
'230'
,
'error_msg'
=>
'回复内容最多 230 个字符'
,
],
[
'checked_type'
=>
'in'
,
'key_name'
=>
'rating'
,
'checked_data'
=>
array_keys
(
self
::
$rating_list
),
'error_msg'
=>
'请选择评分'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 开始操作
$data
=
[
'content'
=>
$params
[
'content'
],
'reply'
=>
$params
[
'reply'
],
'business_type'
=>
$params
[
'business_type'
],
'rating'
=>
intval
(
$params
[
'rating'
]),
'reply_time'
=>
empty
(
$params
[
'reply_time'
])
?
0
:
strtotime
(
$params
[
'reply_time'
]),
'is_reply'
=>
isset
(
$params
[
'is_reply'
])
?
intval
(
$params
[
'is_reply'
])
:
0
,
'is_show'
=>
isset
(
$params
[
'is_show'
])
?
intval
(
$params
[
'is_show'
])
:
0
,
'is_anonymous'
=>
isset
(
$params
[
'is_anonymous'
])
?
intval
(
$params
[
'is_anonymous'
])
:
0
,
'upd_time'
=>
time
(),
];
// 更新
if
(
Db
::
name
(
'GoodsComments'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
(
$data
))
{
return
DataReturn
(
'编辑成功'
,
0
);
}
return
DataReturn
(
'编辑失败或数据不存在'
,
-
100
);
}
/**
* 删除
* @author Devil
...
...
@@ -373,7 +456,7 @@ class GoodsCommentsService
}
// 开始删除
if
(
Db
::
name
(
'GoodsComments'
)
->
where
([
'id'
=>
$comments_id
])
->
delete
())
if
(
Db
::
name
(
'GoodsComments'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])
])
->
delete
())
{
return
DataReturn
(
'删除成功'
,
0
);
}
...
...
@@ -459,6 +542,12 @@ class GoodsCommentsService
'checked_data'
=>
[
0
,
1
],
'error_msg'
=>
'状态有误'
,
],
[
'checked_type'
=>
'in'
,
'key_name'
=>
'field'
,
'checked_data'
=>
[
'is_anonymous'
,
'is_show'
,
'is_reply'
],
'error_msg'
=>
'操作字段有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
...
...
@@ -467,11 +556,60 @@ class GoodsCommentsService
}
// 数据更新
if
(
Db
::
name
(
'GoodsComments'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
([
'is_show'
=>
intval
(
$params
[
'state'
])]))
$data
=
[
$params
[
'field'
]
=>
intval
(
$params
[
'state'
]),
'upd_time'
=>
time
(),
];
if
(
Db
::
name
(
'GoodsComments'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
(
$data
))
{
return
DataReturn
(
'编辑成功'
);
}
return
DataReturn
(
'编辑失败或数据未改变'
,
-
100
);
}
/**
* 商品动态评分
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-05-15
* @desc description
* @param [int] $goods_id [商品id]
*/
public
static
function
GoodsCommentsScore
(
$goods_id
)
{
// 默认
$rating_list
=
[
1
=>
[
'rating'
=>
1
,
'name'
=>
'1分'
,
'count'
=>
0
,
'portion'
=>
0
],
2
=>
[
'rating'
=>
2
,
'name'
=>
'2分'
,
'count'
=>
0
,
'portion'
=>
0
],
3
=>
[
'rating'
=>
3
,
'name'
=>
'3分'
,
'count'
=>
0
,
'portion'
=>
0
],
4
=>
[
'rating'
=>
4
,
'name'
=>
'4分'
,
'count'
=>
0
,
'portion'
=>
0
],
5
=>
[
'rating'
=>
5
,
'name'
=>
'5分'
,
'count'
=>
0
,
'portion'
=>
0
],
];
$where
=
[
[
'goods_id'
,
'='
,
$goods_id
],
[
'rating'
,
'>'
,
0
],
];
$data
=
Db
::
name
(
'GoodsComments'
)
->
where
(
$where
)
->
group
(
'rating'
)
->
column
(
'count(*) as count, rating'
,
'rating'
);
if
(
!
empty
(
$data
))
{
$sum
=
array_sum
(
$data
);
foreach
(
$data
as
$rating
=>
$count
)
{
if
(
$rating
>
0
&&
$rating
<=
5
)
{
$rating_list
[
$rating
][
'count'
]
=
$count
;
$rating_list
[
$rating
][
'portion'
]
=
round
(
$count
/
$sum
,
2
)
*
100
;
}
}
}
sort
(
$rating_list
);
$result
=
[
'avg'
=>
PriceNumberFormat
(
Db
::
name
(
'GoodsComments'
)
->
where
(
$where
)
->
avg
(
'rating'
),
1
),
'rating'
=>
$rating_list
,
];
return
DataReturn
(
'操作成功'
,
0
,
$result
);
}
}
?>
\ No newline at end of file
config/shopxo.sql
浏览文件 @
8e548619
此差异已折叠。
点击以展开。
public/static/admin/default/css/answer.css
浏览文件 @
8e548619
/**
* 列表
*/
table
.am-table
.reply-content
{
max-width
:
200px
;
max-height
:
200px
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
}
@media
only
screen
and
(
max-width
:
321px
)
{
.view-operation
button
{
margin
:
2px
0px
;
}
.content-right
table
.am-table
.reply-content
{
max-width
:
200px
;
max-height
:
200px
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
}
.content-right
table
.am-table
.view-operation
{
width
:
85px
;
}
@media
only
screen
and
(
max-width
:
641px
)
{
.content-right
table
.am-table
td
.content-info
{
width
:
45%
;
}
}
/**
* 用户信息
*/
.content-right
.user-info
img
{
max-width
:
35px
;
max-height
:
35px
;
margin
:
0
5px
2px
0
;
}
.content-right
ul
{
list-style
:
none
;
padding
:
0
;
margin
:
0
;
}
/**
* 编辑
*/
.content-right
.am-alert
p
.title
{
font-weight
:
700
;
font-size
:
14px
;
margin
:
0
0
5px
0
;
color
:
#888
;
}
\ No newline at end of file
public/static/admin/default/css/goodscomments.css
浏览文件 @
8e548619
/**
*
用户信息
*
公共
*/
.content-right
table
.am-table
td
.user-info
{
width
:
200px
;
.content-right
table
.am-table
td
.user-info
,
.content-right
table
.am-table
td
.goods-info
,
.content-right
table
.am-table
td
.content-info
{
width
:
20%
;
}
@media
only
screen
and
(
max-width
:
641px
)
{
.content-right
table
.am-table
td
.content-info
{
width
:
45%
;
}
}
/**
* 用户信息
*/
.content-right
.user-info
img
{
max-width
:
35px
;
max-height
:
35px
;
...
...
@@ -18,9 +29,6 @@
/**
* 商品信息
*/
.content-right
table
.am-table
td
.goods-info
{
width
:
180px
;
}
.content-right
.goods-info
.base
{
min-height
:
57px
;
}
...
...
@@ -37,7 +45,7 @@
* 列表
*/
.content-right
table
.am-table
.reply-content
{
max-width
:
1
80px
;
max-width
:
1
00%
;
max-height
:
130px
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
...
...
@@ -47,4 +55,18 @@
}
.content-right
table
.am-table
.view-operation
{
width
:
85px
;
}
/**
* 编辑
*/
.content-right
.am-alert.goods-info
a
{
color
:
#0e90d2
;
}
.content-right
.am-alert
p
.title
{
font-weight
:
700
;
font-size
:
14px
;
margin
:
0
0
5px
0
;
color
:
#888
;
}
\ No newline at end of file
public/static/admin/default/js/answer.js
浏览文件 @
8e548619
// 表单初始化
FromInit
(
'
form.form-validation-reply
'
);
$
(
function
()
{
// 处理
$
(
'
.submit-reply
'
).
on
(
'
click
'
,
function
()
{
var
json
=
$
(
this
).
data
(
'
json
'
);
$
(
'
#my-popup-reply input[name="id"]
'
).
val
(
json
.
id
);
$
(
'
.reply-name
'
).
html
(
json
.
name
||
'
<span class="cr-ddd">未填写</span>
'
);
$
(
'
.reply-tel
'
).
html
(
json
.
tel
||
'
<span class="cr-ddd">未填写</span>
'
);
});
$
(
'
#my-popup-reply button[type="submit"]
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#my-popup-reply textarea[name="reply"]
'
).
attr
(
'
required
'
,
true
);
$
(
'
#my-popup-reply textarea[name="reply"]
'
).
blur
();
$
(
'
#my-popup-reply input[name="status"]
'
).
val
(
status
);
var
$popup
=
$
(
'
#my-popup-reply
'
);
$popup
.
find
(
'
input[name="id"]
'
).
val
(
json
.
id
);
$popup
.
find
(
'
.user-info img
'
).
attr
(
'
src
'
,
json
.
user
.
avatar
||
$popup
.
find
(
'
.user-info img
'
).
attr
(
'
src
'
));
$popup
.
find
(
'
.user-info .user-base .username span
'
).
html
(
json
.
user
.
username
||
'
<span class="cr-ddd">未填写</span>
'
);
$popup
.
find
(
'
.user-info .user-base .nickname span
'
).
html
(
json
.
user
.
nickname
||
'
<span class="cr-ddd">未填写</span>
'
);
$popup
.
find
(
'
.user-info .user-base .mobile span
'
).
html
(
json
.
user
.
mobile
||
'
<span class="cr-ddd">未填写</span>
'
);
$popup
.
find
(
'
.user-info .user-base .email span
'
).
html
(
json
.
user
.
email
||
'
<span class="cr-ddd">未填写</span>
'
);
});
});
\ No newline at end of file
public/static/admin/default/js/goodscomments.js
0 → 100644
浏览文件 @
8e548619
// 表单初始化
FromInit
(
'
form.form-validation-reply
'
);
$
(
function
()
{
// 处理
$
(
'
.submit-reply
'
).
on
(
'
click
'
,
function
()
{
var
json
=
$
(
this
).
data
(
'
json
'
);
var
$popup
=
$
(
'
#my-popup-reply
'
);
$popup
.
find
(
'
input[name="id"]
'
).
val
(
json
.
id
);
$popup
.
find
(
'
.user-info img
'
).
attr
(
'
src
'
,
json
.
user
.
avatar
||
$popup
.
find
(
'
.user-info img
'
).
attr
(
'
src
'
));
$popup
.
find
(
'
.user-info .user-base .username span
'
).
html
(
json
.
user
.
username
||
'
<span class="cr-ddd">未填写</span>
'
);
$popup
.
find
(
'
.user-info .user-base .nickname span
'
).
html
(
json
.
user
.
nickname
||
'
<span class="cr-ddd">未填写</span>
'
);
$popup
.
find
(
'
.user-info .user-base .mobile span
'
).
html
(
json
.
user
.
mobile
||
'
<span class="cr-ddd">未填写</span>
'
);
$popup
.
find
(
'
.user-info .user-base .email span
'
).
html
(
json
.
user
.
email
||
'
<span class="cr-ddd">未填写</span>
'
);
$popup
.
find
(
'
.goods-info .base a
'
).
attr
(
'
href
'
,
json
.
goods
.
goods_url
||
'
javascript:;
'
);
$popup
.
find
(
'
.goods-info .base img
'
).
attr
(
'
src
'
,
json
.
goods
.
images
||
$popup
.
find
(
'
.goods-info .base img
'
).
attr
(
'
src
'
));
$popup
.
find
(
'
.goods-info .title
'
).
html
(
json
.
goods
.
title
);
$popup
.
find
(
'
.goods-info .price
'
).
html
(
'
¥
'
+
json
.
goods
.
price
);
$popup
.
find
(
'
.content
'
).
html
(
json
.
content
||
'
<span class="cr-ddd">没有评论内容</span>
'
);
});
});
\ No newline at end of file
public/static/index/default/css/goods.css
浏览文件 @
8e548619
...
...
@@ -50,7 +50,6 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
.introduce-main
.am-sticky-placeholder
{
margin
:
0px
!important
;
}
.am-sticky-placeholder
.am-nav-tabs
>
li
span
{
color
:
#888
;
}
.am-sticky-placeholder
.am-nav-tabs
>
li
.am-active
span
{
color
:
#333
;
}
.buy-nav-opt
span
{
font-size
:
12px
;
color
:
#555
;
}
.attr-not-active
{
border
:
1px
solid
#f03726
!important
;
box-shadow
:
0
0px
3px
#ed7f76
,
0
0
6px
rgba
(
0
,
0
,
0
,
0
);
}
.sku-items-disabled
{
color
:
#d2cfcf
!important
;
background-color
:
#ffffff
!important
;
border
:
1px
dashed
#d5d5d5
!important
;
box-shadow
:
none
!important
;
}
.sku-dont-choose
{
color
:
#b4b3b3
!important
;
background-color
:
#ffffff
!important
;
border
:
1px
solid
#ebeaea
!important
;
box-shadow
:
none
!important
;
}
...
...
@@ -58,11 +57,13 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
.sku-items-disabled
img
{
opacity
:
0.3
;
}
/* 购买导航 */
.buy-nav
{
position
:
fixed
;
bottom
:
0px
;
right
:
0px
;
z-index
:
1000
;
width
:
100%
;
background
:
#fff
;
}
.buy-nav-opt
a
{
color
:
#666
;
}
.text-active
{
color
:
#cf2915
!important
;
}
.buy-nav-opt
span
{
font-size
:
12px
;
color
:
#555
;
}
/* 商品评论 */
.goods-comment
.am-comment
{
margin-top
:
15px
;
}
.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
;
}
.comment-reply
{
border-top
:
1px
dashed
#eee
;
margin-top
:
10px
;
padding-top
:
10px
;
}
...
...
@@ -71,6 +72,15 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
.comment-reply-title
{
color
:
#666
;
}
.comment-reply-desc
{
color
:
#905602
;
}
/* 评分 */
.score-container
{
border-color
:
#eee
;
padding
:
15px
25px
;
border-style
:
none
solid
solid
solid
;
border-width
:
1px
;
}
.score-container
.score
{
width
:
80px
;
border-right
:
1px
solid
#eee
;
padding-right
:
25px
;
}
.score-container
.score
.name
{
color
:
#666
;
}
.score-container
.score
.value
{
color
:
#f03726
;
font-weight
:
700
;
font-size
:
32px
;
line-height
:
32px
;
margin-top
:
5px
;
}
.score-container
.am-progress
{
width
:
calc
(
100%
-
105px
);
margin-bottom
:
0
;
margin-top
:
18px
;
line-height
:
2rem
;
}
/*详情*/
.detail-content
img
{
max-width
:
100%
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
.theme-span
{
height
:
0px
;
background
:
#fff
;}
...
...
@@ -244,63 +254,17 @@ color:#F03726;font-size: 14px;text-align: center;border: 0;}
.buy-nav
div
.submit
{
width
:
30%
;
}
.buy-nav
span
{
display
:
inline-block
;
width
:
50%
;
float
:
left
;
;
cursor
:
pointer
;
border-top
:
1px
solid
#f5f5f5
;
border-left
:
1px
solid
#f5f5f5
;}
li
.am-active
hr
{
border-top
:
1px
solid
#f00
;}
/*搭配*/
.match-title
{
height
:
36px
;
line-height
:
36px
;
font-size
:
16px
;
margin
:
0px
10px
;
border-bottom
:
1px
solid
#E6E6E6
;
color
:
#E4393C
;
font-weight
:
700
;}
.like_list
{
overflow
:
hidden
;}
.like_list
li
{
float
:
left
;
margin-left
:
5px
;
margin-right
:
5px
;
padding-bottom
:
15px
;
text-align
:
center
;}
.info-box-price
{
color
:
#E4393C
;
font-size
:
16px
;
font-family
:
arial
;
font-weight
:
600
;}
.info-original-price
{
display
:
none
;
text-decoration
:
line-through
;
font-size
:
12px
;
color
:
#999
;
margin-left
:
5px
;
font-family
:
arial
;
font-weight
:
400
;}
.like_list
.plus_icon
{
width
:
10px
;
text-align
:
center
;
font-size
:
20px
;
color
:
#C3C3C3
;
height
:
100px
;
line-height
:
100px
;
margin
:
0px
0px
;}
.like_list
.total_price
p
{
font-size
:
12px
;
padding-bottom
:
8px
;}
.like_list
.total_price
.combo_price
span
{
font-size
:
16px
;
color
:
#E4393C
;
font-weight
:
600
;}
.like_list
.total_price
{
margin-top
:
35px
;}
.like_list
.total_price
.buy_now
{
background-color
:
#F03726
;
color
:
#FFF
;
margin
:
0px
auto
;
text-align
:
center
;
margin-top
:
4px
;
width
:
62px
;
line-height
:
24px
;
font-size
:
12px
;
display
:
block
;}
.c-title
{
display
:
none
;}
.like_list
.plus_icon
i
.am-icon-angle-right
{
position
:
absolute
;
right
:
10px
;
font-weight
:
600
;}
.match-comment
{
border-bottom
:
1px
solid
#E6E6E6
;}
/*介绍*/
.introduce
{
width
:
100%
;
margin
:
0px
auto
;
text-align
:
center
;
padding-bottom
:
20px
;}
.introduce-main
{
width
:
100%
;
background
:
#fff
;}
.introduce-main
.am-tab-panel
{
padding
:
0px
;
}
.browse
{
display
:
none
;}
/*产品参数*/
ul
.detail-attr
{
overflow
:
hidden
;
text-align
:
left
;}
ul
.detail-attr
li
{
height
:
26px
;
overflow
:
hidden
;
line-height
:
26px
;
vertical-align
:
top
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
color
:
#666
;
font-size
:
14px
;}
/*详情内容*/
.detail-content
img
,
.sh
.return-process
img
{
max-width
:
100%
;
height
:
auto
;
}
/*评价*/
.tb-tbcr-content
{
color
:
#3F3F3F
;
font-size
:
14px
;}
.tb-tbc-rate
.tb-r-act-bar
{
margin-top
:
10px
;
float
:
left
;
font-size
:
10px
;
color
:
#B0B0B0
;}
.tb-r-filter-bar
li
{
float
:
left
;
text-align
:
center
;
width
:
25%
;}
.tb-taglist-li
.comment-info
{}
.am-pagination
li
{
float
:
none
;}
li
.am-comment
{
width
:
100%
}
.am-comments-list-flip
.am-comment-main
{
margin-right
:
0px
;}
/*印象*/
.actor-new
{
position
:
relative
;
margin-top
:
10px
;}
.rate
{
display
:
none
;}
.actor-new
dt
{
height
:
36px
;
line-height
:
36px
;
font-size
:
16px
;
margin
:
0px
10px
;
color
:
#E4393C
;
font-weight
:
700
;
text-align
:
left
;}
.actor-new
.comm-tags
{
float
:
left
;
height
:
21px
;
line-height
:
21px
;
padding
:
0
7px
;
margin-right
:
5px
;
background
:
#f47602
;
margin-bottom
:
10px
;
color
:
#fff
;}
.p-bfc
{
overflow
:
hidden
;
max-height
:
62px
;
padding
:
0px
20px
0px
10px
;}
.actor-new
i
{
position
:
absolute
;
right
:
10px
;
top
:
36px
;
font-size
:
18px
;
color
:
#C3C3C3
;}
/*须知*/
.tb-rate-alert
{
border
:
1px
solid
#EEE
;
padding
:
4px
8px
;
position
:
relative
;
background-color
:
#FFE
;
border-color
:
#FC7
;
font
:
16px
/
1.5
tahoma
,
arial
,
"Hiragino Sans GB"
,
宋体
,
sans-serif
}
.am-breadcrumb-slash
{
max-width
:
1000px
;
margin
:
10px
auto
;}
/*推荐商品*/
.like
{
margin-top
:
25px
;
border-radius
:
4px
;}
.like
li
{
float
:
left
;
padding
:
8px
10px
0
;
font
:
14px
/
1.5
tahoma
,
arial
,
"Hiragino Sans GB"
,
宋体
,
sans-serif
;}
...
...
@@ -309,21 +273,16 @@ li.am-comment{ width:100%}
font-size
:
14px
;
color
:
#E4393C
;
font-weight
:
400
;
font-family
:
Verdana
;}
.like
li
img
{
width
:
100%
}
.footer
{
margin
:
0px
auto
;
margin-top
:
20px
;}
.hwsize
tr
th
{
text-align
:
center
;}
/*改写的样式*/
/*轮播*/
.clearfix-left
{
display
:
none
;}
.scoll
img
{
width
:
100%
;
margin-left
:
0
}
.am-comment-main
,
#J_AttrUL
{
text-align
:
left
;}
.tb-r-filter-bar
{
margin-top
:
20px
;}
.buy-nav
{
position
:
fixed
;
bottom
:
0px
;
right
:
0px
;
z-index
:
1000
;
width
:
100%
;
background
:
#fff
;}
.nav.white
,
.tip
{
z-index
:
999
}
/* 文字提示 */
.goods-not-buy-tips
{
color
:
#FF5722
;
margin
:
5px
0
;
font-size
:
14px
;
}
/*左侧商品-看了又看*/
.browse
{
display
:
none
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
/*导航固定*/
ul
.am-tabs-nav.am-nav.am-nav-tabs
{
margin-right
:
10px
;
margin-left
:
10px
;
width
:
auto
;}
...
...
@@ -414,7 +373,7 @@ li.am-comment{ width:100%}
.freight
{
width
:
400px
;
float
:
left
;}
.iteminfo_parameter.freight
dt
{
padding-top
:
6px
;
padding-bottom
:
0px
;}
/*
介绍
*/
/*
左侧商品-看了又看
*/
.introduce-main
{
width
:
80%
;
float
:
left
;
background
:
#fff
;}
.browse
{
display
:
block
;
float
:
left
;
width
:
20%
;}
.browse
ul
{
border
:
1px
solid
#eee
;
width
:
90%
;}
...
...
@@ -482,6 +441,11 @@ li.am-comment{ width:100%}
/* 商品评论 */
.goods-comment
.am-comment
{
margin-left
:
5px
;
margin-right
:
5px
;
}
/* 商品评分 */
.score-container
{
padding
:
10px
;
border-style
:
none
none
solid
none
;
}
.score-container
.score
{
padding-right
:
10px
;
}
.score-container
.am-progress
{
width
:
calc
(
100%
-
90px
);
}
/* 底部 */
.am-footer
{
padding-bottom
:
35px
;
}
}
\ No newline at end of file
public/static/index/default/js/goods.js
浏览文件 @
8e548619
...
...
@@ -28,15 +28,22 @@ function poptit_close()
*/
function
GoodsCommentsHtml
(
page
)
{
$
(
'
.goods-page-no-data
'
).
addClass
(
'
none
'
);
if
((
page
||
1
)
<=
1
)
{
$
(
'
.goods-page-no-data
'
).
removeClass
(
'
none
'
);
$
(
'
.goods-page-no-data span
'
).
text
(
'
加载中...
'
);
}
else
{
$
(
'
.goods-page-no-data
'
).
addClass
(
'
none
'
);
}
$
.
ajax
({
url
:
$
(
'
.goods-comment
'
).
data
(
'
url
'
),
type
:
'
POST
'
,
data
:{
"
goods_id
"
:
$
(
'
.goods-comment
'
).
data
(
'
goods-id
'
),
"
page
"
:
page
},
data
:{
"
goods_id
"
:
$
(
'
.goods-comment
'
).
data
(
'
goods-id
'
),
"
page
"
:
page
||
1
},
dataType
:
'
json
'
,
success
:
function
(
result
)
{
$
(
'
.goods-page-no-data
'
).
addClass
(
'
none
'
);
if
(
result
.
code
==
0
)
{
var
html
=
''
;
...
...
@@ -80,7 +87,13 @@ function GoodsCommentsHtml(page)
if
(
$
(
'
.goods-comment-content article
'
).
length
<=
0
)
{
$
(
'
.goods-page-no-data
'
).
removeClass
(
'
none
'
);
$
(
'
.goods-page-no-data span
'
).
text
(
'
没有评论数据
'
);
}
},
error
:
function
(
result
)
{
$
(
'
.goods-page-no-data
'
).
removeClass
(
'
none
'
);
$
(
'
.goods-page-no-data span
'
).
text
(
'
请求出现错误,请稍后再试!
'
);
}
});
}
...
...
@@ -604,6 +617,13 @@ $(function() {
$
(
'
.introduce-main .am-tabs
'
).
tabs
(
'
open
'
,
1
);
});
// tab事件
$
(
'
.introduce-main .am-tabs li
'
).
on
(
'
click
'
,
function
()
{
var
top
=
$
(
'
.introduce-main
'
).
offset
().
top
;
$
(
window
).
smoothScroll
({
position
:
top
});
});
});
// 浏览器窗口实时事件
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录